fp4_kernel_hopper.py uses tl.make_block_ptr, which is removed in Triton main (breaks NVFP4 fake quant)
メンテナーはふだん 2 日以内に返信
@kinjalpatel27 がすでに取り組んでいます。
2026年10月15日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 半日
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start in modelopt/torch/kernels/quantization/gemm/fp4_kernel_hopper.py at fp4_fake_quant_kernel, where the two tl.make_block_ptr calls for load and store are, and at fp4_fake_quant_block, the entry point the repro calls. The caller tensor_quant._dynamic_block_quantize_impl routes NVFP4 here when Triton is available and compute capability is at least 8.9, so DISABLE_TRITON_KERNEL is the only switch to note. Done when the repro call compiles under Triton 3.9 and the output matches the pre-change results on an earlier Triton.
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
modelopt/torch/kernels/quantization/gemm/fp4_kernel_hopper.py (fp4_fake_quant_kernel) uses tl.make_block_ptr for its load and store. Triton removed block pointers in triton-lang/triton#10833 ("[BC breaking][FRONTEND] Remove block pointer support"), after deprecating them in triton-lang/triton#9667. The Triton that ships with current PyTorch nightly (pytorch-triton 3.9.0+gitfc8d31a5) already includes this, so the kernel fails to compile:
triton.compiler.errors.CompilationError: at 24:18:
x_block_ptr = tl.make_block_ptr(
^
Block pointers have been removed in favor of the tensor descriptor API
tensor_quant._dynamic_block_quantize_impl routes NVFP4 fake quantization to this kernel whenever Triton is available and compute capability is >= 8.9, so NVFP4 quantization (e.g. mtq.NVFP4_DEFAULT_CFG) breaks on Hopper/Ada/Blackwell with Triton 3.9. The only bypass is the module constant DISABLE_TRITON_KERNEL = False, which isn't user-configurable. This is the only make_block_ptr usage in ModelOpt, and it's still present on main and 0.48.0rc0. Triton 3.8 (the latest stable release) is unaffected.
Steps/Code to reproduce bug
python -m venv venv && . venv/bin/activate
pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu130 # brings triton 3.9.0+gitfc8d31a5
pip install "nvidia-modelopt[hf]==0.47.0"
import torch
from modelopt.torch.kernels.quantization.gemm.fp4_kernel_hopper import fp4_fake_quant_block
x = torch.randn(128, 64, device="cuda", dtype=torch.float16)
fp4_fake_quant_block(x, x.abs().amax().float())
# triton.compiler.errors.CompilationError: ... Block pointers have been removed in favor of the tensor descriptor API
(Side note: plain pip install nvidia-modelopt==0.47.0 fails at import modelopt.torch with No module named 'requests' and then 'huggingface_hub'; both are imported unconditionally but only provided by the [hf] extra.)
Expected behavior
The NVFP4 fake-quant kernel compiles with current Triton. Replacing the two block pointers with plain pointer arithmetic and masks keeps it working on all Triton versions:
offs_m = row_start + tl.arange(0, TILE_M)
offs_n = col_start + tl.arange(0, TILE_N)
mask = (offs_m[:, None] < M) & (offs_n[None, :] < N)
tile = tl.load(x_ptr + offs_m[:, None] * stride_xm + offs_n[None, :] * stride_xn, mask=mask, other=0.0).to(tl.float32)
...
tl.store(y_ptr + offs_m[:, None] * stride_ym + offs_n[None, :] * stride_yn, tile_quant.to(OUT_DTYPE), mask=mask)
(or port to tl.make_tensor_descriptor).
System information
- Container used: none (fresh virtualenv)
- OS: Ubuntu
- CPU architecture: x86_64
- GPU: reproduced on RTX 3080 Ti; the error is raised by Triton's frontend while compiling, so it's GPU-independent
- Library versions:
- Python: 3.13
- ModelOpt: 0.47.0 (same code on
main/0.48.0rc0) - PyTorch: 2.16.0.dev20261014+cu130 (nightly)
- Triton: 3.9.0+gitfc8d31a5 (bundled with the nightly)
- CUDA: 13.0
- 主要言語
- Python
- スター
- 5.4k
- フォーク
- 767
- 平均マージ
- 3日 11時間
- マージ済み PR(30日)
- 203
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
NVIDIA/Model-Optimizer のほかの issue
-
[Bug] modelopt-mcp: all launcher subprocesses hang when the server runs as a stdio MCP server — missing stdin=DEVNULL対応中かも @ChenhanYu が 23 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NVIDIA/Model-Optimizer#2551 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 2 日以内に返信
-
Puzzletron Progress 6/8 (calculating one block scores) takes 10 to 20 times more than in tutorial再び着手できるかも @tejasng053 が 30 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
NVIDIA/Model-Optimizer#1667 ·
メンテナーはふだん 2 日以内に返信
-
feature request
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
NVIDIA/Model-Optimizer#2865 ·
メンテナーはふだん 2 日以内に返信
-
GGML fake-quant keeps stale codes after a bitsandbytes optimizer step, so QAT/QAD silently stops training the quantized weights対応中かも @dcaayushd が 7 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 54/100
NVIDIA/Model-Optimizer#2857 ·
メンテナーはふだん 2 日以内に返信
-
test_cast_fp4_impl_gpu_mem is flaky on Jetson Thor: mem_get_info reports system-wide memory on integrated GPUs対応中かも @LinCanNerd が 18 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
NVIDIA/Model-Optimizer#2706 ·
メンテナーはふだん 2 日以内に返信
NVIDIA/Model-Optimizer の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
nansencenter/geodataset#39 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
awslabs/visual-asset-management-system#804 ·
メンテナーはふだん 1 日以内に返信
-
follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
link-rot
難易度 1/5 1時間未満 初心者へのやさしさ 67/100