-
Notifications
You must be signed in to change notification settings - Fork 34
Refactor benchmarks for Flash Attention Prefill #447
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
base: sycl-develop
Are you sure you want to change the base?
Refactor benchmarks for Flash Attention Prefill #447
Conversation
c863845
to
e7ec638
Compare
* Add comment on final output type conversion
e7ec638
to
6a7ad57
Compare
This PR separates the output type and accumulator type for Flash Attention Prefill. Combinations supported are: * bf16 inputs, fp32 accumulator, bf16 | fp32 output * fp16 inputs, fp32 accumulator, fp16 | fp32 output * fp8 inputs, fp32 accumulator, fp8 | fp32 output Tests added in: #446 Benchmarks added in: #447 --------- Co-authored-by: Alejandro Acosta <[email protected]>
applications/flash_attention_v2/collective/xe_flash_attn_prefill_epilogue.hpp
Show resolved
Hide resolved
@@ -77,12 +77,17 @@ struct FMHAOptions { | |||
cmd.get_cmd_line_argument("num_heads_kv", num_heads_kv, num_heads_q); | |||
cmd.get_cmd_line_argument("seq_len_qo", seq_len_qo, 512); | |||
cmd.get_cmd_line_argument("seq_len_kv", seq_len_kv, seq_len_qo); | |||
cmd.get_cmd_line_argument("head_size_vo", head_size_vo, 128); | |||
cmd.get_cmd_line_argument("head_size_vo", head_size_vo, HEAD_DIM); |
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.
Why even keep this as an option if it must be set to a certain value?
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 helps throw an error on line 88 for the case when the head_size_vo
received by a benchmark does not match the head_size_vo
this benchmark was built for. For example, if we pass head_size_vo=96
to the cutlass_benchmark_flash_attention_prefill_h64_xe
exe file, it should not run the benchmark and throw an error instead.
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.
What I am trying to point out is that given we have the head size in the name of the benchmark, we should not need an argument for head size at all. Without the argument there is no chance of passing wrong argument value.
This PR adds benchmarks for all the different data types supported with Flash Attention Prefill. It is a continuation of PR #443