Skip to content
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

[TEST] Make mixed matmul test deterministic #5151

Merged
merged 2 commits into from
Nov 14, 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
3 changes: 2 additions & 1 deletion python/test/regression/test_cast_matmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ def test_cast_matmul(M, K, N, BLOCK_K, w_dtype, x_dtype, out_dtype):

def init_tensor(dtype, shape):
if dtype == torch.int8:
return torch.randint(0, 3, shape, device=device, dtype=dtype)
return torch.randint(0, 2, shape, device=device, dtype=dtype)
elif dtype == torch.float8_e4m3fn or dtype == torch.float8_e5m2:
return torch.randn(shape, device=device, dtype=torch.float16).to(dtype)
else:
return torch.randn(shape, device=device, dtype=dtype)

torch.manual_seed(42)
a = init_tensor(w_dtype, (M, K))
b = init_tensor(x_dtype, (K, N))

Expand Down
Loading