-
Notifications
You must be signed in to change notification settings - Fork 42
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
[CI][microbenchmarks] Add onednn backend to GEMM with transposed matrices #2445
Conversation
Please fix the CI failure. |
f6a4dda removed |
Are you saying that the current default timing method IPEX would give incorrect results? |
Yes, without |
hmm... |
I'm not talking about |
@whitneywhtsang |
Sure, I can add a PR for that. |
@whitneywhtsang Everything works. Could you approve it now? |
@@ -162,21 +162,23 @@ jobs: | |||
if: ${{ steps.install.outcome == 'success' && !cancelled() }} | |||
run: | | |||
cd benchmarks/triton_kernels_benchmark | |||
TRANSPOSE_B=1 python gemm_benchmark.py --reports $REPORTS | |||
BENCHMARKING_METHOD="ELAPSED_TIME" TRANSPOSE_B=1 python gemm_benchmark.py --reports $REPORTS |
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.
This will also change the default measurement method even if IPEX is set for xetla and triton.
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.
Yes. Otherwise we get wrong measurements for onednn.
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.
Yes. Otherwise we get wrong measurements for onednn.
For legacy profiler or upstream profiler?
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.
~6000 TFLOPs for legacy
Last time I run onednn with upstream profiler it just failed. No kernel was found
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.
I see, btw you could use kernel_name=gemm_kernel
for upstream profiler - it should work.
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.
~6000 TFLOPs for legacy
As for this, I suggest using the function explicitly do_bench_elapsed_time
if the profiler legacy mode is set, with a comment what is workaround is needed, since it gives invalid numbers. Something like this:
if provider == 'onednn':
do_bench = benchmark_suit.do_bench
if BENCHMARKING_MODE == 'PYTORCH_LEGACY_PROFILER_USING_IPEX':
# comment here
do_bench = benchmark_suit.do_bench_elapsed_time
_, min_ms, max_ms, mean_ms, cv = do_bench(lambda: torch.matmul(torch_a, torch_b), warmup=10,
rep=10, quantiles=quantiles, kernel_name="gemm_kernel")
This way you won't change the numbers that are used in dashboards.
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.
Ok, let me try that
Done in #2460. |
BENCHMARKING_METHOD = os.getenv( | ||
"BENCHMARKING_METHOD", "PYTORCH_LEGACY_PROFILER_USING_IPEX" if USE_IPEX_OPTION else "UPSTREAM_PYTORCH_PROFILER") |
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.
Please revert this
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.
The main idea is that USE_IPEX_OPTION
should have priority over BENCHMARKING_METHOD
.
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.
LGTM! @whitneywhtsang ?
Thanks for asking! Mostly LGTM, one concern is as we are using oneDNN as baseline to compare with Triton, would using two different benchmarking methods to compare affect the comparison? |
Without
BENCHMARKING_METHOD="ELAPSED_TIME"
I get ~6000TFLOPS GeoMean for onednn measurements.Closes #2456