Skip to content

[ROCm][Perf][Bugfix] Multi-stream perf improvements; rocprofiler fixes - #55099

Merged
ywang96 merged 7 commits into
vllm-project:mainfrom
ROCm:mawong/rocm_libs_update
Sep 9, 2026
Merged

ywang96 merged 7 commits into
vllm-project:mainfrom
ROCm:mawong/rocm_libs_update

Conversation

@mawong-amd

@mawong-amd mawong-amd commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Purpose

This PR does the following:

  1. Relocates the ROCR+CLR build to its separate stage, instead of being a prerequisite of the base stage. This allows ROCR+CLR updates to not invalidate + force rebuilds of all build stages. Downstream libraries currently only ever link against them dynamically, so this relocation is safe.

  2. Brings a backport of changes in rocr: Add device-resident ordering edges ROCm/rocm-systems#11212 to ROCm 7.2.4's ROCR+CLR, which resolves slow cross-stream dependencies in various workloads (primarily observed in multi-stream use cases, e.g. [Perf][ROCm] Dual-stream decode with hipgraphs #52033, [ROCm][Perf] Enable CSA multi-stream overlap for DeepSeek-V4 #51794, [ROCm] Enable shared-expert multi-stream overlap on ROCm #51117) and completes the fix series started in [Hardware][AMD][Perf][Bugfix] Update ROCr and clr in base image #53712 which only worked on certain stream events.

  3. Brings in the aforementioned multi-stream improvements into the ROCm 10.0 image as well.

  4. Update ROCR to contain a 7.2.4-specific backport of fix(rocr): release GWS queue in ReleaseResources to fix shutdown UAF ROCm/rocm-systems#6942. This resolves the issues previously reported in [ROCm] Work around DeepEP teardown SIGSEGV in MoE test harness #51174 and [ROCm][CI] Keep rocprofiler-sdk out of DeepEP HT MoE test workers #51173 (also occasionally seen during test teardown in some AMD CI jobs e.g. here), so those PRs are reverted as part of this change. Fixes [CI Failure]: tests/kernels/moe/test_deepep_moe.py SIGSEGV on ROCm, drop the two teardown workarounds once the image ships rocm-systems#6942 #51644.

  5. Sets the env var ROCPROFILER_QUEUE_INTERPOSITION=0 to avoid the hangs mentioned in [Bugfix][ROCm][Build] fix profiler hang due to queue interposition bug #54171. While most of them were resolved by said PR, a few remain in some profiling workloads.

Test Plan

Full AMD CI will run on the image built from this PR.

Test Result

There are no new regressions.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify mergify Bot added ci/build rocm Related to AMD ROCm labels Sep 3, 2026
@mergify mergify Bot added the bug Something isn't working label Sep 3, 2026
@github-project-automation github-project-automation Bot moved this to Todo in AMD Sep 3, 2026
@AndreasKaratzas AndreasKaratzas added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

@mawong-amd, CI is now available for this PR.

  • /ci run starts upstream CI; /amd-ci run starts AMD CI only.
  • /ci retry retries failed jobs in the CI build for the current PR head. If the current head has no CI build, it starts a new CI build for the current head containing only jobs that failed in the latest earlier CI build for this PR.
  • /amd-ci retry retries failed jobs in AMD CI for the current PR head. Use /amd-ci run when the current head has no AMD CI build.
  • /ci cancel cancels scheduled or running CI builds for this PR branch; /amd-ci cancel does the same for AMD CI only.

@mawong-amd

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87032 for commit 8df4f1675c78.

@mawong-amd

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87091 for commit 3c4d7d6479fd.

raise
finally:
torch.distributed.destroy_process_group()
if current_platform.is_rocm():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh is this fixed by your changes/the ROCr+CLR bump? awesome!

low_latency_mode = False
use_fp8_dispatch = False

if current_platform.is_rocm():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

