[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
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- Python
- スター
- 3.6k
- フォーク
- 883
- 平均マージ
- 5日 37分
- マージ済み PR(30日)
- 72
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/TransformerEngine のほかの issue
-
[PyTorch] fp8_cs_quantize fake implementation returns a vector inverse scale instead of a scalar再び着手できるかも @sanjana658 が 21 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NVIDIA/TransformerEngine#3636 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
[Bug] Backend selection picks FA3 for training with head_dim_qk=192 / v_head_dim=128, but FA3 backward cannot run it再び着手できるかも @modelpath-dev が 55 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンattention
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
NVIDIA/TransformerEngine#3481 · コメント 4 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
NVIDIA/TransformerEngine#2189 · コメント 7 件 · リアクション 5 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
NVIDIA/TransformerEngine#3765 ·
メンテナーはふだん 2 日以内に返信
-
[PyTorch] NCCL EP handle cache reaches its 4096 limit with only one live EpBuffer under allocator address churn対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
NVIDIA/TransformerEngine#3742 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
NVIDIA/TransformerEngine の issue をすべて見る
似ている issue
-
app: scripts status: backlog type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
netbox-community/netbox-scripts#68 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
marin-community/marin#10765 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
flathub/com.unity.UnityHub#230 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
namespace operations
難易度 1/5 1時間未満 初心者へのやさしさ 63/100
EclipseFdn/open-vsx.org#14910 ·
メンテナーはふだん 1 日以内に返信