Repository navigation
Studio INT8 attention: key the strided cuDNN race by the call each card times - #18584
Merged
Merged
Conversation
…rd times The dispatch race named a strided cuDNN incumbent dispatch:_native_cudnn:strided on every card, although the pin only takes the strided call on its probed cards at its probed dtype. Elsewhere the race times diffusers' contiguous call and stored that verdict under the strided name, so a pin for cuda:0 and a pin for cuda:0 and cuda:1 shared one cuda:1 verdict for two different calls. The name is now chosen per card and dtype.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
#18140 gave a strided cuDNN incumbent its own INT8 race verdict name,
dispatch:_native_cudnn:strided, because the strided call differs from diffusers' contiguous_native_cudnncall. But the name was taken from the marker's class alone. The marker only takes the strided call on the cards it probed and at the dtype it probed; on any other card or dtypeplain_qkvdeclines and the race times diffusers' call. The dispatch install races each module on the load card and on every secondary card (layer split, CFG replica), so a marker for{0}raced oncuda:1timed the contiguous call and cached that verdict ascuda:1 ... :strided. A marker for{0, 1}then read that verdict oncuda:1, although its real call there is the strided one, and the reverse order had the same mix-up. The INT8 token floor on that card could then come from a different incumbent call than the one the route replaces.Change
_race_nameindiffusion_int8_attention_dispatch.pytakes optionalcardanddtypeand keeps the:stridedsuffix only when the marker'scardscontains the card and its probed dtype matches (or is unset). Elsewhere it returns the plaindispatch:_native_cudnnname, so those races share the verdict of the call they actually time. The dispatch install computes the name per raced card with the race dtype. Called without the new arguments,_race_namereturns what it did before, and the persisted verdict names are unchanged.Tests
New
tests/test_diffusion_int8_attention_strided_race_key.py, CPU only:test_strided_race_name_follows_the_call_the_card_times: a{0}bf16 marker is:stridedon card 0 at bf16, plain on card 1 and plain at fp16; a{0, 1}marker is:stridedon card 1. Fails on main, passes here.test_dispatch_race_keys_each_card_by_its_timed_call(3 cases): runs the real dispatch install with a load card and a secondary card, records the verdict name each card races under.{0}bf16 gives strided on 0 and plain on 1;{0, 1}fp16 under a bf16 load gives plain on both. Both fail on main (every card raced as:strided) and pass here.{0, 1}bf16 gives strided on both and passes on main and here.Differential (
test_differential.py, the new file plustest_diffusion_int8_attention_persisted.pyandtest_diffusion_int8_attention_dispatch.py): DISCRIMINATING, fixed=3, unchanged=68, head_fail=0.Suite (
test_diffusion_qwenimage21_strided_attn.py,test_diffusion_flux3_strided_attn.py,test_diffusion_int8_attention_auto.py,test_diffusion_int8_attention_dispatch.py,test_diffusion_int8_attention_persisted.py,test_diffusion_attention.py,test_diffusion_attention_honest_status.py,test_diffusion_attention_cudnn_head_dim.py): main 272 passed, 1 skipped, 1 failed; this branch 276 passed (the 4 new), 1 skipped, 1 failed. The failing ID is the same on both,test_diffusion_qwenimage21_strided_attn.py::test_attention_hook_installs_on_cudnn_pins, which greps moved source and is fixed separately.Not proven here
No GPU run. The tests stub the race, so they show which name each card is raced under, not a changed token floor on real hardware. That would take Qwen-Image-2.1 with a cuDNN pin split across two NVIDIA cards, with the strided probe passing on only one of them, comparing the per-card
diffusion.int8_attentionrace log lines on main and here.