[Bug]: PyTorch backend: LLM(batched_logits_processor=...) is accepted but the processor is never called
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 22/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Ambito
- backend, machine-learning
Direzione di ricerca
Start with the batched_logits_processor field on TorchLlmArgs and the point where the executor request is built, since the apply_batched_logits_processor flag is dropped there. Nothing under tensorrt_llm/_torch reads either name, so the processor has to be wired into the PyTorch sampling path. A linked open pull request (#21044) already targets this, so check it before starting. Done means the processor is called once per step and the example prints the forced Z token.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
System Info
- Tested on one NVIDIA L4 with
nvcr.io/nvidia/tensorrt-llm/release:1.4.0rc4(PyTorch backend), modelQwen/Qwen3-0.6B mainat a6d8944540 has the same code: nothing undertensorrt_llm/_torchreadsbatched_logits_processororapply_batched_logits_processor
Who can help?
No response
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
LLM(batched_logits_processor=...) and SamplingParams(apply_batched_logits_processor=True) are both accepted, but the processor is never called. TorchLlmArgs keeps the batched_logits_processor field, and the request flag is dropped when the executor request is built.
import sys
from transformers import AutoTokenizer
from tensorrt_llm import LLM, SamplingParams
from tensorrt_llm.sampling_params import BatchedLogitsProcessor
class ForceAll(BatchedLogitsProcessor):
def __init__(self, token_id): self.token_id = token_id
def __call__(self, req_ids, logits, token_ids, stream_ptr, client_ids):
print("batched processor called", req_ids, file=sys.stderr, flush=True)
for rows in logits:
rows[:] = float("-inf")
rows[..., self.token_id] = 0
z = AutoTokenizer.from_pretrained("Qwen/Qwen3-0.6B").encode("Z", add_special_tokens=False)[-1]
llm = LLM("Qwen/Qwen3-0.6B", batched_logits_processor=ForceAll(z))
g = dict(max_tokens=4, temperature=0.0)
print(repr(llm.generate("A B C", SamplingParams(**g)).outputs[0].text))
print(repr(llm.generate("A B C", SamplingParams(**g, apply_batched_logits_processor=True)).outputs[0].text))
Expected behavior
The second request is forced to the token for Z on every step, and batched processor called is printed once per step. Or, if the PyTorch backend does not support the batched processor, the LLM or the request is refused with an error.
actual behavior
Both requests return ' D E F G'. batched processor called is never printed and nothing reports that the processor was ignored.
additional notes
The batched processor was a feature of the removed TensorRT backend. The release notes still list it ("Added batched logits processor support"), and trtllm-serve names batched_logits_processor among the fields to set through the Python LLM API.
#21044 makes the PyTorch backend call it.
- 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