[Common] A TE built against cuBLAS ≥ 13.3 fails to import once an older cuBLASLt is loaded, so the runtime grouped-GEMM version check never runs
Maintainer thường phản hồi trong vòng 2 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, machine-learning
Hướng nghiên cứu
Start with common/gemm/cublaslt_grouped_gemm.cu, common/CMakeLists.txt, and the library loading path in _load_core_library(); compare how their symbol binding interacts with the runtime guard in pytorch/module/grouped_linear.py. Reproduce the import order with torch loaded first and CUDA_VISIBLE_DEVICES="". Done when import no longer fails with an undefined grouped GEMM symbol and the existing unsupported-version error path remains reachable.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
If TE is built against cuBLAS ≥ 13.3 and an older cuBLASLt is already loaded, import transformer_engine fails with an undefined grouped GEMM symbol. Because of that failure, the runtime cuBLASLt version check in GroupedLinear never gets a chance to run.
To reproduce:
- Build TE from source against a CUDA 13.2 or 13.3 toolkit, whose cuBLAS is 13.4.0.1 or 13.6.0.2.
- Install it into an environment whose PyTorch wheel brings an older cuBLASLt. For example,
torch 2.14.1+cu130depends onnvidia-cublas 13.1.1.3. - Import
torchfirst, then TE:
import torch
import transformer_engine.pytorch
OSError: .../transformer_engine/libtransformer_engine.so: undefined symbol:
cublasLtGroupedMatrixLayoutInit_internal, version libcublasLt.so.13
Importing transformer_engine.pytorch before torch works, because libcublasLt.so.13 then resolves to the toolkit copy. No GPU is needed: CUDA_VISIBLE_DEVICES="" reproduces it. I reproduced it on main fac8d4a9 on aarch64 (GH200 host, CUDA 13.2) and on x86_64 (L40S host, CUDA 13.3). Several users report the same error in the comments of #2504.
Why it happens
libtransformer_engine.solinkslibcublasLt.so.13by soname. The grouped GEMM path (common/gemm/cublaslt_grouped_gemm.cu) calls symbols that exist only in cuBLAS ≥ 13.3. If PyTorch has already loaded its cuBLASLt 13.1 under the same soname, TE'sDT_NEEDEDentry reuses that library.- The references are ordinary PLT (
JUMP_SLOT) relocations, so lazy binding would defer them until the first call._load_core_library()asks for lazy binding withos.RTLD_LAZY, which was added in #3127. Before #3127 the loader passed onlyRTLD_GLOBAL, and ctypes then binds eagerly. That matches the dates of the #2504 reports (April–May 2026). - Since #3383, the library is also linked with
-z now(LINKER:-z,nowincommon/CMakeLists.txt;readelf -dshowsFLAGS BIND_NOWandFLAGS_1 NOW). This forces eager binding whatever flag the loader passes, soos.RTLD_LAZYno longer has any effect. - As a result, the runtime guard in
pytorch/module/grouped_linear.py(get_cublasLt_version() < 130300, and< 130400below sm_100) can never run.
A toy library with one unresolved PLT call, loaded through ctypes.CDLL with glibc, shows the three cases:
| Library | RTLD_GLOBAL |
RTLD_GLOBAL | os.RTLD_LAZY |
|---|---|---|
| default link | undefined symbol |
loads |
-Wl,-z,now |
undefined symbol |
undefined symbol |
Loading the toolkit's libcublasLt.so.13 with ctypes.CDLL(..., RTLD_GLOBAL) after import torch makes the import succeed. However, that leaves two cuBLASLt copies in the process, so I don't think it is a fix.
Possible directions (I'm happy to help with whichever you prefer)
- Resolve the grouped GEMM cuBLASLt entry points with
dlsymat first use, the way #3434 did for NCCL EP. This works with any link flags. If the symbols are missing, use the existing "requires cuBLAS 13.3+" error path. - Before loading
libtransformer_engine.so, comparecublasLtGetVersion()of the cuBLASLt already in the process with the version TE was built against, and raise a clear error that names both versions and the import-order workaround. The build-time version would have to be recorded outside the library (for example, in the package metadata), becauseget_cublasLt_build_version()is only reachable after the load.
Environment
- TE main
fac8d4a9, built withNVTE_FRAMEWORK=pytorch NVTE_WITH_NCCL_EP=0 - torch 2.14.1+cu130 (
nvidia-cublas 13.1.1.3) - GH200 host: CUDA 13.2 toolkit (cuBLAS 13.4.0.1), aarch64
- L40S host: CUDA 13.3 toolkit (cuBLAS 13.6.0.2), x86_64
- Ngôn ngữ chính
- Python
- Star
- 3.6k
- Fork
- 883
- Merge trung bình
- 4 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 71
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/TransformerEngine
-
[PyTorch] fp8_cs_quantize fake implementation returns a vector inverse scale instead of a scalarCó thể làm lại được @sanjana658 đã nhận 21 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
NVIDIA/TransformerEngine#3636 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Bug] Backend selection picks FA3 for training with head_dim_qk=192 / v_head_dim=128, but FA3 backward cannot run itCó thể làm lại được @modelpath-dev đã nhận 55 ngày trước và không có pull request nào đang mở. Đang mởattention
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
NVIDIA/TransformerEngine#3481 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Increase MAX_TENSOR_NUMĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
NVIDIA/TransformerEngine#2189 · 7 bình luận · 5 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`DotProductAttention` with `fp8_dpa=True` does not update its backward scales when no Linear-family module is in the autocast region, and dQ/dK lose most of their normCó thể đã có người làm @sha7doww đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
NVIDIA/TransformerEngine#3778 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
[Performance] FusedAdam capturable kernel is ~1.9x slower than regular Adam on GB300Có thể đã có người làm @ksivaman đã nhận hôm nay. Đang mở
NVIDIA/TransformerEngine#3777 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của NVIDIA/TransformerEngine
Issue tương tự
-
Support .aac audio uploadsCó thể đã có người làm @julien731 đã nhận hôm nay. Đang mởfeature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
nimblehq/audio-transcriber#153 ·
-
help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
antonyrag/ragleap-core#1062 ·
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
gke-labs/kube-agents#4321 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Git-Hospital/githealthcheck#61 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
changelog investigate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ramnes/notion-sdk-py#433 ·