[Bug]: VisualGen benchmark crashes on plain prompts that are valid JSON

Aperta
#23,246 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@JunkaiWang-TheoPhy ci sta già lavorando.

Dal 2/12/2026.

  • #23247 di @JunkaiWang-TheoPhy — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Start with tensorrt_llm/bench/benchmark/visual_gen_utils.py and inspect load_visual_gen_prompts, which the issue names and reproduces without starting the engine. Check the related prompt loading tests, if present, for plain text and JSONL object cases. Done means the documented plain-text prompt 2026 loads literally, while JSONL objects with text or prompt still extract those fields; pull request #23247 is already open.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

VisualGen
System Info

Reproduced on TensorRT-LLM main ef375f87565b89a5818e705c735ec59a182efb86 with Python 3.12 on macOS ARM64. The prompt loader only needs CPU; the local test bypassed unrelated native package initialization. No GPU, model weights, or inference were used.

Reproduction

The offline trtllm-bench visual-gen command documents --prompt_file as accepting one plain-text prompt per line. A plain prompt such as 2026 causes loading to fail. The production loader can be reproduced without starting the engine:

from pathlib import Path
from tempfile import TemporaryDirectory

from tensorrt_llm.bench.benchmark.visual_gen_utils import load_visual_gen_prompts

with TemporaryDirectory() as tmp:
    prompts = Path(tmp) / "prompts.txt"
    prompts.write_text("2026\n", encoding="utf-8")
    requests = load_visual_gen_prompts(None, str(prompts), num_prompts=1)
    assert [request.prompt for request in requests] == ["2026"]
Expected behavior

Load the line as the literal text prompt 2026. JSONL objects containing text or prompt should still extract those fields.

Actual behavior

Loading raises AttributeError: 'int' object has no attribute 'get'. The same failure occurs for a plain-text line that is a valid JSON null, quoted string, or array. As a result, the benchmark never begins.

Additional notes

The loader uses json.loads to support JSONL, then assumes that any decoded value is an object. The empty-file fix in #17733 handles a different path after prompt extraction. Searches for the loader name and this prompt-file error did not find an equivalent fix.

OpenAI Codex assisted with the reproduction.

Lingua principale
Python
Stelle
15.2k
Fork
3k
Merge medio
2g 21h
PR unite (30g)
477

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NVIDIA/TensorRT-LLM

Tutte le issue di NVIDIA/TensorRT-LLM

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.