From 88be0e638777328a57539bff18b167a20ef09cf9 Mon Sep 17 00:00:00 2001 From: firestar5683 <168790843+firestar5683@users.noreply.github.com> Date: Wed, 22 Jul 2026 15:41:34 -0500 Subject: [PATCH] beeg --- docs/MODEL_REBUILD.md | 9 ++++++--- scripts/model_compiler.py | 7 ++++++- starpilot/assets/tests/test_model_pipeline.py | 8 ++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/docs/MODEL_REBUILD.md b/docs/MODEL_REBUILD.md index 0631c76c9..dffe95adb 100644 --- a/docs/MODEL_REBUILD.md +++ b/docs/MODEL_REBUILD.md @@ -85,16 +85,19 @@ The lower-level device compiler also supports direct use: For a model that cannot run on the device GPU, compile with the USB AMD GPU attached: ```bash -./models --model heavyweight --input-format supercombo --version v15 --gpu +./models --lebowski --gpu ``` -`--external-gpu` remains available as a compatibility alias for `--gpu`. +The dynamic flag (`--lebowski` above) sets the output and manifest model ID; +when only one source model is staged, its ONNX filename does not need to match +that ID. Input format and behavior version are inferred. `--external-gpu` +remains available as a compatibility alias for `--gpu`. This emits a streaming out-of-band pickle and keeps QCOM available for camera warps. Its manifest entry must include: ```json { - "id": "heavyweight", + "id": "lebowski", "uses_external_gpu": true } ``` diff --git a/scripts/model_compiler.py b/scripts/model_compiler.py index 6c836a13a..5a1c92f20 100644 --- a/scripts/model_compiler.py +++ b/scripts/model_compiler.py @@ -171,11 +171,16 @@ def resolve_model_files(input_root: Path, model_key: str) -> dict[str, Path]: root_files = staged.get("_root") if root_files: return root_files - return { + matching_files = { component: path for path in sorted(input_root.glob(f"{model_key}_*.onnx")) if (component := detect_component(path)) is not None } + if matching_files: + return matching_files + + named_sources = [files for key, files in staged.items() if key != "_root"] + return named_sources[0] if len(named_sources) == 1 else {} def find_staged_dm(input_root: Path) -> Path | None: diff --git a/starpilot/assets/tests/test_model_pipeline.py b/starpilot/assets/tests/test_model_pipeline.py index f10a69a29..71e6afa94 100644 --- a/starpilot/assets/tests/test_model_pipeline.py +++ b/starpilot/assets/tests/test_model_pipeline.py @@ -71,6 +71,14 @@ def test_gpu_is_external_gpu_cli_alias(monkeypatch): assert args.external_gpu +def test_requested_model_id_uses_only_staged_source(tmp_path): + source = tmp_path / "big_driving_supercombo.onnx" + source.touch() + assert model_compiler.resolve_model_files(tmp_path, "lebowski") == { + "driving_supercombo": source, + } + + def test_fat_onnx_is_streamed_to_disk(tmp_path, monkeypatch): payload = b"fat model" * 1024