Skip to content

[Perf] Add first warmup config to perf dispatch#422

Draft
hughperkins wants to merge 3 commits intomainfrom
hp/first_warmup
Draft

[Perf] Add first warmup config to perf dispatch#422
hughperkins wants to merge 3 commits intomainfrom
hp/first_warmup

Conversation

@hughperkins
Copy link
Collaborator

@hughperkins hughperkins commented Mar 22, 2026

Issue: #

Brief Summary

  • add first warmup, defaulting to 1
  • also changes default warmup from 3 to 0

copilot:summary

Walkthrough

copilot:walkthrough

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.

@test_utils.test()
def test_perf_dispatch_kernels() -> None:
WARMUP = 3
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 local var should be in lowercase

@qd.perf_dispatch(
get_geometry_hash=lambda a: hash(a.shape),
first_warmup=2,
warmup=0,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

lets test a non-zero warmup


@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."""
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

should have atest with non-zero

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

also, should check something like active + warmup == num calls to non-chosen kernel

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)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what is the purpose of such large, and identcal, warmups

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.

1 participant