Repository navigation
Conversation
lightx2v/__init__.py imports lightx2v_platform.set_ai_device before lightx2v/pipeline.py sets PYTORCH_CUDA_ALLOC_CONF. On amd_rocm the platform import pulls in aiter, which initializes the caching allocator, so expandable_segments was silently ignored and MiniMax-H3 OOMed on 32 GB GPUs. Signed-off-by: Sylvan Liu <Sylvan.Liu@amd.com>
This was referenced Oct 10, 2026
Author
|
@helloyongyang @gushiqiao @llmc-reviewer could you take a look, or point me to the right reviewer? This is a 6-line fix for #1593: on It is one of two ROCm prerequisites (with #1596) for the gfx1201 attention backends in #1598 / #1599 (integration plan: ROCm/aiter#6292). Happy to adjust anything. |
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.
Fixes #1593
lightx2v/pipeline.pysetsPYTORCH_CUDA_ALLOC_CONF=expandable_segments:Trueviasetdefault, butlightx2v/__init__.pyimportslightx2v_platform.set_ai_devicebeforepipeline.py. Some platformbackends initialize the CUDA/HIP caching allocator during that import (on
amd_rocm, importingaiterdoes), and after that the allocator no longer reads the variable. As a result
amd_rocmruns withoutexpandable segments, and MiniMax-H3 OOMs on 32 GB GPUs.
This PR applies the same
setdefaultat the top oflightx2v/__init__.py, before the platform import.The existing line in
pipeline.pyis unchanged. An explicitly exportedPYTORCH_CUDA_ALLOC_CONFstillwins. Platforms whose allocator does not read this variable are unaffected.
Test
is_expandableof the first segment afterimport lightx2v:amd_rocmFalse -> True;cudaTrue (unchanged).PLATFORM=amd_rocm,main:OOM at step 1 -> completes; 4 runs on 4 GPU pairs, 100.0-101.8 s/step (same as
PLATFORM=cuda).ruff check/ruff format --check(v0.11.0) clean.