feat[notask]: build @qvac/fabric with the ROCm/HIP backend - #4057
Open
jpgaribotti wants to merge 6 commits into
Open
feat[notask]: build @qvac/fabric with the ROCm/HIP backend#4057jpgaribotti wants to merge 6 commits into
jpgaribotti wants to merge 6 commits into
Conversation
Contributor
Review StatusCurrent Status: ✅ APPROVED |
The qvac-fabric[hip-backend] feature was requested per-consumer by @qvac/vla-ggml, which paired it with include-rocm on its own prebuild workflow and include-rocm-sdk on its cpp-lint. Now that vla-ggml consumes the shared runtime instead of building its own ggml, nothing in the repo requests the feature and no pipeline installs ROCm, so libqvac-ggml-hip.so ships in no prebuild and the HIP preference branch in vla's BackendSelection is unreachable. Move the request to the shared runtime so the backend ships once for every consumer. packages/fabric/CMakeLists.txt already stages GGML_AVAILABLE_BACKENDS MODULE targets into the prebuild and package.json already publishes prebuilds/*/qvac__fabric/**, so no build or packaging change is needed. - packages/fabric/vcpkg.json: request qvac-fabric[hip-backend] - prebuilds-fabric.yml: include-rocm: true for the linux-x64 cross-compile - on-pr-fabric.yml: include-rocm-sdk: true on cpp-lint, since ggml-config.cmake resolves find_dependency(hip/hipblas/rocblas) at configure time Refs tetherto#3998, QVAC-19291, QVAC-23995
jpgaribotti
force-pushed
the
feature/fabric-hip-backend
branch
from
August 25, 2026 13:33
1f8be81 to
28418ff
Compare
gianni-cor
previously approved these changes
Aug 25, 2026
GustavoA1604
previously approved these changes
Aug 25, 2026
iancris
reviewed
Aug 25, 2026
iancris
reviewed
Aug 25, 2026
The changelog and the prebuilds-fabric.yml comment claimed the build was fail-safe when no ROCm SDK is present. The hip port is the opposite by design: it hard-fails rather than installing empty, so the vcpkg binary cache cannot conflate a no-HIP build with a real HIP build under an identical ABI hash. Only the runtime fallback (DL loader skipping the module on non-AMD hosts) is fail-safe. Also document the resulting linux-x64 build prerequisite in the README, since the hip dependency is unconditional.
iancris
approved these changes
Aug 26, 2026
gianni-cor
approved these changes
Aug 26, 2026
GustavoA1604
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 What problem does this PR solve?
qvac-fabric[hip-backend]was requested per-consumer by@qvac/vla-ggml, which paired it withinclude-rocm: trueonprebuilds-vla.ymlandinclude-rocm-sdk: trueon itscpp-lintcall. That was correct while vla built its own ggml.#3998 migrates vla-ggml onto the shared
@qvac/fabricruntime and removes all three, but nothing on the fabric side picks the feature up:packages/fabric/vcpkg.jsondeclares onlyvk-profiling; it never requestship-backend.prebuilds-fabric.ymlpasses onlyartifact-name-prefixandinclude-vulkan-sdk: true;include-rocmdefaults tofalseinreusable-prebuilds.yml.on-pr-fabric.yml'scpp-lintcall passes noinclude-rocm-sdk.Net effect once #3998 lands:
include-rocm,include-rocm-sdkand.github/actions/setup-rocmhave zero callers repo-wide,libqvac-ggml-hip.sois built by no pipeline and ships in no prebuild, and the HIP-preference branch atpackages/vla-ggml/addon/src/utils/BackendSelection.cpp:132-148becomes unreachable —hipDevis always null andpickBestGpuDevice()falls through to Vulkan. This gives back the ~18% gfx1151 warm-path win from #2781 / #2971 (479 → 384 ms).Nothing turns red, because with no manifest requesting
hip-backendthehipport is never resolved at all — the regression is a silent omission from the prebuild, not a build error. The vla-side CI that would have surfaced it is removed in the same change.📝 How does it solve it?
Moves the request down to the shared runtime, so the backend ships once for every fabric consumer instead of per-addon.
packages/fabric/vcpkg.json— requestqvac-fabric[hip-backend].version>=is already10297.0.0, the same revision vla pinned for HIP. The port'shipdependency isplatform: "linux & x64"-gated, and vla requested the feature unqualified across all 9 prebuild targets onmain, so an unconditional request is proven safe on darwin/windows/android.packages/fabric/vcpkg-configuration.json—qvac-registry-vcpkgbaselinec57eec31→f04e2447, matching vla. Required, not cosmetic:qvac-fabric[hip-backend]depends onhipwith no version constraint, sohip's version comes from the pinned baseline, and thehipport does not exist atc57eec31. Nothing else this package selects moves —qvac-fabricandqvac-lint-cppare pinned above their baseline entries byversion>=,opencl/vcpkg-cmake/vcpkg-cmake-configare identical in both baselines, andspirv-headersresolves from the separately pinnedmicrosoft/vcpkgregistry. CI confirms the resolution:qvac-fabric[core,gpu-backends,hip-backend,llama]:x64-linux@10297.0.0andhip:x64-linux@7.13.0.prebuilds-fabric.yml—include-rocm: true, cross-compilinglibqvac-ggml-hip.so(gfx1151) into the linux-x64 prebuild. No AMD GPU on the runner. Covers both callers of this workflow (on-pr-fabric.ymlandon-merge-fabric.yml).on-pr-fabric.yml—include-rocm-sdk: trueon thecpp-lintcall. Easy to miss but mandatory:ggml-config.cmakeresolvesfind_dependency(hip/hipblas/rocblas)at configure time, which is exactly whyfec63dd21added this for vla.packages/fabric/NOTICE—hipattribution, so thenotice-driftcheck stays green.0.8.0→0.9.0, CHANGELOG entry, and README backend/platform/build notes.No build or packaging change is needed.
packages/fabric/CMakeLists.txt:70-87already walksGGML_AVAILABLE_BACKENDSand stagesMODULE_LIBRARY/SHARED_LIBRARYtargets viaadd_bare_module(qvac-fabric EXPORTS ...), andpackage.jsonfilesalready publishesprebuilds/*/qvac__fabric/**. Enabling the feature is sufficient for the.soto be staged and published.There is no
cpp-tests-fabric, andtest-fabric-stack-actions.ymlonly exercises the composite actions, so those are the only two CI touchpoints.The
hipport is deterministic, not build-time fail-safeWorth stating explicitly because it is the opposite of what you might assume, and an earlier revision of this description got it wrong. The port hard-errors when no ROCm SDK is present rather than installing empty, quoting its
portfile.cmake:Only the runtime path is fail-safe: the DL loader skips
libqvac-ggml-hip.soon non-AMD hosts and falls back to Vulkan/CPU. Consequences:packages/fabricfor linux-x64 now requires a ROCm/TheRock install, found viaROCM_PATHor/opt/rocm. Previously only vla-ggml developers needed one; this moves the requirement onto everyone who builds the shared runtime. Documented in the README build section. Other platforms are unaffected (linux & x64gate).include-rocm/include-rocm-sdkwill now fail rather than silently degrade. Both such call sites are updated here.🧪 How was it tested?
Full green CI on this exact commit via
workflow_dispatchon the branch — run 32878043355, success in 23m 7s, all 9 prebuild targets pluscpp-lint,sanity-checks,fabric-npm-consumer-smokeandmerge-guard.Downloaded the resulting
fabric-linux-x64artifact and inspected it:linux-x64/qvac__fabric/libqvac-ggml-hip.sois present — 67.0 MiB uncompressed, 11.6 MiB gzipped — besidelibqvac-ggml-vulkan.soand the 14 CPU variants.hipv4-amdgcn-amd-amdhsa--gfx1151, confirming the intended target and that it is not fattened with extra architectures.cpp-lintlogs showggml::ggml-hipamong the linkable targets.So the packaging cost is concrete: +11.6 MiB to the published tarball for every
@qvac/fabricconsumer, on linux-x64 only.Still needs hardware: runtime confirmation on a Strix Halo (gfx1151) host that
BackendSelectionlogspreferring HIP/ROCm GPU. Not reproducible in CI — the runners compile HIP but have no AMD GPU.Not verified byte-for-byte: that the other 8 targets are unchanged. Satisfied by construction instead — the
hipdependency isplatform: "linux & x64"-gated, so the feature contributes nothing off linux-x64, and all 8 built green.actionlintwas not run locally: it is not installed on this machine and the repo forbidscurl | bashinstallers. Thepolicy-testsjob insecurity-baseline.ymllints both edited workflows.on-pr-fabric.ymlis triggered bypull_request_target, which loads the workflow YAML from the base branch. Until this PR merges, the auto checks runmain's copies ofprebuilds-fabric.ymlandon-pr-fabric.yml— which do not passinclude-rocm/include-rocm-sdk— against this branch's source tree, which does requesthip-backend. Mismatched by construction.The two runs are a clean controlled experiment, same head SHA
aaaeca1:pull_request_targetworkflow_dispatchThe failing run's logs print the resolved inputs as
include-rocm: falseandinclude-rocm-sdk: falsewhile checking outaaaeca1, and the only jobs that fail are exactly the two this PR edits (cpp-lint,prebuild / linux-x64) plus themerge-guardaggregate.They fail in two different-looking ways, same root cause:
prebuild / linux-x64— vcpkg binary cache miss, so the portfile ran and hard-errored:hip port: no ROCm SDK found.cpp-lint— cache hit (hip:x64-linux@7.13.0restored in 197 ms, portfile never executed), so it failed later at consumer configure:CMake Error at build/_vcpkg/x64-linux/share/hip/hip-config.cmake:1 (include): /lib/cmake/hip/hip-config.cmake. The leading/is the port's relocatableinclude("$ENV{ROCM_PATH}/…")shim expanding an unsetROCM_PATHto empty. Noting it because a warm binary cache can disguise a missing SDK as a successfulhipinstall.Both resolve on merge, and for any PR branched off a
mainthat contains this change.🔌 API Changes
None.
@qvac/fabrichas no JS API; this only changes what ships inside the linux-x64 prebuild.Notes for reviewers
This is a cost/policy decision, not just a checkbox.
hip-backendwas opt-in per-consumer precisely so that only vla paid for it. With the runtime shared, that granularity is gone: every fabric consumer's linux-x64 prebuild carries the HIP module (+11.6 MiB compressed), every fabric linux-x64 build and lint needs ROCm on the runner, and — because the port is deterministic — so does every local linux-x64 build.Two alternatives were considered and rejected:
vk-profiling, withprebuilds-fabric.ymlpassing-D HIP_BACKEND=ON. Keeps local builds working without ROCm. Rejected to stay consistent with how vla-ggml already declares it, and to avoid a build configuration that CI exercises but developers do not.BackendSelection.cpp, fix thepackages/vla-ggml/CHANGELOG.mdclaim that HIP "is provided by@qvac/fabricwhen present in its prebuilds", and delete the now-callerlessinclude-rocm/include-rocm-sdkinputs and thesetup-rocmaction. This is the right change if the size or build cost is judged unacceptable.Merge ordering: independent of #3998 and safe to merge in either order. Merging this first means HIP is never absent from a published prebuild.
Raised from review of #3998.