Repository navigation
MoE: keep the fitted dW tile for float32 activations in the heuristic configs - #15928
Merged
Merged
Conversation
Member
Author
|
@codex review |
Codex Review SummaryThis 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. |
This was referenced Oct 29, 2026
danielhanchen
added a commit
that referenced
this pull request
Oct 29, 2026
…15946) ## Summary `Repo tests (CPU, studio)` is red on main since #15919, and on every PR based after it (seen on staging for #15928, #15931 and #15934). Three tests in `tests/studio/test_desktop_reliability_frontend_contract.py` fail: - `test_audio_page_matches_the_image_rail_header_and_action_footer` - `test_images_header_tracks_preview_and_preserves_titlebar_controls` - `test_media_page_headers_out_stack_the_mac_drag_region` #15919 rebuilt the Images, Video and Audio headers on purpose: Create / Train is centred in a `minmax(0,1fr)_auto_minmax(max-content,1fr)` row, and the API / Library / sibling links moved into the new `MediaHeaderActions` component, which steps down (pill off centre, compact, then hidden) as space runs short. The product is right and the tests pinned the old class strings, so the tests are what changes here. ## What changed - A shared `_assert_media_header_row` check for the Images and Audio headers: the new row columns, the pill centred in column 2 (`data-media-header-centre ... col-start-2 justify-self-center`), and the links rendered inside `<MediaHeaderActions>` (the Library and sibling links are now asserted to sit inside it, not just somewhere in the header). - `MediaHeaderActions` itself is pinned to what the old inline markup guaranteed: its slot stays `pointer-events-none col-start-3 row-start-1` (so gaps in the band still drag the macOS window) and only the links' group is `pointer-events-auto`. - The macOS drag-region test counts the clickable group drawn by `MediaHeaderActions` when a page renders it, since that group no longer appears in the page source. ## Verification - Base (main at `862098ed4a`): 3 failed, 41 passed. Bisected to #15919: its parent passes all 44. - Head: 44 passed. - Each guard still fails when the property it protects breaks (source edited, test run, reverted): - slot made `pointer-events-auto`: Images and Audio header tests fail - links group no longer `pointer-events-auto`: all three fail - Images sibling link moved out of `MediaHeaderActions`: Images header test fails - Audio pill set to `justify-self-end`: Audio header test fails --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…ed faster On L4 (sm89) the 128-wide dW tile is 6-18% faster for float32 activations, so the float32 exclusion now applies only to compute capability 10.x (B200). Other architectures keep main's choice. [skip ci]
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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". |
Member
Author
|
pre-commit.ci run |
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.
Follow-up to #15505.
#15505 widens the heuristic backward dW tile to 64 x 128 x 64 at 3 stages when K leaves
BLOCK_SIZE_K64 (gpt-oss gate_up). The condition does not look at the activation dtype. On a B200 the wide tile is slower for float32 activations, though it is faster for bf16:These are B200 numbers from a recheck reviewer: torch 2.14.1, Triton 3.8, interleaved, A/A spread under 0.14%, and bitwise equal outputs. The same runs reproduced the bf16 gain of 1.35x - 1.50x.
float32 reaches this path with float32 expert weights,
UNSLOTH_FORCE_FLOAT32=1, orUNSLOTH_MOE_TRITON_FP32=1. These heuristic configs are used underUNSLOTH_MOE_DISABLE_AUTOTUNE=1. The autotuned default and the autotune-failure fallback are unchanged.Change
Widening now skips float32 activations on compute capability 10.x (B200 / sm100), the only architecture where the wide tile was measured slower for float32. bf16 / fp16, callers that pass no dtype, and float32 on every other architecture keep the wide tile.
Tests
test_heuristic_dw_widens_only_16bit_activations[bf16, fp16, fp32]checks gpt-oss gate_up and N 1024 x K 960. The fp32 case fails on main and passes here.tests/test_moe*.py: 337 passed, 46 skipped (CUDA only), CPU torch 2.14.1.Other architectures
On L4 (sm89) and RTX PRO 6000 Blackwell (sm120) the wide tile is faster for float32 too, so the float32 exclusion is limited to sm100. fp32 dW kernel time with the 64-wide tile vs main's 128-wide tile (CUDA graphs, interleaved A / A / B over 9 rounds, medians, torch 2.11.0+cu130, Triton 3.6.0; outputs bitwise equal):
With this change both cards pick main's tile for float32 (fix vs main within the A / A band in every cell).
test_heuristic_dw_widens_all_dtypes_on_sm89[bf16, fp16, fp32]pins it; the fp32 case fails on the previous head. B200 itself was not re-measured here, and A100 / H100 were not measured.