Repository navigation
Conversation
…lock scales, from origins inside a 128 block (TP=3's 704); ModelOpt's [Rb,1,Cb,1] scales read as [Rb,Cb]
|
Thanks @Bizuayeu for covering the TP=3 shares starting at rows 0, 704 and 1408, and @jschmied for the fp8g scale layout. We're taking this host foundation for 1.1.1. Review confirms that global row/input origins select the whole matrix's correct 128-block scales, while zero-origin packing retains the old layout. Independent controls fail when either origin is dropped, and the rank-4 scale view preserves its bytes. The GPU repack comparison against the independent layout is still owed when the new path is used, alongside #1015's per-rank row/column-slice and model checks. This does not by itself enable FP4-Local serving. Posted by Ash's AI Assistant Synthena |
|
Noted. We'll take the GPU repack comparison when GLM's loader packs FP4-Local's block-FP8 projections (MLA and the shared experts, whose TP=3 shares start inside a 128 block) through this path: every rank's uploaded scales against the independent layout at TP=2 and TP=3, posted on #1015 with the row and column slice checks. |
Credit: @Bizuayeu for the implementation and TP=3 origin controls. Credit: @jschmied for the original fp8g scale layout (#548). Keep existing zero-origin packing and add the ModelOpt rank-4 scale view. Co-authored-by: Jürgen Schmied <[email protected]>
|
Thanks @Bizuayeu for #1024 and @jschmied for the fp8g layout. 1.1.1 includes global row/input-origin scale packing for rank shares that begin inside a block, plus the ModelOpt rank-4 scale view. Both split orientations and the zero-origin legacy layout are retained. GPU repacking and #1015's per-rank/model checks remain owed when consumers use the new path. This host foundation does not announce complete FP4-Local support. Posted by Ash's AI Assistant Synthena |
Credit: @Bizuayeu for the implementation and TP=3 origin controls. Credit: @jschmied for the original fp8g scale layout (ashhart#548). Keep existing zero-origin packing and add the ModelOpt rank-4 scale view. Co-authored-by: Jürgen Schmied <[email protected]>
What this changes
Adds
fp8.packScalesAt, which packs a rank's share of block-FP8 scales forfp8gfrom any row and input origin, so a share may start inside a 128 block, as TP=3's shares of GLM-5.3-Flash's 2048-row shared expert do at rows 704 and 1408 (#1015).packScalesnow calls it with origins 0, andcore/quant/fp8.zig'sblockScalesreads ModelOpt's[Rb, 1, Cb, 1]scales as[Rb, Cb].fp8g's scale layout is yours (Zig CUDA ports: shared layers belowlanes.Backend, and one place to coordinate them #548); this adds a variant besidepackScalesand keeps its signature.packScalesAttakes the share's row and input origins and the whole matrix's size, and reads each block's scale from the whole matrix's scales.packScales's output is the same forka multiple of 128, and every caller has such ak: the old size check allowed no other.blockScalesgives FP8_PB_WO's scales the[Rb, Cb]shape thatreferencetakes, and refuses any other rank-4 shape.Receipt
9ccf4727plus this commit, Zig 0.17.0. Host tests on x86_64 Linux, on an LF tree fromgit archive.packScalesAtyet.zig build test: 84/84 steps, 1378/1385 tests passed, 7 skipped.zig build test-kernel-contract,test-golden,fuzz-cortheonand a plainzig build: succeeded.main).git diff --check: clean.blockScaleson a 2 × 130 matrix with two column blocks, against the reference's values, and its refusal of a[1, 2, 1, 1]scale.tf-cuda-test's fp8 repack check against the Python layout, which needs a GPU. Forka multiple of 128,packScalesreads the same scale for each tile as before.Checklist
"draft": false, a resumed prompt equals a fresh one, and concurrent equals solo. (No served path changes.)SUMMARYline is in the receipt. (No GPU kernel changes.)