mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-23 18:22:13 +08:00
beeg
This commit is contained in:
@@ -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
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user