8000 Check that CPUInductor selects valid SIMD ISA by malfet · Pull Request #1952 · pytorch/builder · GitHub
[go: up one dir, main page]

Skip to content

Check that CPUInductor selects valid SIMD ISA #1952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/smoke_test/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ def foo(x: torch.Tensor) -> torch.Tensor:
x_pt2 = torch.compile(foo)(x)
torch.testing.assert_close(x_eager, x_pt2)

# Check that SIMD were detected for the architecture
if device == "cpu":
from torch._inductor.codecache import pick_vec_isa, invalid_vec_isa
isa = pick_vec_isa()
if isa == invalid_vec_isa:
raise RuntimeError("Can't detect vectorized ISA for CPU")
print(f"Picked CPU ISA {type(isa).__name__} bit width {isa.bit_width()}")

# Reset torch dynamo since we are changing mode
torch._dynamo.reset()
dtype = torch.float32
Expand Down
Loading
0