Skip to content

feat(freetile): add multi-gen Cloud TPU serving planner, SparseCore ragged gathers, and 4-bit codebook parity (#44) - #48

Open
saariuslystoned wants to merge 3 commits into
mainfrom
feat/44-multigen-sparsecore-serving
Open

saariuslystoned wants to merge 3 commits into
mainfrom
feat/44-multigen-sparsecore-serving

Conversation

@saariuslystoned

Copy link
Copy Markdown
Collaborator

Addresses #44 (host-verified clean-room C++ multi-generation Cloud TPU serving planner for v5e, v5p, v6e Trillium, and tpu7x Ironwood, SparseCore paged-KV & MoE ragged gather reference gated off on v5e, 0.0 ULP 4-bit codebook_dequant, and multi-chip prefix router).

Summary

  • Multi-gen capability & roofline planner (freetile/include/freetile/serving_planner.hpp, freetile/src/serving_planner.cpp, docs/cloud-tpu/multigen-serving-sparsecore.md):
    • Generation descriptors and roofline knees (MXU/VPU/HBM, VMEM offload boundaries) for v5e, v5p, v6e, and tpu7x.
    • SparseCore paged-KV pack/gather/scatter and MoE top-k routing/dedup reference parity on v5p, v6e, and tpu7x, cleanly gated off on v5e (AUTO falls back to VPU with matching numerics; forced SparseCore dispatch fails closed).
    • Unified 4-bit codebook_dequant parity (IQ4_XS, NF4, BOF4, FP4/MXFP4) at 0.0 ULP across VREG select-tree, VPERM, and native-FP4 lowering strategies.
    • Multi-chip prefix-affinity router (1x1, 2x2, 2x4, tpu7x dual-chiplet), length bucketing, and draft/target verify budgets.
  • Tests & build wiring (freetile/tests/test_serving_planner.cpp, freetile/CMakeLists.txt, freetile/Makefile, freetile/README.md, README.md): registered freetile_serving_planner_tests in CTest and Makefile.

Verification

  • make -C freetile test & CMake ctest (5/5): PASS
  • libopenbuenos CTest (3/3) + make -C libopenbuenos verify-header-host host test (27/27): PASS
  • llama-cpp-cloudtpu CTest (1/1) + libopentpu host tests + llama.cpp CLOUDTPU_MOCK=1 overlay (ADD 153/153, RMS_NORM 61/61, SCALE 12/12): PASS
  • git diff --check: clean

…n, fuzz stress

- saturate mxus_per_chip product, overflow-safe slice_device_count
- paged KV pack/gather: 64-bit offsets, full plan-consistency validation
- MoE: route-table and workspace size caps, plan validation
- reject invalid codebook format/path enums, validate d2d buddy packages
- fix shift >=64 UB in build_op640 (freetile + libopenbuenos)
- add deterministic fuzz/property stress test wiring into make/ctest
@saariuslystoned

Copy link
Copy Markdown
Collaborator Author

Adversarial Hardening & Public-Roads Audit Receipt (2a775bb5)

  • Prior PR head: dace3e42 → Hardened head: 2a775bb5
  • Fixes landed: 7 bug classes fixed (overflow, OOB, UB, enum validation, allocation bounds, serving-plan validation) + wired fuzz suite.
  • Verification: ASan+UBSan 6/6 PASS, TSan 4/4 PASS, CTest 6/6 PASS, make test green, Python 79/79 PASS, public-roads diff scan clean.

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