feat(install): make the ROCm compiler toolchain opt-in - #167
Conversation
Every wheel SDK install pulled in the devel extra — headers, static libraries, and the full LLVM toolchain — whether or not the user would ever build GPU code. It is roughly half the download (1.2-1.5 GiB compressed, depending on target) and nothing in this repository needs it at run time: the SDK probe already tolerates its absence and has a test covering that path. Default to rocm[libraries] and add --devel for people who do build against ROCm. Record the choice in the runtime manifest so an update reinstalls what the user picked rather than silently adding or dropping the toolchain. Manifests written before this change have no such field and were all toolchain installs, so a missing field reads back as present. Group the install arguments into SdkInstallRequest, which keeps the argument count within the clippy threshold and makes the call sites readable. Closes #164 Signed-off-by: Roman Inflianskas <Roman.Inflianskas@amd.com>
Review:
|
juhovainio
left a comment
There was a problem hiding this comment.
I reviewed this PR and found two issues worth fixing before merge — left as inline comments below. Both are real regressions caused by the new opt-in-devel default, not style nitpicks.
I also looked into a few other concerns that have come up around this change (the from-source vLLM docs not mentioning --devel is now needed, CI not really exercising the new default because of GPU-lane pre-warm caching, and a claimed bug in cmake_path.is_some()), but none of them held up as clear bugs worth blocking on — the cmake_path one in particular looks like it's based on a test that actually shows the check working correctly, not failing.
| pub family_override: Option<&'a str>, | ||
| pub dry_run: bool, | ||
| /// Install the compiler and headers alongside the runtime libraries. | ||
| pub include_devel: bool, |
There was a problem hiding this comment.
include_devel now defaults to false, which flips the SDK's default extras from rocm[libraries,devel] to rocm[libraries].
scripts/therock_sdk_install_test.py (not touched by this PR) installs without --devel but still asserts the output contains rocm[libraries,devel]== (THEROCK_SDK_PACKAGE_SPEC at line 29, asserted at line 499). This documented manual smoke test (linked from docs/testing.md and docs/manual-testing.md) will now fail every time it's run.
Either pass --devel in the script's install invocation, or update THEROCK_SDK_PACKAGE_SPEC to "rocm[libraries]".
| "install TheRock SDK with the compiler toolchain, torch stack, and resolved dependencies" | ||
| } else { | ||
| "install TheRock SDK, torch stack, and resolved dependencies" | ||
| }, |
There was a problem hiding this comment.
This is the pattern used everywhere else in the file to make user-facing strings reflect include_devel — but resolve_pip_runtime_from_index's error message (around line 1257) doesn't receive include_devel at all, and always says:
no mutually compatible TheRock rocm[libraries,devel], torch, torchvision, and torchaudio versions were found for {requested} in {index_url}
Someone who didn't pass --devel and hits this failure gets an error naming a toolchain they never asked for.
Thread include_devel into resolve_pip_runtime_from_index (or its caller) and branch the message the same way this block does.
Summary
Make the ROCm compiler toolchain opt-in.
rocm install sdknow installsrocm[libraries]by default, and--develadds the toolchain for people who build GPU code.Root cause
Every wheel SDK install pulled in the
develextra — headers, static libraries,hipcc, and the full LLVM toolchain — whether or not the user would ever compile anything. It is roughly half the download:[libraries][libraries,devel]Compressed wheel sizes at ROCm 7.10.0; unpacked is larger. The two extras are disjoint, so dropping
develcannot remove anything needed to run a model.Nothing in this repository needs it at run time. The SDK probe already tolerates its absence and backfills paths from the runtime packages, and
runtime_only_rocm_sdk_probe_validates_without_devel_rootalready covered that path before this change. No codepath compiles against ROCm headers: the vLLM install is a plain wheel install, Lemonade downloads prebuilt backends, and ComfyUI has no custom-node build path.hipccis only ever an existence marker for detecting a system ROCm install.Technical decisions
A positive flag, not a negative one.
--develmatches the dominant convention for this command (--reinstall,--replace,--dkms); the codebase has exactly one negative flag, so--no-develwould match the outlier.The choice is recorded in the runtime manifest so
rocm updatereinstalls what the user picked rather than silently adding or dropping the toolchain. Manifests written before this change have no such field and were all toolchain installs, so a missing field deserializes astrue— defaulting tofalsethere would silently strip the toolchain on the next update.For an adopted environment, the probe's CMake path tells us whether the toolchain is present, so adoption records what the environment actually has. This also gives
cmake_pathits first reader.SdkInstallRequestgroups the install arguments; the eighth positional parameter crossed the clippy threshold and the call sites were getting hard to read.Tests
pip_runtime_omits_devel_extra_by_default— the default spec isrocm[libraries]and the torch stack is unaffected.legacy_manifest_without_devel_field_is_treated_as_having_it.--develpath.Verified against the live index: the default dry run resolves
rocm[libraries]==7.13.0, and--develresolvesrocm[libraries,devel]==7.13.0.Not yet verified
I could not run a real install here, so two things want checking on a GPU lane before this is trusted in anger:
rocm-sdk-develback in transitively via the torch wheels. A--dry-runresolve on a runner would settle it.develtree — but a runtime-only vLLM serve run should confirm that.If maintainers would rather land this behaviour-neutral first, it could ship as an opt-out and flip the default later; given the evidence I think that mostly costs a second flag rename, but I'm happy either way.
Fixes #164