Optimize inference on Strix Halo - #201
Conversation
Expand framework HIP fast-path support for FastPackedProjection4Module and ConvTranspose1d to accept HIP as a CUDA-family backend. Add opt-in gfx1151 decoder graph reuse on rocBLAS for Strix Halo, restore retained graph inputs before execution, and add fast-path unit tests.
b7632b3 to
e3bb9f5
Compare
|
@fedeizzo Thanks for the update. The overall direction looks good, but I found a few things that should be fixed before merge.
I'll test Qwen3-related changes later. Update: The Qwen3-related changes in this PR look safe based on my tests. |
- Fix CMakeLists.txt build failure by removing dangling reference to test_qwen3_tts_options_config.cpp. - Restore Metal eligibility in is_conv_transpose1d_col2im_fast_path_eligible while keeping FastPackedProjection4Module restricted to CUDA/HIP. - Rename uses_ggml_cuda_family_backend to uses_ggml_cuda_or_hip_backend for explicit naming clarity.
|
@0xShug0 done 👍 |
|
@fedeizzo Thanks! I'm just waiting for the Nix CPU check. It keeps failing... Update: Merged! |
Originated from #170
What does this PR do?
.devops/nix/package.nix,flake.nix,CMakeLists.txt: add an opt-inrocm-gfx1151build andENGINE_HIP_STRIX_HALO_OPTIMIZATIONSCMake option.package.nixautomatically deducesstrixHaloOptimizationswhenrocmGpuTargets == [ "gfx1151" ]. It enables the Strix Halo path only for HIP with CUDA-family fast paths and rocBLAS, keeping rocBLAS because hipBLASLt regressed latency on this hardware.include/engine/framework/core/module.h,src/framework/modules/{conv_modules.cpp,optimizations/fast_projection_modules.cpp}: updateuses_ggml_cuda_family_backendto allow HIP to use the verified GGML CUDA-familyConvTranspose1dcol2im and packed-projection fast paths used by Qwen3-TTS, Higgs-Audio-TTS, Confucius4-TTS, and Irodori-TTS. Other backends keep their existing behavior.include/engine/models/qwen3_tts/tokenizer_speech_decoder.h,src/models/qwen3_tts/tokenizer_speech_decoder.cpp: retain common speech decoder graphs on Strix Halo HIP builds, addupload_static_inputs()to restore static inputs (positions_andmask_) prior to replaying retained graphs, and remove redundant backend synchronizations after graph execution.tests/unittests/test_conv_transpose_fast_path.cpp,tests/unittests/test_qwen_decoder_packed_projections.cpp: add HIP fast-path classification, parity execution, and backend rejection unit tests.All Strix-specific behavior is disabled by default. Generic CPU, CUDA, Vulkan, Metal, and generic HIP builds retain their current defaults.
Motivation
Qwen3-TTS repeatedly rebuilt stable decoder graphs on Strix Halo, adding graph construction overhead and variable compute latency. Reusing those graphs removes graph construction overhead and stabilizes speech decoder execution, but reuse is only correct when static graph inputs (positions and attention masks) are restored before every graph replay.
Additionally, expanding
uses_ggml_cuda_family_backendallows HIP devices to share the verified CUDA col2im transposed convolution and packed projection fast paths across multiple model architectures (Qwen3-TTS,Higgs-Audio-TTS,Confucius4-TTS,Irodori-TTS).Gains
Empirical performance and numerical parity results on AMD Radeon 8060S Graphics (Strix Halo
gfx1151, 128 GB VRAM):gfx1151Fast Path)ConvTranspose1dcol2im block4.65e-9)FastPackedProjection4Moduleok)Qwen3-TTSSpeech DecoderHiggs-Audio-TTS(4B Model)All unit tests and end-to-end multi-model inference runs (
Qwen3-TTSandHiggs-Audio-TTS) produced clean audio output with floating-point parity down to float epsilon (~4.65e-9).How to use it
Use the specialized Nix development shell:
nix develop .#rocm-gfx1151Or configure manually:
cmake -S . -B build/rocm-gfx1151 -G Ninja \ -DCMAKE_BUILD_TYPE=Release \ -DENGINE_ENABLE_HIP=ON \ -DGPU_TARGETS=gfx1151 \ -DENGINE_HIP_STRIX_HALO_OPTIMIZATIONS=ON cmake --build build/rocm-gfx1151 --parallelRun
audiocpp_clinormally with the HIP backend. The decoder cache activates automatically for the specialized build when the runtime backend is HIP.For generic ROCm behavior, use
nix develop .#rocmor leaveENGINE_HIP_STRIX_HALO_OPTIMIZATIONS=OFF.AI usage disclosure
AI was used for the following purposes:
AI was NOT used for the following purposes: