Open
Conversation
Document the full optimization journey for moe_blockscale_2stage stage1/stage2: - Sequential block_acc reuse + vec4 FMA (CK-style) - Minimal loop-carried state (16 values vs 34) - Remove redundant scale validity cndmask (buffer OOB returns 0) - Split scale computation (blk*s_a + fma(tmp, s_w_bc, acc)) - Stage2 tile_n=256 Result: 0.18x CK → 1.33x CK (stage1 1.24x, stage2 1.49x) Made-with: Cursor
When n_per_wave <= ScaleBlockN (128), all ni within a wave share the same weight scale block. Load once and reuse instead of loading redundantly for each ni. stage1: 5682→5414us (1.30x CK), total: 9229→8934us (1.38x CK) Made-with: Cursor
Made-with: Cursor
57708a8 to
f2d6f13
Compare
Add optimization 6 (scale_w dedup), failed attempts section, and update final numbers to reflect all optimizations. Made-with: Cursor
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.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist