-
Notifications
You must be signed in to change notification settings - Fork 39
Enables comprehensive benchmark configurations #66
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -735,49 +735,49 @@ def run_performance_benchmark(test_type='all', num_runs=3, warmup_runs=2): | |||||||||
|
|
||||||||||
| # Test configurations: (batch_size, num_heads, num_kv_heads, query_len, key_len, head_dim, keep_window_size, is_causal) | ||||||||||
| configs = [ | ||||||||||
| # # Vary sequence length | ||||||||||
| # (1, 2, 1, 256, 256, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 512, 512, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 1024, 1024, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2048, 2048, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 4096, 4096, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 8192, 8192, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 16384, 16384, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 32768, 32768, 128, 2048, True), | ||||||||||
|
|
||||||||||
| # # Inference | ||||||||||
| # (1, 2, 1, 2, 256, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 512, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 1024, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 2048, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 4096, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 8192, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 16384, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 32768, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 65536, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 131072, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 262144, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 2, 524288, 128, 2048, True), | ||||||||||
|
|
||||||||||
| # # Vary batch size | ||||||||||
| # (1, 2, 1, 1024, 1024, 32, 2048, True), | ||||||||||
| # (2, 2, 1, 1024, 1024, 32, 2048, True), | ||||||||||
| # (4, 2, 1, 1024, 1024, 32, 2048, True), | ||||||||||
| # (8, 2, 1, 1024, 1024, 32, 2048, True), | ||||||||||
|
|
||||||||||
| # # Vary head count | ||||||||||
| # (1, 1, 1, 1024, 1024, 32, 2048, True), | ||||||||||
| # (1, 2, 1, 1024, 1024, 32, 2048, True), | ||||||||||
| # (1, 4, 1, 1024, 1024, 32, 2048, True), | ||||||||||
| # (1, 8, 2, 1024, 1024, 32, 2048, True), | ||||||||||
|
|
||||||||||
| # # Vary head dimension | ||||||||||
| # (1, 2, 1, 1024, 1024, 32, 2048, True), | ||||||||||
| # (1, 2, 1, 1024, 1024, 64, 2048, True), | ||||||||||
| # (1, 2, 1, 1024, 1024, 96, 2048, True), | ||||||||||
| # (1, 2, 1, 1024, 1024, 128, 2048, True), | ||||||||||
| # (1, 2, 1, 1024, 1024, 192, 2048, True), | ||||||||||
| # (1, 2, 1, 1024, 1024, 256, 2048, True), | ||||||||||
| # Vary sequence length | ||||||||||
| (1, 2, 1, 256, 256, 128, 2048, True), | ||||||||||
| (1, 2, 1, 512, 512, 128, 2048, True), | ||||||||||
| (1, 2, 1, 1024, 1024, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2048, 2048, 128, 2048, True), | ||||||||||
| (1, 2, 1, 4096, 4096, 128, 2048, True), | ||||||||||
| (1, 2, 1, 8192, 8192, 128, 2048, True), | ||||||||||
| (1, 2, 1, 16384, 16384, 128, 2048, True), | ||||||||||
| (1, 2, 1, 32768, 32768, 128, 2048, True), | ||||||||||
|
|
||||||||||
| # Inference | ||||||||||
| (1, 2, 1, 2, 256, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 512, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 1024, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 2048, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 4096, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 8192, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 16384, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 32768, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 65536, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 131072, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 262144, 128, 2048, True), | ||||||||||
| (1, 2, 1, 2, 524288, 128, 2048, True), | ||||||||||
|
|
||||||||||
| # Vary batch size | ||||||||||
| (1, 2, 1, 4096, 4096, 32, 2048, True), | ||||||||||
| (2, 2, 1, 4096, 4096, 32, 2048, True), | ||||||||||
| (4, 2, 1, 4096, 4096, 32, 2048, True), | ||||||||||
| (8, 2, 1, 4096, 4096, 32, 2048, True), | ||||||||||
|
|
||||||||||
| # Vary head count | ||||||||||
| (1, 1, 1, 4096, 4096, 32, 2048, True), | ||||||||||
| (1, 2, 1, 4096, 4096, 32, 2048, True), | ||||||||||
| (1, 4, 1, 4096, 4096, 32, 2048, True), | ||||||||||
| (1, 8, 2, 4096, 4096, 32, 2048, True), | ||||||||||
|
|
||||||||||
| # Vary head dimension | ||||||||||
| (1, 2, 1, 4096, 4096, 32, 2048, True), | ||||||||||
| (1, 2, 1, 4096, 4096, 64, 2048, True), | ||||||||||
| (1, 2, 1, 4096, 4096, 96, 2048, True), | ||||||||||
| (1, 2, 1, 4096, 4096, 128, 2048, True), | ||||||||||
| (1, 2, 1, 4096, 4096, 192, 2048, True), | ||||||||||
| (1, 2, 1, 4096, 4096, 256, 2048, True), | ||||||||||
|
|
||||||||||
| # Vary keep_window_size | ||||||||||
| (1, 2, 1, 32768, 32768, 128, 32, True), | ||||||||||
|
|
@@ -792,11 +792,9 @@ def run_performance_benchmark(test_type='all', num_runs=3, warmup_runs=2): | |||||||||
| (1, 2, 1, 32768, 32768, 128, 16384, True), | ||||||||||
| (1, 2, 1, 32768, 32768, 128, 32768, True), | ||||||||||
|
|
||||||||||
| # # Test non-causal | ||||||||||
| # (1, 2, 1, 1024, 1024, 128, 2048, False), | ||||||||||
| # Test non-causal | ||||||||||
| (1, 2, 1, 4096, 4096, 128, 2048, False), | ||||||||||
|
Comment on lines
+795
to
+796
|
||||||||||
| # Test non-causal | |
| (1, 2, 1, 4096, 4096, 128, 2048, False), | |
| # Generate configurations for both causal and non-causal cases | |
| *[(1, 2, 1, 4096, 4096, 128, 2048, is_causal) for is_causal in [True, False]], |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
[nitpick] The manually unrolled
configslist is quite large and repetitive. Consider generating these configurations programmatically using loops or list comprehensions to improve readability and reduce duplication.