Repository navigation
Conversation
…have the same size
osabnis
force-pushed
the
ov-transpose-dim-swap
branch
from
November 28, 2026 23:37
e2c1260 to
cdf6172
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
GLM-4.7-Flash with
-fa offfails on GPU during the first decode step after a 400-token prompt.compute_node_dynamic_dims()currently handlesTRANSPOSEusing the same rule asRESHAPE. When the source and destination shapes are equal, this preserves the source's dynamic dimension instead of moving it to the transposed axis.This affects MLA's compressed KV cache view
[512, n_kv]. Whenn_kv = 512, the transpose does not change the tensor shape, so the KV dynamic dimension remains on the wrong axis. As a result, V retains a fixed length of 512 while K and the attention mask are padded to 768, causing a MatMul dimension mismatch.Changes
TRANSPOSEcase incompute_node_dynamic_dims().PERMUTErule, instead of applying theRESHAPEdynamic-dimension handling.Results
Tested with GLM-4.7-Flash Q4_K_M using:
a97d80a6aIncompatible MatMul matrix dimension. First input dimension=768 ... second input dimension=512a97d80a6a+ this changeAdditional validation
-fa off -ub 1024, perplexity results across 4 chunks are identical before and after the change (KLD 0.070493).--no-warmup, the benchmark fails earlier due to a separate issue addressed by L12.Requirements