Add ROCM_EXPLICIT_CTX support to internode.cu#16
Open
avinashkethineedi wants to merge 1 commit into
Open
Conversation
- Convert ctx selection to 3-way: ROCM_EXPLICIT_CTX (rocshmem_ctx_array), default work-group ctx, ROCM_DISABLE_CTX fallback - Enable work-group ctx create/destroy for the default path in dispatch and combine - Guard combine ctx destroy with USE_ROCM to match its create
|
Hi @avinashkethineedi, @ahubbe-amd Thanks for your contribution. I noticed that there's a possibility for the user of DeepEP library to specify both
Minor: Probably |
avbokovoy
approved these changes
Jun 15, 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.
Motivation
The dispatch and combine kernels had a fixed RDMA context selection. This adds flag-driven selection so the same kernels can be built for explicit, work-group, or context-free modes, making it easier to tune performance and debug context issues.
Technical Details
ROCM_DISABLE_CTXvs.rocshmem_ctx_array) preprocessor branches in the dispatch and combine kernels with a 3-way selection:ROCM_EXPLICIT_CTX→ per-SM explicit context (rocshmem_ctx_array[sm_id])ctx)ROCM_DISABLE_CTX→ context-free shmem fallbackctxcreate/destroy (shmem_wg_ctx_create/shmem_wg_ctx_destroy) for the default path in bothdispatchandcombine.ctxdestroy withUSE_ROCMso it stays symmetric with its create, avoiding an undeclaredctxreference in non-ROCm builds.std::coutdebug block and the now-unused<iostream>include.Test Plan
ROCM_EXPLICIT_CTXenabled and ran the internode stress test for ~150 iterationsTest Result
Submission Checklist