From 12615d2d297c05c351b0622b6fcb68f7aed8d971 Mon Sep 17 00:00:00 2001 From: Jussi Elo Date: Thu, 5 Nov 2026 10:40:03 +0000 Subject: [PATCH 1/5] test(vllm): pin the discover-build versions and every reader's answer for them The vllm engine reads its ROCm discover-build versions in two places: install routing walks `VLLM_ROCM_DISCOVER_BUILD_TABLE`, and launch-time environment setup matches `ROCM_DISCOVER_BUILD_VERSIONS`. Today the only thing holding the two together is `vllm_rocm_discover_build_table_matches_the_discover_version_list`. Add the tests a later consolidation of the two will be held to, written against the current code first: - `discover_build_table_pins_the_versions_it_serves_in_order` pins the table's versions and their order, so changing which versions are served is a deliberate edit of a literal list instead of an unnoticed one. - `every_discover_row_routes_installs_and_launch_env_the_same_way` is a characterisation test. For every table row, in four spellings a real probe produces, it asserts that the install lookup, the install route, the launch environment check and the static-pin fallback all agree the runtime is a discover build and that the static pin fails closed. It also asserts the same four answers for versions outside the table (an unlisted 10.x line, 7.2.3, an unknown major, unparsable text, and no recorded version). Both pass on the current code. Dropping `ROCM_SDK_10_1` from the launch list, or changing or reordering a table row, turns them (and the existing comparison test) red. Signed-off-by: Jussi Elo --- engines/vllm/src/wheel_builds.rs | 131 +++++++++++++++++++++++++++++++ 1 file changed, 131 insertions(+) diff --git a/engines/vllm/src/wheel_builds.rs b/engines/vllm/src/wheel_builds.rs index 1c69201507..3d676cb478 100644 --- a/engines/vllm/src/wheel_builds.rs +++ b/engines/vllm/src/wheel_builds.rs @@ -421,6 +421,137 @@ mod tests { } } + /// The ROCm SDK versions the discover-build table serves, in table order. + /// + /// Pinned on purpose: adding, removing or reordering a row changes which + /// runtimes are installed by discovery and which get the discovery launch + /// environment, so it has to show up as a reviewed edit of this list + /// rather than slip through a test that only compares the data with itself. + #[test] + fn discover_build_table_pins_the_versions_it_serves_in_order() { + let versions: Vec<&str> = VLLM_ROCM_DISCOVER_BUILD_TABLE + .iter() + .map(|build| build.rocm_sdk_version) + .collect(); + assert_eq!( + versions, + ["10.0.0", "10.1.0"], + "the discover-build table's versions or order changed: install routing, the \ + launch environment and the fail-closed static fallback all follow it" + ); + } + + fn runtime_recording_sdk_version(version: Option<&str>) -> crate::runtime::VllmRuntime { + crate::runtime::VllmRuntime { + runtime_id: "wheel-gfx1151".to_owned(), + env_id: "external-vllm-therock".to_owned(), + command: std::path::PathBuf::from("/rocm/runtimes/wheel/gfx1151/bin/vllm"), + python_executable: None, + version: None, + source: "managed_runtime_manifest:wheel-gfx1151".to_owned(), + sdk_root: None, + sdk_bin: None, + sdk_bin_paths: Vec::new(), + sdk_library_paths: Vec::new(), + rocm_sdk_version: version.map(ToOwned::to_owned), + } + } + + /// What every reader of the discover-build data decides for one recorded + /// ROCm SDK version: the row the install lookup finds, the install route, + /// whether launch-time env setup treats the runtime as a discover build, and + /// how the static-pin fallback answers (`Some(true)` resolves a pin, + /// `Some(false)` fails closed, `None` when no version is recorded). + #[derive(Debug, PartialEq, Eq)] + struct DiscoverReaders { + row: Option<&'static str>, + route: VllmInstallRoute, + launch_treats_as_discover: bool, + static_pin_resolves: Option, + } + + fn discover_readers(version: Option<&str>) -> DiscoverReaders { + DiscoverReaders { + row: version + .and_then(vllm_rocm_discover_build) + .map(|build| build.rocm_sdk_version), + route: vllm_install_route(None, version), + launch_treats_as_discover: crate::runtime::runtime_has_discover_build( + &runtime_recording_sdk_version(version), + ), + static_pin_resolves: version.map(|v| install_target(None, Some(v)).is_ok()), + } + } + + /// Install routing and launch-time env setup are two readers of the same + /// discover-build data. For every table row, spelled the way a real probe + /// spells it (exact, with a patch, with a dev suffix), both must agree that + /// the runtime is a discover build, and the static-pin fallback must fail + /// closed for it. For a version outside the table, both must agree it is not. + #[test] + fn every_discover_row_routes_installs_and_launch_env_the_same_way() { + for build in VLLM_ROCM_DISCOVER_BUILD_TABLE { + let key = build.rocm_sdk_version; + let (major_minor, _) = key + .rsplit_once('.') + .expect("table key is major.minor.patch"); + for spelling in [ + key.to_owned(), + format!("{major_minor}.7"), + format!("{key}a20260822"), + format!("{key}.dev0+abc"), + ] { + assert_eq!( + discover_readers(Some(&spelling)), + DiscoverReaders { + row: Some(key), + route: VllmInstallRoute::RocmDiscover, + launch_treats_as_discover: true, + static_pin_resolves: Some(false), + }, + "readers disagree for {spelling}, a spelling of table row {key}" + ); + } + } + + // Outside the table: no row, static route, no discovery env. A 10.x line + // with no row still fails closed instead of taking the 7.2.3 default + // pin; other lines (and unparsable text) resolve that default. + assert_eq!( + discover_readers(Some("10.2.0")), + DiscoverReaders { + row: None, + route: VllmInstallRoute::Static, + launch_treats_as_discover: false, + static_pin_resolves: Some(false), + } + ); + for outside in ["7.2.3", "999.0.0", "not-a-version"] { + assert_eq!( + discover_readers(Some(outside)), + DiscoverReaders { + row: None, + route: VllmInstallRoute::Static, + launch_treats_as_discover: false, + static_pin_resolves: Some(true), + }, + "readers disagree for {outside}, which is outside the table" + ); + } + assert_eq!( + discover_readers(None), + DiscoverReaders { + row: None, + route: VllmInstallRoute::Static, + launch_treats_as_discover: false, + static_pin_resolves: None, + } + ); + // `static_pin_resolves: None` above means no version was recorded; the + // fallback itself fails for that case, with its own message. + assert!(install_target(None, None).is_err()); + } + fn install_target( index: Option<&str>, rocm_sdk_version: Option<&str>, From 7ebfaf131450951e00f62bfff10d4b30a03f2d6a Mon Sep 17 00:00:00 2001 From: Jussi Elo Date: Thu, 5 Nov 2026 10:57:42 +0000 Subject: [PATCH 2/5] refactor(vllm): move the discover-build table into its own leaf module Pure move, no behaviour change. The ROCm 10.x discover-build table, its row type, the `DiscoverVersion` constraint, the row lookup and the `major.minor` matcher move out of `wheel_builds.rs` and `runtime.rs` into a new `discover_builds.rs` that imports no other module of the crate, along with the `ROCM_SDK_10_0` / `ROCM_SDK_10_1` constants the table rows use. The table has to sit below both of its readers to be shared between them: `runtime.rs` (launch-time environment setup) and `wheel_builds.rs` (install routing) read the same rows today but could only do so through two separately kept copies of the versions, because neither may import the other's discover-build code. A leaf both import adds no `runtime` to `install` edge and no module cycle: `discover_builds` imports nothing, `runtime`, `wheel_builds` and `install` import it, and `wheel_builds` no longer imports `runtime` at all outside its tests. Moved with it, with their leaf names unchanged: `discover_build_table_pins_the_versions_it_serves_in_order`, `vllm_rocm_discover_build_looks_up_known_and_unknown_versions`, `discover_version_renders_series_and_exact_requirements` and `discover_rows_select_their_own_indexes`. `VLLM_ROCM_DISCOVER_BUILD_TABLE` becomes `pub(crate)` so `wheel_builds.rs` can still walk it for the fail-closed static-pin fallback. `docs/architecture.md` describes the new module. Signed-off-by: Jussi Elo --- docs/architecture.md | 5 +- engines/vllm/src/discover_builds.rs | 280 ++++++++++++++++++++++++++++ engines/vllm/src/install.rs | 8 +- engines/vllm/src/lib.rs | 1 + engines/vllm/src/runtime.rs | 39 +--- engines/vllm/src/wheel_builds.rs | 249 +------------------------ 6 files changed, 298 insertions(+), 284 deletions(-) create mode 100644 engines/vllm/src/discover_builds.rs diff --git a/docs/architecture.md b/docs/architecture.md index edba1fc0ed..6f442e35f5 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -289,13 +289,14 @@ These modules are private `mod` declarations — [`lib.rs`](../crates/e2e-report `engines/vllm` follows full domain extraction: -- [`install.rs`](../engines/vllm/src/install.rs) — ROCm/vLLM install execution: the static-pin and the ROCm 10.x discovery install routes, run through `uv`. It reads the build tables and target resolution from `wheel_builds.rs`, and asks `repair.rs` whether an already-resolvable environment still needs an install pass. +- [`discover_builds.rs`](../engines/vllm/src/discover_builds.rs) — the ROCm 10.x discovery table (`VLLM_ROCM_DISCOVER_BUILD_TABLE`, one row per supported `major.minor` line, with the `DiscoverVersion` series/exact constraint), the row lookup (`vllm_rocm_discover_build`) and the `major.minor` matcher it uses (`rocm_sdk_series_matches`). A leaf: it imports no other crate module, so `runtime.rs`, `wheel_builds.rs` and `install.rs` can all read it without importing one another's code. Its tests, which pin the table's rows, live with it. +- [`install.rs`](../engines/vllm/src/install.rs) — ROCm/vLLM install execution: the static-pin and the ROCm 10.x discovery install routes, run through `uv`. It reads the static build table and target resolution from `wheel_builds.rs` and the discovery rows from `discover_builds.rs`, and asks `repair.rs` whether an already-resolvable environment still needs an install pass. - [`process.rs`](../engines/vllm/src/process.rs) — the resolve-model, launch, serve and stop handlers (including engine-recipe validation and device-policy/GPU-index resolution), vLLM server spawn, launch environment and path setup, and readiness polling. The text appended to a "never became ready" failure comes from `startup_diagnostics.rs`. - [`repair.rs`](../engines/vllm/src/repair.rs) — runtime-repair assessment: whether an already-resolvable managed vLLM environment violates vLLM's pinned dependencies and must be reinstalled (`assess_runtime_repair`, `RepairAssessment`), including the rule that treats the SDK's build of torch, and a torch the user chose with the alignment disabled, as intended rather than a defect. It imports `runtime.rs` and nothing from `install.rs`. - [`runtime.rs`](../engines/vllm/src/runtime.rs) — TheRock/managed-runtime resolution and TheRock library/bin path derivation; the path derivation performs no filesystem writes. The launch path's compat-shim writes (a `libmpi_cxx` stub, stale-numa-shim removal) are this module's separate `ensure_therock_compat_shims`, called only from `process.rs`; the running-state payload, which never calls it, falls back to a plain directory listing instead. - [`startup_diagnostics.rs`](../engines/vllm/src/startup_diagnostics.rs) — what a failed startup tells the user: the tail of the startup log, re-rendered line by line through `terminal::rendered_lines` (not stripped — stripping deletes line-break tokens with no separator, which welds a progress-bar repaint onto the next line), followed by the out-of-memory and engine-import-failure hints that point at `rocm diagnose`. Its single entry point is `startup_log_context`, which `process.rs` calls from `wait_for_vllm_ready`. It imports only `state.rs`, for the log-read cap. - [`state.rs`](../engines/vllm/src/state.rs) — service state file I/O, log tailing, and health/inference probing. -- [`wheel_builds.rs`](../engines/vllm/src/wheel_builds.rs) — which vLLM wheels to install for a ROCm SDK version: the static build table (`VLLM_ROCM_BUILD_TABLE`) and the ROCm 10.x discovery table (`VLLM_ROCM_DISCOVER_BUILD_TABLE`, with the `DiscoverVersion` series/exact constraint), the install-route choice (`vllm_install_route`), target resolution including the `ROCM_CLI_VLLM_ROCM_INDEX_URL` override (`vllm_install_target`), and the SDK-version matchers. It also holds `verified_torchaudio_release`, which the crate re-exports from `lib.rs` for the `rocm` binary. It imports only `runtime.rs` and runs no process. +- [`wheel_builds.rs`](../engines/vllm/src/wheel_builds.rs) — which vLLM wheels to install for a ROCm SDK version: the static build table (`VLLM_ROCM_BUILD_TABLE`), the install-route choice (`vllm_install_route`, which consults the discovery table in `discover_builds.rs`), target resolution including the `ROCM_CLI_VLLM_ROCM_INDEX_URL` override (`vllm_install_target`), and the static-table SDK-version matchers. It also holds `verified_torchaudio_release`, which the crate re-exports from `lib.rs` for the `rocm` binary. It imports only `discover_builds.rs` and runs no process. [`lib.rs`](../engines/vllm/src/lib.rs) keeps only CLI/envelope dispatch and the few items shared across those modules. diff --git a/engines/vllm/src/discover_builds.rs b/engines/vllm/src/discover_builds.rs new file mode 100644 index 0000000000..80d30bd544 --- /dev/null +++ b/engines/vllm/src/discover_builds.rs @@ -0,0 +1,280 @@ +// Copyright © Advanced Micro Devices, Inc., or its affiliates. +// +// SPDX-License-Identifier: MIT + +/// The ROCm SDK 10.0 release line, as it appears in both +/// [`crate::runtime::ROCM_DISCOVER_BUILD_VERSIONS`] and the discover-build table below. +pub(crate) const ROCM_SDK_10_0: &str = "10.0.0"; +/// The ROCm SDK 10.1 release line, as it appears in both +/// [`crate::runtime::ROCM_DISCOVER_BUILD_VERSIONS`] and the discover-build table below. +pub(crate) const ROCM_SDK_10_1: &str = "10.1.0"; + +/// Whether `recorded` and `table_key` name the same ROCm `major.minor` line, +/// ignoring patch and any dev/pre-release suffix. See +/// [`vllm_rocm_discover_build`] for why the line, not the exact release, is +/// what a discover row covers. Lives here, beside the table, so that +/// `runtime.rs` and `wheel_builds.rs` can both match against it without either +/// importing the other's discover-build code. +pub(crate) fn rocm_sdk_series_matches(recorded: &str, table_key: &str) -> bool { + fn series(version: &str) -> Option<(u64, u64)> { + let mut parts = version.trim().split('.'); + let major = parts.next()?.parse().ok()?; + let minor: String = parts + .next()? + .chars() + .take_while(char::is_ascii_digit) + .collect(); + Some((major, minor.parse().ok()?)) + } + series(recorded).is_some_and(|version| Some(version) == series(table_key)) +} + +/// How a [`VllmRocmDiscoverBuild`] row constrains the release discovery may +/// resolve for one package. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub(crate) enum DiscoverVersion { + /// `{pkg}=={series}.*`: the newest release in the series. + Series(&'static str), + /// `{pkg}=={release}`: exactly this release. Under PEP 440 a specifier + /// without a local version still matches any `+rocm…` local version of + /// it, but not a longer release such as `{release}.2`. Needed where AMD + /// publishes rebuilds as extra release segments (torchaudio + /// `2.11.0`/`2.11.0.2`/`2.11.0.3`, each paired with a different torch), so + /// a series match would pick the rebuild for the wrong torch. + Exact(&'static str), +} + +impl DiscoverVersion { + /// The requirement handed to `uv` for `pkg`. + pub(crate) fn requirement(self, pkg: &str) -> String { + match self { + Self::Series(series) => format!("{pkg}=={series}.*"), + Self::Exact(release) => format!("{pkg}=={release}"), + } + } +} + +/// A ROCm SDK version whose vLLM/flash-attn/amd-aiter wheels aren't published +/// under a fixed filename (AMD rotates the dev-tag suffix constantly), so the +/// exact wheel must be discovered from the index at install time instead of +/// pinned in [`VLLM_ROCM_BUILD_TABLE`]. +pub(crate) struct VllmRocmDiscoverBuild { + pub(crate) rocm_sdk_version: &'static str, + /// PEP 425 interpreter tag this row's wheels are published for. AMD builds + /// ROCm 10.x `vllm`, `flash-attn` and `amd-aiter` for exactly one CPython + /// version, so a venv on any other interpreter resolves nothing at all. + pub(crate) python_tag: &'static str, + /// Index publishing this row's rotating-dev-tag vLLM/flash-attn/amd-aiter + /// wheels. Per-row because ROCm 10.1 frameworks are staged on a different + /// host than 10.0's. + pub(crate) vllm_index_url: &'static str, + /// Index publishing this row's torch build. + pub(crate) torch_index_url: &'static str, + pub(crate) vllm_version_prefix: &'static str, + pub(crate) flash_attn_version_prefix: &'static str, + pub(crate) amd_aiter_version_prefix: &'static str, + pub(crate) torch_version_prefix: &'static str, + /// torchvision's version prefix is always the ROCm "Next" torch minor + /// plus 15 (torch 2.12 pairs with torchvision 0.27); torchaudio has no + /// such rule and is hardcoded per row to whatever AMD has actually + /// published for it. Both are discovered fresh alongside torch rather + /// than trusted from a pre-install snapshot, so the triplet installed + /// here is always coherent with the torch version this row actually pins + /// (see `install_vllm_rocm10_discover`). + pub(crate) torchvision_version_prefix: &'static str, + /// [`DiscoverVersion::Exact`] wherever the row's index publishes more than + /// one rebuild of a torchaudio series, which `whl-next` does (`2.11.0`, + /// `2.11.0.2`, `2.11.0.3`, each paired with a different torch): a series + /// match takes the newest, i.e. the rebuild for some *other* row's torch. + /// [`DiscoverVersion::Series`] is only safe on an index that serves one + /// build per series. + /// + /// An [`DiscoverVersion::Exact`] torchaudio is also the hardware-verified + /// build for the row's ROCm line, and `rocm install sdk` pins it too, via + /// [`verified_torchaudio_release`]: set one only for a build confirmed to + /// load against the row's torch on real hardware, never as a guess. + pub(crate) torchaudio_version: DiscoverVersion, +} + +pub(crate) const VLLM_ROCM_DISCOVER_BUILD_TABLE: &[VllmRocmDiscoverBuild] = &[ + VllmRocmDiscoverBuild { + rocm_sdk_version: ROCM_SDK_10_0, + python_tag: "cp314", + vllm_index_url: "https://rocm.frameworks.amd.com/whl-multi-arch/vllm/", + torch_index_url: "https://stable.repo.amd.com/rocm/whl-next/", + vllm_version_prefix: "0.27", + flash_attn_version_prefix: "2.8", + amd_aiter_version_prefix: "0.1", + torch_version_prefix: "2.12", + torchvision_version_prefix: "0.27", + // Still a series match, unlike the 10.1 row below, and unverified + // against `whl-next` now that both rows read from it: that index is + // flat across ROCm lines, so a series match here can resolve a + // `+rocm10.1.0` wheel, which `ensure_rocm_local_version_matches` + // rejects. Left as-is rather than pinned blind -- which torchaudio + // rebuild pairs with 10.0's torch 2.12 needs a live 10.0 box to + // establish, and this row has no coverage on the self-hosted lanes. + // `rocm install sdk` reads this field too: see `torchaudio_version`. + torchaudio_version: DiscoverVersion::Series("2.11"), + }, + VllmRocmDiscoverBuild { + rocm_sdk_version: ROCM_SDK_10_1, + python_tag: "cp314", + vllm_index_url: "https://rocm.frameworks-prereleases.amd.com/whl-multi-arch-staging/vllm/", + // Torch stack from `whl-next`, not staging: it is the index + // `rocm install sdk` resolves the 10.1 SDK's own `+rocm10.1.0` torch + // stack from, so vLLM realigns onto the same builds rather than + // staging's `rc` ones. + torch_index_url: "https://stable.repo.amd.com/rocm/whl-next/", + vllm_version_prefix: "0.29", + flash_attn_version_prefix: "2.8", + amd_aiter_version_prefix: "0.1", + // 2.13, not 2.12: AMD's own `rocm/vllm:rocm10.1.0_..._vllm-0.29.0` + // image (whose Dockerfile build args pin `TORCH_VERSION=2.13.0`, + // `TORCHVISION_VERSION=0.28.0`) builds this exact vllm release + // against torch 2.13, not 2.12. `vllm` 0.29's own `_rocm_C.abi3.so` + // needs a `c10::NotImplementedError` constructor symbol torch + // 2.12.0+rocm10.1.0 does not export; 2.13 is published on this same + // `whl-next` index and matches what vllm was actually built against. + torch_version_prefix: "2.13", + torchvision_version_prefix: "0.28", + // Exact, not `2.11.*`: `whl-next` publishes three `+rocm10.1.0` + // torchaudio builds, `2.11.0`, `2.11.0.2` and `2.11.0.3`. `2.11.0` is + // a CPU-only rebuild (no `libamdhip64`/`libc10_hip`/`libtorch_hip` + // in its `.so`s) that predates torch's stable-ABI split and does not + // reference the `torch_exception_get_what` / `torch_new_stable_ivalue` + // symbols torch 2.13 exports. `2.11.0.2` and `2.11.0.3` are both HIP + // builds against that same stable ABI (confirmed on a live Strix Halo + // box: torch 2.13.0+rocm10.1.0 exports both symbols as `T`, and + // torchaudio 2.11.0.2 imports them as `U`); a series match would + // resolve the newest, `2.11.0.3`, so pin the lower of the two + // confirmed-working builds instead. `rocm install sdk` pins this same + // build for the 10.1 line: see `torchaudio_version`. + torchaudio_version: DiscoverVersion::Exact("2.11.0.2"), + }, +]; + +/// Looks up the discovery build recipe for a ROCm SDK version, if any. +/// +/// Matched on `major.minor`, ignoring patch and any dev/pre-release suffix. A +/// discover row is a live resolver recipe rather than one pinned filename, so +/// it does span a release line, but only a `major.minor` one: 10.0 and 10.1 +/// publish genuinely different wheels (vLLM `0.27` from +/// `rocm.frameworks.amd.com` versus `0.29` from the staging host), so a +/// major-only row would serve one SDK's wheels to the other. Patch is still +/// ignored, because AMD does rotate the patch and dev tag within a line +/// (`whl-multi-arch/torch/` carries `+rocm7.13.0`, `+rocm7.14.0` and +/// `+rocm7.14.1` as coexisting builds) and a row keyed to an exact string +/// would silently stop matching. An unknown line matches nothing and fails +/// closed in [`crate::wheel_builds::vllm_install_target`] rather than falling back to a +/// stale static pin. +pub(crate) fn vllm_rocm_discover_build( + rocm_sdk_version: &str, +) -> Option<&'static VllmRocmDiscoverBuild> { + VLLM_ROCM_DISCOVER_BUILD_TABLE + .iter() + .find(|build| rocm_sdk_series_matches(rocm_sdk_version, build.rocm_sdk_version)) +} + +#[cfg(test)] +mod tests { + use super::*; + + /// The ROCm SDK versions the discover-build table serves, in table order. + /// + /// Pinned on purpose: adding, removing or reordering a row changes which + /// runtimes are installed by discovery and which get the discovery launch + /// environment, so it has to show up as a reviewed edit of this list + /// rather than slip through a test that only compares the data with itself. + #[test] + fn discover_build_table_pins_the_versions_it_serves_in_order() { + let versions: Vec<&str> = VLLM_ROCM_DISCOVER_BUILD_TABLE + .iter() + .map(|build| build.rocm_sdk_version) + .collect(); + assert_eq!( + versions, + ["10.0.0", "10.1.0"], + "the discover-build table's versions or order changed: install routing, the \ + launch environment and the fail-closed static fallback all follow it" + ); + } + #[test] + fn vllm_rocm_discover_build_looks_up_known_and_unknown_versions() { + assert!(vllm_rocm_discover_build("10.0.0").is_some()); + // AMD tags preview wheels with the real target release (verified via + // whl-multi-arch/torch/'s coexisting +rocm7.13.0/7.14.0/7.14.1 + // builds), so a pre-release suffix on a known major.minor must still + // match its row (here the dedicated 10.1.0 one), not just an exact + // version string. + assert!(vllm_rocm_discover_build("10.1.0a20260822").is_some()); + assert!(vllm_rocm_discover_build("999.0.0").is_none()); + } + /// A series renders with the `.*` that lets `uv` take the newest release + /// in it; an exact release renders bare, so it cannot. + #[test] + fn discover_version_renders_series_and_exact_requirements() { + assert_eq!( + DiscoverVersion::Series("2.11").requirement("torchaudio"), + "torchaudio==2.11.*" + ); + // No trailing `.*`: that would also admit the `2.11.0.2`/`2.11.0.3` + // rebuilds an exact pin exists to exclude. + assert_eq!( + DiscoverVersion::Exact("2.11.0").requirement("torchaudio"), + "torchaudio==2.11.0" + ); + } + /// The 10.1 row must reach the staging host for vLLM, which is only + /// published there, but takes its torch stack from `whl-next` just like + /// 10.0, the same index `rocm install sdk` resolves its own + /// `+rocm10.1.0` torch stack from (though the SDK's resolve and this + /// row's discovery are independent: this row pins its own version + /// prefixes rather than matching whatever the SDK happened to install). + /// Its torchaudio is pinned exactly: a `2.11.*` match resolves the + /// newest rebuild, `2.11.0.3`; `2.11.0.2` is the lower of the two builds + /// confirmed (on a live Strix Halo box) to load against torch 2.13 + /// (therock-next-09). 10.0 keeps the production frameworks index for + /// vLLM. The live half of this is therock-next-09. + #[test] + fn discover_rows_select_their_own_indexes() { + let ten_zero = vllm_rocm_discover_build("10.0.0").expect("10.0.0 has a discover row"); + assert_eq!( + ten_zero.vllm_index_url, + "https://rocm.frameworks.amd.com/whl-multi-arch/vllm/" + ); + assert_eq!( + ten_zero.torch_index_url, + "https://stable.repo.amd.com/rocm/whl-next/" + ); + assert_eq!(ten_zero.vllm_version_prefix, "0.27"); + + // A real probe carries a patch and dev suffix the table key never does. + let ten_one = vllm_rocm_discover_build("10.1.0a20260928").expect("10.1 has a discover row"); + assert_eq!( + ten_one.vllm_index_url, + "https://rocm.frameworks-prereleases.amd.com/whl-multi-arch-staging/vllm/" + ); + assert_eq!( + ten_one.torch_index_url, + "https://stable.repo.amd.com/rocm/whl-next/" + ); + assert_eq!(ten_one.vllm_version_prefix, "0.29"); + // 2.13/0.28, not 2.12/0.27: the pair AMD's own + // `rocm/vllm:...vllm-0.29.0` image builds this vllm release against. + assert_eq!(ten_one.torch_version_prefix, "2.13"); + assert_eq!(ten_one.torchvision_version_prefix, "0.28"); + // `whl-next` carries `2.11.0`, `2.11.0.2` and `2.11.0.3` for + // `+rocm10.1.0`; `2.11.0` is CPU-only, and a series match would + // resolve the newest, `2.11.0.3`, not the confirmed-working + // `2.11.0.2`, so this must stay exact and never a series. + assert_eq!( + ten_one.torchaudio_version, + DiscoverVersion::Exact("2.11.0.2") + ); + + // An unpublished line must not borrow another line's wheels. + assert!(vllm_rocm_discover_build("10.2.0").is_none()); + assert!(vllm_rocm_discover_build("7.2.3").is_none()); + } +} diff --git a/engines/vllm/src/install.rs b/engines/vllm/src/install.rs index 8b5df52147..26453cb1ac 100644 --- a/engines/vllm/src/install.rs +++ b/engines/vllm/src/install.rs @@ -11,15 +11,17 @@ use rocm_engine_protocol::{InstallRequest, InstallResponse}; use std::path::{Path, PathBuf}; use std::process::Command as ProcessCommand; +use crate::discover_builds::{ + DiscoverVersion, VllmRocmDiscoverBuild, rocm_sdk_series_matches, vllm_rocm_discover_build, +}; use crate::repair::{RepairAssessment, assess_runtime_repair}; use crate::runtime::{ assessed_python_for_repair, describe_skipped_managed_runtimes, resolve_managed_runtime_python, - resolve_vllm_runtime, rocm_sdk_series_matches, runtime_is_managed, vllm_runtime_warnings, + resolve_vllm_runtime, runtime_is_managed, vllm_runtime_warnings, }; use crate::state::runtime_lock_hash; use crate::wheel_builds::{ - DiscoverVersion, VllmInstallRoute, VllmInstallTarget, VllmRocmDiscoverBuild, - vllm_install_route, vllm_install_target, vllm_rocm_discover_build, + VllmInstallRoute, VllmInstallTarget, vllm_install_route, vllm_install_target, }; pub(crate) fn install_response(request: InstallRequest) -> Result { diff --git a/engines/vllm/src/lib.rs b/engines/vllm/src/lib.rs index c444275bed..6d203b420d 100644 --- a/engines/vllm/src/lib.rs +++ b/engines/vllm/src/lib.rs @@ -17,6 +17,7 @@ use serde_json::Value; use std::io::{Read, Write}; use std::path::PathBuf; +mod discover_builds; mod install; mod process; mod repair; diff --git a/engines/vllm/src/runtime.rs b/engines/vllm/src/runtime.rs index 448c3b188a..9dac3e9c46 100644 --- a/engines/vllm/src/runtime.rs +++ b/engines/vllm/src/runtime.rs @@ -2,6 +2,7 @@ // // SPDX-License-Identifier: MIT +use crate::discover_builds::{ROCM_SDK_10_0, ROCM_SDK_10_1, rocm_sdk_series_matches}; use anyhow::{Context, Result, bail}; use rocm_core::{AppPaths, split_local_version}; use serde::Deserialize; @@ -95,18 +96,10 @@ pub(crate) fn runtime_is_managed(runtime: &VllmRuntime) -> bool { runtime.source.starts_with("managed_runtime_manifest") } -/// The ROCm SDK 10.0 release line, as it appears in both -/// [`ROCM_DISCOVER_BUILD_VERSIONS`] and `wheel_builds.rs`'s discover-build table. -pub(crate) const ROCM_SDK_10_0: &str = "10.0.0"; -/// The ROCm SDK 10.1 release line, as it appears in both -/// [`ROCM_DISCOVER_BUILD_VERSIONS`] and `wheel_builds.rs`'s discover-build table. -pub(crate) const ROCM_SDK_10_1: &str = "10.1.0"; - -/// ROCm SDK versions keyed by a row in `wheel_builds.rs`'s discover-build table -/// (see [`crate::wheel_builds::vllm_rocm_discover_build`] for the recipe each one -/// resolves to: wheel indexes, version prefixes, interpreter tag). Defined -/// here, in the lower layer, as the single source for which versions count — -/// `wheel_builds.rs`'s table literally uses these constants for its +/// ROCm SDK versions keyed by a row in `discover_builds.rs`'s discover-build table +/// (see [`crate::discover_builds::vllm_rocm_discover_build`] for the recipe each +/// one resolves to: wheel indexes, version prefixes, interpreter tag). The +/// table literally uses [`ROCM_SDK_10_0`] and [`ROCM_SDK_10_1`] for its /// `rocm_sdk_version` fields, and [`runtime_has_discover_build`] below /// matches against the same two strings. This list and that table are still /// two separate pieces of data, kept in agreement only by @@ -115,31 +108,11 @@ pub(crate) const ROCM_SDK_10_1: &str = "10.1.0"; /// and that test is what catches it if one is missed. pub(crate) const ROCM_DISCOVER_BUILD_VERSIONS: &[&str] = &[ROCM_SDK_10_0, ROCM_SDK_10_1]; -/// Whether `recorded` and `table_key` name the same ROCm `major.minor` line, -/// ignoring patch and any dev/pre-release suffix. See -/// [`crate::wheel_builds::vllm_rocm_discover_build`] for why the line, not the -/// exact release, is what a discover row covers. Lives here, not in -/// `wheel_builds.rs`, alongside [`ROCM_DISCOVER_BUILD_VERSIONS`] so -/// [`runtime_has_discover_build`] can match without calling into `wheel_builds`. -pub(crate) fn rocm_sdk_series_matches(recorded: &str, table_key: &str) -> bool { - fn series(version: &str) -> Option<(u64, u64)> { - let mut parts = version.trim().split('.'); - let major = parts.next()?.parse().ok()?; - let minor: String = parts - .next()? - .chars() - .take_while(char::is_ascii_digit) - .collect(); - Some((major, minor.parse().ok()?)) - } - series(recorded).is_some_and(|version| Some(version) == series(table_key)) -} - /// Whether `runtime`'s recorded ROCm SDK version has a live discover-build /// recipe. Exposed as runtime metadata, matched directly against /// [`ROCM_DISCOVER_BUILD_VERSIONS`], so callers outside `wheel_builds` — the /// vLLM launch path in `process.rs`, specifically — don't need to reach into -/// `wheel_builds`'s build-selection table for a plain yes/no check. +/// `wheel_builds`'s build-selection code for a plain yes/no check. pub(crate) fn runtime_has_discover_build(runtime: &VllmRuntime) -> bool { runtime.rocm_sdk_version.as_deref().is_some_and(|version| { ROCM_DISCOVER_BUILD_VERSIONS diff --git a/engines/vllm/src/wheel_builds.rs b/engines/vllm/src/wheel_builds.rs index 3d676cb478..7b04258a8d 100644 --- a/engines/vllm/src/wheel_builds.rs +++ b/engines/vllm/src/wheel_builds.rs @@ -4,7 +4,9 @@ use anyhow::{Result, anyhow, bail}; -use crate::runtime::{ROCM_SDK_10_0, ROCM_SDK_10_1, rocm_sdk_series_matches}; +use crate::discover_builds::{ + DiscoverVersion, VLLM_ROCM_DISCOVER_BUILD_TABLE, vllm_rocm_discover_build, +}; /// Known-good `(ROCm SDK version, vLLM version, ABI tag)` combinations for /// `uv pip install vllm`, keyed by the ROCm SDK version recorded in the @@ -31,153 +33,6 @@ const VLLM_ROCM_BUILD_TABLE: &[VllmRocmBuild] = &[VllmRocmBuild { /// what lets [`vllm_rocm_build_from_index_url`] recover the build a custom /// index serves and keep the requirement pinned to it. const VLLM_ROCM_INDEX_PREFIX: &str = "https://wheels.vllm.ai/rocm"; -/// How a [`VllmRocmDiscoverBuild`] row constrains the release discovery may -/// resolve for one package. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub(crate) enum DiscoverVersion { - /// `{pkg}=={series}.*`: the newest release in the series. - Series(&'static str), - /// `{pkg}=={release}`: exactly this release. Under PEP 440 a specifier - /// without a local version still matches any `+rocm…` local version of - /// it, but not a longer release such as `{release}.2`. Needed where AMD - /// publishes rebuilds as extra release segments (torchaudio - /// `2.11.0`/`2.11.0.2`/`2.11.0.3`, each paired with a different torch), so - /// a series match would pick the rebuild for the wrong torch. - Exact(&'static str), -} - -impl DiscoverVersion { - /// The requirement handed to `uv` for `pkg`. - pub(crate) fn requirement(self, pkg: &str) -> String { - match self { - Self::Series(series) => format!("{pkg}=={series}.*"), - Self::Exact(release) => format!("{pkg}=={release}"), - } - } -} - -/// A ROCm SDK version whose vLLM/flash-attn/amd-aiter wheels aren't published -/// under a fixed filename (AMD rotates the dev-tag suffix constantly), so the -/// exact wheel must be discovered from the index at install time instead of -/// pinned in [`VLLM_ROCM_BUILD_TABLE`]. -pub(crate) struct VllmRocmDiscoverBuild { - pub(crate) rocm_sdk_version: &'static str, - /// PEP 425 interpreter tag this row's wheels are published for. AMD builds - /// ROCm 10.x `vllm`, `flash-attn` and `amd-aiter` for exactly one CPython - /// version, so a venv on any other interpreter resolves nothing at all. - pub(crate) python_tag: &'static str, - /// Index publishing this row's rotating-dev-tag vLLM/flash-attn/amd-aiter - /// wheels. Per-row because ROCm 10.1 frameworks are staged on a different - /// host than 10.0's. - pub(crate) vllm_index_url: &'static str, - /// Index publishing this row's torch build. - pub(crate) torch_index_url: &'static str, - pub(crate) vllm_version_prefix: &'static str, - pub(crate) flash_attn_version_prefix: &'static str, - pub(crate) amd_aiter_version_prefix: &'static str, - pub(crate) torch_version_prefix: &'static str, - /// torchvision's version prefix is always the ROCm "Next" torch minor - /// plus 15 (torch 2.12 pairs with torchvision 0.27); torchaudio has no - /// such rule and is hardcoded per row to whatever AMD has actually - /// published for it. Both are discovered fresh alongside torch rather - /// than trusted from a pre-install snapshot, so the triplet installed - /// here is always coherent with the torch version this row actually pins - /// (see `install_vllm_rocm10_discover`). - pub(crate) torchvision_version_prefix: &'static str, - /// [`DiscoverVersion::Exact`] wherever the row's index publishes more than - /// one rebuild of a torchaudio series, which `whl-next` does (`2.11.0`, - /// `2.11.0.2`, `2.11.0.3`, each paired with a different torch): a series - /// match takes the newest, i.e. the rebuild for some *other* row's torch. - /// [`DiscoverVersion::Series`] is only safe on an index that serves one - /// build per series. - /// - /// An [`DiscoverVersion::Exact`] torchaudio is also the hardware-verified - /// build for the row's ROCm line, and `rocm install sdk` pins it too, via - /// [`verified_torchaudio_release`]: set one only for a build confirmed to - /// load against the row's torch on real hardware, never as a guess. - pub(crate) torchaudio_version: DiscoverVersion, -} - -const VLLM_ROCM_DISCOVER_BUILD_TABLE: &[VllmRocmDiscoverBuild] = &[ - VllmRocmDiscoverBuild { - rocm_sdk_version: ROCM_SDK_10_0, - python_tag: "cp314", - vllm_index_url: "https://rocm.frameworks.amd.com/whl-multi-arch/vllm/", - torch_index_url: "https://stable.repo.amd.com/rocm/whl-next/", - vllm_version_prefix: "0.27", - flash_attn_version_prefix: "2.8", - amd_aiter_version_prefix: "0.1", - torch_version_prefix: "2.12", - torchvision_version_prefix: "0.27", - // Still a series match, unlike the 10.1 row below, and unverified - // against `whl-next` now that both rows read from it: that index is - // flat across ROCm lines, so a series match here can resolve a - // `+rocm10.1.0` wheel, which `ensure_rocm_local_version_matches` - // rejects. Left as-is rather than pinned blind -- which torchaudio - // rebuild pairs with 10.0's torch 2.12 needs a live 10.0 box to - // establish, and this row has no coverage on the self-hosted lanes. - // `rocm install sdk` reads this field too: see `torchaudio_version`. - torchaudio_version: DiscoverVersion::Series("2.11"), - }, - VllmRocmDiscoverBuild { - rocm_sdk_version: ROCM_SDK_10_1, - python_tag: "cp314", - vllm_index_url: "https://rocm.frameworks-prereleases.amd.com/whl-multi-arch-staging/vllm/", - // Torch stack from `whl-next`, not staging: it is the index - // `rocm install sdk` resolves the 10.1 SDK's own `+rocm10.1.0` torch - // stack from, so vLLM realigns onto the same builds rather than - // staging's `rc` ones. - torch_index_url: "https://stable.repo.amd.com/rocm/whl-next/", - vllm_version_prefix: "0.29", - flash_attn_version_prefix: "2.8", - amd_aiter_version_prefix: "0.1", - // 2.13, not 2.12: AMD's own `rocm/vllm:rocm10.1.0_..._vllm-0.29.0` - // image (whose Dockerfile build args pin `TORCH_VERSION=2.13.0`, - // `TORCHVISION_VERSION=0.28.0`) builds this exact vllm release - // against torch 2.13, not 2.12. `vllm` 0.29's own `_rocm_C.abi3.so` - // needs a `c10::NotImplementedError` constructor symbol torch - // 2.12.0+rocm10.1.0 does not export; 2.13 is published on this same - // `whl-next` index and matches what vllm was actually built against. - torch_version_prefix: "2.13", - torchvision_version_prefix: "0.28", - // Exact, not `2.11.*`: `whl-next` publishes three `+rocm10.1.0` - // torchaudio builds, `2.11.0`, `2.11.0.2` and `2.11.0.3`. `2.11.0` is - // a CPU-only rebuild (no `libamdhip64`/`libc10_hip`/`libtorch_hip` - // in its `.so`s) that predates torch's stable-ABI split and does not - // reference the `torch_exception_get_what` / `torch_new_stable_ivalue` - // symbols torch 2.13 exports. `2.11.0.2` and `2.11.0.3` are both HIP - // builds against that same stable ABI (confirmed on a live Strix Halo - // box: torch 2.13.0+rocm10.1.0 exports both symbols as `T`, and - // torchaudio 2.11.0.2 imports them as `U`); a series match would - // resolve the newest, `2.11.0.3`, so pin the lower of the two - // confirmed-working builds instead. `rocm install sdk` pins this same - // build for the 10.1 line: see `torchaudio_version`. - torchaudio_version: DiscoverVersion::Exact("2.11.0.2"), - }, -]; - -/// Looks up the discovery build recipe for a ROCm SDK version, if any. -/// -/// Matched on `major.minor`, ignoring patch and any dev/pre-release suffix. A -/// discover row is a live resolver recipe rather than one pinned filename, so -/// it does span a release line, but only a `major.minor` one: 10.0 and 10.1 -/// publish genuinely different wheels (vLLM `0.27` from -/// `rocm.frameworks.amd.com` versus `0.29` from the staging host), so a -/// major-only row would serve one SDK's wheels to the other. Patch is still -/// ignored, because AMD does rotate the patch and dev tag within a line -/// (`whl-multi-arch/torch/` carries `+rocm7.13.0`, `+rocm7.14.0` and -/// `+rocm7.14.1` as coexisting builds) and a row keyed to an exact string -/// would silently stop matching. An unknown line matches nothing and fails -/// closed in [`resolve_vllm_install_target`] rather than falling back to a -/// stale static pin. -pub(crate) fn vllm_rocm_discover_build( - rocm_sdk_version: &str, -) -> Option<&'static VllmRocmDiscoverBuild> { - VLLM_ROCM_DISCOVER_BUILD_TABLE - .iter() - .find(|build| rocm_sdk_series_matches(rocm_sdk_version, build.rocm_sdk_version)) -} - /// The torchaudio release confirmed on hardware for `rocm_sdk_version`'s ROCm /// `major.minor` line: the row's [`DiscoverVersion::Exact`] torchaudio, if it /// has one. `None` for a line with no row, or whose row still matches a series, @@ -421,26 +276,6 @@ mod tests { } } - /// The ROCm SDK versions the discover-build table serves, in table order. - /// - /// Pinned on purpose: adding, removing or reordering a row changes which - /// runtimes are installed by discovery and which get the discovery launch - /// environment, so it has to show up as a reviewed edit of this list - /// rather than slip through a test that only compares the data with itself. - #[test] - fn discover_build_table_pins_the_versions_it_serves_in_order() { - let versions: Vec<&str> = VLLM_ROCM_DISCOVER_BUILD_TABLE - .iter() - .map(|build| build.rocm_sdk_version) - .collect(); - assert_eq!( - versions, - ["10.0.0", "10.1.0"], - "the discover-build table's versions or order changed: install routing, the \ - launch environment and the fail-closed static fallback all follow it" - ); - } - fn runtime_recording_sdk_version(version: Option<&str>) -> crate::runtime::VllmRuntime { crate::runtime::VllmRuntime { runtime_id: "wheel-gfx1151".to_owned(), @@ -672,17 +507,6 @@ mod tests { } } #[test] - fn vllm_rocm_discover_build_looks_up_known_and_unknown_versions() { - assert!(vllm_rocm_discover_build("10.0.0").is_some()); - // AMD tags preview wheels with the real target release (verified via - // whl-multi-arch/torch/'s coexisting +rocm7.13.0/7.14.0/7.14.1 - // builds), so a pre-release suffix on a known major.minor must still - // match its row (here the dedicated 10.1.0 one), not just an exact - // version string. - assert!(vllm_rocm_discover_build("10.1.0a20260822").is_some()); - assert!(vllm_rocm_discover_build("999.0.0").is_none()); - } - #[test] fn rocm_sdk_version_matches_ignores_dev_suffixes_and_rejects_other_releases() { assert!(rocm_sdk_version_matches("10.0.0", "10.0.0")); assert!(rocm_sdk_version_matches("7.13.0a20260423", "7.13.0")); @@ -726,73 +550,6 @@ mod tests { ); assert_eq!(vllm_install_route(None, None), VllmInstallRoute::Static); } - /// A series renders with the `.*` that lets `uv` take the newest release - /// in it; an exact release renders bare, so it cannot. - #[test] - fn discover_version_renders_series_and_exact_requirements() { - assert_eq!( - DiscoverVersion::Series("2.11").requirement("torchaudio"), - "torchaudio==2.11.*" - ); - // No trailing `.*`: that would also admit the `2.11.0.2`/`2.11.0.3` - // rebuilds an exact pin exists to exclude. - assert_eq!( - DiscoverVersion::Exact("2.11.0").requirement("torchaudio"), - "torchaudio==2.11.0" - ); - } - /// The 10.1 row must reach the staging host for vLLM, which is only - /// published there, but takes its torch stack from `whl-next` just like - /// 10.0, the same index `rocm install sdk` resolves its own - /// `+rocm10.1.0` torch stack from (though the SDK's resolve and this - /// row's discovery are independent: this row pins its own version - /// prefixes rather than matching whatever the SDK happened to install). - /// Its torchaudio is pinned exactly: a `2.11.*` match resolves the - /// newest rebuild, `2.11.0.3`; `2.11.0.2` is the lower of the two builds - /// confirmed (on a live Strix Halo box) to load against torch 2.13 - /// (therock-next-09). 10.0 keeps the production frameworks index for - /// vLLM. The live half of this is therock-next-09. - #[test] - fn discover_rows_select_their_own_indexes() { - let ten_zero = vllm_rocm_discover_build("10.0.0").expect("10.0.0 has a discover row"); - assert_eq!( - ten_zero.vllm_index_url, - "https://rocm.frameworks.amd.com/whl-multi-arch/vllm/" - ); - assert_eq!( - ten_zero.torch_index_url, - "https://stable.repo.amd.com/rocm/whl-next/" - ); - assert_eq!(ten_zero.vllm_version_prefix, "0.27"); - - // A real probe carries a patch and dev suffix the table key never does. - let ten_one = vllm_rocm_discover_build("10.1.0a20260928").expect("10.1 has a discover row"); - assert_eq!( - ten_one.vllm_index_url, - "https://rocm.frameworks-prereleases.amd.com/whl-multi-arch-staging/vllm/" - ); - assert_eq!( - ten_one.torch_index_url, - "https://stable.repo.amd.com/rocm/whl-next/" - ); - assert_eq!(ten_one.vllm_version_prefix, "0.29"); - // 2.13/0.28, not 2.12/0.27: the pair AMD's own - // `rocm/vllm:...vllm-0.29.0` image builds this vllm release against. - assert_eq!(ten_one.torch_version_prefix, "2.13"); - assert_eq!(ten_one.torchvision_version_prefix, "0.28"); - // `whl-next` carries `2.11.0`, `2.11.0.2` and `2.11.0.3` for - // `+rocm10.1.0`; `2.11.0` is CPU-only, and a series match would - // resolve the newest, `2.11.0.3`, not the confirmed-working - // `2.11.0.2`, so this must stay exact and never a series. - assert_eq!( - ten_one.torchaudio_version, - DiscoverVersion::Exact("2.11.0.2") - ); - - // An unpublished line must not borrow another line's wheels. - assert!(vllm_rocm_discover_build("10.2.0").is_none()); - assert!(vllm_rocm_discover_build("7.2.3").is_none()); - } /// Only an exact torchaudio pin counts as verified: the 10.1 row's /// `2.11.0.2` is, the 10.0 row's `2.11` series is not, and a line with no /// row has nothing to offer. `rocm install sdk` reads this same answer. From 8f00b78e78111d95c447e56aca83670cfdc06084 Mon Sep 17 00:00:00 2001 From: Jussi Elo Date: Thu, 5 Nov 2026 11:15:08 +0000 Subject: [PATCH 3/5] refactor(vllm): derive launch-time discover detection from the one discover-build table The ROCm 10.x discover-build versions were kept as two pieces of data: the `VLLM_ROCM_DISCOVER_BUILD_TABLE` rows that install routing walks, and a separate `ROCM_DISCOVER_BUILD_VERSIONS` list that launch-time environment setup (`runtime_has_discover_build`) matched against. They agreed only because a test compared them. A version in the table but not the list would be installed by discovery and then launched without the discovery environment. Delete the list and the two `ROCM_SDK_10_*` constants that fed it. The table is the single list; `runtime_has_discover_build` now asks the same row lookup that install routing uses (`vllm_rocm_discover_build`), so the two readers cannot disagree. The table won because it already carries everything else and is what the install route, the fail-closed static-pin fallback and `verified_torchaudio_release` read; the list was only a projection of its version column. Values, order and the `major.minor` matching are unchanged, so no engine id, version string, launch environment or install route changes for any input; `every_discover_row_routes_installs_and_launch_env_the_same_way` (added earlier in this series against the old code) pins that. Replaces `vllm_rocm_discover_build_table_matches_the_discover_version_list`, which compared the list with the table and has nothing left to compare, with `discover_build_table_pins_the_versions_it_serves_in_order`: it pins which versions the table serves and in what order, so changing them is a deliberate, reviewed edit of a literal list. `docs/architecture.md` and the module docs now describe the single list. Signed-off-by: Jussi Elo --- docs/architecture.md | 2 +- engines/vllm/src/discover_builds.rs | 22 ++++++++++-------- engines/vllm/src/runtime.rs | 35 +++++++++++------------------ engines/vllm/src/wheel_builds.rs | 30 ------------------------- 4 files changed, 27 insertions(+), 62 deletions(-) diff --git a/docs/architecture.md b/docs/architecture.md index 6f442e35f5..e22af6e051 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -289,7 +289,7 @@ These modules are private `mod` declarations — [`lib.rs`](../crates/e2e-report `engines/vllm` follows full domain extraction: -- [`discover_builds.rs`](../engines/vllm/src/discover_builds.rs) — the ROCm 10.x discovery table (`VLLM_ROCM_DISCOVER_BUILD_TABLE`, one row per supported `major.minor` line, with the `DiscoverVersion` series/exact constraint), the row lookup (`vllm_rocm_discover_build`) and the `major.minor` matcher it uses (`rocm_sdk_series_matches`). A leaf: it imports no other crate module, so `runtime.rs`, `wheel_builds.rs` and `install.rs` can all read it without importing one another's code. Its tests, which pin the table's rows, live with it. +- [`discover_builds.rs`](../engines/vllm/src/discover_builds.rs) — the ROCm 10.x discovery table (`VLLM_ROCM_DISCOVER_BUILD_TABLE`, one row per supported `major.minor` line, with the `DiscoverVersion` series/exact constraint), the row lookup (`vllm_rocm_discover_build`) and the `major.minor` matcher it uses (`rocm_sdk_series_matches`). It is the single list of the ROCm SDK versions installed by discovery: install routing, the fail-closed static fallback and launch-time environment setup (`runtime_has_discover_build` in `runtime.rs`) all read these rows, and nothing keeps a second list in step with them. A leaf: it imports no other crate module, so `runtime.rs`, `wheel_builds.rs` and `install.rs` can all read it without importing one another's code. Its tests, including the one that pins which versions the table serves and in what order, live with it. - [`install.rs`](../engines/vllm/src/install.rs) — ROCm/vLLM install execution: the static-pin and the ROCm 10.x discovery install routes, run through `uv`. It reads the static build table and target resolution from `wheel_builds.rs` and the discovery rows from `discover_builds.rs`, and asks `repair.rs` whether an already-resolvable environment still needs an install pass. - [`process.rs`](../engines/vllm/src/process.rs) — the resolve-model, launch, serve and stop handlers (including engine-recipe validation and device-policy/GPU-index resolution), vLLM server spawn, launch environment and path setup, and readiness polling. The text appended to a "never became ready" failure comes from `startup_diagnostics.rs`. - [`repair.rs`](../engines/vllm/src/repair.rs) — runtime-repair assessment: whether an already-resolvable managed vLLM environment violates vLLM's pinned dependencies and must be reinstalled (`assess_runtime_repair`, `RepairAssessment`), including the rule that treats the SDK's build of torch, and a torch the user chose with the alignment disabled, as intended rather than a defect. It imports `runtime.rs` and nothing from `install.rs`. diff --git a/engines/vllm/src/discover_builds.rs b/engines/vllm/src/discover_builds.rs index 80d30bd544..d6aae2fd2d 100644 --- a/engines/vllm/src/discover_builds.rs +++ b/engines/vllm/src/discover_builds.rs @@ -2,13 +2,6 @@ // // SPDX-License-Identifier: MIT -/// The ROCm SDK 10.0 release line, as it appears in both -/// [`crate::runtime::ROCM_DISCOVER_BUILD_VERSIONS`] and the discover-build table below. -pub(crate) const ROCM_SDK_10_0: &str = "10.0.0"; -/// The ROCm SDK 10.1 release line, as it appears in both -/// [`crate::runtime::ROCM_DISCOVER_BUILD_VERSIONS`] and the discover-build table below. -pub(crate) const ROCM_SDK_10_1: &str = "10.1.0"; - /// Whether `recorded` and `table_key` name the same ROCm `major.minor` line, /// ignoring patch and any dev/pre-release suffix. See /// [`vllm_rocm_discover_build`] for why the line, not the exact release, is @@ -96,9 +89,20 @@ pub(crate) struct VllmRocmDiscoverBuild { pub(crate) torchaudio_version: DiscoverVersion, } +/// Every ROCm SDK `major.minor` line the engine installs by live wheel +/// discovery, one row each, and the only list of those versions. +/// +/// Three readers follow it with nothing else to keep in step: install routing +/// ([`vllm_rocm_discover_build`], through `wheel_builds::vllm_install_route`), +/// the static-pin fallback that fails closed for a 10.x line with no row +/// (`wheel_builds::vllm_install_target`), and launch-time environment setup +/// (`runtime::runtime_has_discover_build`). Adding, removing or reordering a +/// row therefore changes all three together; +/// `discover_build_table_pins_the_versions_it_serves_in_order` makes that a +/// reviewed edit. pub(crate) const VLLM_ROCM_DISCOVER_BUILD_TABLE: &[VllmRocmDiscoverBuild] = &[ VllmRocmDiscoverBuild { - rocm_sdk_version: ROCM_SDK_10_0, + rocm_sdk_version: "10.0.0", python_tag: "cp314", vllm_index_url: "https://rocm.frameworks.amd.com/whl-multi-arch/vllm/", torch_index_url: "https://stable.repo.amd.com/rocm/whl-next/", @@ -118,7 +122,7 @@ pub(crate) const VLLM_ROCM_DISCOVER_BUILD_TABLE: &[VllmRocmDiscoverBuild] = &[ torchaudio_version: DiscoverVersion::Series("2.11"), }, VllmRocmDiscoverBuild { - rocm_sdk_version: ROCM_SDK_10_1, + rocm_sdk_version: "10.1.0", python_tag: "cp314", vllm_index_url: "https://rocm.frameworks-prereleases.amd.com/whl-multi-arch-staging/vllm/", // Torch stack from `whl-next`, not staging: it is the index diff --git a/engines/vllm/src/runtime.rs b/engines/vllm/src/runtime.rs index 9dac3e9c46..d04491eb8b 100644 --- a/engines/vllm/src/runtime.rs +++ b/engines/vllm/src/runtime.rs @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: MIT -use crate::discover_builds::{ROCM_SDK_10_0, ROCM_SDK_10_1, rocm_sdk_series_matches}; +use crate::discover_builds::vllm_rocm_discover_build; use anyhow::{Context, Result, bail}; use rocm_core::{AppPaths, split_local_version}; use serde::Deserialize; @@ -96,29 +96,20 @@ pub(crate) fn runtime_is_managed(runtime: &VllmRuntime) -> bool { runtime.source.starts_with("managed_runtime_manifest") } -/// ROCm SDK versions keyed by a row in `discover_builds.rs`'s discover-build table -/// (see [`crate::discover_builds::vllm_rocm_discover_build`] for the recipe each -/// one resolves to: wheel indexes, version prefixes, interpreter tag). The -/// table literally uses [`ROCM_SDK_10_0`] and [`ROCM_SDK_10_1`] for its -/// `rocm_sdk_version` fields, and [`runtime_has_discover_build`] below -/// matches against the same two strings. This list and that table are still -/// two separate pieces of data, kept in agreement only by -/// `wheel_builds.rs`'s `vllm_rocm_discover_build_table_matches_the_discover_version_list` -/// test, not by construction — a new table row needs a matching entry here, -/// and that test is what catches it if one is missed. -pub(crate) const ROCM_DISCOVER_BUILD_VERSIONS: &[&str] = &[ROCM_SDK_10_0, ROCM_SDK_10_1]; - /// Whether `runtime`'s recorded ROCm SDK version has a live discover-build -/// recipe. Exposed as runtime metadata, matched directly against -/// [`ROCM_DISCOVER_BUILD_VERSIONS`], so callers outside `wheel_builds` — the -/// vLLM launch path in `process.rs`, specifically — don't need to reach into -/// `wheel_builds`'s build-selection code for a plain yes/no check. +/// recipe: the same row lookup install routing uses +/// ([`vllm_rocm_discover_build`], over the one discover-build table in +/// `discover_builds.rs`), so a version is a discover build for launch-time +/// environment setup exactly when it is one for install routing. There is no +/// separate list of versions to keep in step with that table. Exposed as +/// runtime metadata so callers outside `wheel_builds` — the vLLM launch path +/// in `process.rs`, specifically — don't need to reach into its +/// build-selection code for a plain yes/no check. pub(crate) fn runtime_has_discover_build(runtime: &VllmRuntime) -> bool { - runtime.rocm_sdk_version.as_deref().is_some_and(|version| { - ROCM_DISCOVER_BUILD_VERSIONS - .iter() - .any(|key| rocm_sdk_series_matches(version, key)) - }) + runtime + .rocm_sdk_version + .as_deref() + .is_some_and(|version| vllm_rocm_discover_build(version).is_some()) } pub(crate) fn vllm_runtime_warnings(runtime: &VllmRuntime) -> Vec { diff --git a/engines/vllm/src/wheel_builds.rs b/engines/vllm/src/wheel_builds.rs index 7b04258a8d..048c9d94ad 100644 --- a/engines/vllm/src/wheel_builds.rs +++ b/engines/vllm/src/wheel_builds.rs @@ -245,36 +245,6 @@ fn vllm_rocm_build_from_index_url(index_url: &str) -> Option<(String, String)> { #[cfg(test)] mod tests { use super::*; - use crate::runtime::ROCM_DISCOVER_BUILD_VERSIONS; - - #[test] - fn vllm_rocm_discover_build_table_matches_the_discover_version_list() { - // `ROCM_DISCOVER_BUILD_VERSIONS` (runtime.rs) and - // `VLLM_ROCM_DISCOVER_BUILD_TABLE` (here) are two separate pieces of data that - // must name the same ROCm SDK versions — the list drives launch-time env setup - // (`apply_therock_env`), the table drives install routing, and a row present in - // only one of them means a runtime gets installed one way and launched another. - // See the doc comment on `ROCM_DISCOVER_BUILD_VERSIONS` for why nothing but this - // test enforces the agreement. - for build in VLLM_ROCM_DISCOVER_BUILD_TABLE { - assert!( - ROCM_DISCOVER_BUILD_VERSIONS.contains(&build.rocm_sdk_version), - "{} is a VLLM_ROCM_DISCOVER_BUILD_TABLE row but missing from \ - ROCM_DISCOVER_BUILD_VERSIONS; launch-time env setup would silently skip it", - build.rocm_sdk_version - ); - } - for version in ROCM_DISCOVER_BUILD_VERSIONS { - assert!( - VLLM_ROCM_DISCOVER_BUILD_TABLE - .iter() - .any(|build| build.rocm_sdk_version == *version), - "{version} is in ROCM_DISCOVER_BUILD_VERSIONS but has no \ - VLLM_ROCM_DISCOVER_BUILD_TABLE row; install routing has nothing to install \ - for a runtime launch-time env setup now treats as a discover build" - ); - } - } fn runtime_recording_sdk_version(version: Option<&str>) -> crate::runtime::VllmRuntime { crate::runtime::VllmRuntime { From cc726d3f1016fe2d6e8968013a3a982d5ed08643 Mon Sep 17 00:00:00 2001 From: Jussi Elo Date: Thu, 5 Nov 2026 14:53:18 +0000 Subject: [PATCH 4/5] test(vllm): build test VllmRuntime values from one shared constructor Several test modules assembled every VllmRuntime field by hand, so adding a field to the struct meant editing each of them, including modules unrelated to runtime.rs such as wheel_builds. Add a cfg(test) VllmRuntime::for_test() next to the struct and have those tests override only the fields they are about with struct-update syntax. Values each test sees are unchanged and no test is added, removed or renamed. Signed-off-by: Jussi Elo --- engines/vllm/src/process.rs | 51 +++------------------- engines/vllm/src/runtime.rs | 75 +++++++++++++------------------- engines/vllm/src/state.rs | 17 +------- engines/vllm/src/wheel_builds.rs | 8 +--- 4 files changed, 39 insertions(+), 112 deletions(-) diff --git a/engines/vllm/src/process.rs b/engines/vllm/src/process.rs index 98ccd5ead5..1d6acf7c1e 100644 --- a/engines/vllm/src/process.rs +++ b/engines/vllm/src/process.rs @@ -922,19 +922,7 @@ mod tests { } #[test] fn launch_env_sets_vllm_rocm_target_device() -> Result<()> { - let runtime = VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), - command: PathBuf::from("vllm"), - python_executable: None, - version: None, - source: "managed_runtime_manifest:test".to_owned(), - sdk_root: None, - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, - }; + let runtime = VllmRuntime::for_test(); let mut command = ProcessCommand::new("vllm"); apply_therock_env(&mut command, &runtime)?; @@ -966,17 +954,9 @@ mod tests { std::os::unix::fs::symlink("/does/not/exist", &stale_shim)?; let runtime = VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), - command: PathBuf::from("vllm"), python_executable: Some(env.path().join("bin").join("python")), - version: None, - source: "managed_runtime_manifest:test".to_owned(), sdk_root: Some(env.path().join("sdk")), - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; let mut command = ProcessCommand::new("vllm"); @@ -1006,17 +986,9 @@ mod tests { let env = tempfile::tempdir()?; let runtime = VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), - command: PathBuf::from("vllm"), python_executable: Some(env.path().join("bin").join("python")), - version: None, - source: "managed_runtime_manifest:test".to_owned(), sdk_root: Some(env.path().join("sdk")), - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; let mut command = ProcessCommand::new("vllm"); @@ -1053,17 +1025,9 @@ mod tests { // `compat_dir` must not keep that directory on the loader path. let env = tempfile::tempdir()?; let runtime = VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), - command: PathBuf::from("vllm"), python_executable: Some(env.path().join("bin").join("python")), - version: None, - source: "managed_runtime_manifest:test".to_owned(), sdk_root: Some(env.path().join("sdk")), - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; // Plant the leftover directly, bypassing `ensure_mpi_cxx_compat`: @@ -1097,15 +1061,10 @@ mod tests { VllmRuntime { runtime_id: "test".to_owned(), env_id: "test".to_owned(), - command: PathBuf::from("vllm"), python_executable, - version: None, source: "test".to_owned(), - sdk_root: None, - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), rocm_sdk_version, + ..VllmRuntime::for_test() } } #[test] diff --git a/engines/vllm/src/runtime.rs b/engines/vllm/src/runtime.rs index d04491eb8b..29b87b2e39 100644 --- a/engines/vllm/src/runtime.rs +++ b/engines/vllm/src/runtime.rs @@ -29,6 +29,31 @@ pub(crate) struct VllmRuntime { pub(crate) rocm_sdk_version: Option, } +#[cfg(test)] +impl VllmRuntime { + /// The one place tests outside this struct's own definition get a runtime + /// from: a managed TheRock runtime with every optional part empty. A test + /// overrides only the fields it is about, with struct-update syntax + /// (`VllmRuntime { sdk_root: Some(root), ..VllmRuntime::for_test() }`), so a + /// field added to the struct is defaulted here once instead of breaking + /// every test module that builds one. + pub(crate) fn for_test() -> Self { + Self { + runtime_id: "therock-release:gfx120X-all".to_owned(), + env_id: "external-vllm-therock".to_owned(), + command: PathBuf::from("vllm"), + python_executable: None, + version: None, + source: "managed_runtime_manifest:test".to_owned(), + sdk_root: None, + sdk_bin: None, + sdk_bin_paths: Vec::new(), + sdk_library_paths: Vec::new(), + rocm_sdk_version: None, + } + } +} + #[derive(Debug, Clone, Default, Deserialize)] pub(crate) struct TheRockRuntimeManifest { #[serde(default)] @@ -821,21 +846,14 @@ mod tests { #[test] fn managed_env_reflects_managed_runtime_manifest_source() { let mut runtime = VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), command: PathBuf::from(if cfg!(windows) { r"C:\venv\Scripts\vllm.exe" } else { "/home/user/.venv/bin/vllm" }), - python_executable: None, version: Some("test".to_owned()), source: "managed_runtime_manifest:vllm-source-pip-gfx120x-all".to_owned(), - sdk_root: None, - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; assert!(runtime_is_managed(&runtime)); @@ -861,18 +879,13 @@ mod tests { // assessed environment or it fixes an interpreter nobody found broken. let assessed = VllmRuntime { runtime_id: "nightly-wheel-gfx94x-dcgpu-7-14-0a20260611".to_owned(), - env_id: "external-vllm-therock".to_owned(), command: PathBuf::from("/rocm/runtimes/wheel/nightly-gfx94x/bin/vllm"), python_executable: Some(PathBuf::from( "/rocm/runtimes/wheel/nightly-gfx94x/bin/python", )), version: Some("0.26.0".to_owned()), source: "managed_runtime_manifest:nightly-wheel-gfx94x-dcgpu".to_owned(), - sdk_root: None, - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; let target = assessed_python_for_repair(&assessed).expect("a managed runtime has a python"); @@ -959,16 +972,10 @@ mod tests { fn runtime_with_sdk_version(version: Option<&str>) -> VllmRuntime { VllmRuntime { runtime_id: "nightly-wheel-gfx94x-dcgpu".to_owned(), - env_id: "external-vllm-therock".to_owned(), command: PathBuf::from("/rocm/runtimes/wheel/nightly-gfx94x/bin/vllm"), - python_executable: None, - version: None, source: "managed_runtime_manifest:nightly-wheel-gfx94x-dcgpu".to_owned(), - sdk_root: None, - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), rocm_sdk_version: version.map(ToOwned::to_owned), + ..VllmRuntime::for_test() } } #[test] @@ -1000,17 +1007,11 @@ mod tests { // for the step that does). let root = PathBuf::from("/tmp/rocm-sdk"); let runtime = VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), - command: PathBuf::from("vllm"), - python_executable: None, - version: None, - source: "managed_runtime_manifest:test".to_owned(), sdk_root: Some(root.clone()), sdk_bin: Some(root.join("bin")), sdk_bin_paths: vec![root.join("runtime").join("bin")], sdk_library_paths: vec![root.join("runtime").join("lib")], - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; let entries = therock_library_path_entries(&runtime); assert!(entries.contains(&root.join("runtime").join("lib"))); @@ -1038,17 +1039,9 @@ mod tests { #[cfg(target_os = "linux")] fn runtime_with_compat_dir(env_root: &Path) -> VllmRuntime { VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), - command: PathBuf::from("vllm"), python_executable: Some(env_root.join("bin").join("python")), - version: None, - source: "managed_runtime_manifest:test".to_owned(), sdk_root: Some(env_root.join("sdk")), - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, + ..VllmRuntime::for_test() } } @@ -1146,15 +1139,9 @@ mod tests { let runtime = VllmRuntime { runtime_id: "external-vllm-python".to_owned(), env_id: "external-vllm-python".to_owned(), - command: PathBuf::from("vllm"), python_executable: Some(env.path().join("bin").join("python")), - version: None, source: "environment python".to_owned(), - sdk_root: None, - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; let shim = ensure_therock_compat_shims(&runtime, rocm_core::openmpi::ensure_mpi_cxx_compat); diff --git a/engines/vllm/src/state.rs b/engines/vllm/src/state.rs index bca142849a..2691dc62fa 100644 --- a/engines/vllm/src/state.rs +++ b/engines/vllm/src/state.rs @@ -503,16 +503,12 @@ mod tests { engine_recipe: None, }; let runtime = VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), command: PathBuf::from(if cfg!(windows) { r"C:\venv\Scripts\vllm.exe" } else { "/home/user/.venv/bin/vllm" }), - python_executable: None, version: Some("test".to_owned()), - source: "managed_runtime_manifest:test".to_owned(), sdk_root: Some(PathBuf::from(if cfg!(windows) { r"C:\rocm-sdk" } else { @@ -533,7 +529,7 @@ mod tests { } else { "/home/user/.venv/lib/python/site-packages/_rocm_sdk_libraries/lib" })], - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; write_running_state(&request, &runtime, own_pid)?; @@ -671,17 +667,8 @@ mod tests { engine_recipe: Some(recipe), }; let runtime = VllmRuntime { - runtime_id: "therock-release:gfx120X-all".to_owned(), - env_id: "external-vllm-therock".to_owned(), - command: PathBuf::from("vllm"), - python_executable: None, version: Some("test".to_owned()), - source: "managed_runtime_manifest:test".to_owned(), - sdk_root: None, - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), - rocm_sdk_version: None, + ..VllmRuntime::for_test() }; write_running_state(&request, &runtime, std::process::id())?; diff --git a/engines/vllm/src/wheel_builds.rs b/engines/vllm/src/wheel_builds.rs index 048c9d94ad..e1358d9608 100644 --- a/engines/vllm/src/wheel_builds.rs +++ b/engines/vllm/src/wheel_builds.rs @@ -249,16 +249,10 @@ mod tests { fn runtime_recording_sdk_version(version: Option<&str>) -> crate::runtime::VllmRuntime { crate::runtime::VllmRuntime { runtime_id: "wheel-gfx1151".to_owned(), - env_id: "external-vllm-therock".to_owned(), command: std::path::PathBuf::from("/rocm/runtimes/wheel/gfx1151/bin/vllm"), - python_executable: None, - version: None, source: "managed_runtime_manifest:wheel-gfx1151".to_owned(), - sdk_root: None, - sdk_bin: None, - sdk_bin_paths: Vec::new(), - sdk_library_paths: Vec::new(), rocm_sdk_version: version.map(ToOwned::to_owned), + ..crate::runtime::VllmRuntime::for_test() } } From 388dd8580d34ff93e6e486fc85825cf02a17a7cd Mon Sep 17 00:00:00 2001 From: Jussi Elo Date: Thu, 5 Nov 2026 14:54:30 +0000 Subject: [PATCH 5/5] docs(vllm): fix two intra-doc links broken by the discover-build move The doc comments that moved into discover_builds.rs referred to VLLM_ROCM_BUILD_TABLE and verified_torchaudio_release by bare name, which resolved while they sat beside those items in wheel_builds.rs. Under cargo doc --document-private-items they no longer resolve. Point the verified_torchaudio_release link at its module path and name the private table in plain code formatting, since a module-private const cannot be linked from a sibling module. Comment-only change. Signed-off-by: Jussi Elo --- engines/vllm/src/discover_builds.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engines/vllm/src/discover_builds.rs b/engines/vllm/src/discover_builds.rs index d6aae2fd2d..99d7a92462 100644 --- a/engines/vllm/src/discover_builds.rs +++ b/engines/vllm/src/discover_builds.rs @@ -50,7 +50,7 @@ impl DiscoverVersion { /// A ROCm SDK version whose vLLM/flash-attn/amd-aiter wheels aren't published /// under a fixed filename (AMD rotates the dev-tag suffix constantly), so the /// exact wheel must be discovered from the index at install time instead of -/// pinned in [`VLLM_ROCM_BUILD_TABLE`]. +/// pinned in `wheel_builds::VLLM_ROCM_BUILD_TABLE`. pub(crate) struct VllmRocmDiscoverBuild { pub(crate) rocm_sdk_version: &'static str, /// PEP 425 interpreter tag this row's wheels are published for. AMD builds @@ -84,7 +84,7 @@ pub(crate) struct VllmRocmDiscoverBuild { /// /// An [`DiscoverVersion::Exact`] torchaudio is also the hardware-verified /// build for the row's ROCm line, and `rocm install sdk` pins it too, via - /// [`verified_torchaudio_release`]: set one only for a build confirmed to + /// [`verified_torchaudio_release`](crate::wheel_builds::verified_torchaudio_release): set one only for a build confirmed to /// load against the row's torch on real hardware, never as a guess. pub(crate) torchaudio_version: DiscoverVersion, }