Repository navigation
[Feat] [AMD] multimodal: Enable feature IPC transport on ROCm - #33747
vincentzed wants to merge 2 commits into
Conversation
--mm-feature-transport=cuda_ipc only uses PyTorch CUDA-compatible APIs (torch.cuda, _share_cuda_), which dispatch to HIP IPC on a ROCm build, so accept it there instead of forcing image feature tensors through the CPU shared-memory transport. On MI325X the CPU SHM path cost 0.73 s of frontend wrapping for 128 concurrent image requests vs 0.02 s over HIP IPC; C32 image serving improved 27.8%. Single-node and multimodal-splitting guards unchanged; the public flag name stays cuda_ipc. The acceptance unit test restores os.environ (acceptance writes the legacy IPC env var) so it cannot leak into later tests.
The transport resolution moved from ServerArgs._handle_multimodal_feature_transport to arg_groups/serving_hook.handle_multimodal_feature_transport. Accept cuda_ipc on CUDA or HIP there. Tests use override_platform instead of patching server_args. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01KVPUFiK2bhzjErEnCMv26w
|
Closing this. Since it was written, #33949 moved the cuda_ipc pool onto the CUDA driver calls |
|
Reopening, I closed this too early. The change is still wanted, but it needs testing on AMD before it can merge. Since this was written, #33949 moved the cuda_ipc pool onto |
…_v0.5.21` (#54) * Merge main; port the cuda_ipc ROCm gate to serving_hook The transport resolution moved from ServerArgs._handle_multimodal_feature_transport to arg_groups/serving_hook.handle_multimodal_feature_transport. Accept cuda_ipc on CUDA or HIP there. Tests use override_platform instead of patching server_args. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01KVPUFiK2bhzjErEnCMv26w (cherry picked from commit 7453337) * [AMD] Complete stream-ordered multimodal IPC support on ROCm PR sgl-project#33747 opens the multimodal IPC gate on HIP, but the pool lifecycle introduced by sgl-project#33949 still calls the NVIDIA CUDA driver. Dispatch the ROCm ready/wait/ack words through small Triton kernels with system-scope acquire/release atomics. Keep the NVIDIA path unchanged. Native HIP stream wait crashed on peer IPC mappings in the tested ROCm build; the GPU kernel path preserves copy ordering and lease safety. Correct the inherited gate comment to describe this additional backend requirement and register IPC coverage for AMD. * support qwen3.5 fp8 ptpc model Signed-off-by: Xiake Sun <[email protected]> * Add Qwen3.5 + dflash support with cuda graph and target verify Signed-off-by: Xiake Sun <[email protected]> * Add evaluation guide and scripts Signed-off-by: Xiake Sun <[email protected]> * eval: update eval guide & scripts Signed-off-by: Xiake Sun <[email protected]> * Addess review comments Signed-off-by: Xiake Sun <[email protected]> * eval: update guide to enforce reinstall process Signed-off-by: Xiake Sun <[email protected]> * fix(qwen3.8 ple): release loader parameter references before FP8 postprocessing The self-referencing PLE shard loader forms a closure cycle that retains params_dict after weight loading. When FP8 postprocessing (fp8e4m3->fp8e4m3nuz) replaces the parameters, the dictionary keeps their original GPU storage alive until cyclic GC runs, causing Qwen3.8 BF16-PLE TP2 launches OOM. Clear params_dict before returning so obsolete weight storage can be released during postprocessing. Preserve PLE GPU residency, weight precision, and existing quantization behavior. Signed-off-by: Xiake Sun <[email protected]> * eval: add Qwen3.5 dflash model and eval guide Signed-off-by: Xiake Sun <[email protected]> --------- Signed-off-by: Xiake Sun <[email protected]> Co-authored-by: vincentzed <[email protected]> Co-authored-by: Claude Fable 5.1 <[email protected]>
…anch (#75) * [AMD] Allow multimodal CUDA IPC on ROCm in the Qwen3.8 branch Adapt 881b8ec to the existing ServerArgs handler and platform mocks; this branch predates serving_hook. Signed-off-by: Xiake Sun <[email protected]> * [AMD] Complete stream-ordered multimodal IPC support on ROCm PR sgl-project#33747 opens the multimodal IPC gate on HIP, but the pool lifecycle introduced by sgl-project#33949 still calls the NVIDIA CUDA driver. Dispatch the ROCm ready/wait/ack words through small Triton kernels with system-scope acquire/release atomics. Keep the NVIDIA path unchanged. Native HIP stream wait crashed on peer IPC mappings in the tested ROCm build; the GPU kernel path preserves copy ordering and lease safety. Correct the inherited gate comment to describe this additional backend requirement and register IPC coverage for AMD. Signed-off-by: Xiake Sun <[email protected]> * fix(multimodal): bound ROCm IPC waits with server watchdog timeout - Reuse --watchdog-timeout for stream-ordered ROCm IPC readiness waits. - Track GPU completion independently of scheduler batch activity. - Log wait diagnostics and terminate consumers on timeout or query failure. - Preserve supervision after event-record failures and reject graph capture. - Add timeout and cached/uncached peer-IPC tests with two-GPU AMD CI. Signed-off-by: Xiake Sun <[email protected]> * eval: enable cuda_ipc for qwen3.8 by default Signed-off-by: Xiake Sun <[email protected]> --------- Signed-off-by: Xiake Sun <[email protected]>
|
Thanks @vincentzed. Closing this because you have 7 PRs open and none updated in 7 days, over our soft cap of 5 for idle PRs. Reopen the two or three you most want reviewed - a short active set moves faster than a long idle one. Some directories moved recently, so an older branch may need retargeting: |
Motivation
--mm-feature-transport=cuda_ipcwas rejected on ROCm even though the implementation only uses PyTorch's CUDA-compatible APIs (torch.cuda,_share_cuda_), which dispatch to HIP IPC in a ROCm build. That forced every image feature tensor through the CPU shared-memory transport. On MI325X, a paired frontend profile attributed 0.73 s towrap_shm_features/_wrap_shm_or_inlinefor 128 concurrent image requests; HIP IPC wrapping is 0.02 s (−97.3%).Modifications
cuda_ipcon CUDA or ROCm/HIP in_handle_multimodal_feature_transport. The single-node and multimodal-splitting guards are unchanged, and the public flag name stayscuda_ipc.patch.dict— acceptance writes the legacy IPC env var and must not leak into later tests) and an explicit rejection test for non-CUDA-like platforms.Accuracy Tests
MI325X, Torch 2.9.1 + ROCm 7.2, BF16 (
HSA_ENABLE_IPC_MODE_LEGACY=1):test/registered/unit/server_args/test_server_args.pypasses; cross-processtest_cuda_ipc_transport.pypasses.torch.testing.assert_close) with exactly one cached pool handle.Speed Tests and Profiling
Single-image serving workload (512×512, 268 input / 32 output tokens, 512 prompts, 1 warmup + 3 measured runs, one MI325X):
Checklist
CI States
Latest PR Test (Base): ❌ Run #39094939664
Latest PR Test (Extra): ❌ Run #39094939726
Latest PR Test (AMD ROCm 10): ❌ Run #39094939657