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 fp8fp8bf16/bf16fp8bf16_fast_gemv is torch compileable #3809

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 5 additions & 2 deletions fbgemm_gpu/experimental/gen_ai/test/quantize/quantize_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,12 @@ def test_quantize_compile(self) -> None:
block_scale[0],
)
# test bf16_fast_gemv is torch compileable
X_bf16 = torch.randn(M, K, device="cuda", dtype=torch.bfloat16)
W_bf16 = torch.randn(N, K, device="cuda", dtype=torch.bfloat16)
torch.compile(torch.ops.fbgemm.bf16_fast_gemv)(X_bf16, W_bf16)
torch.compile(torch.ops.fbgemm.bf16_fast_gemv)(X, W_bf16)
# test fp8fp8bf16_fast_gemv is torch compileable
torch.compile(torch.ops.fbgemm.fp8fp8bf16_fast_gemv)(XQ, WQ, tensor_scale)
# test bf16bf16bf16_fast_gemv is torch compileable
torch.compile(torch.ops.fbgemm.bf16fp8bf16_fast_gemv)(X, WQ, tensor_scale)

@unittest.skipIf(
not torch.version.cuda, "Skip on AMD: fast gemv op is not yet supported."
Expand Down
Loading