Skip to content

docs(mmq): the Metal line numbers were master's, not the pin's - #453

Merged
glennneuber merged 1 commit into
mainfrom
docs/mmq-metal-line-numbers
Oct 5, 2026
Merged

glennneuber merged 1 commit into
mainfrom
docs/mmq-metal-line-numbers

Conversation

@glennneuber

Copy link
Copy Markdown

Summary

Follow-up to #452, from the Metal host's third review note there: the two mul_mv.metal line numbers in docs/maxusai/mmq-padding-metal-not-affected.md were three lines off at b11081. The reading was done on upstream master (dd266785c) while the file said it was done at the fork's pin, and mul_mm.metal and mul_mv.metal differ between the two.

At b11081 (161755f2) the quoted loops in kernel_mul_mv_q4_K_f32_impl are at 1569 (the unconditional src0 read) and 1607 (the guarded write), not 1572 and 1610. At the pin, 1572 is sc16[2] = … inside the read loop and 1610 is dst_f32[first_row + row] = sum_all; inside the write loop, as the review said.

The conclusion is unchanged: the specific MMQ tail-padding defect is absent from Metal. What was wrong was the tree the numbers came from.

Changes

docs/maxusai/mmq-padding-metal-not-affected.md, one file, no code:

  • mul_mv.metal:1572 → :1569 and :1610 → :1607; that block's ... elision becomes [...], matching the other quoted block.
  • A Which tree note at the top: read on dd266785c, re-verified at b11081, every line number in the file is the pin's.
  • A third bullet in the review section recording this correction.

#452's own description still carries 1572/1610 and the "read from b11081" line. The file on main is the record.

Test plan

Every check below was run against b11081 (161755f2), not master. The tree is what was wrong last time, so each line names it.

  • The two quoted mul_mv.metal lines, trailing citation comments stripped, diffed against sed -n '1569p;1607p' of the pin's file: identical, whitespace included.
  • The quoted kernel_mul_mm_id block diffed against the pin's mul_mm.metal: two exact contiguous runs, 542–555 and 559–560, so the block is 542–560 verbatim with 556–558 (the il0/il lines) elided at the marker. The clamp comment is at 552.
  • The review's other references: mul_mm.metal:406 is n_all += sel > 0;, and :822 is the write-back's for (short j = sgitg; j < nr1; j += 4) {.
  • ggml_metal_op_mul_mat_id_extra_{tpe,ids,amax} each appear in both ggml-metal.cpp and ggml-metal-ops.cpp; MMQ_TILE_Y_K and block_q8_1_mmq appear only under ggml/src/ggml-cuda/.
  • check_source_paths.py --changed-since origin/main (every referenced file resolves), name scan.
  • No GPU run; not applicable to a citation fix.

ai-server/mlx-cuda

🤖 Generated with Claude Code

Third correction from the Metal host on #452, and the one worth having: the
mul_mv.metal loops are at 1569 and 1607 at b11081 (161755f2), not 1572 and 1610.
Those were dd266785c's -- the tree this work had open -- while the file claimed
to have read the pin. mul_mm.metal and mul_mv.metal differ between the two.

Verified at b11081 before taking it: 1572 is sc16[2] = ... inside the read loop
and 1610 is dst_f32[first_row + row] = sum_all; inside the write loop, exactly as
they said. The two quoted mul_mv.metal lines, citation comments stripped, diff
clean against 1569 and 1607, whitespace included. The quoted kernel_mul_mm_id
block is mul_mm.metal:542-560 verbatim, with the il0/il lines (556-558) elided
where marked and the clamp comment at 552 -- checked this time by diffing the
block against the pin rather than grepping its lines, which is the check the
previous correction taught me to run. Their other references hold too:
mul_mm.metal:406 is n_all += sel > 0; and :822 is the write-back's j < nr1, the
three MUL_MAT_ID extras are in both ggml-metal.cpp and ggml-metal-ops.cpp, and
MMQ_TILE_Y_K and block_q8_1_mmq appear only under ggml-cuda at b11081.

The conclusion is unchanged. What was wrong was the provenance, which the file
now states at the top: read on master, re-verified at the pin, line numbers the
pin's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@glennneuber
glennneuber merged commit 09f5c1a into main Oct 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant