Ship one binary with NPU + ROCm + CUDA support, fix CLI flag precedence
Adds breadmill's `full` feature (npu + rocm + cuda together) and switches the release workflow to build with it. All three backends are ort's load-dynamic (dlopen) mode, so combining them doesn't require the NPU/ROCm/ CUDA toolkits on the build host -- which backend is actually available is resolved at runtime via ORT_DYLIB_PATH / the dynamic linker, per whichever backend is selected for that run. Also fixes a real bug this surfaced: backend selection checked `config.model.backend == "rocm"` unconditionally in an if/else-if chain, so an explicit --cuda (or --npu) flag silently lost to an unrelated `backend` value already sitting in config.toml. CLI flags now always take priority over config. Version bump: breadmill 0.2.0 -> 0.2.1.
This commit is contained in:
parent
2618a33fd5
commit
fdf596e58a
5 changed files with 56 additions and 14 deletions
13
README.md
13
README.md
|
|
@ -24,6 +24,7 @@ Optional features:
|
|||
| `npu` | AMD XDNA NPU via VitisAI ONNX Runtime EP (requires Ryzen AI SDK) |
|
||||
| `rocm` | AMD iGPU via the MIGraphX ONNX Runtime EP (ROCm-backed) |
|
||||
| `cuda` | NVIDIA GPU via the CUDA ONNX Runtime EP |
|
||||
| `full` | All three of the above in one binary |
|
||||
|
||||
```
|
||||
# NPU build
|
||||
|
|
@ -34,6 +35,9 @@ cargo build --release -p breadmill --features rocm
|
|||
|
||||
# CUDA (NVIDIA GPU) build
|
||||
cargo build --release -p breadmill --features cuda
|
||||
|
||||
# All backends in one binary (what the release build ships)
|
||||
cargo build --release -p breadmill --features full
|
||||
```
|
||||
|
||||
`rocm`/`cuda`/`npu` all use `ort`'s `load-dynamic` mode: at runtime, breadmill
|
||||
|
|
@ -43,6 +47,15 @@ build actually has the matching execution provider compiled in — breadmill
|
|||
logs a clear `Successfully registered` / `not enabled in this build` line for
|
||||
this at startup (see [GPU backend notes](#gpu-backend-notes) below).
|
||||
|
||||
Because all three are dlopen-based, `full` doesn't require the NPU/ROCm/CUDA
|
||||
toolkits to be installed at build time — only at run time, and only for
|
||||
whichever single backend you actually select via `--npu`/`--rocm`/`--cuda`
|
||||
or `backend` in config.toml. The **released binaries are built with
|
||||
`full`**: same binary works CPU-only out of the box, and picks up NPU/ROCm/CUDA
|
||||
acceleration on a machine that has the matching ONNX Runtime available,
|
||||
without needing a different download. An explicit `--npu`/`--rocm`/`--cuda`
|
||||
flag always overrides `backend` in config.toml, not the other way around.
|
||||
|
||||
## Setup
|
||||
|
||||
**1. Fetch the embedding model** (~550 MB, downloaded once from Hugging Face):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue