[Bug]: Guided decoding (xgrammar) + EAGLE-3 + draft_len_schedule reaching 0 crashes during CUDA graph capture, "bitmask must have the same batch size as logits"
System Info
TensorRT-LLM v1.3.0rc15 CUDA 13.1 Python 3.12.3
Who can help?
No response
Information
- [x] The official example scripts
- [x] My own modified scripts
Tasks
- [ ] An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - [x] My own task or dataset (give details below)
Reproduction
TensorRT-LLM launch command to minimally reproduce the crash (using v1.3.0rc15 Docker image):
trtllm-serve meta-llama/Llama-3.1-8B-Instruct \
--backend pytorch --host 0.0.0.0 --port 8000 \
--max_batch_size 64 \
--max_seq_len 8192 \
--extra_llm_api_options '{
"speculative_config": {
"decoding_type": "Eagle3",
"max_draft_len": 1,
"speculative_model_dir": "yuhuili/EAGLE3-LLaMA3.1-Instruct-8B",
"eagle3_model_arch": "llama3",
"draft_len_schedule": {"1": 1, "16": 1, "32": 0}
},
"guided_decoding_backend": "xgrammar"
}'
Traceback (without debug verbose flag):
root@c95ef39f810d:/app/tensorrt_llm# export TLLM_DEBUG_MODE=0
root@c95ef39f810d:/app/tensorrt_llm# trtllm-serve meta-llama/Meta-Llama-3.1-8B-Instruct --backend pytorch --host 0.0.0.0 --port 8000 --max_batch_size 64 --max_seq_len 8192 --extra_llm_api_options '{
"speculative_config": {
"decoding_type": "Eagle3",
"max_draft_len": 1,
"speculative_model_dir": "yuhuili/EAGLE3-LLaMA3.1-Instruct-8B",
"eagle3_model_arch": "llama3",
"draft_len_schedule": {"1": 1, "16": 1, "32": 0}
},
"guided_decoding_backend": "xgrammar"
}'
Skipping import of cpp extensions due to incompatible torch version 2.11.0a0+eb65b36914.nv26.02 for torchao version 0.15.0 Please see https://github.com/pytorch/ao/issues/2919 for more info
/usr/local/lib/python3.12/dist-packages/modelopt/torch/__init__.py:36: UserWarning: transformers version 5.5.3 is incompatible with nvidia-modelopt and may cause issues. Please install recommended version with `pip install nvidia-modelopt[hf]` if working with HF models.
_warnings.warn(
[TensorRT-LLM] TensorRT LLM version: 1.3.0rc15
/usr/local/lib/python3.12/dist-packages/tensorrt_llm/serve/openai_protocol.py:117: UserWarning: Field name "schema" in "ResponseFormat" shadows an attribute in parent "OpenAIBaseModel"
class ResponseFormat(OpenAIBaseModel):
[06/05/2026-22:17:03] [TRT-LLM] [I] [commands] SIGUSR1 signal handler installed. Send 'kill -USR1 <pid>' to get stack traces.
[06/05/2026-22:17:03] [TRT-LLM] [I] [llmapi] Using LLM with PyTorch backend
[06/05/2026-22:17:03] [TRT-LLM] [I] [llmapi] Automatically enabling cuda_graph_config.enable_padding because draft_len_schedule is set.
[06/05/2026-22:17:03] [TRT-LLM] [I] [llmapi] neither checkpoint_format nor checkpoint_loader were provided, checkpoint_format will be set to HF.
[06/05/2026-22:17:03] [TRT-LLM] [I] [llmapi] Downloading model yuhuili/EAGLE3-LLaMA3.1-Instruct-8B from HuggingFace
[06/05/2026-22:17:03] [TRT-LLM] [I] [llmapi] Finished downloading model yuhuili/EAGLE3-LLaMA3.1-Instruct-8B from HuggingFace
[06/05/2026-22:17:03] [TRT-LLM] [I] [llmapi] Downloading model meta-llama/Meta-Llama-3.1-8B-Instruct from HuggingFace
[06/05/2026-22:17:03] [TRT-LLM] [I] [llmapi] Finished downloading model meta-llama/Meta-Llama-3.1-8B-Instruct from HuggingFace
The argument `trust_remote_code` is to be used with Auto classes. It has no effect here and is ignored.
You are using a model of type `llama` to instantiate a model of type ``. This may be expected if you are loading a checkpoint that shares a subset of the architecture (e.g., loading a `sam2_video` checkpoint into `Sam2Model`), but is otherwise not supported and can yield errors. Please verify that the checkpoint is compatible with the model you are instantiating.
PreTrainedConfig got `key=rope_scaling` in kwargs but hasn't set it as attribute. For RoPE standardization you need to set `self.rope_parameters` in model's config.
[06/05/2026-22:17:04] [TRT-LLM] [W] [llmapi] Failed to load hf model config from meta-llama/Meta-Llama-3.1-8B-Instruct, encountered error: 'PreTrainedConfig' object has no attribute 'max_position_embeddings'
`torch_dtype` is deprecated! Use `dtype` instead!
[06/05/2026-22:17:05] [TRT-LLM] [W] [executor] Orchestrator is creating IPC executor
rank 0 using MpiPoolSession to spawn MPI processes
[06/05/2026-22:17:05] [TRT-LLM] [I] [executor] Generating a new HMAC key for server proxy_request_queue
[06/05/2026-22:17:05] [TRT-LLM] [I] [executor] Generating a new HMAC key for server worker_init_status_queue
[06/05/2026-22:17:05] [TRT-LLM] [I] [executor] Generating a new HMAC key for server proxy_result_queue
Skipping import of cpp extensions due to incompatible torch version 2.11.0a0+eb65b36914.nv26.02 for torchao version 0.15.0 Please see https://github.com/pytorch/ao/issues/2919 for more info
Multiple distributions found for package optimum. Picked distribution: optimum
Multiple distributions found for package modelopt. Picked distribution: nvidia-modelopt
/usr/local/lib/python3.12/dist-packages/modelopt/torch/__init__.py:36: UserWarning: transformers version 5.5.3 is incompatible with nvidia-modelopt and may cause issues. Please install recommended version with `pip install nvidia-modelopt[hf]` if working with HF models.
_warnings.warn(
[TensorRT-LLM] TensorRT LLM version: 1.3.0rc15
/usr/local/lib/python3.12/dist-packages/tensorrt_llm/serve/openai_protocol.py:117: UserWarning: Field name "schema" in "ResponseFormat" shadows an attribute in parent "OpenAIBaseModel"
class ResponseFormat(OpenAIBaseModel):
[TRT-LLM] [I] [runtime][RANK 0] Refreshed the MPI local session
[06/05/2026-22:17:23] [TRT-LLM] [W] [executor] Worker process 8802 is affined to run on the following CPUs: [4, 132] (subset of all logical CPUs). This may harm performance if set incorrectly.
[06/05/2026-22:17:23] [TRT-LLM] [W] [executor] Worker process 8802 has constrained CPU affinity but `TLLM_NUMA_AWARE_WORKER_AFFINITY` is not set. Removing CPU affinity constraints.
`torch_dtype` is deprecated! Use `dtype` instead!
[06/05/2026-22:17:23] [TRT-LLM] [I] [_torch] Tokenizer not provided; loading from checkpoint for guided decoding
[06/05/2026-22:17:24] [TRT-LLM] [W] [_torch] Falling back to greedy decoding for Eagle3. If you want to use non-greedy sampling, please set allow_advanced_sampling=True.
[06/05/2026-22:17:24] [TRT-LLM] [I] [_torch] ATTENTION RUNTIME FEATURES: AttentionRuntimeFeatures(chunked_prefill=False, cache_reuse=True, has_speculative_draft_tokens=False, chunk_size=8192, chunked_prefill_buffer_batch_size=4)
[06/05/2026-22:17:24] [TRT-LLM] [I] [_torch] Validating KV Cache config against kv_cache_dtype="auto"
[06/05/2026-22:17:24] [TRT-LLM] [I] [_torch] [DEBUG validate_and_set_kv_cache_quant] kv_cache_quant=None, type=<class 'NoneType'>, pyt_kv_cache_dtype='auto'
[06/05/2026-22:17:24] [TRT-LLM] [I] [_torch] KV cache quantization set to "auto". Using checkpoint KV quantization.
[06/05/2026-22:17:25] [TRT-LLM] [I] [_torch] Use 15.75 GB for model weights.
[06/05/2026-22:17:25] [TRT-LLM] [I] [_torch] Prefetching 14.96GB checkpoint files.
[06/05/2026-22:17:25] [TRT-LLM] [I] [_torch] Prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00003-of-00004.safetensors to memory...
[06/05/2026-22:17:25] [TRT-LLM] [I] [_torch] Prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00002-of-00004.safetensors to memory...
[06/05/2026-22:17:25] [TRT-LLM] [I] [_torch] Prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00001-of-00004.safetensors to memory...
[06/05/2026-22:17:25] [TRT-LLM] [I] [_torch] Prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00004-of-00004.safetensors to memory...
[06/05/2026-22:17:25] [TRT-LLM] [I] [_torch] Finished prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00004-of-00004.safetensors.
[06/05/2026-22:17:28] [TRT-LLM] [I] [_torch] Finished prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00003-of-00004.safetensors.
[06/05/2026-22:17:28] [TRT-LLM] [I] [_torch] Finished prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00002-of-00004.safetensors.
[06/05/2026-22:17:28] [TRT-LLM] [I] [_torch] Finished prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00001-of-00004.safetensors.
Loading safetensors weights in parallel: 0%| | 0/4 [00:00<?, ?it/s][06/05/2026-22:17:28] [TRT-LLM] [I] [_torch] Start to load safetensor file /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00003-of-00004.safetensors
[06/05/2026-22:17:28] [TRT-LLM] [I] [_torch] Start to load safetensor file /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00002-of-00004.safetensors
[06/05/2026-22:17:28] [TRT-LLM] [I] [_torch] Start to load safetensor file /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00001-of-00004.safetensors
[06/05/2026-22:17:28] [TRT-LLM] [I] [_torch] Start to load safetensor file /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00004-of-00004.safetensors
Loading safetensors weights in parallel: 100%|██████████| 4/4 [00:00<00:00, 336.10it/s]
Loading weights concurrently: 100%|██████████| 709/709 [00:03<00:00, 201.72it/s]
Loading bin weights in parallel: 100%|██████████| 1/1 [00:00<00:00, 269.64it/s]
Loading weights concurrently: 100%|██████████| 28/28 [00:00<00:00, 155.35it/s]
Model init total -- 7.97s
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] Guided decoder initialized with backend: GuidedDecodingBackend.XGRAMMAR
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] Using Sampler: Eagle3OneModelSampler
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [create_py_executor] Created execution_stream: <torch.cuda.Stream device=cuda:0 cuda_stream=0x331f5c50>
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] Memory used at after loading weights (inside torch) in memory usage profiling: 15.81 GiB
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] Memory used at after loading weights (outside torch) in memory usage profiling: 1.48 GiB
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [kv cache manager] Primary/secondary blocks for window sizes set to {8194: (320, 0)} for estimation dry run
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [KVCacheManager] execution_stream: <torch.cuda.Stream device=cuda:0 cuda_stream=0x331f5c50>
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [KVCacheManager] blocks_per_window: {8194: (320, 0)}
[TRT-LLM] [I] [batchmgr][RANK 0] Max KV cache blocks per sequence: 257 [window size=8194], tokens per block=32, primary blocks=320, secondary blocks=0, max sequence length=8194
[TRT-LLM] [I] [batchmgr][RANK 0] Number of tokens per block: 32.
[TRT-LLM] [I] [batchmgr][RANK 0] [MemUsageChange] Allocated 1.25 GiB for max tokens in paged KV cache (10240).
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] Draft KV cache sizing: gpu_free_mem=249.15GiB, target_blocks=320, min_draft_blocks=352, min_draft_tokens=11264, current_max_tokens=10240, free_gpu_memory_fraction=0.9
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] Draft KV cache: adjusting max_tokens 10240 -> 11264 (352 blocks = 1.1 * target's 320)
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [kv cache manager] Primary/secondary blocks for window sizes set to {8194: (352, 0)} for estimation dry run
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [KVCacheManager] execution_stream: <torch.cuda.Stream device=cuda:0 cuda_stream=0x331f5c50>
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [KVCacheManager] blocks_per_window: {8194: (352, 0)}
[TRT-LLM] [I] [batchmgr][RANK 0] Max KV cache blocks per sequence: 257 [window size=8194], tokens per block=32, primary blocks=352, secondary blocks=0, max sequence length=8194
[TRT-LLM] [I] [batchmgr][RANK 0] Number of tokens per block: 32.
[TRT-LLM] [I] [batchmgr][RANK 0] [MemUsageChange] Allocated 0.04 GiB for max tokens in paged KV cache (11264).
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] max_seq_len=8194, max_num_requests=64, max_num_tokens=8192, max_batch_size=64
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] cache_transceiver is disabled
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [PyExecutor] execution_stream initialized: <torch.cuda.Stream device=cuda:0 cuda_stream=0x331f5c50>.
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] Running autotuner warmup...
[06/05/2026-22:17:33] [TRT-LLM] [I] [_torch] [Autotuner] Autotuning process starts ...
[06/05/2026-22:17:34] [TRT-LLM] [I] [_torch] PDL enabled
[TRT-LLM] [W] [thop][RANK 0] Attention workspace size is not enough, increase the size from 0 bytes to 100747008 bytes
[06/05/2026-22:17:39] [TRT-LLM] [I] [_torch] [Autotuner] Autotuning process ends
[06/05/2026-22:17:39] [TRT-LLM] [I] [_torch] [Autotuner] Cache size after warmup is 0
[06/05/2026-22:17:39] [TRT-LLM] [I] [_torch] Creating CUDA graph instances for 64 batch sizes.
[06/05/2026-22:17:39] [TRT-LLM] [I] [_torch] Dynamic draft length enabled for one-model path. Capturing 64 graphs: [(1, 1), (2, 1), (3, 1), (4, 1), (5, 1), (6, 1), (7, 1), (8, 1), (9, 1), (10, 1), (11, 1), (12, 1), (13, 1), (14, 1), (15, 1), (16, 1), (17, 0), (18, 0), (19, 0), (20, 0), (21, 0), (22, 0), (23, 0), (24, 0), (25, 0), (26, 0), (27, 0), (28, 0), (29, 0), (30, 0), (31, 0), (32, 0), (33, 0), (34, 0), (35, 0), (36, 0), (37, 0), (38, 0), (39, 0), (40, 0), (41, 0), (42, 0), (43, 0), (44, 0), (45, 0), (46, 0), (47, 0), (48, 0), (49, 0), (50, 0), (51, 0), (52, 0), (53, 0), (54, 0), (55, 0), (56, 0), (57, 0), (58, 0), (59, 0), (60, 0), (61, 0), (62, 0), (63, 0), (64, 0)]
[06/05/2026-22:17:39] [TRT-LLM] [I] [_torch] Run generation-only CUDA graph warmup for batch size=64, draft_len=0, max_seq_len=8192
[TRT-LLM] [W] [thop][RANK 0] Attention workspace size is not enough, increase the size from 0 bytes to 34097408 bytes
[06/05/2026-22:17:50] [TRT-LLM] [E] [executor] Failed to initialize executor on rank 0: bitmask must have the same batch size as logits.
[06/05/2026-22:17:50] [TRT-LLM] [E] [executor] Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/worker.py", line 405, in worker_main
worker: GenerationExecutorWorker = worker_cls(
^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/worker.py", line 72, in __init__
self.setup_engine()
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/base_worker.py", line 272, in setup_engine
self.engine = _create_py_executor(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/base_worker.py", line 243, in _create_py_executor
_executor = create_executor(**args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/py_executor_creator.py", line 909, in create_py_executor
py_executor = create_py_executor_instance(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/_util.py", line 1708, in create_py_executor_instance
return PyExecutor(
^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/py_executor.py", line 501, in __init__
self.model_engine.warmup(self.resource_manager)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 694, in wrapper
return method(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 725, in wrapper
result = method(self, resource_manager, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 840, in warmup
self._run_cuda_graph_warmup(resource_manager)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 1015, in _run_cuda_graph_warmup
self._capture_generation_cuda_graphs(resource_manager)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 1083, in _capture_generation_cuda_graphs
self.forward(batch,
File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/utils.py", line 123, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 4045, in forward
self.cuda_graph_runner.capture(
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py", line 379, in capture
_setup_spec_decoding_and_forward(key, forward_fn,
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py", line 370, in _setup_spec_decoding_and_forward
return forward_fn(capture_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 4037, in capture_forward_fn
return self._forward_step(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 4112, in _forward_step
outputs = self.model_forward(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 4098, in model_forward
return self.model.forward(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/models/modeling_speculative.py", line 1763, in forward
return self.spec_worker(input_ids=spec_input_ids,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1789, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/speculative/eagle3.py", line 562, in forward
return self.skip_drafting(input_ids, position_ids, hidden_states,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/speculative/interface.py", line 760, in skip_drafting
self.guided_decoder.execute(logits)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/guided_decoder.py", line 515, in execute
self.apply_bitmask(logits, d2t=d2t)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/guided_decoder.py", line 353, in apply_bitmask
self._apply_bitmask(self.requests,
File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/guided_decoder.py", line 329, in _apply_bitmask
torch.ops.trtllm.logits_bitmask(
File "/usr/local/lib/python3.12/dist-packages/torch/_ops.py", line 1243, in __call__
return self._op(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: bitmask must have the same batch size as logits.
[06/05/2026-22:17:50] [TRT-LLM] [I] [executor] get signal from executor worker
[06/05/2026-22:17:50] [TRT-LLM] [E] [executor] Executor worker initialization error: Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/worker.py", line 405, in worker_main
worker: GenerationExecutorWorker = worker_cls(
^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/worker.py", line 72, in __init__
self.setup_engine()
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/base_worker.py", line 272, in setup_engine
self.engine = _create_py_executor(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/base_worker.py", line 243, in _create_py_executor
_executor = create_executor(**args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/py_executor_creator.py", line 909, in create_py_executor
py_executor = create_py_executor_instance(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/_util.py", line 1708, in create_py_executor_instance
return PyExecutor(
^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/py_executor.py", line 501, in __init__
self.model_engine.warmup(self.resource_manager)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 694, in wrapper
return method(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 725, in wrapper
result = method(self, resource_manager, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 840, in warmup
self._run_cuda_graph_warmup(resource_manager)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 1015, in _run_cuda_graph_warmup
self._capture_generation_cuda_graphs(resource_manager)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 1083, in _capture_generation_cuda_graphs
self.forward(batch,
File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/utils.py", line 123, in wrapper
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 4045, in forward
self.cuda_graph_runner.capture(
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py", line 379, in capture
_setup_spec_decoding_and_forward(key, forward_fn,
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/cuda_graph_runner.py", line 370, in _setup_spec_decoding_and_forward
return forward_fn(capture_inputs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 4037, in capture_forward_fn
return self._forward_step(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 4112, in _forward_step
outputs = self.model_forward(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/model_engine.py", line 4098, in model_forward
return self.model.forward(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/models/modeling_speculative.py", line 1763, in forward
return self.spec_worker(input_ids=spec_input_ids,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1778, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1789, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/speculative/eagle3.py", line 562, in forward
return self.skip_drafting(input_ids, position_ids, hidden_states,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/speculative/interface.py", line 760, in skip_drafting
self.guided_decoder.execute(logits)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/guided_decoder.py", line 515, in execute
self.apply_bitmask(logits, d2t=d2t)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/guided_decoder.py", line 353, in apply_bitmask
self._apply_bitmask(self.requests,
File "/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/guided_decoder.py", line 329, in _apply_bitmask
torch.ops.trtllm.logits_bitmask(
File "/usr/local/lib/python3.12/dist-packages/torch/_ops.py", line 1243, in __call__
return self._op(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: bitmask must have the same batch size as logits.
RuntimeError: bitmask must have the same batch size as logits.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/trtllm-serve", line 6, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1524, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1445, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1912, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1308, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 877, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/serve.py", line 1132, in serve
_serve_llm()
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/serve.py", line 1101, in _serve_llm
launch_server(host,
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/serve.py", line 399, in launch_server
llm = PyTorchLLM(**llm_args)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/llmapi/llm.py", line 1605, in __init__
super().__init__(model, tokenizer, tokenizer_mode, skip_tokenizer_init,
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/llmapi/llm.py", line 1447, in __init__
super().__init__(model,
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/llmapi/llm.py", line 272, in __init__
self._build_model()
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/llmapi/llm.py", line 1552, in _build_model
self._executor = self._executor_cls.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/executor.py", line 629, in create
return GenerationExecutor._create_ipc_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/executor.py", line 500, in _create_ipc_executor
return GenerationExecutorProxy(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/proxy.py", line 116, in __init__
self._start_executor_workers(worker_kwargs)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/proxy.py", line 467, in _start_executor_workers
raise RuntimeError(
RuntimeError: Executor worker returned error
Traceback (with debug verbose flag):
root@c95ef39f810d:/app/tensorrt_llm# export TLLM_DEBUG_MODE=1
root@c95ef39f810d:/app/tensorrt_llm# trtllm-serve meta-llama/Meta-Llama-3.1-8B-Instruct --backend pytorch --host 0.0.0.0 --port 8000 --max_batch_size 64 --max_seq_len 8192 --extra_llm_api_options '{
"speculative_config": {
"decoding_type": "Eagle3",
"max_draft_len": 1,
"speculative_model_dir": "yuhuili/EAGLE3-LLaMA3.1-Instruct-8B",
"eagle3_model_arch": "llama3",
"draft_len_schedule": {"1": 1, "16": 1, "32": 0}
},
"guided_decoding_backend": "xgrammar"
}'
Skipping import of cpp extensions due to incompatible torch version 2.11.0a0+eb65b36914.nv26.02 for torchao version 0.15.0 Please see https://github.com/pytorch/ao/issues/2919 for more info
/usr/local/lib/python3.12/dist-packages/modelopt/torch/__init__.py:36: UserWarning: transformers version 5.5.3 is incompatible with nvidia-modelopt and may cause issues. Please install recommended version with `pip install nvidia-modelopt[hf]` if working with HF models.
_warnings.warn(
[TensorRT-LLM] TensorRT LLM version: 1.3.0rc15
/usr/local/lib/python3.12/dist-packages/tensorrt_llm/serve/openai_protocol.py:117: UserWarning: Field name "schema" in "ResponseFormat" shadows an attribute in parent "OpenAIBaseModel"
class ResponseFormat(OpenAIBaseModel):
[06/05/2026-22:06:37] [TRT-LLM] [I] [commands] SIGUSR1 signal handler installed. Send 'kill -USR1 <pid>' to get stack traces.
[06/05/2026-22:06:37] [TRT-LLM] [I] [llmapi] Using LLM with PyTorch backend
[06/05/2026-22:06:37] [TRT-LLM] [I] [llmapi] Automatically enabling cuda_graph_config.enable_padding because draft_len_schedule is set.
[06/05/2026-22:06:37] [TRT-LLM] [I] [llmapi] neither checkpoint_format nor checkpoint_loader were provided, checkpoint_format will be set to HF.
[06/05/2026-22:06:37] [TRT-LLM] [I] [llmapi] Downloading model yuhuili/EAGLE3-LLaMA3.1-Instruct-8B from HuggingFace
[06/05/2026-22:06:37] [TRT-LLM] [I] [llmapi] Finished downloading model yuhuili/EAGLE3-LLaMA3.1-Instruct-8B from HuggingFace
[06/05/2026-22:06:37] [TRT-LLM] [I] [llmapi] Downloading model meta-llama/Meta-Llama-3.1-8B-Instruct from HuggingFace
[06/05/2026-22:06:37] [TRT-LLM] [I] [llmapi] Finished downloading model meta-llama/Meta-Llama-3.1-8B-Instruct from HuggingFace
The argument `trust_remote_code` is to be used with Auto classes. It has no effect here and is ignored.
You are using a model of type `llama` to instantiate a model of type ``. This may be expected if you are loading a checkpoint that shares a subset of the architecture (e.g., loading a `sam2_video` checkpoint into `Sam2Model`), but is otherwise not supported and can yield errors. Please verify that the checkpoint is compatible with the model you are instantiating.
PreTrainedConfig got `key=rope_scaling` in kwargs but hasn't set it as attribute. For RoPE standardization you need to set `self.rope_parameters` in model's config.
[06/05/2026-22:06:39] [TRT-LLM] [W] [llmapi] Failed to load hf model config from meta-llama/Meta-Llama-3.1-8B-Instruct, encountered error: 'PreTrainedConfig' object has no attribute 'max_position_embeddings'
`torch_dtype` is deprecated! Use `dtype` instead!
[06/05/2026-22:06:39] [TRT-LLM] [W] [executor] Orchestrator is creating IPC executor
rank 0 using MpiPoolSession to spawn MPI processes
[06/05/2026-22:06:39] [TRT-LLM] [I] [executor] Generating a new HMAC key for server proxy_request_queue
[06/05/2026-22:06:39] [TRT-LLM] [I] [executor] Generating a new HMAC key for server worker_init_status_queue
[06/05/2026-22:06:39] [TRT-LLM] [I] [executor] Generating a new HMAC key for server proxy_result_queue
Skipping import of cpp extensions due to incompatible torch version 2.11.0a0+eb65b36914.nv26.02 for torchao version 0.15.0 Please see https://github.com/pytorch/ao/issues/2919 for more info
Multiple distributions found for package optimum. Picked distribution: optimum
Multiple distributions found for package modelopt. Picked distribution: nvidia-modelopt
/usr/local/lib/python3.12/dist-packages/modelopt/torch/__init__.py:36: UserWarning: transformers version 5.5.3 is incompatible with nvidia-modelopt and may cause issues. Please install recommended version with `pip install nvidia-modelopt[hf]` if working with HF models.
_warnings.warn(
[TensorRT-LLM] TensorRT LLM version: 1.3.0rc15
/usr/local/lib/python3.12/dist-packages/tensorrt_llm/serve/openai_protocol.py:117: UserWarning: Field name "schema" in "ResponseFormat" shadows an attribute in parent "OpenAIBaseModel"
class ResponseFormat(OpenAIBaseModel):
[TRT-LLM] [I] [runtime][RANK 0] Refreshed the MPI local session
[06/05/2026-22:06:57] [TRT-LLM] [W] [executor] Worker process 8365 is affined to run on the following CPUs: [4, 132] (subset of all logical CPUs). This may harm performance if set incorrectly.
[06/05/2026-22:06:57] [TRT-LLM] [W] [executor] Worker process 8365 has constrained CPU affinity but `TLLM_NUMA_AWARE_WORKER_AFFINITY` is not set. Removing CPU affinity constraints.
`torch_dtype` is deprecated! Use `dtype` instead!
[06/05/2026-22:06:57] [TRT-LLM] [I] [_torch] Tokenizer not provided; loading from checkpoint for guided decoding
[06/05/2026-22:06:59] [TRT-LLM] [W] [_torch] Falling back to greedy decoding for Eagle3. If you want to use non-greedy sampling, please set allow_advanced_sampling=True.
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] ATTENTION RUNTIME FEATURES: AttentionRuntimeFeatures(chunked_prefill=False, cache_reuse=True, has_speculative_draft_tokens=False, chunk_size=8192, chunked_prefill_buffer_batch_size=4)
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] Validating KV Cache config against kv_cache_dtype="auto"
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] [DEBUG validate_and_set_kv_cache_quant] kv_cache_quant=None, type=<class 'NoneType'>, pyt_kv_cache_dtype='auto'
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] KV cache quantization set to "auto". Using checkpoint KV quantization.
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] Use 15.75 GB for model weights.
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] Prefetching 14.96GB checkpoint files.
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] Prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00003-of-00004.safetensors to memory...
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] Prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00002-of-00004.safetensors to memory...
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] Prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00001-of-00004.safetensors to memory...
[06/05/2026-22:06:59] [TRT-LLM] [I] [_torch] Prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00004-of-00004.safetensors to memory...
[06/05/2026-22:07:00] [TRT-LLM] [I] [_torch] Finished prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00004-of-00004.safetensors.
[06/05/2026-22:07:03] [TRT-LLM] [I] [_torch] Finished prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00003-of-00004.safetensors.
[06/05/2026-22:07:03] [TRT-LLM] [I] [_torch] Finished prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00002-of-00004.safetensors.
[06/05/2026-22:07:03] [TRT-LLM] [I] [_torch] Finished prefetching /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00001-of-00004.safetensors.
Loading safetensors weights in parallel: 0%| | 0/4 [00:00<?, ?it/s][06/05/2026-22:07:03] [TRT-LLM] [I] [_torch] Start to load safetensor file /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00003-of-00004.safetensors
[06/05/2026-22:07:03] [TRT-LLM] [I] [_torch] Start to load safetensor file /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00002-of-00004.safetensors
[06/05/2026-22:07:03] [TRT-LLM] [I] [_torch] Start to load safetensor file /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00001-of-00004.safetensors
[06/05/2026-22:07:03] [TRT-LLM] [I] [_torch] Start to load safetensor file /root/.cache/huggingface/hub/models--meta-llama--Meta-Llama-3.1-8B-Instruct/snapshots/0e9e39f249a16976918f6564b8830bc894c89659/model-00004-of-00004.safetensors
Loading safetensors weights in parallel: 100%|██████████| 4/4 [00:00<00:00, 323.73it/s]
Loading weights concurrently: 100%|██████████| 709/709 [00:03<00:00, 202.50it/s]
Loading bin weights in parallel: 100%|██████████| 1/1 [00:00<00:00, 258.37it/s]
Loading weights concurrently: 100%|██████████| 28/28 [00:00<00:00, 148.20it/s]
Model init total -- 8.36s
[06/05/2026-22:07:07] [TRT-LLM] [I] [_torch] Guided decoder initialized with backend: GuidedDecodingBackend.XGRAMMAR
[06/05/2026-22:07:07] [TRT-LLM] [I] [_torch] Using Sampler: Eagle3OneModelSampler
[06/05/2026-22:07:07] [TRT-LLM] [I] [_torch] [create_py_executor] Created execution_stream: <torch.cuda.Stream device=cuda:0 cuda_stream=0x4916ff40>
[06/05/2026-22:07:07] [TRT-LLM] [I] [_torch] Memory used at after loading weights (inside torch) in memory usage profiling: 15.81 GiB
[06/05/2026-22:07:07] [TRT-LLM] [I] [_torch] Memory used at after loading weights (outside torch) in memory usage profiling: 1.48 GiB
[06/05/2026-22:07:07] [TRT-LLM] [I] [_torch] [kv cache manager] Primary/secondary blocks for window sizes set to {8194: (320, 0)} for estimation dry run
[06/05/2026-22:07:07] [TRT-LLM] [I] [_torch] [KVCacheManager] execution_stream: <torch.cuda.Stream device=cuda:0 cuda_stream=0x4916ff40>
[06/05/2026-22:07:07] [TRT-LLM] [I] [_torch] [KVCacheManager] blocks_per_window: {8194: (320, 0)}
[06/05/2026-22:07:07] [TRT-LLM] [E] [executor] Failed to initialize executor on rank 0: [TensorRT-LLM][ERROR] Assertion failed: value >= 0 && this->value != kInvalidPoolIndex (/src/tensorrt_llm/cpp/include/tensorrt_llm/kernels/kvCacheIndex.h:47)
1 0x7586c830ba20 tensorrt_llm::_v1::common::throwRuntimeError(char const*, int, char const*) + 97
2 0x7586971d5ef5 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/libs/libtensorrt_llm.so(+0x1cf4ef5) [0x7586971d5ef5]
3 0x75869973b023 tensorrt_llm::batch_manager::kv_cache_manager::BlockManager::BlockManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, std::shared_ptr<tensorrt_llm::runtime::CudaStream>, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, int, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, std::optional<tensorrt_llm::executor::kv_cache::BaseAgentConfig>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 2147
4 0x75869973c30f tensorrt_llm::batch_manager::kv_cache_manager::KVCacheManager::KVCacheManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, std::shared_ptr<tensorrt_llm::runtime::CudaStream>, int, int, bool, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 751
5 0x75869973cefe tensorrt_llm::batch_manager::kv_cache_manager::KVCacheManager::KVCacheManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, long, int, int, bool, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 526
6 0x7586ce389d3c /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x98d3c) [0x7586ce389d3c]
7 0x7586ce43dea1 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x14cea1) [0x7586ce43dea1]
8 0x7586ce4450c9 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x1540c9) [0x7586ce4450c9]
9 0x54b155 PyObject_Call + 277
10 0x5db510 _PyEval_EvalFrameDefault + 19632
11 0x54a84a _PyObject_Call_Prepend + 394
12 0x59e12f /usr/bin/python3() [0x59e12f]
13 0x599b83 /usr/bin/python3() [0x599b83]
14 0x54b0ac PyObject_Call + 108
15 0x5db510 _PyEval_EvalFrameDefault + 19632
16 0x54a84a _PyObject_Call_Prepend + 394
17 0x59e12f /usr/bin/python3() [0x59e12f]
18 0x599b83 /usr/bin/python3() [0x599b83]
19 0x548ffe _PyObject_MakeTpCall + 318
20 0x5d733f _PyEval_EvalFrameDefault + 2783
21 0x5d582b PyEval_EvalCode + 347
22 0x5d33bc /usr/bin/python3() [0x5d33bc]
23 0x581e4d /usr/bin/python3() [0x581e4d]
24 0x549935 PyObject_Vectorcall + 53
25 0x5d733f _PyEval_EvalFrameDefault + 2783
26 0x6bc772 /usr/bin/python3() [0x6bc772]
27 0x6bc3a2 Py_RunMain + 562
28 0x6bc00d Py_BytesMain + 45
29 0x7589d43361ca /usr/lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca) [0x7589d43361ca]
30 0x7589d433628b __libc_start_main + 139
31 0x657445 _start + 37
[06/05/2026-22:07:07] [TRT-LLM] [E] [executor] Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/worker.py", line 405, in worker_main
worker: GenerationExecutorWorker = worker_cls(
^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/worker.py", line 72, in __init__
self.setup_engine()
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/base_worker.py", line 272, in setup_engine
self.engine = _create_py_executor(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/base_worker.py", line 243, in _create_py_executor
_executor = create_executor(**args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/py_executor_creator.py", line 874, in create_py_executor
kv_cache_creator.build_managers(resources, estimating_kv_cache)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/_util.py", line 1027, in build_managers
kv_cache_manager = self._create_kv_cache_manager(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/_util.py", line 727, in _create_kv_cache_manager
kv_cache_manager = _create_kv_cache_manager(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/_util.py", line 1400, in _create_kv_cache_manager
kv_cache_manager = kv_cache_manager_cls(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/resource_manager.py", line 595, in __init__
self.impl = KVCacheManagerCpp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: [TensorRT-LLM][ERROR] Assertion failed: value >= 0 && this->value != kInvalidPoolIndex (/src/tensorrt_llm/cpp/include/tensorrt_llm/kernels/kvCacheIndex.h:47)
1 0x7586c830ba20 tensorrt_llm::_v1::common::throwRuntimeError(char const*, int, char const*) + 97
2 0x7586971d5ef5 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/libs/libtensorrt_llm.so(+0x1cf4ef5) [0x7586971d5ef5]
3 0x75869973b023 tensorrt_llm::batch_manager::kv_cache_manager::BlockManager::BlockManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, std::shared_ptr<tensorrt_llm::runtime::CudaStream>, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, int, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, std::optional<tensorrt_llm::executor::kv_cache::BaseAgentConfig>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 2147
4 0x75869973c30f tensorrt_llm::batch_manager::kv_cache_manager::KVCacheManager::KVCacheManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, std::shared_ptr<tensorrt_llm::runtime::CudaStream>, int, int, bool, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 751
5 0x75869973cefe tensorrt_llm::batch_manager::kv_cache_manager::KVCacheManager::KVCacheManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, long, int, int, bool, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 526
6 0x7586ce389d3c /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x98d3c) [0x7586ce389d3c]
7 0x7586ce43dea1 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x14cea1) [0x7586ce43dea1]
8 0x7586ce4450c9 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x1540c9) [0x7586ce4450c9]
9 0x54b155 PyObject_Call + 277
10 0x5db510 _PyEval_EvalFrameDefault + 19632
11 0x54a84a _PyObject_Call_Prepend + 394
12 0x59e12f /usr/bin/python3() [0x59e12f]
13 0x599b83 /usr/bin/python3() [0x599b83]
14 0x54b0ac PyObject_Call + 108
15 0x5db510 _PyEval_EvalFrameDefault + 19632
16 0x54a84a _PyObject_Call_Prepend + 394
17 0x59e12f /usr/bin/python3() [0x59e12f]
18 0x599b83 /usr/bin/python3() [0x599b83]
19 0x548ffe _PyObject_MakeTpCall + 318
20 0x5d733f _PyEval_EvalFrameDefault + 2783
21 0x5d582b PyEval_EvalCode + 347
22 0x5d33bc /usr/bin/python3() [0x5d33bc]
23 0x581e4d /usr/bin/python3() [0x581e4d]
24 0x549935 PyObject_Vectorcall + 53
25 0x5d733f _PyEval_EvalFrameDefault + 2783
26 0x6bc772 /usr/bin/python3() [0x6bc772]
27 0x6bc3a2 Py_RunMain + 562
28 0x6bc00d Py_BytesMain + 45
29 0x7589d43361ca /usr/lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca) [0x7589d43361ca]
30 0x7589d433628b __libc_start_main + 139
31 0x657445 _start + 37
[06/05/2026-22:07:07] [TRT-LLM] [I] [executor] get signal from executor worker
[06/05/2026-22:07:07] [TRT-LLM] [E] [executor] Executor worker initialization error: Traceback (most recent call last):
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/worker.py", line 405, in worker_main
worker: GenerationExecutorWorker = worker_cls(
^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/worker.py", line 72, in __init__
self.setup_engine()
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/base_worker.py", line 272, in setup_engine
self.engine = _create_py_executor(
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/base_worker.py", line 243, in _create_py_executor
_executor = create_executor(**args)
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/py_executor_creator.py", line 874, in create_py_executor
kv_cache_creator.build_managers(resources, estimating_kv_cache)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/_util.py", line 1027, in build_managers
kv_cache_manager = self._create_kv_cache_manager(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/_util.py", line 727, in _create_kv_cache_manager
kv_cache_manager = _create_kv_cache_manager(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/_util.py", line 1400, in _create_kv_cache_manager
kv_cache_manager = kv_cache_manager_cls(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/_torch/pyexecutor/resource_manager.py", line 595, in __init__
self.impl = KVCacheManagerCpp(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: [TensorRT-LLM][ERROR] Assertion failed: value >= 0 && this->value != kInvalidPoolIndex (/src/tensorrt_llm/cpp/include/tensorrt_llm/kernels/kvCacheIndex.h:47)
1 0x7586c830ba20 tensorrt_llm::_v1::common::throwRuntimeError(char const*, int, char const*) + 97
2 0x7586971d5ef5 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/libs/libtensorrt_llm.so(+0x1cf4ef5) [0x7586971d5ef5]
3 0x75869973b023 tensorrt_llm::batch_manager::kv_cache_manager::BlockManager::BlockManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, std::shared_ptr<tensorrt_llm::runtime::CudaStream>, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, int, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, std::optional<tensorrt_llm::executor::kv_cache::BaseAgentConfig>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 2147
4 0x75869973c30f tensorrt_llm::batch_manager::kv_cache_manager::KVCacheManager::KVCacheManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, std::shared_ptr<tensorrt_llm::runtime::CudaStream>, int, int, bool, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 751
5 0x75869973cefe tensorrt_llm::batch_manager::kv_cache_manager::KVCacheManager::KVCacheManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, long, int, int, bool, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 526
6 0x7586ce389d3c /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x98d3c) [0x7586ce389d3c]
7 0x7586ce43dea1 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x14cea1) [0x7586ce43dea1]
8 0x7586ce4450c9 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x1540c9) [0x7586ce4450c9]
9 0x54b155 PyObject_Call + 277
10 0x5db510 _PyEval_EvalFrameDefault + 19632
11 0x54a84a _PyObject_Call_Prepend + 394
12 0x59e12f /usr/bin/python3() [0x59e12f]
13 0x599b83 /usr/bin/python3() [0x599b83]
14 0x54b0ac PyObject_Call + 108
15 0x5db510 _PyEval_EvalFrameDefault + 19632
16 0x54a84a _PyObject_Call_Prepend + 394
17 0x59e12f /usr/bin/python3() [0x59e12f]
18 0x599b83 /usr/bin/python3() [0x599b83]
19 0x548ffe _PyObject_MakeTpCall + 318
20 0x5d733f _PyEval_EvalFrameDefault + 2783
21 0x5d582b PyEval_EvalCode + 347
22 0x5d33bc /usr/bin/python3() [0x5d33bc]
23 0x581e4d /usr/bin/python3() [0x581e4d]
24 0x549935 PyObject_Vectorcall + 53
25 0x5d733f _PyEval_EvalFrameDefault + 2783
26 0x6bc772 /usr/bin/python3() [0x6bc772]
27 0x6bc3a2 Py_RunMain + 562
28 0x6bc00d Py_BytesMain + 45
29 0x7589d43361ca /usr/lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca) [0x7589d43361ca]
30 0x7589d433628b __libc_start_main + 139
31 0x657445 _start + 37
RuntimeError: [TensorRT-LLM][ERROR] Assertion failed: value >= 0 && this->value != kInvalidPoolIndex (/src/tensorrt_llm/cpp/include/tensorrt_llm/kernels/kvCacheIndex.h:47)
1 0x7586c830ba20 tensorrt_llm::_v1::common::throwRuntimeError(char const*, int, char const*) + 97
2 0x7586971d5ef5 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/libs/libtensorrt_llm.so(+0x1cf4ef5) [0x7586971d5ef5]
3 0x75869973b023 tensorrt_llm::batch_manager::kv_cache_manager::BlockManager::BlockManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, std::shared_ptr<tensorrt_llm::runtime::CudaStream>, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, int, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, std::optional<tensorrt_llm::executor::kv_cache::BaseAgentConfig>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 2147
4 0x75869973c30f tensorrt_llm::batch_manager::kv_cache_manager::KVCacheManager::KVCacheManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, std::shared_ptr<tensorrt_llm::runtime::CudaStream>, int, int, bool, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 751
5 0x75869973cefe tensorrt_llm::batch_manager::kv_cache_manager::KVCacheManager::KVCacheManager(std::vector<int, std::allocator<int> > const&, int, int, std::map<int, std::tuple<int, int>, std::less<int>, std::allocator<std::pair<int const, std::tuple<int, int> > > > const&, int, int, std::vector<int, std::allocator<int> > const&, nvinfer1::DataType, int, long, int, int, bool, tensorrt_llm::batch_manager::kv_cache_manager::CacheType, std::optional<int>, std::shared_ptr<tensorrt_llm::batch_manager::kv_cache_manager::KVCacheEventManager>, bool, bool, std::shared_ptr<tensorrt_llm::batch_manager::kv_connector::KvCacheConnectorManager>, bool, int, int, bool, std::optional<tensorrt_llm::batch_manager::kv_cache_manager::LinearAttentionMetadata>) + 526
6 0x7586ce389d3c /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x98d3c) [0x7586ce389d3c]
7 0x7586ce43dea1 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x14cea1) [0x7586ce43dea1]
8 0x7586ce4450c9 /usr/local/lib/python3.12/dist-packages/tensorrt_llm/bindings.cpython-312-x86_64-linux-gnu.so(+0x1540c9) [0x7586ce4450c9]
9 0x54b155 PyObject_Call + 277
10 0x5db510 _PyEval_EvalFrameDefault + 19632
11 0x54a84a _PyObject_Call_Prepend + 394
12 0x59e12f /usr/bin/python3() [0x59e12f]
13 0x599b83 /usr/bin/python3() [0x599b83]
14 0x54b0ac PyObject_Call + 108
15 0x5db510 _PyEval_EvalFrameDefault + 19632
16 0x54a84a _PyObject_Call_Prepend + 394
17 0x59e12f /usr/bin/python3() [0x59e12f]
18 0x599b83 /usr/bin/python3() [0x599b83]
19 0x548ffe _PyObject_MakeTpCall + 318
20 0x5d733f _PyEval_EvalFrameDefault + 2783
21 0x5d582b PyEval_EvalCode + 347
22 0x5d33bc /usr/bin/python3() [0x5d33bc]
23 0x581e4d /usr/bin/python3() [0x581e4d]
24 0x549935 PyObject_Vectorcall + 53
25 0x5d733f _PyEval_EvalFrameDefault + 2783
26 0x6bc772 /usr/bin/python3() [0x6bc772]
27 0x6bc3a2 Py_RunMain + 562
28 0x6bc00d Py_BytesMain + 45
29 0x7589d43361ca /usr/lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca) [0x7589d43361ca]
30 0x7589d433628b __libc_start_main + 139
31 0x657445 _start + 37
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/bin/trtllm-serve", line 6, in <module>
sys.exit(main())
^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1524, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1445, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1912, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 1308, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/click/core.py", line 877, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/serve.py", line 1132, in serve
_serve_llm()
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/serve.py", line 1101, in _serve_llm
launch_server(host,
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/commands/serve.py", line 399, in launch_server
llm = PyTorchLLM(**llm_args)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/llmapi/llm.py", line 1605, in __init__
super().__init__(model, tokenizer, tokenizer_mode, skip_tokenizer_init,
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/llmapi/llm.py", line 1447, in __init__
super().__init__(model,
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/llmapi/llm.py", line 272, in __init__
self._build_model()
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/llmapi/llm.py", line 1552, in _build_model
self._executor = self._executor_cls.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/executor.py", line 629, in create
return GenerationExecutor._create_ipc_executor(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/executor.py", line 500, in _create_ipc_executor
return GenerationExecutorProxy(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/proxy.py", line 116, in __init__
self._start_executor_workers(worker_kwargs)
File "/usr/local/lib/python3.12/dist-packages/tensorrt_llm/executor/proxy.py", line 467, in _start_executor_workers
raise RuntimeError(
RuntimeError: Executor worker returned error
Expected behavior
CUDA Graph capture success when draft_len_schedule is set.
actual behavior
CUDA Graph capture failure when "draft_len_schedule": {"1": 1, "16": 1, "32": 0} is set.
Meanwhile, the error is not present in v1.3.0rc5 release.
additional notes
"bitmask must have the same batch size as logits" indicates the batch created for CUDA Graph capture has unexpected size with draft_len_schedule. I heva spotted a few code locations on this.
I am happy to open a PR fixing this, please let me know if there is any questions.
Before submitting a new issue...
- [x] Make sure you already searched for relevant issues, and checked the documentation and examples for answers to frequently asked questions.
Hi @chungen04, thanks for opening this issue with such detailed traces!
The root cause seems to be a shape mismatch during the CUDA graph capture warmup when draft_len_schedule drops to 0. Under GuidedDecodingBackend.XGRAMMAR, self.guided_decoder.execute(logits) expects the structural format bitmask to match the full generation batch size (64). However, when speculative drafting is skipped inside eagle3.py (self.skip_drafting), the bitmask construction path doesn't align its batch dimension correctly before calling torch.ops.trtllm.logits_bitmask.
I'm working on a local setup of TensorRT-LLM to inspect the tensor padding logic inside tensorrt_llm/_torch/pyexecutor/guided_decoder.py and eagle3.py when draft_len == 0. I will update here soon with my findings!
@Priyanshu31102003 Thank you! Any feedback is welcomed