-
Notifications
You must be signed in to change notification settings - Fork 44
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
Move output tensor allocation out of benchmark function for GEMM #2328
Conversation
Signed-off-by: Anatoly Myachev <[email protected]>
@@ -256,7 +252,13 @@ def benchmark(B, M, N, K, provider): | |||
_, min_ms, max_ms, mean_ms, cv = benchmark_suit.do_bench(lambda: torch.matmul(a, b), warmup=10, rep=10, | |||
quantiles=quantiles, fast_flush=False) | |||
elif provider == 'triton': | |||
triton_fn = lambda: matmul(a, b) | |||
if len(a.shape) == 3 and len(b.shape) == 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about assert len(a.shape) == len(b.shape)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about assert len(a.shape) == len(b.shape)?
@whitneywhtsang could you elaborate a bit?
how about assert len(a.shape) == len(b.shape)?
Should I add this assert before if
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like #2328 (comment)
Co-authored-by: Whitney Tsang <[email protected]>
Signed-off-by: Anatoly Myachev <[email protected]>
Geomean was incorrectly calculated for GEMM (in #2298), after recalculating I saw a deterioration in the ratio, which may be due to allocations.
Let's see: https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/11019414473
The Triton GEMM adv geomean increased by ~1TFlops.