&& git config --global user.email "you@example.com" && git config --global user.name "Your Name" \
&& if [ ! -f setup.py ]; then cd python; fi \
&& python3 setup.py bdist_wheel --dist-dir=dist \
&& MAX_JOBS=16 python3 setup.py bdist_wheel --dist-dir=dist \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop the MAX_JOBS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a race condition in Triton build which we hit somewhat often when we use the default MAX_JOBS (when unset it's defaulted to $(nproc) in Triton setup.py). It's related to the issue mentioned in triton-lang/triton#6718 but is not necessarily the same manifestation. They haven't bothered to fix it and honestly it's not a blocker for us -- Triton builds quickly by itself and if it's a cold build, the build time of the Triton stage is hidden by the long build time of the other stages it builds in parallel with.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point; I'd forgotten about this occasional error, LGTM

RUN --mount=type=bind,from=build_mori,src=/app/install/,target=/install \
cp /install/*.whl /app/debs

###

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry just to clarify, why'd we move this down here instead of up top before the other build stages? It's a minor nit I'd just prefer ROCm stuff to be before component libs

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some Docker build backends (not BuildKit though) invalidate all stages below when a change is made above it, even in a stage it doesn't depend on. Since the ROCR/CLR runtime builds are quick, it's pretty cheap if it's invalidated. And conversely, we don't want to invalidate expensive stages if we bump the runtime, because with the proper caching it should just be a <5 min build of the new ROCm base.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with this for now, I think we use buildkit by default across both CI and release pipelines and it'd be a little more organized to put it up top to track+remove it later once the fixes land in ROCm

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 8366fc6f-0934-4fc1-b3b6-f46b181b322d

📥 Commits

Reviewing files that changed from the base of the PR and between 0475b7b and 27fc2d3.

📒 Files selected for processing (1)
  • docker/Dockerfile.rocm_base

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

The ROCm image now uses a shared ROCm systems repository for runtime and profiler builds. Runtime installation moves to the final image stage. DeepEP workers use common exception teardown, and the ROCm profiler environment workaround is removed.

Changes

ROCm runtime and DeepEP integration

Layer / File(s) Summary
Shared ROCm systems build
docker/Dockerfile.rocm_base
Runtime and rocprofiler SDK builds use ROCM_SYSTEMS_REPO. The runtime commit and package set are updated. Triton builds use MAX_JOBS=16.
Runtime installation and image metadata
docker/Dockerfile.rocm_base
Runtime copying, library linking, and ldconfig move to final. The image sets ROCPROFILER_QUEUE_INTERPOSITION=0 and records the shared repository.
DeepEP worker teardown
tests/kernels/moe/parallel_utils.py, tests/kernels/moe/test_deepep_moe.py
Workers re-raise exceptions after process-group destruction. The ROCm profiler environment workaround is removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 27fc2

The ROCm image now uses the updated shared runtime build, installs it in the final image, and removes the DeepEP teardown workarounds. No concrete merge-blocking regression is identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The pull request implements issue #51644 by updating the ROCr source to include the upstream fix and removing both ROCm-specific DeepEP teardown workarounds. The remaining build and profiler changes s…
Out of Scope Changes check ✅ Passed The changes remain within the ROCm runtime, rocprofiler, container build, and DeepEP teardown scope described by the pull request and issue #51644. No unrelated code changes are evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Title check ✅ Passed The title clearly identifies the ROCm performance bugfixes and rocprofiler fixes that are central to the changeset.
Description check ✅ Passed The description directly explains the build-stage relocation, ROCr fixes, DeepEP workaround removal, profiler environment change, and planned AMD CI validation.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AndreasKaratzas

Copy link
Copy Markdown
Member

/ci run

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87141 for commit 0475b7b8b43a.

Rohan138 added a commit to Rohan138/vllm that referenced this pull request Sep 4, 2026
torch 2.12 attaches rocprofiler-sdk implicitly and its queue interposition
hangs at HSA teardown. Set ROCPROFILER_QUEUE_INTERPOSITION=0 in the final
image, matching the mitigation in vllm-project#55099 for Dockerfile.rocm_base. The ROCr/CLR
and rocprofiler-sdk source rebuilds from rocm_base are not ported: they target
ROCm 7.2.x and ROCm 10.0 already carries those fixes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Rohan Potdar <rohan.potdar@amd.com>
Rohan138 added a commit to Rohan138/vllm that referenced this pull request Sep 4, 2026
torch 2.12 attaches rocprofiler-sdk implicitly and its queue interposition
hangs at HSA teardown. Set ROCPROFILER_QUEUE_INTERPOSITION=0 in the final
image, matching the mitigation in vllm-project#55099 for Dockerfile.rocm_base. The ROCr/CLR
and rocprofiler-sdk source rebuilds from rocm_base are not ported: they target
ROCm 7.2.x and ROCm 10.0 already carries those fixes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Rohan Potdar <rohan.potdar@amd.com>
@mawong-amd

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87339 for commit 27fc2d399fcb.

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
vllm-project#51174)"

This reverts commit c2d8009.

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
…kers (vllm-project#51173)"

This reverts commit 65addac.

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
@mawong-amd
mawong-amd force-pushed the mawong/rocm_libs_update branch from 27fc2d3 to f00cd34 Compare September 8, 2026 02:44
@mawong-amd mawong-amd changed the title [Hardware][AMD][Bugfix] Relocate ROCR/CLR build + rocprofiler improvements [Hardware][AMD][Bugfix] Multi-stream perf improvements; rocprofiler fixes Sep 8, 2026
@mawong-amd mawong-amd changed the title [Hardware][AMD][Bugfix] Multi-stream perf improvements; rocprofiler fixes [ROCm][Perf][Bugfix] Multi-stream perf improvements; rocprofiler fixes Sep 8, 2026
@mawong-amd

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87617 for commit f00cd34c047c.

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
@mawong-amd

Copy link
Copy Markdown
Contributor Author

/ci run

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #87629 for commit 961c3d457d2a.

@AndreasKaratzas AndreasKaratzas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stamping for clarity -- all AMD failures here are pre-existing.

@ywang96
ywang96 merged commit bc8587f into vllm-project:main Sep 9, 2026
143 of 146 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in AMD Sep 9, 2026
@mawong-amd
mawong-amd deleted the mawong/rocm_libs_update branch September 9, 2026 10:41
ItsRoy69 pushed a commit to ItsRoy69/vllm that referenced this pull request Sep 10, 2026
vllm-project#55099)

Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
Signed-off-by: Jyotirmoy Roy <jyotirmoyroy649@gmail.com>
mawong-amd added a commit to ROCm/vllm that referenced this pull request Sep 14, 2026
…e baseline

Remove the ROCr + CLR source rebuild (build_rocm_runtime stage, final-stage
COPY/relink, and the ROCM_SYSTEMS_REPO/ROCM_RUNTIME_COMMIT ARGs) from the
rock base, runs the
stock TheRock ROCr/CLR runtimes. Baseline for comparing ROCm 10 with and
without the multi-stream runtime patches.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
mawong-amd added a commit to ROCm/vllm that referenced this pull request Sep 14, 2026
…e baseline

Remove the ROCr + CLR source rebuild (build_rocm_runtime stage, final-stage
COPY/relink, and the ROCM_SYSTEMS_REPO/ROCM_RUNTIME_COMMIT ARGs) from the
rock base so the image runs the stock TheRock ROCr/CLR runtimes. Baseline
for comparing ROCm 10 with and without the multi-stream runtime patches.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Matthew Wong <Matthew.Wong2@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci/build ready ONLY add when PR is ready to merge/full CI is needed rocm Related to AMD ROCm

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[CI Failure]: tests/kernels/moe/test_deepep_moe.py SIGSEGV on ROCm, drop the two teardown workarounds once the image ships rocm-systems#6942

4 participants