mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #487] Fix IQ1_S/IQ2_S/IQ3_S MMQ decoding on Windows CUDA #558
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#558
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mw00/project-maya/pull/487
Author: @Fringe210
Created: 10/25/2026
Status: 🔄 Open
Base:
main← Head:fix/glm-iq-mmq-prefill📝 Commits (1)
ae26bf6fix(cuda): correct IQ S MMQ decoding and partial expert tile IDs📊 Changes
6 files changed (+428 additions, -33 deletions)
View changed files
📝
CMakeLists.txt(+9 -3)➕
docs/GLM_MMQ_CORRECTNESS.md(+80 -0)📝
tests/glm_mmq_glu_test.cu(+33 -0)➕
tests/glm_prefill_probe.cpp(+71 -0)📝
third_party/ggml/mmq-fused-swiglu.patch(+118 -30)➕
tools/check_glm_conversations.py(+117 -0)📄 Description
GLM conversations on Windows/CUDA 13.2 could ignore the latest turn, repeat earlier text or invent an unrelated translation task when using batched prefill. The same weights, prompt and API request worked through token-at-a-time prefill; disabling the CPU expert lane or fused SwiGLU did not fix it.
The IQ1_S/IQ2_S/IQ3_S MMQ loaders read codebook and sign bytes through pointers to local packed registers. In the affected build these reads produced incorrect indices, including out-of-bounds codebook accesses. Extract unsigned bytes explicitly with shifts/masks for both plain and fused products. Also guard unused destination-ID reads in the last partial expert tile.
Extend the existing fused/plain regression with independent CPU dequantization and scalar double-precision dots: fused/plain parity alone passed when both products were wrong. Non-finite values now fail both parity modes. Add
--iq-s-onlyfor targeted memory checks, a full-pack prefill diagnostic and a conversation acceptance harness. The patch still applies to CMake's build-tree copy of the pinned GGML sources.Before/after on the same hardware
Base:
4615f346d9311dd1ce9f5738ab04446f023a6e42(v1.1.27). Windows, NVIDIA RTX PRO 6000 Blackwell sm_120, driver 596.86, CUDA 13.2, Maya-M.Full-model prefill/token KL decreased from 3.48662072 to 0.0674770672 and the next-token argmax agreed after the byte fix. This full-pack measurement preceded the additional partial-ID guards; the final guarded kernels passed the memory checks below. Numerical output changes intentionally because the affected original products were incorrect.
Validation
glm_mmq_glu_test: 14 formats, two expert-row profiles, clamped/unclamped fused/plain checks and independent CPU-dot comparisons all passed.compute-sanitizer --tool memcheck --error-exitcode 88 .../glm_mmq_glu_test --iq-s-only: all affected formats passed; 0 errors.python tools/check_hip_compat.py: passed.Measurements and reproduction commands are in
docs/GLM_MMQ_CORRECTNESS.md. GPU numerical tests were performed on this Blackwell/CUDA configuration; other GPUs, toolkits and HIP hardware were not exercised. No performance improvement is claimed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.