Skip to content

Add attention benchmarking numbers to pytorch operator microbenchmarks#164155

Closed
jainapurva wants to merge 19 commits intomainfrom
attention_benchmark
Closed

Add attention benchmarking numbers to pytorch operator microbenchmarks#164155
jainapurva wants to merge 19 commits intomainfrom
attention_benchmark

Conversation

@jainapurva
Copy link
Contributor

@jainapurva jainapurva commented Sep 29, 2025

This pull request introduces a standardized YAML-based configuration system for transformer attention benchmarks, making it easier to run and manage comprehensive performance tests. It adds example configs, and a wrapper script to convert YAML configs into CLI arguments for the benchmark runner.

Next Steps:

CI Enablement: This change would further lead to running the attention ops in CI for regression tracking.

Developer flow: (Run locally)

python score_mod.py --config configs/config_test.yaml

Enabling CI run: #165915

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 29, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/164155

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 2882e90 with merge base 8110ce0 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@jainapurva jainapurva marked this pull request as draft September 30, 2025 19:53
@jainapurva jainapurva marked this pull request as ready for review October 13, 2025 14:30
@jainapurva jainapurva added module: performance Issues related to performance, either of kernel code or framework glue topic: performance topic category and removed module: performance Issues related to performance, either of kernel code or framework glue labels Oct 13, 2025
@@ -0,0 +1,29 @@
# Comprehensive benchmark configuration for PyTorch transformer benchmarks
# Usage: python score_mod.py --config config_comprehensive.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets just keep the basicyaml config, we can add there

@jainapurva jainapurva requested a review from liangel-02 October 20, 2025 15:54
Copy link
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! I've got a few stylistic comments but nothing major

experiment_count += 1
# Periodic memory cleanup every 10 experiments
if experiment_count % 10 == 0:
cleanup_memory()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason behind manually doing memory cleanup? I expect this to be handled automatically, is this not the case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just doing it to be more thorough.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alrighty, I don't have a strong opinion against it so I won't hold up the review, but I do generally prefer introducing logic that isn't strictly necessary to keep complexity lower, up to you :)

Copy link
Contributor

@jbschlosser jbschlosser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome!

@jainapurva jainapurva added the release notes: benchmark release notes category label Oct 28, 2025
@jainapurva
Copy link
Contributor Author

@pytorchmergebot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 28, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@github-actions github-actions bot deleted the attention_benchmark branch November 29, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged release notes: benchmark release notes category topic: performance topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants