vllm - ✅(Solved) Fix [Bug]: `max_num_batched_tokens=1` raises unhandled `IndexError` [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
vllm-project/vllm#39341Fetched 2026-04-09 07:51:44
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Participants
Timeline (top)
commented ×1cross-referenced ×1labeled ×1

Error Message

File ".../vllm/compilation/piecewise_backend.py", line 356, in call runtime_shape = args[self.sym_shape_indices[0]] ~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range

Fix Action

Fix / Workaround

============================== CPU Info

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 39 bits physical, 48 bits virtual Byte Order: Little Endian CPU(s): 24 On-line CPU(s) list: 0-23 Vendor ID: GenuineIntel Model name: 13th Gen Intel(R) Core(TM) i7-13700F CPU family: 6 Model: 183 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 1 Stepping: 1 CPU(s) scaling MHz: 43% CPU max MHz: 5200.0000 CPU min MHz: 800.0000 BogoMIPS: 4224.00 Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities Virtualization: VT-x L1d cache: 640 KiB (16 instances) L1i cache: 768 KiB (16 instances) L2 cache: 24 MiB (10 instances) L3 cache: 30 MiB (1 instance) NUMA node(s): 1 NUMA node0 CPU(s): 0-23 Vulnerability Gather data sampling: Not affected Vulnerability Ghostwrite: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling: Mitigation; Clear Register File Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Not affected Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl Vulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Vulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Mitigation; IBPB before exit to userspace

PR fix notes

PR #39395: [BugFix][Graph] fix: handle empty sym_shape_indices in PiecewiseBackend.

Description (problem / solution / changelog)

Purpose

FIx #39341

Test Plan

generating_prompts = [prefix + prompt for prompt in prompts]
llm = LLM(
    model="/mnt/data4/models/Qwen/Qwen3-0.6B",
    max_model_len=512,
    max_num_batched_tokens=1,
)
sampling_params = SamplingParams(temperature=0, top_p=0.95, max_tokens=10)

outputs = llm.generate(generating_prompts, sampling_params)
print(outputs)

Test Result

[RequestOutput(request_id=0, prompt="You are an expert school principal, skilled in effectively managing faculty and staff. Draft 10-15 questions for a potential first grade Head Teacher for my K-12, all-girls', independent school that emphasizes community, joyful discovery, and life-long learning. The candidate is coming in for a first-round panel interview for a 8th grade Math teaching role. They have 5 years of previous teaching experience as an assistant teacher at a co-ed, public school with experience in middle school math teaching. Based on these information, fulfill the following paragraph: Hello, my name is", prompt_token_ids=[2610, 525, 458, 6203, 2906, 12435, 11, 25530, 304, 13444, 18150, 21564, 323, 5570, 13, 28564, 220, 16, 15, 12, 16, 20, 4755, 369, 264, 4650, 1156, 11972, 11203, 29069, 369, 847, 730, 12, 16, 17, 11, 678, 62870, 82, 516, 9489, 2906, 429, 65059, 3942, 11, 82112, 18335, 11, 323, 2272, 23791, 6832, 13, 576, 9144, 374, 5001, 304, 369, 264, 1156, 21015, 6945, 7128, 369, 264, 220, 23, 339, 11972, 4149, 12629, 3476, 13, 2379, 614, 220, 20, 1635, 315, 3681, 12629, 3139, 438, 458, 17847, 11079, 518, 264, 1062, 34435, 11, 584, 2906, 448, 3139, 304, 6149, 2906, 6888, 12629, 13, 20205, 389, 1493, 1995, 11, 20423, 279, 2701, 14311, 25, 21927, 11, 847, 829, 374], encoder_prompt=None, encoder_prompt_token_ids=None, prompt_logprobs=None, outputs=[CompletionOutput(index=0, text=' [Name], and I am a [Position]', token_ids=[508, 675, 1125, 323, 358, 1079, 264, 508, 3812, 60], routed_experts=None, cumulative_logprob=None, logprobs=None, finish_reason=length, stop_reason=None)], finished=True, metrics=None, lora_request=None, num_cached_tokens=0), RequestOutput(request_id=1, prompt="You are an expert school principal, skilled in effectively managing faculty and staff. Draft 10-15 questions for a potential first grade Head Teacher for my K-12, all-girls', independent school that emphasizes community, joyful discovery, and life-long learning. The candidate is coming in for a first-round panel interview for a 8th grade Math teaching role. They have 5 years of previous teaching experience as an assistant teacher at a co-ed, public school with experience in middle school math teaching. Based on these information, fulfill the following paragraph: The president of the United States is", prompt_token_ids=[2610, 525, 458, 6203, 2906, 12435, 11, 25530, 304, 13444, 18150, 21564, 323, 5570, 13, 28564, 220, 16, 15, 12, 16, 20, 4755, 369, 264, 4650, 1156, 11972, 11203, 29069, 369, 847, 730, 12, 16, 17, 11, 678, 62870, 82, 516, 9489, 2906, 429, 65059, 3942, 11, 82112, 18335, 11, 323, 2272, 23791, 6832, 13, 576, 9144, 374, 5001, 304, 369, 264, 1156, 21015, 6945, 7128, 369, 264, 220, 23, 339, 11972, 4149, 12629, 3476, 13, 2379, 614, 220, 20, 1635, 315, 3681, 12629, 3139, 438, 458, 17847, 11079, 518, 264, 1062, 34435, 11, 584, 2906, 448, 3139, 304, 6149, 2906, 6888, 12629, 13, 20205, 389, 1493, 1995, 11, 20423, 279, 2701, 14311, 25, 576, 4767, 315, 279, 3639, 4180, 374], encoder_prompt=None, encoder_prompt_token_ids=None, prompt_logprobs=None, outputs=[CompletionOutput(index=0, text=' a woman, and the president is a woman.', token_ids=[264, 5220, 11, 323, 279, 4767, 374, 264, 5220, 13], routed_experts=None, cumulative_logprob=None, logprobs=None, finish_reason=length, stop_reason=None)], finished=True, metrics=None, lora_request=None, num_cached_tokens=112), RequestOutput(request_id=2, prompt="You are an expert school principal, skilled in effectively managing faculty and staff. Draft 10-15 questions for a potential first grade Head Teacher for my K-12, all-girls', independent school that emphasizes community, joyful discovery, and life-long learning. The candidate is coming in for a first-round panel interview for a 8th grade Math teaching role. They have 5 years of previous teaching experience as an assistant teacher at a co-ed, public school with experience in middle school math teaching. Based on these information, fulfill the following paragraph: The capital of France is", prompt_token_ids=[2610, 525, 458, 6203, 2906, 12435, 11, 25530, 304, 13444, 18150, 21564, 323, 5570, 13, 28564, 220, 16, 15, 12, 16, 20, 4755, 369, 264, 4650, 1156, 11972, 11203, 29069, 369, 847, 730, 12, 16, 17, 11, 678, 62870, 82, 516, 9489, 2906, 429, 65059, 3942, 11, 82112, 18335, 11, 323, 2272, 23791, 6832, 13, 576, 9144, 374, 5001, 304, 369, 264, 1156, 21015, 6945, 7128, 369, 264, 220, 23, 339, 11972, 4149, 12629, 3476, 13, 2379, 614, 220, 20, 1635, 315, 3681, 12629, 3139, 438, 458, 17847, 11079, 518, 264, 1062, 34435, 11, 584, 2906, 448, 3139, 304, 6149, 2906, 6888, 12629, 13, 20205, 389, 1493, 1995, 11, 20423, 279, 2701, 14311, 25, 576, 6722, 315, 9625, 374], encoder_prompt=None, encoder_prompt_token_ids=None, prompt_logprobs=None, outputs=[CompletionOutput(index=0, text=' Paris, and the capital of Italy is Rome.', token_ids=[12095, 11, 323, 279, 6722, 315, 15344, 374, 21718, 13], routed_experts=None, cumulative_logprob=None, logprobs=None, finish_reason=length, stop_reason=None)], finished=True, metrics=None, lora_request=None, num_cached_tokens=112), RequestOutput(request_id=3, prompt="You are an expert school principal, skilled in effectively managing faculty and staff. Draft 10-15 questions for a potential first grade Head Teacher for my K-12, all-girls', independent school that emphasizes community, joyful discovery, and life-long learning. The candidate is coming in for a first-round panel interview for a 8th grade Math teaching role. They have 5 years of previous teaching experience as an assistant teacher at a co-ed, public school with experience in middle school math teaching. Based on these information, fulfill the following paragraph: The future of AI is", prompt_token_ids=[2610, 525, 458, 6203, 2906, 12435, 11, 25530, 304, 13444, 18150, 21564, 323, 5570, 13, 28564, 220, 16, 15, 12, 16, 20, 4755, 369, 264, 4650, 1156, 11972, 11203, 29069, 369, 847, 730, 12, 16, 17, 11, 678, 62870, 82, 516, 9489, 2906, 429, 65059, 3942, 11, 82112, 18335, 11, 323, 2272, 23791, 6832, 13, 576, 9144, 374, 5001, 304, 369, 264, 1156, 21015, 6945, 7128, 369, 264, 220, 23, 339, 11972, 4149, 12629, 3476, 13, 2379, 614, 220, 20, 1635, 315, 3681, 12629, 3139, 438, 458, 17847, 11079, 518, 264, 1062, 34435, 11, 584, 2906, 448, 3139, 304, 6149, 2906, 6888, 12629, 13, 20205, 389, 1493, 1995, 11, 20423, 279, 2701, 14311, 25, 576, 3853, 315, 15235, 374], encoder_prompt=None, encoder_prompt_token_ids=None, prompt_logprobs=None, outputs=[CompletionOutput(index=0, text=' not just about the technology itself, but about how', token_ids=[537, 1101, 911, 279, 5440, 5086, 11, 714, 911, 1246], routed_experts=None, cumulative_logprob=None, logprobs=None, finish_reason=length, stop_reason=None)], finished=True, metrics=None, lora_request=None, num_cached_tokens=112)]

<details> <summary> Essential Elements of an Effective PR Description Checklist </summary>
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.
</details>

Changed files

  • tests/compile/test_dynamic_shapes_compilation.py (modified, +44/-0)
  • vllm/compilation/piecewise_backend.py (modified, +15/-5)

Code Example

Collecting environment information...
  ==============================
          System Info
  ==============================
  OS                           : Ubuntu 24.04.4 LTS (x86_64)
  GCC version                  : (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
  Clang version                : 15.0.0 (git@github.com:llvm/llvm-project.git 4ba6a9c9f65bbc8bd06e3652cb20fd4dfc846137)
  CMake version                : version 3.28.3
  Libc version                 : glibc-2.39

  ==============================
        PyTorch Info
  ==============================
  PyTorch version              : 2.10.0+cu128
  Is debug build               : False
  CUDA used to build PyTorch   : 12.8
  ROCM used to build PyTorch   : N/A

  ==============================
        Python Environment
  ==============================
  Python version               : 3.12.13 | packaged by conda-forge | (main, Mar  5 2026, 16:50:00) [GCC 14.3.0] (64-bit runtime)
  Python platform              : Linux-6.14.0-37-generic-x86_64-with-glibc2.39

  ==============================
        CUDA / GPU Info
  ==============================
  Is CUDA available            : True
  CUDA runtime version         : Could not collect
  CUDA_MODULE_LOADING set to   : 
  GPU models and configuration : GPU 0: NVIDIA GeForce RTX 4070
  Nvidia driver version        : 575.57.08
  cuDNN version                : Probably one of the following:
  /usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.7
  HIP runtime version          : N/A
  MIOpen runtime version       : N/A
  Is XNNPACK available         : True

  ==============================
            CPU Info
  ==============================
  Architecture:                            x86_64
  CPU op-mode(s):                          32-bit, 64-bit
  Address sizes:                           39 bits physical, 48 bits virtual
  Byte Order:                              Little Endian
  CPU(s):                                  24
  On-line CPU(s) list:                     0-23
  Vendor ID:                               GenuineIntel
  Model name:                              13th Gen Intel(R) Core(TM) i7-13700F
  CPU family:                              6
  Model:                                   183
  Thread(s) per core:                      2
  Core(s) per socket:                      16
  Socket(s):                               1
  Stepping:                                1
  CPU(s) scaling MHz:                      43%
  CPU max MHz:                             5200.0000
  CPU min MHz:                             800.0000
  BogoMIPS:                                4224.00
  Flags:                                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
  Virtualization:                          VT-x
  L1d cache:                               640 KiB (16 instances)
  L1i cache:                               768 KiB (16 instances)
  L2 cache:                                24 MiB (10 instances)
  L3 cache:                                30 MiB (1 instance)
  NUMA node(s):                            1
  NUMA node0 CPU(s):                       0-23
  Vulnerability Gather data sampling:      Not affected
  Vulnerability Ghostwrite:                Not affected
  Vulnerability Indirect target selection: Not affected
  Vulnerability Itlb multihit:             Not affected
  Vulnerability L1tf:                      Not affected
  Vulnerability Mds:                       Not affected
  Vulnerability Meltdown:                  Not affected
  Vulnerability Mmio stale data:           Not affected
  Vulnerability Reg file data sampling:    Mitigation; Clear Register File
  Vulnerability Retbleed:                  Not affected
  Vulnerability Spec rstack overflow:      Not affected
  Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
  Vulnerability Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Vulnerability Spectre v2:                Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
  Vulnerability Srbds:                     Not affected
  Vulnerability Tsa:                       Not affected
  Vulnerability Tsx async abort:           Not affected
  Vulnerability Vmscape:                   Mitigation; IBPB before exit to userspace

  ==============================
  Versions of relevant libraries
  ==============================
  [pip3] flashinfer-python==0.6.6
  [pip3] numpy==2.2.6
  [pip3] nvidia-cublas-cu12==12.8.4.1
  [pip3] nvidia-cuda-cupti-cu12==12.8.90
  [pip3] nvidia-cuda-nvrtc-cu12==12.8.93
  [pip3] nvidia-cuda-runtime-cu12==12.8.90
  [pip3] nvidia-cudnn-cu12==9.10.2.21
  [pip3] nvidia-cudnn-frontend==1.18.0
  [pip3] nvidia-cufft-cu12==11.3.3.83
  [pip3] nvidia-cufile-cu12==1.13.1.3
  [pip3] nvidia-curand-cu12==10.3.9.90
  [pip3] nvidia-cusolver-cu12==11.7.3.90
  [pip3] nvidia-cusparse-cu12==12.5.8.93
  [pip3] nvidia-cusparselt-cu12==0.7.1
  [pip3] nvidia-cutlass-dsl==4.4.2
  [pip3] nvidia-cutlass-dsl-libs-base==4.4.2
  [pip3] nvidia-ml-py==13.595.45
  [pip3] nvidia-nccl-cu12==2.27.5
  [pip3] nvidia-nvjitlink-cu12==12.8.93
  [pip3] nvidia-nvshmem-cu12==3.4.5
  [pip3] nvidia-nvtx-cu12==12.8.90
  [pip3] pyzmq==27.1.0
  [pip3] torch==2.10.0+cu128
  [pip3] torch_c_dlpack_ext==0.1.5
  [pip3] torchaudio==2.10.0+cu128
  [pip3] torchvision==0.25.0+cu128
  [pip3] transformers==4.57.6
  [pip3] triton==3.6.0
  [conda] Could not collect

  ==============================
          vLLM Info
  ==============================
  ROCM Version                 : Could not collect
  vLLM Version                 : 0.19.0
  vLLM Build Flags:
    CUDA Archs: Not Set; ROCm: Disabled
  GPU Topology:
      GPU0	CPU Affinity	NUMA Affinity	GPU NUMA ID
  GPU0	 X 	0-23	0		N/A

  Legend:

    X    = Self
    SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
    NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
    PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
    PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
    PIX  = Connection traversing at most a single PCIe bridge
    NV#  = Connection traversing a bonded set of # NVLinks

  ==============================
      Environment Variables
  ==============================
  PYTORCH_NVML_BASED_CUDA_CHECK=1
  TORCHINDUCTOR_COMPILE_THREADS=1
  TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_fqin2

---

import vllm

vllm.LLM(
    model="Qwen/Qwen3-0.6B",
    max_model_len=512,
    max_num_batched_tokens=1,
)

---

File ".../vllm/compilation/piecewise_backend.py", line 356, in __call__
    runtime_shape = args[self.sym_shape_indices[0]]
                         ~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
RAW_BUFFERClick to expand / collapse

Your current environment

<details> <summary>The output of <code>python collect_env.py</code></summary>
  Collecting environment information...
  ==============================
          System Info
  ==============================
  OS                           : Ubuntu 24.04.4 LTS (x86_64)
  GCC version                  : (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
  Clang version                : 15.0.0 ([email protected]:llvm/llvm-project.git 4ba6a9c9f65bbc8bd06e3652cb20fd4dfc846137)
  CMake version                : version 3.28.3
  Libc version                 : glibc-2.39

  ==============================
        PyTorch Info
  ==============================
  PyTorch version              : 2.10.0+cu128
  Is debug build               : False
  CUDA used to build PyTorch   : 12.8
  ROCM used to build PyTorch   : N/A

  ==============================
        Python Environment
  ==============================
  Python version               : 3.12.13 | packaged by conda-forge | (main, Mar  5 2026, 16:50:00) [GCC 14.3.0] (64-bit runtime)
  Python platform              : Linux-6.14.0-37-generic-x86_64-with-glibc2.39

  ==============================
        CUDA / GPU Info
  ==============================
  Is CUDA available            : True
  CUDA runtime version         : Could not collect
  CUDA_MODULE_LOADING set to   : 
  GPU models and configuration : GPU 0: NVIDIA GeForce RTX 4070
  Nvidia driver version        : 575.57.08
  cuDNN version                : Probably one of the following:
  /usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.7
  /usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.7
  HIP runtime version          : N/A
  MIOpen runtime version       : N/A
  Is XNNPACK available         : True

  ==============================
            CPU Info
  ==============================
  Architecture:                            x86_64
  CPU op-mode(s):                          32-bit, 64-bit
  Address sizes:                           39 bits physical, 48 bits virtual
  Byte Order:                              Little Endian
  CPU(s):                                  24
  On-line CPU(s) list:                     0-23
  Vendor ID:                               GenuineIntel
  Model name:                              13th Gen Intel(R) Core(TM) i7-13700F
  CPU family:                              6
  Model:                                   183
  Thread(s) per core:                      2
  Core(s) per socket:                      16
  Socket(s):                               1
  Stepping:                                1
  CPU(s) scaling MHz:                      43%
  CPU max MHz:                             5200.0000
  CPU min MHz:                             800.0000
  BogoMIPS:                                4224.00
  Flags:                                   fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves split_lock_detect user_shstk avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi vnmi umip pku ospke waitpkg gfni vaes vpclmulqdq rdpid movdiri movdir64b fsrm md_clear serialize arch_lbr ibt flush_l1d arch_capabilities
  Virtualization:                          VT-x
  L1d cache:                               640 KiB (16 instances)
  L1i cache:                               768 KiB (16 instances)
  L2 cache:                                24 MiB (10 instances)
  L3 cache:                                30 MiB (1 instance)
  NUMA node(s):                            1
  NUMA node0 CPU(s):                       0-23
  Vulnerability Gather data sampling:      Not affected
  Vulnerability Ghostwrite:                Not affected
  Vulnerability Indirect target selection: Not affected
  Vulnerability Itlb multihit:             Not affected
  Vulnerability L1tf:                      Not affected
  Vulnerability Mds:                       Not affected
  Vulnerability Meltdown:                  Not affected
  Vulnerability Mmio stale data:           Not affected
  Vulnerability Reg file data sampling:    Mitigation; Clear Register File
  Vulnerability Retbleed:                  Not affected
  Vulnerability Spec rstack overflow:      Not affected
  Vulnerability Spec store bypass:         Mitigation; Speculative Store Bypass disabled via prctl
  Vulnerability Spectre v1:                Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Vulnerability Spectre v2:                Mitigation; Enhanced / Automatic IBRS; IBPB conditional; PBRSB-eIBRS SW sequence; BHI BHI_DIS_S
  Vulnerability Srbds:                     Not affected
  Vulnerability Tsa:                       Not affected
  Vulnerability Tsx async abort:           Not affected
  Vulnerability Vmscape:                   Mitigation; IBPB before exit to userspace

  ==============================
  Versions of relevant libraries
  ==============================
  [pip3] flashinfer-python==0.6.6
  [pip3] numpy==2.2.6
  [pip3] nvidia-cublas-cu12==12.8.4.1
  [pip3] nvidia-cuda-cupti-cu12==12.8.90
  [pip3] nvidia-cuda-nvrtc-cu12==12.8.93
  [pip3] nvidia-cuda-runtime-cu12==12.8.90
  [pip3] nvidia-cudnn-cu12==9.10.2.21
  [pip3] nvidia-cudnn-frontend==1.18.0
  [pip3] nvidia-cufft-cu12==11.3.3.83
  [pip3] nvidia-cufile-cu12==1.13.1.3
  [pip3] nvidia-curand-cu12==10.3.9.90
  [pip3] nvidia-cusolver-cu12==11.7.3.90
  [pip3] nvidia-cusparse-cu12==12.5.8.93
  [pip3] nvidia-cusparselt-cu12==0.7.1
  [pip3] nvidia-cutlass-dsl==4.4.2
  [pip3] nvidia-cutlass-dsl-libs-base==4.4.2
  [pip3] nvidia-ml-py==13.595.45
  [pip3] nvidia-nccl-cu12==2.27.5
  [pip3] nvidia-nvjitlink-cu12==12.8.93
  [pip3] nvidia-nvshmem-cu12==3.4.5
  [pip3] nvidia-nvtx-cu12==12.8.90
  [pip3] pyzmq==27.1.0
  [pip3] torch==2.10.0+cu128
  [pip3] torch_c_dlpack_ext==0.1.5
  [pip3] torchaudio==2.10.0+cu128
  [pip3] torchvision==0.25.0+cu128
  [pip3] transformers==4.57.6
  [pip3] triton==3.6.0
  [conda] Could not collect

  ==============================
          vLLM Info
  ==============================
  ROCM Version                 : Could not collect
  vLLM Version                 : 0.19.0
  vLLM Build Flags:
    CUDA Archs: Not Set; ROCm: Disabled
  GPU Topology:
      GPU0	CPU Affinity	NUMA Affinity	GPU NUMA ID
  GPU0	 X 	0-23	0		N/A

  Legend:

    X    = Self
    SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
    NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
    PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
    PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
    PIX  = Connection traversing at most a single PCIe bridge
    NV#  = Connection traversing a bonded set of # NVLinks

  ==============================
      Environment Variables
  ==============================
  PYTORCH_NVML_BASED_CUDA_CHECK=1
  TORCHINDUCTOR_COMPILE_THREADS=1
  TORCHINDUCTOR_CACHE_DIR=/tmp/torchinductor_fqin2
</details>

🐛 Describe the bug

Reproduce

import vllm

vllm.LLM(
    model="Qwen/Qwen3-0.6B",
    max_model_len=512,
    max_num_batched_tokens=1,
)

EngineCore stderr:

File ".../vllm/compilation/piecewise_backend.py", line 356, in __call__
    runtime_shape = args[self.sym_shape_indices[0]]
                         ~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Expected

Add a validity checker at construction time. The backend assumes self.sym_shape_indices has a valid index into args for whatever batch size it's running, but for a single-token batch this is empty/out-of-range.

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.

extent analysis

TL;DR

The issue can be fixed by adding a validity checker at construction time to ensure self.sym_shape_indices has a valid index into args for the given batch size.

Guidance

  • The error occurs because self.sym_shape_indices is empty when the batch size is 1, causing an "IndexError: list index out of range" exception.
  • To fix this, a validity checker should be added at construction time to verify that self.sym_shape_indices has a valid index into args for the given batch size.
  • The checker should handle the case where the batch size is 1 and self.sym_shape_indices is empty.
  • The vllm.LLM constructor should be modified to include this validity checker.

Example

class LLM:
    def __init__(self, model, max_model_len, max_num_batched_tokens):
        # ... existing code ...
        if max_num_batched_tokens == 1 and not self.sym_shape_indices:
            raise ValueError("Invalid batch size: sym_shape_indices is empty")
        # ... existing code ...

Notes

  • This fix assumes that the vllm.LLM constructor is the correct place to add the validity checker.
  • The exact implementation of the validity checker may vary depending on the specific requirements of the vllm library.

Recommendation

Apply workaround: Add a validity checker at construction time to ensure self.sym_shape_indices has a valid index into args for the given batch size. This will prevent the "IndexError: list index out of range" exception and ensure the vllm.LLM constructor handles the case where the batch size is 1.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

vllm - ✅(Solved) Fix [Bug]: `max_num_batched_tokens=1` raises unhandled `IndexError` [1 pull requests, 1 comments, 2 participants]