From 94a9e65c3120b63f8b33696dbcce4c7caa3683a2 Mon Sep 17 00:00:00 2001 From: handongl Date: Fri, 24 Jul 2026 06:59:27 -0700 Subject: [PATCH 1/2] [nvbugs/6507080][fix] Add safe __repr__ to TokenizerBase PreTrainedTokenizerBase.__repr__ reads properties (e.g. added_tokens_decoder) that TokenizerBase subclasses are not required to implement. When a user-supplied custom tokenizer becomes a field of the pydantic llm_args model, logging f"LLM Args:\n{llm_args}" in py_executor_creator triggers pydantic's __repr__, which recursively calls repr() on the tokenizer and blows up with NotImplementedError. Override __repr__ on TokenizerBase to return a class-name-only string so pydantic reprs and startup logging never crash on custom tokenizers. Signed-off-by: handongl --- tensorrt_llm/tokenizer/tokenizer.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tensorrt_llm/tokenizer/tokenizer.py b/tensorrt_llm/tokenizer/tokenizer.py index 9715865c65a1..b88b6b53ea45 100644 --- a/tensorrt_llm/tokenizer/tokenizer.py +++ b/tensorrt_llm/tokenizer/tokenizer.py @@ -65,6 +65,12 @@ class TokenizerBase(PreTrainedTokenizerBase): ''' This is a protocol for the tokenizer. Users can implement their own tokenizer by inheriting this class. ''' + def __repr__(self) -> str: + # PreTrainedTokenizerBase.__repr__ reads properties (e.g. + # added_tokens_decoder) that TokenizerBase subclasses are not + # required to implement, so fall back to a class-name-only repr. + return f"{self.__class__.__name__}()" + def _reconstruct_transformers_tokenizer(inner_bytes: bytes): '''Reconstruct a TransformersTokenizer from cloudpickle-serialized bytes.''' From 27c1d74997c604263400cdfe709f728cf52d0c05 Mon Sep 17 00:00:00 2001 From: handongl Date: Fri, 24 Jul 2026 12:36:21 -0700 Subject: [PATCH 2/2] [nvbugs/6507080][chore] Remove stale waiver after fix Signed-off-by: handongl --- tests/integration/test_lists/waives.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/integration/test_lists/waives.txt b/tests/integration/test_lists/waives.txt index afd7d5ad9780..76a52de21419 100644 --- a/tests/integration/test_lists/waives.txt +++ b/tests/integration/test_lists/waives.txt @@ -395,7 +395,6 @@ unittest/executor/test_rpc_proxy.py SKIP (https://nvbugs/5605741) unittest/executor/test_rpc_worker.py SKIP (https://nvbugs/5605741) unittest/llmapi/test_additional_model_outputs.py -m "gpu2" SKIP (https://nvbugs/6428091) unittest/llmapi/test_llm.py::test_generate_with_detokenization_stop_words_streaming[/scratch.trt_llm_data/llm-models/gemma/gemma-3-1b-it] SKIP (https://nvbugs/6566772) -unittest/llmapi/test_llm.py::test_llm_with_customized_tokenizer SKIP (https://nvbugs/6507080) unittest/llmapi/test_llm_multi_gpu_pytorch.py -m "gpu2" SKIP (https://nvbugs/6428092) unittest/llmapi/test_llm_multi_gpu_pytorch.py::test_llm_get_stats_pp2[False-False-True] SKIP (https://nvbugs/6432826) unittest/llmapi/test_llm_multi_gpu_pytorch.py::test_phi3_lora_fused_modules_output_on_tp2_identical_to_tp1 SKIP (https://nvbugs/6109745)