Repository navigation
Conversation
leejet
left a comment
There was a problem hiding this comment.
Thanks for the optimization. I think two lifecycle issues should be addressed before merging:
Reuse the hipBLASLt handle. Creating and destroying it for every GEMM adds allocation overhead, and hipblasLtDestroy() implicitly synchronizes the device. This introduces a synchronization point after every INT8 GEMM, including unsuccessful dispatch attempts. Please cache the handle in the backend context and release it during context teardown.
Initialize the fallback before graph capture. If warmup uses hipBLASLt exclusively, ctx.cublas_handle() remains uninitialized until the capture-time fallback. Depending on the ROCm configuration, creating that handle can itself initialize hipBLASLt and perform operations incompatible with capture. Please initialize and warm up the fallback outside capture, and test repeated execution of a pure INT8 graph on a fresh backend context.
The second issue is based on the initialization call chain; I haven’t reproduced it on HIP hardware.
Summary
Add an optional hipBLASLt dispatch path for HIP INT8 GEMM operations.
When the HIP backend is built with hipBLASLt, INT8 GEMM now tries the hipBLASLt heuristic path before falling back to the existing hipBLAS/cuBLAS-compatible implementation. Builds without hipBLASLt and non-HIP backends retain their existing behavior.
The path also declines dispatch while a HIP stream is being captured, because ROCm 10.1 hipBLASLt may submit work to the legacy stream during capture. The existing GEMM path remains responsible for captured graphs.
Validation
Tested on an AMD Radeon RX 9070 XT (gfx1201) with ROCm 10.1:
The implementation is limited to the HIP backend and is guarded by optional hipBLASLt detection in CMake.