Skip to content

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

Open
wants to merge 6 commits into
base: sycl-develop
Choose a base branch
from

Conversation

muhammad-tanvir-1211
Copy link
Collaborator

This PR adds benchmarks for all the different data types supported with Flash Attention Prefill. It is a continuation of PR #443

@muhammad-tanvir-1211 muhammad-tanvir-1211 requested a review from a team June 26, 2025 09:39
@muhammad-tanvir-1211 muhammad-tanvir-1211 force-pushed the flash_prefill_separate_out_benchmarks branch 2 times, most recently from c863845 to e7ec638 Compare June 26, 2025 11:36
@muhammad-tanvir-1211 muhammad-tanvir-1211 force-pushed the flash_prefill_separate_out_benchmarks branch from e7ec638 to 6a7ad57 Compare June 27, 2025 13:43
aacostadiaz added a commit that referenced this pull request Jun 28, 2025
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]>
@@ -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);
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants