[Bug]: AutoTuner load_cache crashes on a non-string tactic entry: warning_once(key=<list>) raises TypeError: unhashable type
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Inizia in tensorrt_llm/_torch/autotuner.py, in corrispondenza di _deserialize_cache_data, dove l’avviso passa il valore raw di tactic come chiave. Leggi Logger.log_once in tensorrt_llm/logger.py per confermare che la chiave deve essere hashable, quindi verifica se esistono già test di deserializzazione di AutoTuner. Il lavoro è completato quando le voci tactic di tipo lista o dizionario vengono ignorate con l’avviso previsto e il resto della cache può ancora essere caricato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 15.1k
- Fork
- 3k
- Merge medio
- 3g 1h
- PR unite (30g)
- 474
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
-
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 1 giorno 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 24 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
-
[Bug]: MPIPoolExecutor is not defined with ENABLE_MULTI_DEVICE=OFFForse già presa Una pull request collegata a questa issue è aperta o già unita. ApertaLLM API
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NVIDIA/TensorRT-LLM#20647 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: trtllm-gen FMHA CudaArchDecl.h numbers Sm107a as 4, but the prebuilt libTrtLlmGen archives use 4 for 105a and 5 for 107aForse già presa @lucifer1004 l’ha presa 46 giorni fa. ApertaCustomized kernels
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
NVIDIA/TensorRT-LLM#20507 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di NVIDIA/TensorRT-LLM
Issue simili
-
Make the "%" unit spacing the same in the web and in A10Forse già presa @kragent66-glitch l’ha presa oggi. Apertabug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
maiychrus25/OpenTea-DX-OS#226 · 1 commento ·
-
ci severity: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
TMHSDigital/Spackle#205 ·
I maintainer di solito rispondono entro 1 giorno
-
pkg:lgm type:chore upstream-gaussx
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
jejjohnson/pyrox#610 ·
I maintainer di solito rispondono entro 1 giorno
-
changelog investigate
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
ramnes/notion-sdk-py#523 ·
-
feature-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
open-telemetry/opentelemetry-python#5994 ·
I maintainer di solito rispondono entro 2 giorni