From 632da6a667da647c8ded195822190d6bc77e52b9 Mon Sep 17 00:00:00 2001 From: kbenkhaled Date: Sun, 29 Nov 2026 17:38:49 +0000 Subject: [PATCH 1/2] Add SM110 admission in Ignition and ForwardCache source-root hashing Before this change, Helios, Flare, and Orbit already recognized Jetson AGX Thor (SM110 / gb10b), but Ignition rejected (11, 0) during GPU planning and ForwardCache hashed only ignition/ and flashinfer/ sources (missing edits in external recipe and kernel repositories). Adding (11, 0) to SUPPORTED_CAPABILITIES and hashing CLI-bound external source roots in ForwardCache lets external recipe repositories such as hyperflare-jetson-recipes prepare Jetson Thor cores without adding any kernel-library code or dependencies to Core. Changes: - ignition/planning.py and ignition/cli/__init__.py: add (11, 0) to SUPPORTED_CAPABILITIES and SM110 to SUPPORTED_ARCHITECTURES and CLI help, matching SM87, SM103, SM120, and SM121 admission. - ignition/preparation/aot.py: hash CLI-bound _EXTRA_ROOTS into ForwardCache keys using framed relative paths and per-file SHA-256 digests, failing explicitly if a bound root is missing. - docs/cli-design.md: list SM87 and SM110 alongside SM103, SM120, and SM121 in the opening summary to match ignition CLI help. - tests/cli/test_planning.py and tests/preparation/test_forward_cache_sources.py: test SM110 admission and ForwardCache external source-root invalidation. Result: - Jetson Thor (SM110 / gb10b) is admitted by Ignition planning alongside SM87, SM103, SM120, and SM121, and ForwardCache invalidates compiled forwards when external recipe or kernel-library sources change. Validation (NVIDIA Jetson Thor, SM110): - pytest tests/cli/ tests/preparation/test_forward_cache_sources.py tests/preparation/test_core_boundary.py: 140 passed. - Companion recipe tests (hyperflare-jetson-recipes, FLARE_RUN_CUDA_TESTS=1 pytest tests/): 14/14 passed (including cold CompilePool -> fresh-process ForwardCache hit with Breeze 51ab00e). - Prior end-to-end companion recipe export and native serving on Thor (hyperflare-jetson-recipes qwen38, nvidia/Qwen3.8-Flash-Next-FP4-Local@b9ce18a6, Breeze 51ab00e): 53 compiled forwards, 71 graphs, 3,247 kernels, 71.21 GiB fixed mappings; 9/9 serving checks passed for MTP5 and MTP0 (0.000000 step-0 top-5 logprob diff); AIPerf (c=1, 20 req) 30.40/29.95/30.10 tok/s (MTP0), 48.75/46.67/45.20 tok/s (MTP3), 48.65/45.63/44.76 tok/s (MTP5). Limitations: - End-to-end export and native serving have not been re-run after rebasing onto origin/main 3801ff1d (gb10b platform naming). - Non-Thor GPUs (SM87, SM103, SM120, and SM121) were verified via unit tests only, not live hardware. Design-Signed-Off-By: Gemini 4 Neon (Cursor); design-review=2e5b Signed-off-by: kbenkhaled --- docs/cli-design.md | 4 +-- ignition/cli/__init__.py | 2 +- ignition/planning.py | 4 +-- ignition/preparation/aot.py | 9 +++++++ tests/cli/test_planning.py | 10 ++++++++ .../preparation/test_forward_cache_sources.py | 25 +++++++++++++++++++ 6 files changed, 49 insertions(+), 5 deletions(-) diff --git a/docs/cli-design.md b/docs/cli-design.md index 3fc182813..7b49b72ab 100644 --- a/docs/cli-design.md +++ b/docs/cli-design.md @@ -3,8 +3,8 @@ For environment setup and model-specific launch examples, see [model preparation and serving](model-preparation.md). -Flare serves the model architectures its recipes support on NVIDIA SM103, SM120, -and SM121 GPUs. Recipes declare default checkpoints and supported preparation +Flare serves the model architectures its recipes support on NVIDIA SM87, SM103, +SM110, SM120, and SM121 GPUs. Recipes declare default checkpoints and supported preparation capacities. The command line selects models, GPUs, concurrency, storage, and listeners. The engine derives memory and execution geometry from those choices; advanced preparation flags expose the explicit overrides listed below. diff --git a/ignition/cli/__init__.py b/ignition/cli/__init__.py index d16f44433..0adc7c302 100644 --- a/ignition/cli/__init__.py +++ b/ignition/cli/__init__.py @@ -87,7 +87,7 @@ def _parser(*, recipes=(), prog="ignition", recipe=None, checkpoint=None) -> arg recipes = tuple(recipes) parser = argparse.ArgumentParser( prog=prog, allow_abbrev=False, - description="Prepare native runtime cores for NVIDIA SM103, SM120, and SM121 GPUs.", + description="Prepare native runtime cores for NVIDIA SM87, SM103, SM110, SM120, and SM121 GPUs.", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=catalog_epilog(recipes=recipes, prog=prog), ) diff --git a/ignition/planning.py b/ignition/planning.py index 41cc3f6b2..13bbfefe6 100644 --- a/ignition/planning.py +++ b/ignition/planning.py @@ -34,8 +34,8 @@ # Each exchange can retain prompt and terminal checkpoints; snapshot slots have # virtual capacity for about four recent exchanges per concurrent request. CACHE_STATES_PER_REQUEST = 8 -SUPPORTED_CAPABILITIES = ((8, 7), (10, 3), (12, 0), (12, 1)) -SUPPORTED_ARCHITECTURES = "SM87, SM103, SM120, or SM121" +SUPPORTED_CAPABILITIES = ((8, 7), (10, 3), (11, 0), (12, 0), (12, 1)) +SUPPORTED_ARCHITECTURES = "SM87, SM103, SM110, SM120, or SM121" _GIB = 1 << 30 diff --git a/ignition/preparation/aot.py b/ignition/preparation/aot.py index 29597f280..7aaae43a7 100644 --- a/ignition/preparation/aot.py +++ b/ignition/preparation/aot.py @@ -759,6 +759,15 @@ def __init__(self, *, namespace, device, root=None, headroom_bytes=0, options=No continue key.update(str(path.relative_to(source)).encode()) key.update(path.read_bytes()) + from .source_identity import _EXTRA_ROOTS + + for label, extra_root in _EXTRA_ROOTS.get(): + extra_root = Path(extra_root).resolve() + if not extra_root.is_dir(): + raise ValueError(f"bound source root {label!r} does not exist: {extra_root}") + for path in sorted(extra_root.rglob('*.py')): + rel = f'{label}/{path.relative_to(extra_root).as_posix()}'.encode() + key.update(b'\0' + rel + b'\0' + hashlib.sha256(path.read_bytes()).digest()) root = DEFAULT_CACHE_ROOT if root is None else Path(root) self.root = root / 'forwards' / key.hexdigest() diff --git a/tests/cli/test_planning.py b/tests/cli/test_planning.py index ec6d00cd0..d36c85359 100644 --- a/tests/cli/test_planning.py +++ b/tests/cli/test_planning.py @@ -563,3 +563,13 @@ class BadContextParams(RecipeParameters): bad_recipe, native, (_gpu(0),), selected=(0,), parameters=replace(bad_recipe.parameters, bad=BadContextGroup(target=100)), ) + + +def test_sm110_gpu_admission(): + assert (11, 0) in planning.SUPPORTED_CAPABILITIES + assert "SM110" in planning.SUPPORTED_ARCHITECTURES + thor = _gpu(0, capability=(11, 0)) + assert thor.supported + recipe = _recipe(device_gib=20) + admitted = planning.plan(recipe, recipe.checkpoints[0], (thor,)) + assert admitted.gpus == (thor,) diff --git a/tests/preparation/test_forward_cache_sources.py b/tests/preparation/test_forward_cache_sources.py index b73485091..4a97304d1 100644 --- a/tests/preparation/test_forward_cache_sources.py +++ b/tests/preparation/test_forward_cache_sources.py @@ -45,3 +45,28 @@ def root(): assert changed != original operator.write_text("kernel = 2\n") assert root() != changed + + +def test_bound_external_source_roots_invalidate_forward_cache(tmp_path, monkeypatch): + import pytest + from ignition.preparation.source_identity import source_roots + + monkeypatch.setattr(aot.torch.cuda, "get_device_properties", lambda device: + SimpleNamespace(name="NVIDIA Thor", major=11, minor=0, multi_processor_count=20)) + + ext_pkg = tmp_path / "ext_pkg" + ext_pkg.mkdir() + mod = ext_pkg / "kernel.py" + mod.write_text("VERSION = 1\n") + + without_roots = aot.ForwardCache(namespace={"model": "example"}, device="cuda:0", root=tmp_path).root + with source_roots((("ext_pkg", ext_pkg),)): + v1 = aot.ForwardCache(namespace={"model": "example"}, device="cuda:0", root=tmp_path).root + mod.write_text("VERSION = 2\n") + v2 = aot.ForwardCache(namespace={"model": "example"}, device="cuda:0", root=tmp_path).root + + assert without_roots != v1 + assert v1 != v2 + with source_roots((("missing", tmp_path / "does_not_exist"),)): + with pytest.raises(ValueError, match="does not exist"): + aot.ForwardCache(namespace={"model": "example"}, device="cuda:0", root=tmp_path) From 144877c27657fc58dface29e03337228934f29a1 Mon Sep 17 00:00:00 2001 From: kbenkhaled Date: Sun, 29 Nov 2026 17:58:21 +0000 Subject: [PATCH 2/2] Align ForwardCache source-root test with existing fixture pattern Fold the external source-root check into the existing tmp_path fixture in tests/preparation/test_forward_cache_sources.py and drop the redundant constant-check test in tests/cli/test_planning.py. Validation: - pytest tests/cli/ tests/preparation/test_forward_cache_sources.py tests/preparation/test_core_boundary.py: 138 passed on Jetson Thor. Design-Signed-Off-By: Gemini 4 Neon (Cursor); design-review=2e5b Signed-off-by: kbenkhaled --- tests/cli/test_planning.py | 10 ----- .../preparation/test_forward_cache_sources.py | 38 +++++++------------ 2 files changed, 14 insertions(+), 34 deletions(-) diff --git a/tests/cli/test_planning.py b/tests/cli/test_planning.py index d36c85359..ec6d00cd0 100644 --- a/tests/cli/test_planning.py +++ b/tests/cli/test_planning.py @@ -563,13 +563,3 @@ class BadContextParams(RecipeParameters): bad_recipe, native, (_gpu(0),), selected=(0,), parameters=replace(bad_recipe.parameters, bad=BadContextGroup(target=100)), ) - - -def test_sm110_gpu_admission(): - assert (11, 0) in planning.SUPPORTED_CAPABILITIES - assert "SM110" in planning.SUPPORTED_ARCHITECTURES - thor = _gpu(0, capability=(11, 0)) - assert thor.supported - recipe = _recipe(device_gib=20) - admitted = planning.plan(recipe, recipe.checkpoints[0], (thor,)) - assert admitted.gpus == (thor,) diff --git a/tests/preparation/test_forward_cache_sources.py b/tests/preparation/test_forward_cache_sources.py index 4a97304d1..521da8013 100644 --- a/tests/preparation/test_forward_cache_sources.py +++ b/tests/preparation/test_forward_cache_sources.py @@ -7,8 +7,10 @@ from types import SimpleNamespace import flashinfer +import pytest from ignition.preparation import aot +from ignition.preparation.source_identity import source_roots def test_presentation_edits_preserve_forward_cache_but_execution_edits_invalidate(tmp_path, monkeypatch): @@ -27,6 +29,10 @@ def test_presentation_edits_preserve_forward_cache_but_execution_edits_invalidat kernels.mkdir() operator = kernels / "operator.py" operator.write_text("kernel = 1\n") + external = tmp_path / "external_recipes" + external.mkdir() + recipe = external / "recipe.py" + recipe.write_text("recipe = 1\n") monkeypatch.setattr(aot, "__file__", str(backend)) monkeypatch.setattr(flashinfer, "__file__", str(kernels / "__init__.py")) monkeypatch.setattr(aot.torch.cuda, "get_device_properties", lambda device: @@ -44,29 +50,13 @@ def root(): changed = root() assert changed != original operator.write_text("kernel = 2\n") - assert root() != changed - - -def test_bound_external_source_roots_invalidate_forward_cache(tmp_path, monkeypatch): - import pytest - from ignition.preparation.source_identity import source_roots - - monkeypatch.setattr(aot.torch.cuda, "get_device_properties", lambda device: - SimpleNamespace(name="NVIDIA Thor", major=11, minor=0, multi_processor_count=20)) - - ext_pkg = tmp_path / "ext_pkg" - ext_pkg.mkdir() - mod = ext_pkg / "kernel.py" - mod.write_text("VERSION = 1\n") - - without_roots = aot.ForwardCache(namespace={"model": "example"}, device="cuda:0", root=tmp_path).root - with source_roots((("ext_pkg", ext_pkg),)): - v1 = aot.ForwardCache(namespace={"model": "example"}, device="cuda:0", root=tmp_path).root - mod.write_text("VERSION = 2\n") - v2 = aot.ForwardCache(namespace={"model": "example"}, device="cuda:0", root=tmp_path).root - - assert without_roots != v1 - assert v1 != v2 + after_kernel = root() + assert after_kernel != changed + with source_roots((("external_recipes", external),)): + with_external = root() + assert with_external != after_kernel + recipe.write_text("recipe = 2\n") + assert root() != with_external with source_roots((("missing", tmp_path / "does_not_exist"),)): with pytest.raises(ValueError, match="does not exist"): - aot.ForwardCache(namespace={"model": "example"}, device="cuda:0", root=tmp_path) + root()