[Bug]: torch.ops.trtllm empty batch (batch_size=0) raises cudaErrorInvalidValue in rmsnorm, gated-act, and RoPE
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 56/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend, machine-learning
Direzione di ricerca
Start by locating the torch.ops.trtllm wrappers for the five named FlashInfer operations and tracing how they forward empty tensors to the CUDA launchers. Check the launch paths for zero-sized batches and the RoPE reshape described in the report. Done means all five operations return cleanly for the provided B=0 inputs while existing nonempty behavior remains intact; the issue names no source files or tests to run.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
System Info
- TensorRT-LLM:
1.3.0(torch.ops.trtllm, upstreammainchecked @546c48139181) - GPU: NVIDIA Tesla T4 (SM 7.5, 15360 MiB, driver
580.82.07) - PyTorch / CUDA:
2.14.1+cu130/ CUDA13.0 - OS / Python: Linux-6.6.159+-x86_64-with-glibc2.39, Python 3.12.3
Reproduction
import torch
import tensorrt_llm # registers torch.ops.trtllm
dt = torch.float16
cases = [
("flashinfer_rmsnorm", lambda: torch.ops.trtllm.flashinfer_rmsnorm(torch.empty(0, 64, device="cuda", dtype=dt), torch.ones(64, device="cuda", dtype=dt), 1e-6)),
("flashinfer_fused_add_rmsnorm", lambda: torch.ops.trtllm.flashinfer_fused_add_rmsnorm(torch.empty(0, 64, device="cuda", dtype=dt), torch.empty(0, 64, device="cuda", dtype=dt), torch.ones(64, device="cuda", dtype=dt), 1e-6)),
("flashinfer_silu_and_mul", lambda: torch.ops.trtllm.flashinfer_silu_and_mul(torch.empty(0, 128, device="cuda", dtype=dt))),
("flashinfer_gelu_tanh_and_mul", lambda: torch.ops.trtllm.flashinfer_gelu_tanh_and_mul(torch.empty(0, 128, device="cuda", dtype=dt))),
("flashinfer_apply_rope_with_cos_sin_cache_inplace", lambda: torch.ops.trtllm.flashinfer_apply_rope_with_cos_sin_cache_inplace(torch.empty(0, device="cuda", dtype=torch.int32), torch.empty(0, 128, device="cuda", dtype=dt), torch.empty(0, 128, device="cuda", dtype=dt), 64, torch.randn(16, 64, device="cuda", dtype=torch.float32), True)),
]
for name, fn in cases:
try:
fn(); torch.cuda.synchronize(); print(name, "OK")
except Exception as e:
print(name, "FAIL:", type(e).__name__, str(e).splitlines()[0])
Expected behavior
Passing a valid empty batch (B=0, numel() == 0) to any of these torch.ops.trtllm ops should return cleanly as a no-op (matching B=4 which succeeds on all 5 ops), rather than launching a CUDA kernel with gridDim.x = 0 or calling .view(0, -1, 64).
actual behavior
flashinfer_rmsnorm FAIL: RuntimeError Check failed: (status == cudaSuccess) is false: RMSNorm failed with error code invalid argument
flashinfer_fused_add_rmsnorm FAIL: RuntimeError Check failed: (status == cudaSuccess) is false: FusedAddRMSNorm failed with error code invalid argument
flashinfer_silu_and_mul FAIL: RuntimeError Check failed: (err == cudaSuccess) is false: Failed to launch kernel: invalid argument
flashinfer_gelu_tanh_and_mul FAIL: RuntimeError Check failed: (err == cudaSuccess) is false: Failed to launch kernel: invalid argument
flashinfer_apply_rope_with_cos_sin_cache_inplace FAIL: RuntimeError cannot reshape tensor of 0 elements into shape [0, -1, 64] because the unspecified dimension size -1 can be any value and is ambiguous
additional notes
Adding an early if (input.size(0) == 0) return ...; guard in the torch.ops.trtllm custom op wrappers before forwarding to the CUDA kernel launchers avoids cudaErrorInvalidValue on empty DP/PP microbatches.
Before submitting a new issue...
- Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
Credit given to UCSB PLSE.
- Lingua principale
- Python
- Stelle
- 15.2k
- Fork
- 3k
- Merge medio
- 2g 21h
- PR unite (30g)
- 477
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di NVIDIA/TensorRT-LLM
-
Bug: AttributeError: 'GptOssConfig' object has no attribute 'rope_scaling_factor' with transformers >= 5.xForse già presa @NimaVaziri l’ha presa oggi. ApertaPytorch
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA/TensorRT-LLM#23406 ·
I maintainer di solito rispondono entro 1 giorno
-
Inference runtime Windows
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
NVIDIA/TensorRT-LLM#23394 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: MMLU subsampling changes when evaluators are interleavedForse già presa @LeNeLeNeWo l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
NVIDIA/TensorRT-LLM#23273 ·
I maintainer di solito rispondono entro 1 giorno
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderForse già presa @sbeierle l’ha presa 3 giorni fa. ApertaTesting
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
NVIDIA/TensorRT-LLM#23077 ·
I maintainer di solito rispondono entro 1 giorno
-
LongBench V2 blog command breaks on inline comments after continuationsForse già presa @ddlw l’ha presa 25 giorni fa. ApertaDoc
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
NVIDIA/TensorRT-LLM#21879 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NVIDIA/TensorRT-LLM
Issue simili
-
[Resource]: SpaicelyApertaresource-submission validation-passed
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
hesreallyhim/awesome-claude-code#3875 · 1 commento ·
-
[Bug]: Ajax Pro login issueApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
bvis/aegis-hass#725 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
datasektionen/cashflow#468 ·
-
dont call alembic upgrade until we check whether or not the cache DB has an alembic version stampAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
#1643 unrecoverable split: 1 digest with a 403 — two earlier captures of the same URL are real 200sAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
Robin-IA/Congressional-Letters-Dev#1684 ·
I maintainer di solito rispondono entro 1 giorno