Repository navigation
[BUGFIX] Avoid CustomAllreduce when expandable_segments:True - #4560
jamesETsmith wants to merge 1 commit into
Conversation
…ly falling back to rccl
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
|
I don't think the CI error is related to my changes: |
|
@TennyWang1223 — two things here: one concrete, one that needs your judgement. 1. The new test cannot pass, and CI never ran it
The warning is emitted (through aiter's own handler, to stderr), but CI didn't catch it because The sibling assertion Fix: capture 2. Is disabling CustomAllreduce outright the right scope?This is the part I can't answer from the diff. Not everything CustomAllreduce IPC-exports comes from the PyTorch allocator:
The third row is already avoidable today: That leaves one buffer: the Whether that's worth doing is your call, and here's why I'm asking: vLLM turns on For the record, the diagnosis in the PR description is correct — fixing only the |
|
@zufayu |
|
@zufayu and @TennyWang1223, thanks for looking at the PR! IIUC, @TennyWang1223 will implement an alternative change to input pool and you'll merge that over this PR, is that correct? If this PR is still useful, I can update the tests according to @zufayu's suggestion, just lmk! |
|
@zufayu , @jamesETsmith |
Trying this now, thanks @TennyWang1223! |
|
@TennyWang1223 your PR looks good to me (I posted a comment on the PR here)! I'll leave this one open until yours is merged and then close it |
|
Closing this since #4621 has been merged. Thanks again for the review and follow up PR! |
Motivation
Fixes #4174.
AITER CustomAllreduce aborts during initialization when PyTorch uses
expandable_segments:True. PyTorch expandable-segment allocations use HIP virtual memory management and cannot be exported through AITER's classichipIpcGetMemHandlepath.The goal is to preserve correctness and avoid terminating TP workers. In this configuration, collectives fall back to RCCL instead of using CustomAllreduce.
Technical Details
Before initializing the classic HIP IPC transport, CustomAllreduce now checks whether PyTorch expandable segments are enabled.
The active setting is read from PyTorch's allocator snapshot, allowing programmatic allocator changes to be detected. Environment-variable parsing is used as a fallback and follows PyTorch's precedence:
PYTORCH_CUDA_ALLOC_CONFPYTORCH_HIP_ALLOC_CONFPYTORCH_ALLOC_CONFWhen expandable segments are enabled for the classic IPC transport, CustomAllreduce remains disabled and emits an actionable warning. Existing callers then use their RCCL fallback. AITER's VMM transport is unaffected.
Regression tests cover allocator snapshot detection, environment fallback, variable precedence, repeated settings, and disabled communicator behavior.
Test Plan
Test Result
pytest op_tests/test_custom_all_reduce_allocator.py -q: 8 passed on MI355X, Slurm job37581.ruff check aiter/dist/device_communicators/custom_all_reduce.py op_tests/test_custom_all_reduce_allocator.py: passed.black --check aiter/dist/device_communicators/custom_all_reduce.py op_tests/test_custom_all_reduce_allocator.py: passed.python3 -m py_compile aiter/dist/device_communicators/custom_all_reduce.py op_tests/test_custom_all_reduce_allocator.py: passed.git diff --check: passed.Submission Checklist