HipBlas gemm error
Hello,
I receive the below HipBlas gemm error on MI3001x node with ROCM-7.2.
<stdin>:4: UserWarning: bgemm_internal_cublaslt error: HIPBLAS_STATUS_INTERNAL_ERROR when calling hipblasLtMatmul with transpose_mat1 n transpose_mat2 n m 1024 n 1024 k 1024 lda 1024 ldb 1024 ldc 1024 abType 0 cType 0 computeType 2 scaleType 0. Will attempt to recover by calling cublas instead. (Triggered internally at /pytorch/aten/src/ATen/hip/HIPBlas.cpp:575.)
Traceback (most recent call last):
File "<stdin>", line 4, in <module>
torch.AcceleratorError: CUDA error: file not found
To reproduce, it is sufficient to run :
$ python - <<'PY'
import torch
a = torch.randn(1024, 1024, device="cuda", dtype=torch.float32)
b = torch.randn(1024, 1024, device="cuda", dtype=torch.float32)
c = a @ b
torch.cuda.synchronize()
print(c.shape, c.dtype, "matmul ok")
PY
Below is the version of my PyTorch and it is able to detect the GPU:
$ print(torch.__version__, "hip:", torch.version.hip)
2.11.0+rocm7.2 hip: 7.2.26015
$ python - <<'PY' import torch print(torch.cuda.get_device_name(0)) print(torch.cuda.get_device_properties(0)) PY AMD Instinct MI300X _CudaDeviceProperties(name='AMD Instinct MI300X', major=9, minor=4, gcnArchName='gfx942:sramecc+:xnack-', total_memory=196592MB, multi_processor_count=304, uuid=66383837-6633-3139-6366-313263636339, pci_bus_id=14, pci_device_id=0, pci_domain_id=0, L2_cache_size=4MB)
Furthermore, one more minor issue on MI3001x node is that safetensors package was unable to load checkpoints saved on /work1/ mount. Copying the files to node-local /tmp worked for me. This was not an issue on multi-GPU nodes like MI2508x or MI2104x.
I still could not find a workaround solution to the bgemm_internal_cublaslt error above. Help is appreciated, thanks1
Hi @selinyldrm.
Thanks for reporting this issue. I encountered this last night myself on the virtualized mi3001x nodes (no issue on the bare metal mi3008x nodes). I get the same error with both rocm/7.1.0 and rocm/7.2.0. I believe I understand why this is failing but I'll need to confirm.
In the meantime, the following workaround should help you avoid the error, but you'll need to make sure to the module-loaded ROCm version matches the PyTorch ROCm version:
$ export HIPBLASLT_TENSILE_LIBPATH=/opt/rocm-7.2.0/lib/hipblaslt/library
$ export ROCBLAS_TENSILE_LIBPATH=/opt/rocm-7.2.0/lib/rocblas/library
This points PyTorch to the node-local system versions of the TENSILE libraries rather than the ones within your Python environment that live on NSF-mounted file systems.
Please let me know if this workaround unblocks you.
-Tom
Hi Selin. This workaround should no longer be needed. Can you please confirm on your end?
Thanks, Tom
Closing this issue as resolved.
Sorry for the late response. Issue is fixed, thank you!