[Bug]: AutoTuner load_cache crashes on a non-string tactic entry: warning_once(key=<list>) raises TypeError: unhashable type
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
Línea de trabajo
Empieza en tensorrt_llm/_torch/autotuner.py, en _deserialize_cache_data, donde la advertencia pasa el valor raw de tactic como clave. Lee Logger.log_once en tensorrt_llm/logger.py para confirmar que la clave debe ser hashable y luego comprueba si ya existen pruebas de deserialización de AutoTuner. Se considera terminado cuando se omiten las entradas de tactic que sean listas o diccionarios con la advertencia prevista y el resto de la caché todavía puede cargarse.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
System info
- TensorRT-LLM
mainat f65df75fcd (tensorrt_llm/version.py: 1.4.0rc3). The code path is unchanged since #9835. - Pure Python logic, independent of GPU and driver. Reproduced with Python 3.12.
Reproduction
Load an AutoTuner cache file in which one entry's "tactic" is not a string, for example a list or a dict. A cache written before #9835 stored the raw tactic ("tactic": tactic), so a list tactic is what an old-format or hand-merged cache contains:
{"<shared key>": {"('op', 0, ((16, 128),))": {"runner_id": 0, "tactic": [1, 2], "min_time": 0.1}}}
The same thing happens when calling _deserialize_cache_data directly with that entry.
Expected
The entry is skipped with the "Could not deserialize tactic ... skipping entry" warning, as the comment above that except intends ("so one bad entry can't crash the whole load").
Actual
ast.literal_eval raises on the non-string value, and the handler then raises while logging the warning, so load_cache logs Failed to load cache with JSON and re-raises:
Traceback (most recent call last):
File "tensorrt_llm/_torch/autotuner.py", line 872, in _deserialize_cache_data
tactic = ast.literal_eval(value["tactic"])
...
ValueError: malformed node or string: [1, 2]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "tensorrt_llm/_torch/autotuner.py", line 879, in _deserialize_cache_data
logger.warning_once(
File "tensorrt_llm/logger.py", line 343, in warning_once
self.log_once(self.WARNING, *msg, key=key)
File "tensorrt_llm/logger.py", line 320, in log_once
if key not in self._appeared_keys:
TypeError: unhashable type: 'list'
A dict tactic fails the same way (unhashable type: 'dict').
Location
tensorrt_llm/_torch/autotuner.py, _deserialize_cache_data (line 879 on f65df75fcd):
logger.warning_once(
f"[AutoTuner] Could not deserialize tactic: {value['tactic']} for cache key {key_str}; skipping entry.",
key=value["tactic"])
Logger.log_once stores key in a set, so the key must be hashable. The raw JSON value is not hashable when it is a list or a dict.
Suggested fix
Use a hashable key, for example key=("autotuner_deserialize_tactic", repr(value["tactic"])). The serialize-side warning_once(..., key=tactic_str) is already a string and is fine.
- Lenguaje dominante
- Python
- Estrellas
- 15.1k
- Forks
- 3k
- Merge medio
- 3 d 1 h
- PR fusionados (30 d)
- 474
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de NVIDIA/TensorRT-LLM
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
NVIDIA/TensorRT-LLM#23273 ·
Los mantenedores suelen responder en 1 día
-
Trace-replay Pareto window includes the drain when sessions finish out of admission orderPosiblemente ocupada @sbeierle la tomó hace 1 día. AbiertoTesting
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
NVIDIA/TensorRT-LLM#23077 ·
Los mantenedores suelen responder en 1 día
-
LongBench V2 blog command breaks on inline comments after continuationsPosiblemente ocupada @ddlw la tomó hace 24 días. AbiertoDoc
Dificultad 1/5 Menos de una hora Aptitud para principiantes 91/100
NVIDIA/TensorRT-LLM#21879 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: MPIPoolExecutor is not defined with ENABLE_MULTI_DEVICE=OFFPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. AbiertoLLM API
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NVIDIA/TensorRT-LLM#20647 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: trtllm-gen FMHA CudaArchDecl.h numbers Sm107a as 4, but the prebuilt libTrtLlmGen archives use 4 for 105a and 5 for 107aPosiblemente ocupada @lucifer1004 la tomó hace 46 días. AbiertoCustomized kernels
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
NVIDIA/TensorRT-LLM#20507 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de NVIDIA/TensorRT-LLM
Issues similares
-
Make the "%" unit spacing the same in the web and in A10Posiblemente ocupada @kragent66-glitch la tomó hoy. Abiertobug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 comentario ·
-
ci severity: low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
TMHSDigital/Spackle#205 ·
Los mantenedores suelen responder en 1 día
-
pkg:lgm type:chore upstream-gaussx
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
jejjohnson/pyrox#610 ·
Los mantenedores suelen responder en 1 día
-
changelog investigate
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
ramnes/notion-sdk-py#523 ·
-
feature-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
open-telemetry/opentelemetry-python#5994 ·
Los mantenedores suelen responder en 2 días