[Perf] Add first warmup config to perf dispatch#422
Draft
hughperkins wants to merge 3 commits intomainfrom
Draft
[Perf] Add first warmup config to perf dispatch#422hughperkins wants to merge 3 commits intomainfrom
hughperkins wants to merge 3 commits intomainfrom
Conversation
The first evaluation cycle (when kernels may need JIT compilation) uses first_warmup (default 1) warmup iterations. Subsequent re-evaluations use warmup (default 0) since kernels are already compiled, reducing the number of dispatch overhead steps from 8 to 2 per re-evaluation cycle.
When warmup=0, the method would declare trials finished after trying only one impl because untried impls weren't in the trial count dict. Now checks that all compatible impls have been tried before evaluating the min trial threshold.
hughperkins
commented
Mar 22, 2026
|
|
||
| @test_utils.test() | ||
| def test_perf_dispatch_kernels() -> None: | ||
| WARMUP = 3 |
Collaborator
Author
There was a problem hiding this comment.
this local var should be in lowercase
hughperkins
commented
Mar 22, 2026
| @qd.perf_dispatch( | ||
| get_geometry_hash=lambda a: hash(a.shape), | ||
| first_warmup=2, | ||
| warmup=0, |
Collaborator
Author
There was a problem hiding this comment.
lets test a non-zero warmup
hughperkins
commented
Mar 22, 2026
|
|
||
| @test_utils.test() | ||
| def test_perf_dispatch_default_warmup_values() -> None: | ||
| """With defaults (first_warmup=1, warmup=0), first eval uses 1 warmup, re-evals use 0.""" |
Collaborator
Author
There was a problem hiding this comment.
should have atest with non-zero
Collaborator
Author
There was a problem hiding this comment.
also, should check something like active + warmup == num calls to non-chosen kernel
hughperkins
commented
Mar 22, 2026
Comment on lines
402
to
+403
| def test_perf_dispatch_sanity_check_register_args() -> None: | ||
| @qd.perf_dispatch(get_geometry_hash=lambda a, c: hash(a.shape + c.shape), warmup=25, active=25) | ||
| @qd.perf_dispatch(get_geometry_hash=lambda a, c: hash(a.shape + c.shape), first_warmup=25, warmup=25, active=25) |
Collaborator
Author
There was a problem hiding this comment.
what is the purpose of such large, and identcal, warmups
7 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue: #
Brief Summary
copilot:summary
Walkthrough
copilot:walkthrough