Repository navigation
fix(CI-MAIN-CTEST-RESIDUE): deepseek-v4 keep-quant slices consume repacked stacked-expert weights - #3610
Open
lu-zero wants to merge 1 commit into
Conversation
… i8mm arm64 The arm64-full CI has red test_deepseek_v4_gguf_load and eight test_deepseek_v4_mm_reach sub-cases since Nov 22: on an i8mm host the auto repack lever (QuantRepackActive() default auto) interleaves the stacked-expert Q8_0 weights into block_q8_0x4 at load, and GemmRowSlice refused them outright. The refusal also masked a silent second defect: the forward's full-tensor GEMMs consume weights through OwnedTensor::View(), whose ViewOn deliberately drops the LAYOUT markers, so a repacked weight decodes as plain q8_0 and yields NaN logits with no refusal (the localai-org#2031 failure mode). Option (a), the real fix; no option-(b) disable gate is needed: - GemmRowSlice accepts a repacked stacked weight when the slice is GROUP-ALIGNED (row_off and N multiples of kQ8_0xNrowsInterleaved = 4). The interleave is size-neutral (block_q8_0x4 == 4 * block_q8_0), so a group-aligned slice maps to the same byte offset and stays a valid QuantRepackMatmul operand; the slice carries wt.repacked. Group-crossing slices and device queues are refused loudly. The tiny test geometry (mi = olr = 32) and the real arch are always group-aligned. - GemmGroupedExpertsKq accepts repacked with N % 4 == 0; the CPU grouped provider already carries repacked onto its per-expert slices. - Gemm, GemmGroupedExpertsKq and GemmIntoKq carry repacked/q8_0_aligned back onto the View() operand, exactly as qwen3_5.cpp does for its tower. A repacked weight never exists on a device queue (QuantRepackForDevice), so the device arms are unaffected. Local i8mm aarch64 host reproduced the CI failure verbatim before the fix. After: both CI tests 100% with the lever ON (default) and with VT_CPU_QUANT_REPACK=0; test_deepseek_v4_forward/scaffold/moe and test_ops_quant_dot pass. Two mutations (delete the Gemm marker carry; strip wt.repacked in GemmRowSlice) each red the suite and were restored byte-for-byte. New hermetic case "CIQ G7: the repacked stacked-expert weights serve the forward (arm64 i8mm)" enters at ModelRegistry::Forward and reds under both mutants. Fixes ISSUE-LOCAL-01M93Y397CF1KRTRW8SFCNAMF1 (row CI-MAIN-CTEST-RESIDUE). FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: AGENT:zai/glm-5.3-flash [task]
This branch has not been deployed
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.
fix(CI-MAIN-CTEST-RESIDUE): deepseek-v4 keep-quant slices consume repacked stacked-expert weights
On i8mm aarch64 hosts the auto repack lever packs deepseek-v4's
stacked-expert Q8_0 weights at load, and the keep-quant expert/group
slice GEMM refused them (deepseek_v4.cpp:631) - breaking
deepseek-v4 k-quant on every i8mm ARM box and failing
test_deepseek_v4_gguf_load + test_deepseek_v4_mm_reach on the
scheduled arm64-full lane since Nov 22. Two defects, both fixed:
slices (row_off/N multiples of the 4-row block_q8_0x4 interleave -
size-neutral, byte offset unchanged), carries wt.repacked, and still
refuses group-crossing slices and device queues loudly.
full-tensor GEMMs decoded interleaved bytes as plain q8_0 (all-NaN
logits once the refusal was unblocked). They now carry
repacked/q8_0_aligned back, matching qwen3_5.cpp's tower handling.
Reproduced locally on this i8mm aarch64 host before any fix (the CI
failure verbatim; mm_reach 8/20 cases failing); after the fix both
tests run 100% with the repack lever ON (default) and with
VT_CPU_QUANT_REPACK=0. New hermetic case enters at
ModelRegistry::Forward (finite, deterministic logits over repacked
bytes); two mutations (marker-carry deleted; wt.repacked stripped)
each red the new tests. Repacked weights never exist on a device
queue, so device arms are untouched. Slice widths must be multiples
of 4 (true for every real DeepSeek-V4 shape); violations throw with
a message naming the constraint.
Closes ISSUE-LOCAL-01M93Y397CF1KRTRW8SFCNAMF1
FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: AGENT:zai/glm-5.3-flash [maki]