Skip to content

Commit

Permalink
[Inductor] Fix the issue that cannot pass lint check for debug mode (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
EikanWang authored and pytorchmergebot committed Mar 22, 2023
1 parent 37e1d85 commit 573b2de
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions test/inductor/test_torchinductor.py
Original file line number Diff line number Diff line change
Expand Up @@ -6372,14 +6372,19 @@ def fn(x, y):
x = torch.randn((2, 9), dtype=torch.bfloat16)
y = torch.randn((2, 9), dtype=torch.bfloat16)

with config.patch({"cpp.simdlen": None}):
torch._dynamo.reset()
metrics.reset()
traced = make_fx(fn)(x, y)
compiled = compile_fx_inner(traced, [x, y])
assert same(fn(x, y)[0], compiled([x, y])[0], equal_nan=True, tol=1e-2)
if codecache.valid_vec_isa_list():
assert metrics.generated_cpp_vec_kernel_count == 1
for torch_compile_debug in [True, False]:
with config.patch(
{"trace.enabled": torch_compile_debug, "cpp.simdlen": None}
):
torch._dynamo.reset()
metrics.reset()
traced = make_fx(fn)(x, y)
compiled = compile_fx_inner(traced, [x, y])
assert same(
fn(x, y)[0], compiled([x, y])[0], equal_nan=True, tol=1e-2
)
if codecache.valid_vec_isa_list():
assert metrics.generated_cpp_vec_kernel_count == 1

@unittest.skipIf(
not codecache.valid_vec_isa_list(), "Does not support vectorization"
Expand Down

0 comments on commit 573b2de

Please sign in to comment.