Repository navigation
fix(ignition): raise GA10B external floor, reseal unified-memory capture window, warm addmm, and mark vocab_ids numeric - #658
Merged
Conversation
Collaborator
|
A case file has been opened for 658. Future reviews will auto-run 90 minutes after code updates are pushed.
|
Collaborator
Autobot ReviewFull Review · Value Proposition · Case File Recommendation: Changes RequestedThe production fixes in
Walkthrough
Merge Risk: Low · up to
|
…ure window, warm addmm, and mark vocab_ids numeric Exporting prepared cores on Jetson Orin (GA10B / SM 8.7) unified-memory GPUs encountered four preparation and address-hygiene defects during CUDA graph capture and export pointer-table auditing: 1. On integrated GA10B (compute capability 8.7, default device window), `CoreStorage.EXTERNAL_FLOOR` was `0x300000000` (12 GiB). Static `cuRAND` `precalc_xorwow_offset_matrix` tables contain 64-bit integer words in `[0x3_0000_0000, 0x3_0300_0000]`, producing false-positive pointer matches against external library allocations placed at `0x300000000`. 2. On Linux unified-memory GPUs, the first CUDA graph capture trims CUDA's pre-init low allocation slab, reopening free virtual address spans below `EXTERNAL_FLOOR` after `CoreStorage._reserve_low_window()` already sealed them. Subsequent external allocations during serving-graph capture could then land below `EXTERNAL_FLOOR`, where a serving process's own driver storage resides. 3. `_seed_warmup_workspaces` in `ignition/preparation/capture.py` executed only `torch.mm`, leaving cuBLAS `addmm` epilogue workspaces unseeded on the warmup stream prior to capture. 4. `DeviceRequestState.vocab_ids` in `ignition/components/sampling.py` allocated a persistent `int64` `arange(vocab_size)` tensor without registering it via `record_numeric_tensor`, leaving pure numeric vocabulary indices exposed to pointer scanning. What changed: - `ignition/preparation/core_storage.py`: Before: integrated GA10B (`major == 8, minor == 7`, `device_window is None`) set `self.EXTERNAL_FLOOR = 0x300000000` (12 GiB). After: sets `self.EXTERNAL_FLOOR = 0x900000000` (36 GiB), placing external library allocations in the 36 GiB `[0x9_0000_0000, 0x12_0000_0000)` band below `DEVICE_BASE` (`0x12_0000_0000`, 72 GiB; `RESERVATION_BYTES = 48 GiB`, total 120 GiB inside GA10B's 128 GiB VMM window) and above cuRAND's offset-matrix words. - `ignition/preparation/capture.py`: Before: `_seed_warmup_workspaces` ran `torch.mm` only, and `capture_forwards` entered the serving graph capture loop without triggering a Linux integrated-GPU probe capture or resealing the low window. After: `_seed_warmup_workspaces` runs both `torch.mm` and `torch.addmm` (with a 1D `bfloat16` bias) on the dedicated warmup stream and pool. When `os.name != "nt" and getattr(warmup_storage, "integrated", False)` is true, `capture_forwards` runs one minimal 1-byte `probe_buf.zero_()` probe capture inside `warmup()` (`CoreStorage.transient()`), whose exit synchronizes, releases the transient pool, and calls `seal_low_window()` before the serving capture loop, and calls `warmup_storage.seal_low_window()` again after each `record_export_graph`. Windows (`os.name == "nt"`) skips the probe capture and per-graph resealing because WDDM retains its low allocation pool. - `ignition/components/sampling.py`: Before: `DeviceRequestState.vocab_ids` returned `persistent_copy(arange)` without numeric registration. After: imports `record_numeric_tensor` at module scope and calls `record_numeric_tensor(ids)` on the persistent `vocab_ids` tensor before returning it. - `docs/runtime-core-design.md`: Before: stated unconditionally that Linux integrated GPUs reserve and reject external device storage below 256 GiB. After: documents the external device floor (`CoreStorage.EXTERNAL_FLOOR`: 256 GiB by default, or 36 GiB for integrated GA10B / SM 8.7's default 128 GiB VMM layout with a 72 GiB device base and 48 GiB reservation). - `tests/preparation/test_core_storage.py`, `tests/preparation/test_capture_graph_metadata.py`: Added five CPU unit tests covering the GA10B window constants, `DeviceRequestState.vocab_ids` numeric registration through a real `NumericStorage` context, `torch.mm` + `torch.addmm` workspace seeding, Linux integrated-GPU probe capture plus low-window resealing order, and Windows (`os.name == "nt"`) probe/reseal skipping, with shared export-capture monkeypatch setup in `_patch_export_capture`. - Compatibility: No core wire format, Protobuf, CLI, or Helios runtime changes; existing prepared cores retain their recorded `device_address_floor` and load and serve unchanged. Claimed benefit and result: - Prevents false-positive cuRAND pointer collisions and post-capture low-address leaks during Linux unified-memory (Jetson GA10B / SM 8.7) core export, avoids an unnecessary probe graph on Windows WDDM integrated GPUs, seeds cuBLAS `addmm` workspaces outside capture, and excludes persistent `vocab_ids` tables from pointer scanning. - An earlier Jetson checkout carrying the same GA10B floor, probe/reseal, `addmm` seeding, and `vocab_ids` registration logic exported Inkling-2-Mini (`ga10b-tp1-202612010822`, 9 graphs) on Jetson AGX Orin and served it via `flare run --memory-limit -16m` on Jetson Orin Nano 8 GiB. Supporting evidence and limitations: - Targeted CPU preparation and component tests on base `cb191a93` (`CUDA_VISIBLE_DEVICES="" pytest` across `test_core_storage.py`, `test_low_window.py`, `test_capture_graph_metadata.py`, `test_capture_stream_isolation.py`, `test_capture_rank_readiness.py`, `test_capture_roce_wait.py`, `test_transient_retention.py`, `test_preparation_reclamation.py`, `test_capture_order.py`, `test_core_boundary.py`, `test_persistent.py`, and `tests/components/`): 274 passed, 57 skipped (55 GPU/qualification component tests, 1 Windows layout test, 1 GPU test in `test_persistent.py`), 0 failed; `tests/cli/`: 148 passed, 0 failed. - Targeted SM120 CUDA preparation tests (`CUDA_VISIBLE_DEVICES=0 FLARE_RUN_CUDA_TESTS=1 pytest` on RTX PRO 6000 Blackwell across `test_capture_cublas_workspace_cuda.py`, `test_capture_order_cuda.py`, `test_recorded_export_graph_cuda.py::test_export_capture_retains_cuda_handles_and_preserves_storage`, `test_persistent.py`, and `test_virtual_storage_cuda.py`): 26 passed, 0 failed. - Direct SM120 GPU verification: `DeviceRequestState.vocab_ids` recorded its exact byte span in `CoreStorage.numeric_storage.ranges()`, probe capture ran cleanly inside `CoreStorage.transient()`, and `capture_forwards` captured and replayed `torch.addmm` accurately. - Limitations / unrun checks: live SM87 (Jetson Orin) and SM121 (DGX Spark / GB10) export and serving were not re-run directly on this rebased commit; `test_sampling_score_defaults_cuda.py` and `test_sampling_flashinfer.py` require `flare_heliopause` built with the `qualification` Cargo feature (`GraphReplayWorker`), which is absent in this host's `.venv`; `test_recorded_export_graph_cuda.py::test_exported_node_priority_core_loads_and_replays_in_helios` was not run because no Rust code changed. Design-Signed-Off-By: Antigravity (Gemini); design-review=2e5b Signed-off-by: Luke Alonso <lalonso@gmail.com>
lukealonso
force-pushed
the
fix/ga10b-export-preparation
branch
from
December 3, 2026 20:55
f4851b3 to
3b539bb
Compare
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.
Exporting prepared cores on Jetson Orin (GA10B / SM 8.7) unified-memory GPUs encountered four preparation and address-hygiene defects during CUDA graph capture and export pointer-table auditing:
EXTERNAL_FLOORcollided with cuRAND static table bit patterns: On integrated GA10B (compute capability 8.7, defaultdevice_window=None),CoreStorage.EXTERNAL_FLOORwas0x300000000(12 GiB). StaticcuRANDprecalc_xorwow_offset_matrixtables contain 64-bit integer words whose bit patterns fall in[0x3_0000_0000, 0x3_0300_0000], causing export pointer scanning to hit false-positive matches against external library allocations placed at0x300000000.EXTERNAL_FLOORafterCoreStorage._reserve_low_window()already sealed them. Subsequent external allocations during serving-graph capture could then land belowEXTERNAL_FLOOR, where a serving process's own driver storage resides.addmmworkspace:_seed_warmup_workspacesinignition/preparation/capture.pyexecuted onlytorch.mm, leaving cuBLASaddmmepilogue workspaces unseeded on the warmup stream prior to capture.vocab_idstensor:DeviceRequestState.vocab_idsinignition/components/sampling.pyallocated a persistentint64arange(vocab_size)tensor without registering it viarecord_numeric_tensor, leaving pure numeric vocabulary indices exposed to pointer scanning.What changed
ignition/preparation/core_storage.py:major == 8, minor == 7,device_window is None) setself.EXTERNAL_FLOOR = 0x300000000(12 GiB).self.EXTERNAL_FLOOR = 0x900000000(36 GiB), placing external library allocations in the 36 GiB[0x9_0000_0000, 0x12_0000_0000)band belowDEVICE_BASE(0x12_0000_0000, 72 GiB;RESERVATION_BYTES = 48 GiB, total 120 GiB inside GA10B's 128 GiB VMM window) and above cuRAND's offset-matrix words.ignition/preparation/capture.py:_seed_warmup_workspacesexecuted onlytorch.mm, andcapture_forwardsentered the serving graph capture loop without a Linux integrated-GPU probe capture or low-window resealing._seed_warmup_workspacesruns bothtorch.mmandtorch.addmm(with a 1Dbfloat16bias) on the warmup stream in the dedicated warmup pool. Whenos.name != "nt" and getattr(warmup_storage, "integrated", False)is true,capture_forwardsruns one minimal 1-byteprobe_buf.zero_()probe capture insidewarmup()(CoreStorage.transient()), whose exit synchronizes, releases the transient pool, and callsseal_low_window()before the serving capture loop, and callswarmup_storage.seal_low_window()again after eachrecord_export_graph. Windows (os.name == "nt") skips both the probe capture and per-graph resealing because WDDM retains its low allocation pool.ignition/components/sampling.py:DeviceRequestState.vocab_idsreturnedpersistent_copy(torch.arange(...))without numeric metadata registration.record_numeric_tensorat module scope and callsrecord_numeric_tensor(ids)on the persistentvocab_idstensor before returning it.docs/runtime-core-design.md:CoreStorage.EXTERNAL_FLOOR: 256 GiB by default, or 36 GiB for integrated GA10B / SM 8.7's default 128 GiB VMM layout with a 72 GiB device base and 48 GiB reservation).tests/preparation/test_core_storage.py,tests/preparation/test_capture_graph_metadata.py:DeviceRequestState.vocab_idsnumeric registration through a realNumericStoragecontext,torch.mm+torch.addmmworkspace seeding, Linux integrated-GPU probe capture plus low-window resealing order, and Windows (os.name == "nt") probe/reseal skipping, with shared export-capture monkeypatch setup in_patch_export_capture.device_address_floorand load and serve unchanged.Claimed benefit and result
addmmworkspaces outside capture, and excludes persistentvocab_idstables from pointer scanning.addmmseeding, andvocab_idsregistration logic exported Inkling-2-Mini (ga10b-tp1-202612010822, 9 graphs) on Jetson AGX Orin and served it viaflare run --memory-limit -16mon Jetson Orin Nano 8 GiB.Supporting evidence and limitations
3b539bbc(basecb191a93):CUDA_VISIBLE_DEVICES="" .venv/bin/python -m pytest -v \ tests/preparation/test_core_storage.py \ tests/preparation/test_low_window.py \ tests/preparation/test_capture_graph_metadata.py \ tests/preparation/test_capture_stream_isolation.py \ tests/preparation/test_capture_rank_readiness.py \ tests/preparation/test_capture_roce_wait.py \ tests/preparation/test_transient_retention.py \ tests/preparation/test_preparation_reclamation.py \ tests/preparation/test_capture_order.py \ tests/preparation/test_core_boundary.py \ tests/preparation/test_persistent.py \ tests/components/274 passed, 57 skipped(55 GPU/qualification component tests, 1 Windows layout test, 1 GPU test intest_persistent.py),0 failed, including all five new unit tests (test_ga10b_integrated_window_places_external_floor_above_curand_table,test_device_request_state_vocab_ids_records_numeric_tensor,test_seed_warmup_workspaces_warms_both_mm_and_addmm,test_capture_forwards_integrated_storage_probes_and_reseals_low_window, andtest_capture_forwards_integrated_storage_skips_probe_and_reseal_on_windows).CUDA_VISIBLE_DEVICES="" .venv/bin/python -m pytest -q tests/cli/passed148 passed, 0 failed.3b539bbc(RTX PRO 6000 Blackwell):26 passed, 0 failed.3b539bbc: ConfirmedDeviceRequestState.vocab_idsrecords its exact(data_ptr, data_ptr + nbytes)byte span inCoreStorage.numeric_storage.ranges(), the 1-byte probe graph capture runs and cleans up insideCoreStorage.transient(), andcapture_forwardscaptures and replaystorch.addmmaccurately.3b539bbc.tests/components/test_sampling_score_defaults_cuda.pyandtests/components/test_sampling_flashinfer.pyrequireflare_heliopausebuilt with thequalificationCargo feature (GraphReplayWorker), absent from this host's.venv.tests/preparation/test_recorded_export_graph_cuda.py::test_exported_node_priority_core_loads_and_replays_in_helios(which runscargo testinhelios/) was not run because no Rust code changed.Discord: lukealonso