Conversation
- Guard ROCm platform detection with torch.cuda.is_available() so a HIP build without a visible GPU falls back to CPU like the CUDA check - Implement device_count/is_accelerator_available/current_device on CudaPlatform and RocmPlatform, completing the BasePlatform contract already consumed by ray_worker and pipeline_service - Add wan21_1_3b_text_to_video_rocm.py: TORCH_SDPA attention, eager execution, T5 CPU offload with non-pinned memory, 2-tile VAE decode geometry, and CLIP stage disabled for T2V; validated single-GPU on a Radeon RX 9070 (gfx1201, ROCm 7.2) - Add a hardware platforms doc page (en/zh) covering platform selection order, capability matrix, and per-platform attention backends with RCCL noted as the collectives library behind the nccl backend on ROCm; cross-link from installation/ops/attention docs and register the page in the mkdocs nav - Document the ROCm example in examples/wan_video/README.md and ignore the local model_zoo/ checkpoint directory Verification: 13 new unit tests (platform dispatch and example config) pass; pre-commit passes on all touched files; docs site build passes with rendered page, asset, and anchor validation; preview server rendered the new en/zh pages with correct titles.
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.
Description
Adds first-class AMD ROCm support to TeleFuser: platform-layer detection fixes and interface completion, a validated
Wan2.1 1.3B text-to-video example for ROCm hosts (
wan21_1_3b_text_to_video_rocm.py), unit tests, and a newhardware-platforms documentation page (en/zh) that consolidates per-platform capabilities previously scattered across
installation/ops/attention docs.
Motivation
+rocm) PyTorch build without a visible GPU was misdetected as a ROCm platform; a HIP build also setstorch.cuda.is_available()toTrue, so the CUDA path could never be distinguished correctly.BasePlatformdeclaresdevice_count/is_accelerator_available/current_deviceand existing callers(
worker/ray_worker.py,service/core/pipeline_service.py) already use them, butCudaPlatformandRocmPlatformraisedNotImplementedError— any CUDA/ROCm process reaching those call sites crashed.new example needed a single authoritative reference. RCCL is now correctly documented as the collectives library
behind the
ncclbackend string on ROCm.Type of Change
Changes Made
telefuser/platforms/__init__.py:_is_rocm_available()now additionally requirestorch.cuda.is_available(),so a HIP build without a visible GPU falls back to CPU symmetrically with the CUDA check.
telefuser/platforms/cuda.py,telefuser/platforms/rocm.py: implementdevice_count(),is_accelerator_available(), andcurrent_device()per the existingBasePlatformcontract (mirrors theNPUPlatformimplementations; no behavior change on healthy CUDA hosts).examples/wan_video/wan21_1_3b_text_to_video_rocm.py: Wan2.1 1.3B T2V on ROCm using the official checkpointlayout —
TORCH_SDPAattention (no flash-attn / SageAttention / tf-kernel), eager execution (compile notvalidated on ROCm), T5 encoder CPU offload with non-pinned host copies for a 16GB host budget, 2-tile VAE decode
geometry, CLIP stage disabled for T2V. Multi-GPU branches reuse the
_h100.pyparallel configuration (not yetvalidated on ROCm).
tests/unit/platforms/test_rocm_platform.py(platform resolution order, visible-GPU fallback, delegation,interface completeness) and
tests/unit/pipelines/wan_video/test_rocm_example.py(example defaults, VAE tilegeometry, official-layout loading, config assertions).
docs/en/platforms.md+docs/zh/platforms.md(platform selection order, capability matrix, per-platformattention backends, RCCL note); trimmed cross-references in installation/ops/attention docs (en/zh); registered
under Runtime & Optimization in
mkdocs.ymlwith zh nav translation; documented the example inexamples/wan_video/README.mdwith measured performance notes; ignore localmodel_zoo/checkpoints.Testing
pytest tests/) — focused selection: 13 new tests pass (full suite not run in thisenvironment; GPU-marked tests skip via existing markers on CPU-only hosts)
measured numbers recorded in
examples/wan_video/README.mdbenchmark harness changes
Test commands:
Checklist
ruff)pre-commit run --all-files— verified on all files changed by this PR)pytest tests/— new and affected unit tests; full suite requires GPU hardware)[TYPE] Brief descriptionRelated Issues
Fixes #
Additional Notes
enable_clip_stage = False(T2V loads no CLIP weights; the_h100.pybaseline leaves it
True) — flagged here as a deliberate deviation from the baseline example.introduced; the new platform methods complete an existing
BasePlatformcontract with existing callers.prepare_cookbook.py serveserves the.build/docscopy; re-runprepareafter editingdocs/sources.GPU Architecture Support
No kernels added or modified (
tf-kerneluntouched; ROCm uses Tritonforward_cudapaths and PyTorch-nativefallbacks via the existing ops dispatch).
Performance Impact
Measured on Radeon RX 9070 (gfx1201, ROCm 7.2, 832x480, 81 frames), recorded in the example README:
VRAM
torch.compile,TunableOp, and MIOpen fused attention measured slower or unsupported on this GPU
NotImplementedErrorstubs with correctimplementations