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

Abierto
#23,246 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@JunkaiWang-TheoPhy ya está trabajando en esto.

Desde el 2/12/2026.

  • #23247 de @JunkaiWang-TheoPhy — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
python
Área
backend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
15.2k
Forks
3k
Merge medio
2 d 21 h
PR fusionados (30 d)
477

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NVIDIA/TensorRT-LLM

Todos los issues de NVIDIA/TensorRT-LLM

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.