Repository navigation
feat(cloud-tpu): branchless VREG 4-bit IQ4_XS select-tree LUT kernel + parity tests (#43) - #46
Open
saariuslystoned wants to merge 2 commits into
Open
saariuslystoned wants to merge 2 commits into
saariuslystoned wants to merge 2 commits into
Conversation
…nel and parity tests (#43)
…r IQ4_XS/NL dequant (freetpu#46) - Handle non-multiple K tails (k%32/k%256) in dequant_iq4_nl_row and dequant_iq4_xs_row instead of silent truncation leaving outputs unwritten; both C++ and Python mirror now dequantize the trailing partial block with correct scale decoding - Add null-pointer and k==0 guards (throw invalid_argument) fail-closed to all dequant entry points - Fix iq4xs_dequant_matmul row stride to ceil(K/256)*136 for non-multiple K - Harden select_tree_select_count against shift UB for bits>=32 (saturate UINT32_MAX) and Python count_selects bits range check - Fuzz-validated bit-exact tree vs direct and scalar reference over 20k cases Audit: ASan+UBSan -Wall -Wextra -Werror clean, 10k random + boundary + subnormal + unaligned Clean-room grep: no private terms
Collaborator
Author
Adversarial Hardening & Public-Roads Audit Receipt (
|
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.
Closes #43 (clean-room branchless 4-bit VREG select-tree LUT kernel in FreeTile + StableHLO/Python emitter,
0.0bit-exact parity tests across non-power-of-2 MoE shapes, generalization acrossIQ4_XS/IQ4_NL/NF4/FP4, CI wiring, and reproducible proof doc).Summary
freetile/,llama-cpp-cloudtpu/,tools/select_tree_lut.py): replaces dynamic XLAgatherwith a 4-level branchlessselect(bit, hi, lo)tree over 16-entry codebooks (IQ4_XS/kvalues_iq4nl,IQ4_NL,NF4,FP4), verified statically to emit zerogatherops.0.0parity & shape coverage (freetile/tests/,llama-cpp-cloudtpu/tests/test_cloudtpu_host.cpp,tools/test_select_tree_lut.py): verifiesmax_abs_diff == 0.0across non-power-of-2 MoE shapes (1/64/128×2304²,128×3072²,128×4096²,64×6144²) and cross-checks againstlibopenbuenosscalarIQ4_XSdequantization.proof/cloud-tpu-iq4xs-select-tree/PROOF.md,.github/workflows/ci.yml): host bit-exact + IR proof verified here; ready-to-run Cloud TPUv5e/v6elive timing commands documented separately.Verification
make -C freetile test+ ASan+UBSan: PASS (0 failures,max_abs_diff=0.0).CLOUDTPU_MOCK=1 test_cloudtpu_host: PASS (0 failures).python3 tools/select_tree_lut.py --self-test&tools/test_select_tree_lut.py: 6/6 OK.make -C libopenbuenos verify-header-host host test&make -C libopentpu verify-header-host host test: PASS.