Skip to content

feat(ops): CDI v1.1.0 (drop --net=host, iommufd, NUMA) & direct gRPC/SeqLock/AER tpu-exporter (#3, #21) - #24

Open
saariuslystoned wants to merge 18 commits into
mainfrom
feat/tpu-ops-cdi-v1-grpc-telemetry
Open

saariuslystoned wants to merge 18 commits into
mainfrom
feat/tpu-ops-cdi-v1-grpc-telemetry

Conversation

@saariuslystoned

Copy link
Copy Markdown
Owner

Summary

Hardens the Pillar 6 ops/tpu-cdi/ and ops/tpu-exporter/ stack (#3, #21) from c212e34:

ops/tpu-cdi/ (CNCF CDI v1.1.0 + Network Isolation)

  • Upgrades emitted and validated CDI schema to cdiVersion: "1.1.0" (including intelRdt and additionalGids schema validation while keeping --check-host strictly locked to env and deviceNodes).
  • Eliminates mandatory --net=host / hostNetwork: true for single-host slices by injecting MEGASCALE_COORDINATOR_ADDRESS=127.0.0.1:8353, TPU_HOST_BOUNDS=1,1,1, slice-scoped TPU_CHIPS_PER_HOST_BOUNDS, TPU_VISIBLE_DEVICES, and TPU_SKIP_MDS_QUERY=1 into each CDI device entry's containerEdits.env (with --network-mode isolated|host across generate, sync, and docker-args).
  • Adds Linux 6.8+ iommufd dual-path auto-detection (/dev/iommu + /dev/vfio/devices/vfioN) with fallback to legacy VFIO (/dev/vfio/vfio + /dev/vfio/<iommu_group>), plus --iommu-dev override and --check-host verification.
  • Adds NUMA / PCIe-root-complex-aware 4-chip sub-host presets (numa0, numa1, 0-3, 4-7) for v6e-8 (0000:00:* vs 0000:80:*) and enforces domain boundaries during --check-host.
  • Adds PCI ID 0x0075 (tpu7x, marked pending live hardware confirmation per Ironwood (tpu7x-standard-4t): Enumerate 8 logical devices (dual-chiplet D2D pairing) across ggml-cloudtpu, libopentpu, and ops #21).
  • Updates ops/tpu-cdi/manifests/k8s-tpu-cdi-daemonset.yaml for --network-mode isolated and adds starter DRA manifest ops/tpu-cdi/manifests/k8s-tpu-dra-example.yaml.

ops/tpu-exporter/ (Direct gRPC, SeqLock MMF, PCIe AER, Alerts)

  • Adds in-process direct libtpu gRPC RuntimeMetricService (127.0.0.1:8431) scraper with persistent channel reuse and graceful fallback when grpcio/proto stubs are absent, eliminating unconditional tpu-info subprocess churn.
  • Adds lockless SeqLock /dev/shm/freetpu_metrics_<bdf> mmap reader for libopentpu.so with documented 48-byte C ABI header ops/tpu-exporter/freetpu_metrics_shm.h.
  • Adds pure libtpu-free sysfs PCIe AER counters (freetpu_pcie_aer_correctable_total, freetpu_pcie_aer_fatal_total).
  • Adds opt-in fast-timeout GCP Spot preemption metadata gauge (--gcp-metadata-preemption -> gcp_metadata_preempted_status) and ops/tpu-exporter/prometheus-alerts.yml (TpuHbmOOMWarning, TpuMxuDutyCycleCollapse, TpuPcieAerFault, GcpSpotPreemption).

Verification

  • python3 ops/tpu-cdi/test_freetpu_cdi.py -v — 21/21 passed
  • python3 ops/tpu-exporter/test_tpu_exporter.py -v — 19/19 passed
  • clang -x c -std=c11 -fsyntax-only -Wall -Wextra -Werror ops/tpu-exporter/freetpu_metrics_shm.h — passed
  • clang++ -x c++ -std=c++17 -fsyntax-only -Wall -Wextra -Werror ops/tpu-exporter/freetpu_metrics_shm.h — passed
  • Clean-room & OSS boundary audit across 106 tracked files — passed

Refs #3, #21

…aults, Ironwood topology/duty-cycle, DRA v1, PCIe ancestry)
…, Ironwood visibility/per-core duty cycle, SHM expiry, PCIe slice annotations)
…fallback, worker env, 96 GiB Ironwood chiplet HBM, Spot max_over_time, slice alias verification, DRA locality prereqs, closID rules)
… runtime mapping only, SHM pool capacity with SHM usage, K8s 1.34 DRA Topology Manager note)
…ted slice topologies, raw-ID duty-cycle layout, bare custom tpu-info-bin, safe metadata Request error handling)
…sibility ordinals, Ironwood all function completeness, set-exact duty-cycle join, proxy bypass for GCP metadata)
…ip-id-map docs, local gRPC channel credentials + proxy disable, SHM total pairing with SHM usage, verified stable numeric range aliases)
…pu-info import on >=0.14.2, require verified chip IDs for all visibility masks, strict exact-set Ironwood duty-cycle join)
…TYPE on isolated presets, domain-scoped Ironwood pairing, iommufd compat symlink auto-detection)
…y guard, auto cdev probe, and C11 SHM atomics
…s, and preserve Ironwood per-core duty on partial HBM
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