ggml-backend-meta: do not scale view offsets internal to a split unit - #25689
Draft
Frozenlock wants to merge 1 commit into
Draft
ggml-backend-meta: do not scale view offsets internal to a split unit#25689Frozenlock wants to merge 1 commit into
Frozenlock wants to merge 1 commit into
Conversation
|
Hi @Frozenlock, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
The heuristic classifying a view offset as internal vs. proportional missed offsets that are smaller than the stride of one split unit, e.g. a strided view at a fixed offset into rows that are split along that unit (the MLA q_pe rope view). Such offsets apply within every unit on every device and must be preserved as-is; scaling them makes devices with distributed slices read from the wrong position.
Frozenlock
force-pushed
the
fix-view-offset-split
branch
from
July 15, 2026 09:13
f08302a to
6b6e44d
Compare
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.
Overview
The heuristic classifying a view offset as internal vs. proportional misses offsets smaller than the stride of one split unit — e.g. a strided view at a fixed offset into rows that are split along that unit. Such offsets apply within every unit on every device and must be preserved as-is; scaling them makes devices holding distributed slices read from the wrong position.
Concrete case: an MLA attention graph's rope view (offset 768 into 1024-byte per-head rows, rows split by head). The proportional scaling turned the offset into 384, landing mid-row, corrupting output whenever heads were actually distributed across devices. With the fix, -sm tensor output on GLM-4.7-Flash is byte-identical to -sm layer on even and skewed splits.
Additional information
Prerequisite for MLA-architecture tensor parallelism (DeepSeek2/GLM-DSA), which I intend to propose as a follow-up; see the split scheme sketched by @gaugarg-nv in #19378.
Requirements
[1] I am NOT a cpp programmer, so I'm not in a position to evaluate the quality as I would with my main programming languages. That's my way on contributing back to this project. Given the contributing guidelines, I'll understand if you don't accept the PR.