Skip to content

feat(ironwood): tpu7x 8 logical device enumeration + dual-chiplet CDI/exporter metadata (#21) - #47

Open
saariuslystoned wants to merge 2 commits into
mainfrom
feat/21-ironwood-tpu7x-8dev-d2d
Open

saariuslystoned wants to merge 2 commits into
mainfrom
feat/21-ironwood-tpu7x-8dev-d2d

Conversation

@saariuslystoned

Copy link
Copy Markdown
Collaborator

Prepares Day-1 host-verified support for #21 (Ironwood tpu7x-standard-4t 8 logical devices & dual-chiplet metadata; live lspci -nn / /dev/vfio/* PCI ID confirmation remains pending Day-1 hardware).

Summary

  • libopentpu (ot_pjrt.cpp, ot_vfio.cpp, tests/opentpu_host_test.cpp): adds tpu7x-4t-single / tpu7x_4t_single 8 single-chiplet PCI-function enumeration yielding 8 logical tpu7x devices (256×256 MXU, FP8 (4,1), 96 GiB HBM3e per logical device), matching the existing 4×2 dual-chiplet path. Provisional PCI ID 0x1ae0:0x0075 remains explicitly annotated pending Day-1 lspci -nn.
  • ops/tpu-cdi & ops/tpu-exporter (freetpu_cdi.py, tpu_exporter.py + tests): adds TPU_CHIPLETS_PER_PKG (tpu7x: 2), TPU_HBM_GIB_PER_LOGICAL_DEVICE (tpu7x: 96), tpu_topology_metadata(), and CDI annotations freetpu.dev/chiplets-per-pkg / freetpu.dev/hbm-gib-per-logical-device.
  • llama-cpp-cloudtpu: verified existing TPU7X_4T 8×96 GiB mock, compute_d2d_hamiltonian_order, and f8E4M3FN lowering compile and pass all host checks unchanged.

Verification

  • make -C libopentpu verify-header-host host test: PASS (incl. test_pjrt_single_chiplet_tpu7x_enumeration).
  • python3 ops/tpu-cdi/test_freetpu_cdi.py -v: 34/34 OK.
  • python3 ops/tpu-exporter/test_tpu_exporter.py -v: 26/26 OK.
  • CLOUDTPU_MOCK=1 test_cloudtpu_host: ALL PASSED.
  • Clean-room audit across 192 files: PASS (0 violations).

…dening

- parse_hex_u64: require *end==\0 (fail-closed on trailing junk e.g. 0x75JUNK)
- ot_pjrt_client_create: guard zero/absurd pci/chiplet dims, overflow check on pci_funcs*chiplets_per_func, enforce total_logical <=64, double check for mock & live paths
- freetpu_cdi.tpu_topology_metadata: fail-closed on non-str/unhashable gens (None/int/list/dict), correct Optional[int] hint, add PEP8 blank line
- build_cdi_spec: emit chiplets-per-pkg/hbm for homogeneous shared-iommu-group selectors (Ironwood dual-chiplet gap), keep mixed-generation suppression
- No public-roads violations; ASan+UBSan clean; all Python tests pass
@saariuslystoned

Copy link
Copy Markdown
Collaborator Author

Adversarial Hardening & Public-Roads Audit Receipt (26ec5d86)

  • Prior PR head: f58cd0e9 → Hardened head: 26ec5d86
  • 3 bugs fixed: ot_vfio.cpp parse_hex_u64 trailing-junk bypass (0x75JUNK → fail-closed *end == '\0'), ot_pjrt.cpp total_logical overflow/div0 + <=64 guard, freetpu_cdi.py fail-closed on non-str/unhashable gens + homogeneous dual-chiplet metadata emission.
  • Verification: make -C libopentpu test + ASan+UBSan ALL_HOST_TESTS_PASSED, 34 CDI + 26 exporter + 62 adversarial stress checks 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