Repository navigation
serve: a rejected IREE_HAL_AMDGPU_LIBHSA_PATH does not reach the backend either (follow-up to #3323, engine#3314) - #3326
Merged
Conversation
…end either (follow-up to #3323, engine#3314) #3323 made serve refuse a user value that is not the absolute path of a libhsa-runtime64.so* file and log "is not used", then name the runtime it fell back to. The value was still inherited by every child: serve passes its choice as merge_env's env_extra, which an inherited variable beats, so the backend opened the rejected file while the log named another. --print-backend-env had the same hole (it prints a variable only when serve's environment does not have it). serve now drops a rejected value from its own environment at startup, in every mode, so the launch paths' value is the one a backend gets and the plan prints it. tests/hrx_runtime_route.sh: for each rejected value the backend gets the runtime the log names (fails on main, 4 rows), and the --print-backend-env plan under a rejected value equals the plan with no user value. Co-Authored-By: Claude Opus 5.5 <[email protected]>
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
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.
Follow-up to #3323 (engine#3314), for the defect raised in my review there before it merged.
#3323 rejects a user
IREE_HAL_AMDGPU_LIBHSA_PATHthat is not the absolute path of an existinglibhsa-runtime64.so*. In that case it logs…is not usedand names the runtime it falls back to. But the rejected value was still inherited by every child: the launch paths pass serve's choice asmerge_env'senv_extra(serve.cpp:1460/1698/1951/2253), and an inherited variable wins overenv_extra. So the backend opened the rejected file while the log named a different one.--print-backend-envhad the same hole, because it prints a variable only when serve's own environment doesn't have it.Change (
app/serve.cpp, +11): at startup, in every mode, when the variable is non-empty,--hrx-libhsais not set, anduser_libhsa()rejects the value, serve removes it from its own environment (unsetenv;_putenv_s(…, "")on Windows). From then on the launch paths' value is the one a backend gets, and the plan prints it. A valid user value and--hrx-libhsabehave exactly as before.Tests (
tests/hrx_runtime_route.sh; no new file, so no ctest row and no new skip)IREE_HAL_AMDGPU_LIBHSA_PATHequals the runtime serve's log names. That is the build copy, the/opt/rocm-therockscan, or none; which one depends on the machine, so the row compares against the log rather than a fixed path.--print-backend-envwith a rejected value prints the same runtime line as with no user value.Measured on ryzen (CI-style build:
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release, gcc-16, targetonebit)serve.cpp:hrx_runtime_route.shgives 22 ok, 4 FAIL (the four new backend rows).ctest -R 'hrx_runtime_route|hrx_cwsr_route|laya_gguf_route|recipes_route|print_backend|lemonade_hrx|mem_admit_route': 7/7 pass.bash scripts/pre-pr-checks.sh --base origin/main: 18 green, 2 skipped (the gpu-kernels audits).Caveat: this build machine has no TheRock runtime, so serve's fallback here is "none". The plan row therefore compares two empty plans on ryzen; it only bites on a machine where a runtime is found. The four backend rows fail on main either way. Not run on hardware; the change is in environment handling only.
🤖 Generated with Claude Code