• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Owner(s): ["module: inductor"]
2#
3# This smoketest is referenced in the internal-only minifier runbook
4# https://docs.google.com/document/d/18L9e7bZSBpJ7gGbwlUV13LasmjiEX2lree2pl-SdbCU/edit
5import os
6
7
8os.environ["TORCHDYNAMO_REPRO_AFTER"] = "dynamo"
9import torch
10import torch._dynamo as torchdynamo
11import torch._inductor.config
12import torch._ops
13
14
15torch._inductor.config.cpp.inject_relu_bug_TESTING_ONLY = "compile_error"
16
17
18def func(x):
19    x = torch.sigmoid(x)
20    x = torch.mul(x, torch.ones(2))
21    x = torch.relu(x)
22    x = torch.add(x, torch.zeros(2))
23    x = torch.ops.aten.round(x)
24    return x
25
26
27def run_internal_minifier():
28    torchdynamo.config.debug_dir_root = "."
29    f_opt = torch.compile(func)
30    f_opt(torch.ones(2))
31
32
33run_internal_minifier()
34