Repository navigation
Upstream PR: H3 Metal fc1 in int8 on the tensor units - #4989
plotarmordev wants to merge 7 commits into
Conversation
Every block's fc1 rows are quantized once at bind into a private int8 copy, a scale per 256 values of K; each block quantizes its normed rows a row and runs fc1 on h3_gemm_32x64_i8, folding each 256-deep block's int32 sums at the weights' scales. The server joins the copy to its weights' residency set. A warm 2048 picture: 11.14 and 11.16 s against 12.12 s in bf16; the picture holds card 80's rule (cosine 0.995344, 28.240 dB, mean 4.011, max 245). (cherry picked from commit b07236c)
The limits runner joins gemm_nax's fragments ahead of h3_gemm.metal, as source.zig does at load. h3_gemm_32x64 and its ragged form are gated bit-equal to the MLX gemm_nax they replaced; the int8 form against float64 at its scales; h3_quantize_rows against its formula; each with its limits record. The quantizer dropped NaN through max: a group holding one now takes a NaN scale. (cherry picked from commit 653f88b)
…8 picture's geometry (cherry picked from commit b5bd38a)
(cherry picked from commit 405f9a6)
…roducts' contract joins gemm_source The fork's finish() was inlined upstream in the give-way rework, so quantizeFc1 waits cb and checks its failure the same way. Upstream keeps the products in kernels.gemm_source, not .source: the limits runner's own 'h3 product' join already covers them (the duplicated cherry-picked branch is dropped), and the suite's library() joins gemm_source beside .source as source.zig does at load.
|
The zig job's lean findings are fixed on the new head: the h3 fc1 comments are one line each under 120 columns, so the checker reports 0 new problems over the merge base (165 inherited, unchanged). I also added the Unreleased changelog bullet naming this PR. |
|
I tried the landing order main zig build test-h3-gemm test-h3-image-server test-h3-read-ahead \
test-h3-image-decoder-load -Dcpu=apple_m1 --summary allAll 54 build steps and 16 tests passed: 3 GEMM, 9 image-server, 2 read-ahead and 2 decoder-load tests. That checks the server and loader fixtures with both H3 heads present. It does not cover the 2048-pixel checkpoint rendering or timing comparison. Igor Lessio - AIFLOW LABS |
How to check
94e0f2dc274f1cbd63bde7cc343e47babb87cff3f5cf48ff71febb9742948b71312becbc0deee9a8Test results:
zig build compile-h3-host tf-kernel-contract -Dcpu=apple_m1ata14263c09d96(older head): 1 passed, 0 failed, 0 skippedzig-out/bin/tf-kernel-contract --only "h3 product" (base 94e0f2dc2, scratch checkout)at94e0f2dc274f(older head): 16 passed, 2 failed, 0 skippedzig-out/bin/tf-kernel-contract --only "h3 product"ata14263c09d96(older head): 31 passed, 2 failed, 0 skippedzig build test-h3-image-serverata14263c09d96(older head): 7 passed, 0 failed, 0 skippedswarm scan . refs/swarm/upstream/ashhart/TensorFold/main..HEAData14263c09d96(older head): 1 passed, 0 failed, 0 skippedzig build test-h3-gemm test-h3-image-serverata14263c09d96(older head): 46 passed, 0 failed, 0 skippedzig build test test-goldenata14263c09d96(older head): 6143 passed, 4 failed, 85 skippedpython3 tools/zig/lean_check.py (166 findings, all inherited; the gate is lean_new)atf5cf48ff71fe: 0 passed, 1 failed, 0 skippedpython3 tools/zig/lean_new.py lean-base.txt lean-head.txt (merge base 94e0f2dc274f1cbd63bde7cc343e47babb87cff3): 165 problems, 165 on the base, 0 newatf5cf48ff71fe: 1 passed, 0 failed, 0 skippedpython3 tools/pr_check.py --base origin/main --pr 4989atf5cf48ff71fe: 1 passed, 0 failed, 0 skippedzig fmt --check zig/src/families/h3/block.zig zig/src/families/h3/h3.zig zig/tests/contract/metal_h3_gemm.zig zig/tests/h3_image_decoder_selftest.zig zig/tests/h3_image_server.zigatf5cf48ff71fe: 1 passed, 0 failed, 0 skippedswarm scan . origin/feat/109-upstream-pr-h3-metal-fc1-in-int8-on-the-..HEADatf5cf48ff71fe: 1 passed, 0 failed, 0 skipped