[gfx1250][optimization] qk norm rope quant optimization for gfx1250#4073
Closed
jli-melchior wants to merge 2 commits into
Closed
[gfx1250][optimization] qk norm rope quant optimization for gfx1250#4073jli-melchior wants to merge 2 commits into
jli-melchior wants to merge 2 commits into
Conversation
Hoist scale-multiply before NOPE/ROPE branch to eliminate duplicate computation, and skip FP8 underflow clamp on e4m3fn architectures (gfx950/gfx1250) where 0x80 encodes -0, not NaN. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Store scaled values to rmem before the NOPE/ROPE branch. ROPE threads load from rmem, apply cos/sin rotation, and write back. After the branch, all threads read from rmem and issue a single full-width coalesced store instead of two partial-width divergent stores. The PromoteRegMemToVectorSSA pass automatically threads the rmem state through scf.if yield, keeping SSA semantics correct. Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
1b3513d to
4621442
Compare
2910039 to
5597772
Compare
valarLip
requested changes
Jul 5, 2026
| # gfx942 ships e4m3fnuz (max_pos=240), gfx950+ ships OCP e4m3fn (max_pos=448). | ||
| # ``emit_mx_e8m0_scale`` uses this to pick the right ``max_pos`` reciprocal. | ||
| _fp8_mx_dtype = _D.FP8_E4M3_FNUZ if get_hip_arch() == "gfx942" else _D.FP8_E4M3 | ||
| _is_fnuz = get_hip_arch() == "gfx942" |
Collaborator
There was a problem hiding this comment.
_is_fnuz check _is_fnuz by tensor's DType intead of arch
Collaborator
There was a problem hiding this comment.
remove this one before merge
a3c7a24 to
4621442
Compare
Contributor
Author
|
switch to PR #4089 |
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
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