vllm - 💡(How to fix) Fix [Bug]: --enable-return-routed-experts crashes with AttributeError on non-MoE models after full model load (missing architecture compatibility check)

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…

Error Message

(vllm) root@lizhiyuan-ubuntu-01:~# /root/anaconda3/envs/vllm/bin/vllm serve /root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct --host 127.0.0.1 --port 19354 --enable-return-routed-experts (APIServer pid=1033505) INFO 05-14 11:07:22 [api_server.py:1272] vLLM API server version 0.14.1 (APIServer pid=1033505) INFO 05-14 11:07:22 [utils.py:263] non-default args: {'model_tag': '/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', 'host': '127.0.0.1', 'port': 19354, 'model': '/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', 'enable_return_routed_experts': True} (APIServer pid=1033505) INFO 05-14 11:07:22 [model.py:530] Resolved architecture: LlamaForCausalLM (APIServer pid=1033505) INFO 05-14 11:07:22 [model.py:1545] Using max model len 131072 (APIServer pid=1033505) INFO 05-14 11:07:22 [scheduler.py:229] Chunked prefill is enabled with max_num_batched_tokens=8192. (APIServer pid=1033505) INFO 05-14 11:07:22 [vllm.py:630] Asynchronous scheduling is enabled. (APIServer pid=1033505) INFO 05-14 11:07:22 [vllm.py:637] Disabling NCCL for DP synchronization when using async scheduling. (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:28 [core.py:97] Initializing a V1 LLM engine (v0.14.1) with config: model='/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', speculative_config=None, tokenizer='/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=131072, download_dir=None, load_format=auto, tensor_parallel_size=1, pipeline_parallel_size=1, data_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, enable_return_routed_experts=True, kv_cache_dtype=auto, device_config=cuda, structured_outputs_config=StructuredOutputsConfig(backend='auto', disable_fallback=False, disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser='', reasoning_parser_plugin='', enable_in_reasoning=False), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None, kv_cache_metrics=False, kv_cache_metrics_sample=0.01, cudagraph_metrics=False, enable_layerwise_nvtx_tracing=False, enable_mfu_metrics=False, enable_mm_processor_stats=False, enable_logging_iteration_details=False), seed=0, served_model_name=/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct, enable_prefix_caching=True, enable_chunked_prefill=True, pooler_config=None, compilation_config={'level': None, 'mode': <CompilationMode.VLLM_COMPILE: 3>, 'debug_dump_path': None, 'cache_dir': '', 'compile_cache_save_format': 'binary', 'backend': 'inductor', 'custom_ops': ['none'], 'splitting_ops': ['vllm::unified_attention', 'vllm::unified_attention_with_output', 'vllm::unified_mla_attention', 'vllm::unified_mla_attention_with_output', 'vllm::mamba_mixer2', 'vllm::mamba_mixer', 'vllm::short_conv', 'vllm::linear_attention', 'vllm::plamo2_mamba_mixer', 'vllm::gdn_attention_core', 'vllm::kda_attention', 'vllm::sparse_attn_indexer'], 'compile_mm_encoder': False, 'compile_sizes': [], 'compile_ranges_split_points': [8192], 'inductor_compile_config': {'enable_auto_functionalized_v2': False, 'combo_kernels': True, 'benchmark_combo_kernel': True}, 'inductor_passes': {}, 'cudagraph_mode': <CUDAGraphMode.FULL_AND_PIECEWISE: (2, 1)>, 'cudagraph_num_of_warmups': 1, 'cudagraph_capture_sizes': [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496, 512], 'cudagraph_copy_inputs': False, 'cudagraph_specialize_lora': True, 'use_inductor_graph_partition': False, 'pass_config': {'fuse_norm_quant': False, 'fuse_act_quant': False, 'fuse_attn_quant': False, 'eliminate_noops': True, 'enable_sp': False, 'fuse_gemm_comms': False, 'fuse_allreduce_rms': False}, 'max_cudagraph_capture_size': 512, 'dynamic_shapes_config': {'type': <DynamicShapesType.BACKED: 'backed'>, 'evaluate_guards': False, 'assume_32_bit_indexing': True}, 'local_cache_dir': None} (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [parallel_state.py:1214] world_size=1 rank=0 local_rank=0 distributed_init_method=tcp://172.17.0.4:60409 backend=nccl (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [parallel_state.py:1425] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, PCP rank 0, TP rank 0, EP rank N/A (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [gpu_model_runner.py:3808] Starting to load model /root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct... (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:30 [cuda.py:351] Using FLASH_ATTN attention backend out of potential backends: ('FLASH_ATTN', 'FLASHINFER', 'TRITON_ATTN', 'FLEX_ATTENTION') Loading safetensors checkpoint shards: 0% Completed | 0/4 [00:00<?, ?it/s] Loading safetensors checkpoint shards: 25% Completed | 1/4 [00:00<00:00, 4.63it/s] Loading safetensors checkpoint shards: 50% Completed | 2/4 [00:01<00:01, 1.54it/s] Loading safetensors checkpoint shards: 75% Completed | 3/4 [00:02<00:00, 1.04it/s] Loading safetensors checkpoint shards: 100% Completed | 4/4 [00:03<00:00, 1.11s/it] Loading safetensors checkpoint shards: 100% Completed | 4/4 [00:03<00:00, 1.05it/s] (EngineCore_DP0 pid=1033779) (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:34 [default_loader.py:291] Loading weights took 3.90 seconds (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:34 [gpu_model_runner.py:3905] Model loading took 14.99 GiB memory and 4.328942 seconds (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:39 [backends.py:644] Using cache directory: /root/.cache/vllm/torch_compile_cache/5c72d10b53/rank_0_0/backbone for vLLM's torch.compile (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:39 [backends.py:704] Dynamo bytecode transform time: 4.96 s (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:44 [backends.py:226] Directly load the compiled graph(s) for compile range (1, 8192) from the cache, took 0.777 s (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:44 [monitor.py:34] torch.compile takes 5.74 s in total (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [gpu_worker.py:358] Available KV cache memory: 51.39 GiB (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [kv_cache_utils.py:1305] GPU KV cache size: 420,944 tokens (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [kv_cache_utils.py:1310] Maximum concurrency for 131,072 tokens per request: 3.21x (EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [gpu_model_runner.py:5672] Initializing routed experts capturer, enable_return_routed_experts: True (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] EngineCore failed to start. (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] Traceback (most recent call last): (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 927, in run_engine_core (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs) (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 692, in init (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] super().init( (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 113, in init (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches( (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] ^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 270, in _initialize_kv_caches (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] self.model_executor.initialize_from_config(kv_cache_configs) (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 115, in initialize_from_config (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] self.collective_rpc("initialize_from_config", args=(kv_cache_configs,)) (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 75, in collective_rpc (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] result = run_method(self.driver_worker, method, args, kwargs) (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 461, in run_method (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] return func(*args, **kwargs) (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] ^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/worker_base.py", line 320, in initialize_from_config (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] self.worker.initialize_from_config(kv_cache_config) # type: ignore (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 415, in initialize_from_config (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] self.model_runner.initialize_kv_cache(kv_cache_config) (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5669, in initialize_kv_cache (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] self.init_routed_experts_capturer() (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5683, in init_routed_experts_capturer (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] routed_experts_capturer.init_buffer( (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/fused_moe/routed_experts_capturer.py", line 131, in init_buffer (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] num_experts_per_tok = hf_config.num_experts_per_tok (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/transformers/configuration_utils.py", line 207, in getattribute (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] return super().getattribute(key) (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] AttributeError: 'LlamaConfig' object has no attribute 'num_experts_per_tok' (EngineCore_DP0 pid=1033779) Process EngineCore_DP0: (EngineCore_DP0 pid=1033779) Traceback (most recent call last): (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap (EngineCore_DP0 pid=1033779) self.run() (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/multiprocessing/process.py", line 108, in run (EngineCore_DP0 pid=1033779) self._target(*self._args, **self._kwargs) (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 940, in run_engine_core (EngineCore_DP0 pid=1033779) raise e (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 927, in run_engine_core (EngineCore_DP0 pid=1033779) engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs) (EngineCore_DP0 pid=1033779) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 692, in init (EngineCore_DP0 pid=1033779) super().init( (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 113, in init (EngineCore_DP0 pid=1033779) num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches( (EngineCore_DP0 pid=1033779) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 270, in _initialize_kv_caches (EngineCore_DP0 pid=1033779) self.model_executor.initialize_from_config(kv_cache_configs) (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 115, in initialize_from_config (EngineCore_DP0 pid=1033779) self.collective_rpc("initialize_from_config", args=(kv_cache_configs,)) (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 75, in collective_rpc (EngineCore_DP0 pid=1033779) result = run_method(self.driver_worker, method, args, kwargs) (EngineCore_DP0 pid=1033779) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 461, in run_method (EngineCore_DP0 pid=1033779) return func(*args, **kwargs) (EngineCore_DP0 pid=1033779) ^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/worker_base.py", line 320, in initialize_from_config (EngineCore_DP0 pid=1033779) self.worker.initialize_from_config(kv_cache_config) # type: ignore (EngineCore_DP0 pid=1033779) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 415, in initialize_from_config (EngineCore_DP0 pid=1033779) self.model_runner.initialize_kv_cache(kv_cache_config) (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5669, in initialize_kv_cache (EngineCore_DP0 pid=1033779) self.init_routed_experts_capturer() (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5683, in init_routed_experts_capturer (EngineCore_DP0 pid=1033779) routed_experts_capturer.init_buffer( (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/fused_moe/routed_experts_capturer.py", line 131, in init_buffer (EngineCore_DP0 pid=1033779) num_experts_per_tok = hf_config.num_experts_per_tok (EngineCore_DP0 pid=1033779) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/transformers/configuration_utils.py", line 207, in getattribute (EngineCore_DP0 pid=1033779) return super().getattribute(key) (EngineCore_DP0 pid=1033779) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (EngineCore_DP0 pid=1033779) AttributeError: 'LlamaConfig' object has no attribute 'num_experts_per_tok' [rank0]:[W514 11:07:46.937383087 ProcessGroupNCCL.cpp:1524] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator()) (APIServer pid=1033505) Traceback (most recent call last): (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/bin/vllm", line 7, in <module> (APIServer pid=1033505) sys.exit(main()) (APIServer pid=1033505) ^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/cli/main.py", line 73, in main (APIServer pid=1033505) args.dispatch_function(args) (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/cli/serve.py", line 60, in cmd (APIServer pid=1033505) uvloop.run(run_server(args)) (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/uvloop/init.py", line 96, in run (APIServer pid=1033505) return __asyncio.run( (APIServer pid=1033505) ^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/asyncio/runners.py", line 195, in run (APIServer pid=1033505) return runner.run(main) (APIServer pid=1033505) ^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/asyncio/runners.py", line 118, in run (APIServer pid=1033505) return self._loop.run_until_complete(task) (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/uvloop/init.py", line 48, in wrapper (APIServer pid=1033505) return await main (APIServer pid=1033505) ^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 1319, in run_server (APIServer pid=1033505) await run_server_worker(listen_address, sock, args, **uvicorn_kwargs) (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 1338, in run_server_worker (APIServer pid=1033505) async with build_async_engine_client( (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 210, in aenter (APIServer pid=1033505) return await anext(self.gen) (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 173, in build_async_engine_client (APIServer pid=1033505) async with build_async_engine_client_from_engine_args( (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 210, in aenter (APIServer pid=1033505) return await anext(self.gen) (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 214, in build_async_engine_client_from_engine_args (APIServer pid=1033505) async_llm = AsyncLLM.from_vllm_config( (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 205, in from_vllm_config (APIServer pid=1033505) return cls( (APIServer pid=1033505) ^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 132, in init (APIServer pid=1033505) self.engine_core = EngineCoreClient.make_async_mp_client( (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 122, in make_async_mp_client (APIServer pid=1033505) return AsyncMPClient(*client_args) (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 824, in init (APIServer pid=1033505) super().init( (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 479, in init (APIServer pid=1033505) with launch_core_engines(vllm_config, executor_class, log_stats) as ( (APIServer pid=1033505) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 144, in exit (APIServer pid=1033505) next(self.gen) (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 921, in launch_core_engines (APIServer pid=1033505) wait_for_engine_startup( (APIServer pid=1033505) File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 980, in wait_for_engine_startup (APIServer pid=1033505) raise RuntimeError( (APIServer pid=1033505) RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}

Root Cause

When serving a dense (non-MoE) model such as Meta-Llama-3.1-8B-Instruct with --enable-return-routed-experts, the CLI and config validation both accept the flag without complaint, but the server crashes deep into KV cache initialization with an AttributeError because LlamaConfig has no num_experts_per_tok attribute.

Fix Action

Fix / Workaround

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

Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Address sizes: 52 bits physical, 57 bits virtual Byte Order: Little Endian CPU(s): 128 On-line CPU(s) list: 0-127 Vendor ID: GenuineIntel Model name: Intel(R) Xeon(R) Gold 6430 CPU family: 6 Model: 143 Thread(s) per core: 2 Core(s) per socket: 32 Socket(s): 2 Stepping: 8 CPU max MHz: 3400.0000 CPU min MHz: 800.0000 BogoMIPS: 4200.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 smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities ibpb_exit_to_user Virtualization: VT-x L1d cache: 3 MiB (64 instances) L1i cache: 2 MiB (64 instances) L2 cache: 128 MiB (64 instances) L3 cache: 120 MiB (2 instances) NUMA node(s): 2 NUMA node0 CPU(s): 0-31,64-95 NUMA node1 CPU(s): 32-63,96-127 Vulnerability Gather data sampling: 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: Not affected 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

vllm serve <path-to-Meta-Llama-3.1-8B-Instruct> \
  --host 127.0.0.1 \
  --port 19354 \
  --enable-return-routed-experts
(vllm) root@lizhiyuan-ubuntu-01:~# /root/anaconda3/envs/vllm/bin/vllm serve   /root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct   --host 127.0.0.1   --port 19354   --enable-return-routed-experts
(APIServer pid=1033505) INFO 05-14 11:07:22 [api_server.py:1272] vLLM API server version 0.14.1
(APIServer pid=1033505) INFO 05-14 11:07:22 [utils.py:263] non-default args: {'model_tag': '/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', 'host': '127.0.0.1', 'port': 19354, 'model': '/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', 'enable_return_routed_experts': True}
(APIServer pid=1033505) INFO 05-14 11:07:22 [model.py:530] Resolved architecture: LlamaForCausalLM
(APIServer pid=1033505) INFO 05-14 11:07:22 [model.py:1545] Using max model len 131072
(APIServer pid=1033505) INFO 05-14 11:07:22 [scheduler.py:229] Chunked prefill is enabled with max_num_batched_tokens=8192.
(APIServer pid=1033505) INFO 05-14 11:07:22 [vllm.py:630] Asynchronous scheduling is enabled.
(APIServer pid=1033505) INFO 05-14 11:07:22 [vllm.py:637] Disabling NCCL for DP synchronization when using async scheduling.
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:28 [core.py:97] Initializing a V1 LLM engine (v0.14.1) with config: model='/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', speculative_config=None, tokenizer='/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=131072, download_dir=None, load_format=auto, tensor_parallel_size=1, pipeline_parallel_size=1, data_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, enable_return_routed_experts=True, kv_cache_dtype=auto, device_config=cuda, structured_outputs_config=StructuredOutputsConfig(backend='auto', disable_fallback=False, disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser='', reasoning_parser_plugin='', enable_in_reasoning=False), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None, kv_cache_metrics=False, kv_cache_metrics_sample=0.01, cudagraph_metrics=False, enable_layerwise_nvtx_tracing=False, enable_mfu_metrics=False, enable_mm_processor_stats=False, enable_logging_iteration_details=False), seed=0, served_model_name=/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct, enable_prefix_caching=True, enable_chunked_prefill=True, pooler_config=None, compilation_config={'level': None, 'mode': <CompilationMode.VLLM_COMPILE: 3>, 'debug_dump_path': None, 'cache_dir': '', 'compile_cache_save_format': 'binary', 'backend': 'inductor', 'custom_ops': ['none'], 'splitting_ops': ['vllm::unified_attention', 'vllm::unified_attention_with_output', 'vllm::unified_mla_attention', 'vllm::unified_mla_attention_with_output', 'vllm::mamba_mixer2', 'vllm::mamba_mixer', 'vllm::short_conv', 'vllm::linear_attention', 'vllm::plamo2_mamba_mixer', 'vllm::gdn_attention_core', 'vllm::kda_attention', 'vllm::sparse_attn_indexer'], 'compile_mm_encoder': False, 'compile_sizes': [], 'compile_ranges_split_points': [8192], 'inductor_compile_config': {'enable_auto_functionalized_v2': False, 'combo_kernels': True, 'benchmark_combo_kernel': True}, 'inductor_passes': {}, 'cudagraph_mode': <CUDAGraphMode.FULL_AND_PIECEWISE: (2, 1)>, 'cudagraph_num_of_warmups': 1, 'cudagraph_capture_sizes': [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496, 512], 'cudagraph_copy_inputs': False, 'cudagraph_specialize_lora': True, 'use_inductor_graph_partition': False, 'pass_config': {'fuse_norm_quant': False, 'fuse_act_quant': False, 'fuse_attn_quant': False, 'eliminate_noops': True, 'enable_sp': False, 'fuse_gemm_comms': False, 'fuse_allreduce_rms': False}, 'max_cudagraph_capture_size': 512, 'dynamic_shapes_config': {'type': <DynamicShapesType.BACKED: 'backed'>, 'evaluate_guards': False, 'assume_32_bit_indexing': True}, 'local_cache_dir': None}
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [parallel_state.py:1214] world_size=1 rank=0 local_rank=0 distributed_init_method=tcp://172.17.0.4:60409 backend=nccl
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [parallel_state.py:1425] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, PCP rank 0, TP rank 0, EP rank N/A
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [gpu_model_runner.py:3808] Starting to load model /root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct...
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:30 [cuda.py:351] Using FLASH_ATTN attention backend out of potential backends: ('FLASH_ATTN', 'FLASHINFER', 'TRITON_ATTN', 'FLEX_ATTENTION')
Loading safetensors checkpoint shards:   0% Completed | 0/4 [00:00<?, ?it/s]
Loading safetensors checkpoint shards:  25% Completed | 1/4 [00:00<00:00,  4.63it/s]
Loading safetensors checkpoint shards:  50% Completed | 2/4 [00:01<00:01,  1.54it/s]
Loading safetensors checkpoint shards:  75% Completed | 3/4 [00:02<00:00,  1.04it/s]
Loading safetensors checkpoint shards: 100% Completed | 4/4 [00:03<00:00,  1.11s/it]
Loading safetensors checkpoint shards: 100% Completed | 4/4 [00:03<00:00,  1.05it/s]
(EngineCore_DP0 pid=1033779) 
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:34 [default_loader.py:291] Loading weights took 3.90 seconds
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:34 [gpu_model_runner.py:3905] Model loading took 14.99 GiB memory and 4.328942 seconds
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:39 [backends.py:644] Using cache directory: /root/.cache/vllm/torch_compile_cache/5c72d10b53/rank_0_0/backbone for vLLM's torch.compile
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:39 [backends.py:704] Dynamo bytecode transform time: 4.96 s
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:44 [backends.py:226] Directly load the compiled graph(s) for compile range (1, 8192) from the cache, took 0.777 s
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:44 [monitor.py:34] torch.compile takes 5.74 s in total
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [gpu_worker.py:358] Available KV cache memory: 51.39 GiB
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [kv_cache_utils.py:1305] GPU KV cache size: 420,944 tokens
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [kv_cache_utils.py:1310] Maximum concurrency for 131,072 tokens per request: 3.21x
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [gpu_model_runner.py:5672] Initializing routed experts capturer, enable_return_routed_experts: True
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] EngineCore failed to start.
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] Traceback (most recent call last):
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 927, in run_engine_core
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 692, in __init__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     super().__init__(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 113, in __init__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 270, in _initialize_kv_caches
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.model_executor.initialize_from_config(kv_cache_configs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 115, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.collective_rpc("initialize_from_config", args=(kv_cache_configs,))
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 75, in collective_rpc
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 461, in run_method
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     return func(*args, **kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/worker_base.py", line 320, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.worker.initialize_from_config(kv_cache_config)  # type: ignore
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 415, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.model_runner.initialize_kv_cache(kv_cache_config)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5669, in initialize_kv_cache
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.init_routed_experts_capturer()
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5683, in init_routed_experts_capturer
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     routed_experts_capturer.init_buffer(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/fused_moe/routed_experts_capturer.py", line 131, in init_buffer
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     num_experts_per_tok = hf_config.num_experts_per_tok
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/transformers/configuration_utils.py", line 207, in __getattribute__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     return super().__getattribute__(key)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] AttributeError: 'LlamaConfig' object has no attribute 'num_experts_per_tok'
(EngineCore_DP0 pid=1033779) Process EngineCore_DP0:
(EngineCore_DP0 pid=1033779) Traceback (most recent call last):
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
(EngineCore_DP0 pid=1033779)     self.run()
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/multiprocessing/process.py", line 108, in run
(EngineCore_DP0 pid=1033779)     self._target(*self._args, **self._kwargs)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 940, in run_engine_core
(EngineCore_DP0 pid=1033779)     raise e
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 927, in run_engine_core
(EngineCore_DP0 pid=1033779)     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore_DP0 pid=1033779)                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 692, in __init__
(EngineCore_DP0 pid=1033779)     super().__init__(
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 113, in __init__
(EngineCore_DP0 pid=1033779)     num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches(
(EngineCore_DP0 pid=1033779)                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 270, in _initialize_kv_caches
(EngineCore_DP0 pid=1033779)     self.model_executor.initialize_from_config(kv_cache_configs)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 115, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.collective_rpc("initialize_from_config", args=(kv_cache_configs,))
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 75, in collective_rpc
(EngineCore_DP0 pid=1033779)     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore_DP0 pid=1033779)              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 461, in run_method
(EngineCore_DP0 pid=1033779)     return func(*args, **kwargs)
(EngineCore_DP0 pid=1033779)            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/worker_base.py", line 320, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.worker.initialize_from_config(kv_cache_config)  # type: ignore
(EngineCore_DP0 pid=1033779)     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 415, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.model_runner.initialize_kv_cache(kv_cache_config)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5669, in initialize_kv_cache
(EngineCore_DP0 pid=1033779)     self.init_routed_experts_capturer()
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5683, in init_routed_experts_capturer
(EngineCore_DP0 pid=1033779)     routed_experts_capturer.init_buffer(
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/fused_moe/routed_experts_capturer.py", line 131, in init_buffer
(EngineCore_DP0 pid=1033779)     num_experts_per_tok = hf_config.num_experts_per_tok
(EngineCore_DP0 pid=1033779)                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/transformers/configuration_utils.py", line 207, in __getattribute__
(EngineCore_DP0 pid=1033779)     return super().__getattribute__(key)
(EngineCore_DP0 pid=1033779)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) AttributeError: 'LlamaConfig' object has no attribute 'num_experts_per_tok'
[rank0]:[W514 11:07:46.937383087 ProcessGroupNCCL.cpp:1524] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())
(APIServer pid=1033505) Traceback (most recent call last):
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/bin/vllm", line 7, in <module>
(APIServer pid=1033505)     sys.exit(main())
(APIServer pid=1033505)              ^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/cli/main.py", line 73, in main
(APIServer pid=1033505)     args.dispatch_function(args)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/cli/serve.py", line 60, in cmd
(APIServer pid=1033505)     uvloop.run(run_server(args))
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/uvloop/__init__.py", line 96, in run
(APIServer pid=1033505)     return __asyncio.run(
(APIServer pid=1033505)            ^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/asyncio/runners.py", line 195, in run
(APIServer pid=1033505)     return runner.run(main)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/asyncio/runners.py", line 118, in run
(APIServer pid=1033505)     return self._loop.run_until_complete(task)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/uvloop/__init__.py", line 48, in wrapper
(APIServer pid=1033505)     return await main
(APIServer pid=1033505)            ^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 1319, in run_server
(APIServer pid=1033505)     await run_server_worker(listen_address, sock, args, **uvicorn_kwargs)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 1338, in run_server_worker
(APIServer pid=1033505)     async with build_async_engine_client(
(APIServer pid=1033505)                ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 210, in __aenter__
(APIServer pid=1033505)     return await anext(self.gen)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 173, in build_async_engine_client
(APIServer pid=1033505)     async with build_async_engine_client_from_engine_args(
(APIServer pid=1033505)                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 210, in __aenter__
(APIServer pid=1033505)     return await anext(self.gen)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 214, in build_async_engine_client_from_engine_args
(APIServer pid=1033505)     async_llm = AsyncLLM.from_vllm_config(
(APIServer pid=1033505)                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 205, in from_vllm_config
(APIServer pid=1033505)     return cls(
(APIServer pid=1033505)            ^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 132, in __init__
(APIServer pid=1033505)     self.engine_core = EngineCoreClient.make_async_mp_client(
(APIServer pid=1033505)                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 122, in make_async_mp_client
(APIServer pid=1033505)     return AsyncMPClient(*client_args)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 824, in __init__
(APIServer pid=1033505)     super().__init__(
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 479, in __init__
(APIServer pid=1033505)     with launch_core_engines(vllm_config, executor_class, log_stats) as (
(APIServer pid=1033505)          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 144, in __exit__
(APIServer pid=1033505)     next(self.gen)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 921, in launch_core_engines
(APIServer pid=1033505)     wait_for_engine_startup(
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 980, in wait_for_engine_startup
(APIServer pid=1033505)     raise RuntimeError(
(APIServer pid=1033505) RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}

Expected Behavior

Code Example

Collecting environment information...
==============================
        System Info
==============================
OS                           : Ubuntu 22.04.3 LTS (x86_64)
GCC version                  : (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version                : Could not collect
CMake version                : version 3.22.1
Libc version                 : glibc-2.35

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

==============================
      Python Environment
==============================
Python version               : 3.12.12 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 20:16:04) [GCC 11.2.0] (64-bit runtime)
Python platform              : Linux-6.8.0-110-generic-x86_64-with-glibc2.35
    
==============================
       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 H100 80GB HBM3
Nvidia driver version        : 570.124.06
cuDNN version                : Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.0
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:                           52 bits physical, 57 bits virtual
Byte Order:                              Little Endian
CPU(s):                                  128
On-line CPU(s) list:                     0-127
Vendor ID:                               GenuineIntel
Model name:                              Intel(R) Xeon(R) Gold 6430
CPU family:                              6
Model:                                   143
Thread(s) per core:                      2
Core(s) per socket:                      32
Socket(s):                               2
Stepping:                                8
CPU max MHz:                             3400.0000
CPU min MHz:                             800.0000
BogoMIPS:                                4200.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 smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities ibpb_exit_to_user
Virtualization:                          VT-x
L1d cache:                               3 MiB (64 instances)
L1i cache:                               2 MiB (64 instances)
L2 cache:                                128 MiB (64 instances)
L3 cache:                                120 MiB (2 instances)
NUMA node(s):                            2
NUMA node0 CPU(s):                       0-31,64-95
NUMA node1 CPU(s):                       32-63,96-127
Vulnerability Gather data sampling:      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:    Not affected
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.5.3
[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.3.5
[pip3] nvidia-ml-py==13.590.48
[pip3] nvidia-nccl-cu12==2.27.5
[pip3] nvidia-nvjitlink-cu12==12.8.93
[pip3] nvidia-nvshmem-cu12==3.3.20
[pip3] nvidia-nvtx-cu12==12.8.90
[pip3] pyzmq==27.1.0
[pip3] torch==2.9.1+cu128
[pip3] torchaudio==2.9.1+cu128
[pip3] torchvision==0.24.1+cu128
[pip3] transformers==4.57.6
[pip3] triton==3.5.1
[conda] flashinfer-python         0.5.3                    pypi_0    pypi
[conda] numpy                     2.2.6                    pypi_0    pypi
[conda] nvidia-cublas-cu12        12.8.4.1                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.8.90                  pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.8.93                  pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.8.90                  pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.10.2.21                pypi_0    pypi
[conda] nvidia-cudnn-frontend     1.18.0                   pypi_0    pypi
[conda] nvidia-cufft-cu12         11.3.3.83                pypi_0    pypi
[conda] nvidia-cufile-cu12        1.13.1.3                 pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.9.90                pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.7.3.90                pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.5.8.93                pypi_0    pypi
[conda] nvidia-cusparselt-cu12    0.7.1                    pypi_0    pypi
[conda] nvidia-cutlass-dsl        4.3.5                    pypi_0    pypi
[conda] nvidia-ml-py              13.590.48                pypi_0    pypi
[conda] nvidia-nccl-cu12          2.27.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.8.93                  pypi_0    pypi
[conda] nvidia-nvshmem-cu12       3.3.20                   pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.8.90                  pypi_0    pypi
[conda] pyzmq                     27.1.0                   pypi_0    pypi
[conda] torch                     2.9.1+cu128              pypi_0    pypi
[conda] torchaudio                2.9.1+cu128              pypi_0    pypi
[conda] torchvision               0.24.1+cu128             pypi_0    pypi
[conda] transformers              4.57.6                   pypi_0    pypi
[conda] triton                    3.5.1                    pypi_0    pypi

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.14.1
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled; XPU: Disabled
GPU Topology:
        GPU0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      32-63,96-127    1               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

---

vllm serve <path-to-Meta-Llama-3.1-8B-Instruct> \
  --host 127.0.0.1 \
  --port 19354 \
  --enable-return-routed-experts

---

(vllm) root@lizhiyuan-ubuntu-01:~# /root/anaconda3/envs/vllm/bin/vllm serve   /root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct   --host 127.0.0.1   --port 19354   --enable-return-routed-experts
(APIServer pid=1033505) INFO 05-14 11:07:22 [api_server.py:1272] vLLM API server version 0.14.1
(APIServer pid=1033505) INFO 05-14 11:07:22 [utils.py:263] non-default args: {'model_tag': '/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', 'host': '127.0.0.1', 'port': 19354, 'model': '/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', 'enable_return_routed_experts': True}
(APIServer pid=1033505) INFO 05-14 11:07:22 [model.py:530] Resolved architecture: LlamaForCausalLM
(APIServer pid=1033505) INFO 05-14 11:07:22 [model.py:1545] Using max model len 131072
(APIServer pid=1033505) INFO 05-14 11:07:22 [scheduler.py:229] Chunked prefill is enabled with max_num_batched_tokens=8192.
(APIServer pid=1033505) INFO 05-14 11:07:22 [vllm.py:630] Asynchronous scheduling is enabled.
(APIServer pid=1033505) INFO 05-14 11:07:22 [vllm.py:637] Disabling NCCL for DP synchronization when using async scheduling.
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:28 [core.py:97] Initializing a V1 LLM engine (v0.14.1) with config: model='/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', speculative_config=None, tokenizer='/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=131072, download_dir=None, load_format=auto, tensor_parallel_size=1, pipeline_parallel_size=1, data_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, enable_return_routed_experts=True, kv_cache_dtype=auto, device_config=cuda, structured_outputs_config=StructuredOutputsConfig(backend='auto', disable_fallback=False, disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser='', reasoning_parser_plugin='', enable_in_reasoning=False), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None, kv_cache_metrics=False, kv_cache_metrics_sample=0.01, cudagraph_metrics=False, enable_layerwise_nvtx_tracing=False, enable_mfu_metrics=False, enable_mm_processor_stats=False, enable_logging_iteration_details=False), seed=0, served_model_name=/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct, enable_prefix_caching=True, enable_chunked_prefill=True, pooler_config=None, compilation_config={'level': None, 'mode': <CompilationMode.VLLM_COMPILE: 3>, 'debug_dump_path': None, 'cache_dir': '', 'compile_cache_save_format': 'binary', 'backend': 'inductor', 'custom_ops': ['none'], 'splitting_ops': ['vllm::unified_attention', 'vllm::unified_attention_with_output', 'vllm::unified_mla_attention', 'vllm::unified_mla_attention_with_output', 'vllm::mamba_mixer2', 'vllm::mamba_mixer', 'vllm::short_conv', 'vllm::linear_attention', 'vllm::plamo2_mamba_mixer', 'vllm::gdn_attention_core', 'vllm::kda_attention', 'vllm::sparse_attn_indexer'], 'compile_mm_encoder': False, 'compile_sizes': [], 'compile_ranges_split_points': [8192], 'inductor_compile_config': {'enable_auto_functionalized_v2': False, 'combo_kernels': True, 'benchmark_combo_kernel': True}, 'inductor_passes': {}, 'cudagraph_mode': <CUDAGraphMode.FULL_AND_PIECEWISE: (2, 1)>, 'cudagraph_num_of_warmups': 1, 'cudagraph_capture_sizes': [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496, 512], 'cudagraph_copy_inputs': False, 'cudagraph_specialize_lora': True, 'use_inductor_graph_partition': False, 'pass_config': {'fuse_norm_quant': False, 'fuse_act_quant': False, 'fuse_attn_quant': False, 'eliminate_noops': True, 'enable_sp': False, 'fuse_gemm_comms': False, 'fuse_allreduce_rms': False}, 'max_cudagraph_capture_size': 512, 'dynamic_shapes_config': {'type': <DynamicShapesType.BACKED: 'backed'>, 'evaluate_guards': False, 'assume_32_bit_indexing': True}, 'local_cache_dir': None}
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [parallel_state.py:1214] world_size=1 rank=0 local_rank=0 distributed_init_method=tcp://172.17.0.4:60409 backend=nccl
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [parallel_state.py:1425] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, PCP rank 0, TP rank 0, EP rank N/A
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [gpu_model_runner.py:3808] Starting to load model /root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct...
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:30 [cuda.py:351] Using FLASH_ATTN attention backend out of potential backends: ('FLASH_ATTN', 'FLASHINFER', 'TRITON_ATTN', 'FLEX_ATTENTION')
Loading safetensors checkpoint shards:   0% Completed | 0/4 [00:00<?, ?it/s]
Loading safetensors checkpoint shards:  25% Completed | 1/4 [00:00<00:00,  4.63it/s]
Loading safetensors checkpoint shards:  50% Completed | 2/4 [00:01<00:01,  1.54it/s]
Loading safetensors checkpoint shards:  75% Completed | 3/4 [00:02<00:00,  1.04it/s]
Loading safetensors checkpoint shards: 100% Completed | 4/4 [00:03<00:00,  1.11s/it]
Loading safetensors checkpoint shards: 100% Completed | 4/4 [00:03<00:00,  1.05it/s]
(EngineCore_DP0 pid=1033779) 
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:34 [default_loader.py:291] Loading weights took 3.90 seconds
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:34 [gpu_model_runner.py:3905] Model loading took 14.99 GiB memory and 4.328942 seconds
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:39 [backends.py:644] Using cache directory: /root/.cache/vllm/torch_compile_cache/5c72d10b53/rank_0_0/backbone for vLLM's torch.compile
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:39 [backends.py:704] Dynamo bytecode transform time: 4.96 s
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:44 [backends.py:226] Directly load the compiled graph(s) for compile range (1, 8192) from the cache, took 0.777 s
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:44 [monitor.py:34] torch.compile takes 5.74 s in total
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [gpu_worker.py:358] Available KV cache memory: 51.39 GiB
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [kv_cache_utils.py:1305] GPU KV cache size: 420,944 tokens
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [kv_cache_utils.py:1310] Maximum concurrency for 131,072 tokens per request: 3.21x
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [gpu_model_runner.py:5672] Initializing routed experts capturer, enable_return_routed_experts: True
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] EngineCore failed to start.
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] Traceback (most recent call last):
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 927, in run_engine_core
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 692, in __init__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     super().__init__(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 113, in __init__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 270, in _initialize_kv_caches
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.model_executor.initialize_from_config(kv_cache_configs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 115, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.collective_rpc("initialize_from_config", args=(kv_cache_configs,))
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 75, in collective_rpc
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 461, in run_method
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     return func(*args, **kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/worker_base.py", line 320, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.worker.initialize_from_config(kv_cache_config)  # type: ignore
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 415, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.model_runner.initialize_kv_cache(kv_cache_config)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5669, in initialize_kv_cache
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.init_routed_experts_capturer()
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5683, in init_routed_experts_capturer
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     routed_experts_capturer.init_buffer(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/fused_moe/routed_experts_capturer.py", line 131, in init_buffer
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     num_experts_per_tok = hf_config.num_experts_per_tok
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/transformers/configuration_utils.py", line 207, in __getattribute__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     return super().__getattribute__(key)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] AttributeError: 'LlamaConfig' object has no attribute 'num_experts_per_tok'
(EngineCore_DP0 pid=1033779) Process EngineCore_DP0:
(EngineCore_DP0 pid=1033779) Traceback (most recent call last):
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
(EngineCore_DP0 pid=1033779)     self.run()
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/multiprocessing/process.py", line 108, in run
(EngineCore_DP0 pid=1033779)     self._target(*self._args, **self._kwargs)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 940, in run_engine_core
(EngineCore_DP0 pid=1033779)     raise e
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 927, in run_engine_core
(EngineCore_DP0 pid=1033779)     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore_DP0 pid=1033779)                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 692, in __init__
(EngineCore_DP0 pid=1033779)     super().__init__(
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 113, in __init__
(EngineCore_DP0 pid=1033779)     num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches(
(EngineCore_DP0 pid=1033779)                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 270, in _initialize_kv_caches
(EngineCore_DP0 pid=1033779)     self.model_executor.initialize_from_config(kv_cache_configs)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 115, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.collective_rpc("initialize_from_config", args=(kv_cache_configs,))
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 75, in collective_rpc
(EngineCore_DP0 pid=1033779)     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore_DP0 pid=1033779)              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 461, in run_method
(EngineCore_DP0 pid=1033779)     return func(*args, **kwargs)
(EngineCore_DP0 pid=1033779)            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/worker_base.py", line 320, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.worker.initialize_from_config(kv_cache_config)  # type: ignore
(EngineCore_DP0 pid=1033779)     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 415, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.model_runner.initialize_kv_cache(kv_cache_config)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5669, in initialize_kv_cache
(EngineCore_DP0 pid=1033779)     self.init_routed_experts_capturer()
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5683, in init_routed_experts_capturer
(EngineCore_DP0 pid=1033779)     routed_experts_capturer.init_buffer(
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/fused_moe/routed_experts_capturer.py", line 131, in init_buffer
(EngineCore_DP0 pid=1033779)     num_experts_per_tok = hf_config.num_experts_per_tok
(EngineCore_DP0 pid=1033779)                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/transformers/configuration_utils.py", line 207, in __getattribute__
(EngineCore_DP0 pid=1033779)     return super().__getattribute__(key)
(EngineCore_DP0 pid=1033779)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) AttributeError: 'LlamaConfig' object has no attribute 'num_experts_per_tok'
[rank0]:[W514 11:07:46.937383087 ProcessGroupNCCL.cpp:1524] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())
(APIServer pid=1033505) Traceback (most recent call last):
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/bin/vllm", line 7, in <module>
(APIServer pid=1033505)     sys.exit(main())
(APIServer pid=1033505)              ^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/cli/main.py", line 73, in main
(APIServer pid=1033505)     args.dispatch_function(args)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/cli/serve.py", line 60, in cmd
(APIServer pid=1033505)     uvloop.run(run_server(args))
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/uvloop/__init__.py", line 96, in run
(APIServer pid=1033505)     return __asyncio.run(
(APIServer pid=1033505)            ^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/asyncio/runners.py", line 195, in run
(APIServer pid=1033505)     return runner.run(main)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/asyncio/runners.py", line 118, in run
(APIServer pid=1033505)     return self._loop.run_until_complete(task)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/uvloop/__init__.py", line 48, in wrapper
(APIServer pid=1033505)     return await main
(APIServer pid=1033505)            ^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 1319, in run_server
(APIServer pid=1033505)     await run_server_worker(listen_address, sock, args, **uvicorn_kwargs)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 1338, in run_server_worker
(APIServer pid=1033505)     async with build_async_engine_client(
(APIServer pid=1033505)                ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 210, in __aenter__
(APIServer pid=1033505)     return await anext(self.gen)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 173, in build_async_engine_client
(APIServer pid=1033505)     async with build_async_engine_client_from_engine_args(
(APIServer pid=1033505)                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 210, in __aenter__
(APIServer pid=1033505)     return await anext(self.gen)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 214, in build_async_engine_client_from_engine_args
(APIServer pid=1033505)     async_llm = AsyncLLM.from_vllm_config(
(APIServer pid=1033505)                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 205, in from_vllm_config
(APIServer pid=1033505)     return cls(
(APIServer pid=1033505)            ^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 132, in __init__
(APIServer pid=1033505)     self.engine_core = EngineCoreClient.make_async_mp_client(
(APIServer pid=1033505)                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 122, in make_async_mp_client
(APIServer pid=1033505)     return AsyncMPClient(*client_args)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 824, in __init__
(APIServer pid=1033505)     super().__init__(
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 479, in __init__
(APIServer pid=1033505)     with launch_core_engines(vllm_config, executor_class, log_stats) as (
(APIServer pid=1033505)          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 144, in __exit__
(APIServer pid=1033505)     next(self.gen)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 921, in launch_core_engines
(APIServer pid=1033505)     wait_for_engine_startup(
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 980, in wait_for_engine_startup
(APIServer pid=1033505)     raise RuntimeError(
(APIServer pid=1033505) RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}
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 22.04.3 LTS (x86_64)
GCC version                  : (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version                : Could not collect
CMake version                : version 3.22.1
Libc version                 : glibc-2.35

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

==============================
      Python Environment
==============================
Python version               : 3.12.12 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 20:16:04) [GCC 11.2.0] (64-bit runtime)
Python platform              : Linux-6.8.0-110-generic-x86_64-with-glibc2.35
    
==============================
       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 H100 80GB HBM3
Nvidia driver version        : 570.124.06
cuDNN version                : Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.9.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.9.0
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:                           52 bits physical, 57 bits virtual
Byte Order:                              Little Endian
CPU(s):                                  128
On-line CPU(s) list:                     0-127
Vendor ID:                               GenuineIntel
Model name:                              Intel(R) Xeon(R) Gold 6430
CPU family:                              6
Model:                                   143
Thread(s) per core:                      2
Core(s) per socket:                      32
Socket(s):                               2
Stepping:                                8
CPU max MHz:                             3400.0000
CPU min MHz:                             800.0000
BogoMIPS:                                4200.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 smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities ibpb_exit_to_user
Virtualization:                          VT-x
L1d cache:                               3 MiB (64 instances)
L1i cache:                               2 MiB (64 instances)
L2 cache:                                128 MiB (64 instances)
L3 cache:                                120 MiB (2 instances)
NUMA node(s):                            2
NUMA node0 CPU(s):                       0-31,64-95
NUMA node1 CPU(s):                       32-63,96-127
Vulnerability Gather data sampling:      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:    Not affected
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.5.3
[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.3.5
[pip3] nvidia-ml-py==13.590.48
[pip3] nvidia-nccl-cu12==2.27.5
[pip3] nvidia-nvjitlink-cu12==12.8.93
[pip3] nvidia-nvshmem-cu12==3.3.20
[pip3] nvidia-nvtx-cu12==12.8.90
[pip3] pyzmq==27.1.0
[pip3] torch==2.9.1+cu128
[pip3] torchaudio==2.9.1+cu128
[pip3] torchvision==0.24.1+cu128
[pip3] transformers==4.57.6
[pip3] triton==3.5.1
[conda] flashinfer-python         0.5.3                    pypi_0    pypi
[conda] numpy                     2.2.6                    pypi_0    pypi
[conda] nvidia-cublas-cu12        12.8.4.1                 pypi_0    pypi
[conda] nvidia-cuda-cupti-cu12    12.8.90                  pypi_0    pypi
[conda] nvidia-cuda-nvrtc-cu12    12.8.93                  pypi_0    pypi
[conda] nvidia-cuda-runtime-cu12  12.8.90                  pypi_0    pypi
[conda] nvidia-cudnn-cu12         9.10.2.21                pypi_0    pypi
[conda] nvidia-cudnn-frontend     1.18.0                   pypi_0    pypi
[conda] nvidia-cufft-cu12         11.3.3.83                pypi_0    pypi
[conda] nvidia-cufile-cu12        1.13.1.3                 pypi_0    pypi
[conda] nvidia-curand-cu12        10.3.9.90                pypi_0    pypi
[conda] nvidia-cusolver-cu12      11.7.3.90                pypi_0    pypi
[conda] nvidia-cusparse-cu12      12.5.8.93                pypi_0    pypi
[conda] nvidia-cusparselt-cu12    0.7.1                    pypi_0    pypi
[conda] nvidia-cutlass-dsl        4.3.5                    pypi_0    pypi
[conda] nvidia-ml-py              13.590.48                pypi_0    pypi
[conda] nvidia-nccl-cu12          2.27.5                   pypi_0    pypi
[conda] nvidia-nvjitlink-cu12     12.8.93                  pypi_0    pypi
[conda] nvidia-nvshmem-cu12       3.3.20                   pypi_0    pypi
[conda] nvidia-nvtx-cu12          12.8.90                  pypi_0    pypi
[conda] pyzmq                     27.1.0                   pypi_0    pypi
[conda] torch                     2.9.1+cu128              pypi_0    pypi
[conda] torchaudio                2.9.1+cu128              pypi_0    pypi
[conda] torchvision               0.24.1+cu128             pypi_0    pypi
[conda] transformers              4.57.6                   pypi_0    pypi
[conda] triton                    3.5.1                    pypi_0    pypi

==============================
         vLLM Info
==============================
ROCM Version                 : Could not collect
vLLM Version                 : 0.14.1
vLLM Build Flags:
  CUDA Archs: Not Set; ROCm: Disabled; XPU: Disabled
GPU Topology:
        GPU0    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      32-63,96-127    1               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
</details>

🐛 Describe the bug

When serving a dense (non-MoE) model such as Meta-Llama-3.1-8B-Instruct with --enable-return-routed-experts, the CLI and config validation both accept the flag without complaint, but the server crashes deep into KV cache initialization with an AttributeError because LlamaConfig has no num_experts_per_tok attribute.

This is a missing validation bug: --enable-return-routed-experts is a MoE-only feature, but there is no early check to verify that the loaded model architecture actually has routed experts before attempting to initialize the RoutedExpertsCapturer. The crash occurs after the full model has been loaded (~15 GiB, ~4 seconds) and torch.compile has completed, wasting significant GPU resources before failing with an unhelpful internal error.

Note: --enable-expert-parallel (-ep) has an equivalent check in pydantic that correctly rejects non-MoE models at config time with a clear message. --enable-return-routed-experts has no such guard.

Steps to Reproduce

vllm serve <path-to-Meta-Llama-3.1-8B-Instruct> \
  --host 127.0.0.1 \
  --port 19354 \
  --enable-return-routed-experts
(vllm) root@lizhiyuan-ubuntu-01:~# /root/anaconda3/envs/vllm/bin/vllm serve   /root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct   --host 127.0.0.1   --port 19354   --enable-return-routed-experts
(APIServer pid=1033505) INFO 05-14 11:07:22 [api_server.py:1272] vLLM API server version 0.14.1
(APIServer pid=1033505) INFO 05-14 11:07:22 [utils.py:263] non-default args: {'model_tag': '/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', 'host': '127.0.0.1', 'port': 19354, 'model': '/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', 'enable_return_routed_experts': True}
(APIServer pid=1033505) INFO 05-14 11:07:22 [model.py:530] Resolved architecture: LlamaForCausalLM
(APIServer pid=1033505) INFO 05-14 11:07:22 [model.py:1545] Using max model len 131072
(APIServer pid=1033505) INFO 05-14 11:07:22 [scheduler.py:229] Chunked prefill is enabled with max_num_batched_tokens=8192.
(APIServer pid=1033505) INFO 05-14 11:07:22 [vllm.py:630] Asynchronous scheduling is enabled.
(APIServer pid=1033505) INFO 05-14 11:07:22 [vllm.py:637] Disabling NCCL for DP synchronization when using async scheduling.
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:28 [core.py:97] Initializing a V1 LLM engine (v0.14.1) with config: model='/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', speculative_config=None, tokenizer='/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, tokenizer_revision=None, trust_remote_code=False, dtype=torch.bfloat16, max_seq_len=131072, download_dir=None, load_format=auto, tensor_parallel_size=1, pipeline_parallel_size=1, data_parallel_size=1, disable_custom_all_reduce=False, quantization=None, enforce_eager=False, enable_return_routed_experts=True, kv_cache_dtype=auto, device_config=cuda, structured_outputs_config=StructuredOutputsConfig(backend='auto', disable_fallback=False, disable_any_whitespace=False, disable_additional_properties=False, reasoning_parser='', reasoning_parser_plugin='', enable_in_reasoning=False), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None, kv_cache_metrics=False, kv_cache_metrics_sample=0.01, cudagraph_metrics=False, enable_layerwise_nvtx_tracing=False, enable_mfu_metrics=False, enable_mm_processor_stats=False, enable_logging_iteration_details=False), seed=0, served_model_name=/root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct, enable_prefix_caching=True, enable_chunked_prefill=True, pooler_config=None, compilation_config={'level': None, 'mode': <CompilationMode.VLLM_COMPILE: 3>, 'debug_dump_path': None, 'cache_dir': '', 'compile_cache_save_format': 'binary', 'backend': 'inductor', 'custom_ops': ['none'], 'splitting_ops': ['vllm::unified_attention', 'vllm::unified_attention_with_output', 'vllm::unified_mla_attention', 'vllm::unified_mla_attention_with_output', 'vllm::mamba_mixer2', 'vllm::mamba_mixer', 'vllm::short_conv', 'vllm::linear_attention', 'vllm::plamo2_mamba_mixer', 'vllm::gdn_attention_core', 'vllm::kda_attention', 'vllm::sparse_attn_indexer'], 'compile_mm_encoder': False, 'compile_sizes': [], 'compile_ranges_split_points': [8192], 'inductor_compile_config': {'enable_auto_functionalized_v2': False, 'combo_kernels': True, 'benchmark_combo_kernel': True}, 'inductor_passes': {}, 'cudagraph_mode': <CUDAGraphMode.FULL_AND_PIECEWISE: (2, 1)>, 'cudagraph_num_of_warmups': 1, 'cudagraph_capture_sizes': [1, 2, 4, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200, 208, 216, 224, 232, 240, 248, 256, 272, 288, 304, 320, 336, 352, 368, 384, 400, 416, 432, 448, 464, 480, 496, 512], 'cudagraph_copy_inputs': False, 'cudagraph_specialize_lora': True, 'use_inductor_graph_partition': False, 'pass_config': {'fuse_norm_quant': False, 'fuse_act_quant': False, 'fuse_attn_quant': False, 'eliminate_noops': True, 'enable_sp': False, 'fuse_gemm_comms': False, 'fuse_allreduce_rms': False}, 'max_cudagraph_capture_size': 512, 'dynamic_shapes_config': {'type': <DynamicShapesType.BACKED: 'backed'>, 'evaluate_guards': False, 'assume_32_bit_indexing': True}, 'local_cache_dir': None}
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [parallel_state.py:1214] world_size=1 rank=0 local_rank=0 distributed_init_method=tcp://172.17.0.4:60409 backend=nccl
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [parallel_state.py:1425] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, PCP rank 0, TP rank 0, EP rank N/A
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:29 [gpu_model_runner.py:3808] Starting to load model /root/.cache/modelscope/hub/models/LLM-Research/Meta-Llama-3___1-8B-Instruct...
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:30 [cuda.py:351] Using FLASH_ATTN attention backend out of potential backends: ('FLASH_ATTN', 'FLASHINFER', 'TRITON_ATTN', 'FLEX_ATTENTION')
Loading safetensors checkpoint shards:   0% Completed | 0/4 [00:00<?, ?it/s]
Loading safetensors checkpoint shards:  25% Completed | 1/4 [00:00<00:00,  4.63it/s]
Loading safetensors checkpoint shards:  50% Completed | 2/4 [00:01<00:01,  1.54it/s]
Loading safetensors checkpoint shards:  75% Completed | 3/4 [00:02<00:00,  1.04it/s]
Loading safetensors checkpoint shards: 100% Completed | 4/4 [00:03<00:00,  1.11s/it]
Loading safetensors checkpoint shards: 100% Completed | 4/4 [00:03<00:00,  1.05it/s]
(EngineCore_DP0 pid=1033779) 
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:34 [default_loader.py:291] Loading weights took 3.90 seconds
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:34 [gpu_model_runner.py:3905] Model loading took 14.99 GiB memory and 4.328942 seconds
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:39 [backends.py:644] Using cache directory: /root/.cache/vllm/torch_compile_cache/5c72d10b53/rank_0_0/backbone for vLLM's torch.compile
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:39 [backends.py:704] Dynamo bytecode transform time: 4.96 s
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:44 [backends.py:226] Directly load the compiled graph(s) for compile range (1, 8192) from the cache, took 0.777 s
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:44 [monitor.py:34] torch.compile takes 5.74 s in total
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [gpu_worker.py:358] Available KV cache memory: 51.39 GiB
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [kv_cache_utils.py:1305] GPU KV cache size: 420,944 tokens
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [kv_cache_utils.py:1310] Maximum concurrency for 131,072 tokens per request: 3.21x
(EngineCore_DP0 pid=1033779) INFO 05-14 11:07:45 [gpu_model_runner.py:5672] Initializing routed experts capturer, enable_return_routed_experts: True
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] EngineCore failed to start.
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] Traceback (most recent call last):
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 927, in run_engine_core
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 692, in __init__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     super().__init__(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 113, in __init__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 270, in _initialize_kv_caches
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.model_executor.initialize_from_config(kv_cache_configs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 115, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.collective_rpc("initialize_from_config", args=(kv_cache_configs,))
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 75, in collective_rpc
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 461, in run_method
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     return func(*args, **kwargs)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/worker_base.py", line 320, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.worker.initialize_from_config(kv_cache_config)  # type: ignore
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 415, in initialize_from_config
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.model_runner.initialize_kv_cache(kv_cache_config)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5669, in initialize_kv_cache
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     self.init_routed_experts_capturer()
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5683, in init_routed_experts_capturer
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     routed_experts_capturer.init_buffer(
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/fused_moe/routed_experts_capturer.py", line 131, in init_buffer
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     num_experts_per_tok = hf_config.num_experts_per_tok
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/transformers/configuration_utils.py", line 207, in __getattribute__
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]     return super().__getattribute__(key)
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) ERROR 05-14 11:07:45 [core.py:936] AttributeError: 'LlamaConfig' object has no attribute 'num_experts_per_tok'
(EngineCore_DP0 pid=1033779) Process EngineCore_DP0:
(EngineCore_DP0 pid=1033779) Traceback (most recent call last):
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/multiprocessing/process.py", line 314, in _bootstrap
(EngineCore_DP0 pid=1033779)     self.run()
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/multiprocessing/process.py", line 108, in run
(EngineCore_DP0 pid=1033779)     self._target(*self._args, **self._kwargs)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 940, in run_engine_core
(EngineCore_DP0 pid=1033779)     raise e
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 927, in run_engine_core
(EngineCore_DP0 pid=1033779)     engine_core = EngineCoreProc(*args, engine_index=dp_rank, **kwargs)
(EngineCore_DP0 pid=1033779)                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 692, in __init__
(EngineCore_DP0 pid=1033779)     super().__init__(
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 113, in __init__
(EngineCore_DP0 pid=1033779)     num_gpu_blocks, num_cpu_blocks, kv_cache_config = self._initialize_kv_caches(
(EngineCore_DP0 pid=1033779)                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core.py", line 270, in _initialize_kv_caches
(EngineCore_DP0 pid=1033779)     self.model_executor.initialize_from_config(kv_cache_configs)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/abstract.py", line 115, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.collective_rpc("initialize_from_config", args=(kv_cache_configs,))
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/executor/uniproc_executor.py", line 75, in collective_rpc
(EngineCore_DP0 pid=1033779)     result = run_method(self.driver_worker, method, args, kwargs)
(EngineCore_DP0 pid=1033779)              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/serial_utils.py", line 461, in run_method
(EngineCore_DP0 pid=1033779)     return func(*args, **kwargs)
(EngineCore_DP0 pid=1033779)            ^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/worker_base.py", line 320, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.worker.initialize_from_config(kv_cache_config)  # type: ignore
(EngineCore_DP0 pid=1033779)     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_worker.py", line 415, in initialize_from_config
(EngineCore_DP0 pid=1033779)     self.model_runner.initialize_kv_cache(kv_cache_config)
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5669, in initialize_kv_cache
(EngineCore_DP0 pid=1033779)     self.init_routed_experts_capturer()
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/worker/gpu_model_runner.py", line 5683, in init_routed_experts_capturer
(EngineCore_DP0 pid=1033779)     routed_experts_capturer.init_buffer(
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/model_executor/layers/fused_moe/routed_experts_capturer.py", line 131, in init_buffer
(EngineCore_DP0 pid=1033779)     num_experts_per_tok = hf_config.num_experts_per_tok
(EngineCore_DP0 pid=1033779)                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/transformers/configuration_utils.py", line 207, in __getattribute__
(EngineCore_DP0 pid=1033779)     return super().__getattribute__(key)
(EngineCore_DP0 pid=1033779)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(EngineCore_DP0 pid=1033779) AttributeError: 'LlamaConfig' object has no attribute 'num_experts_per_tok'
[rank0]:[W514 11:07:46.937383087 ProcessGroupNCCL.cpp:1524] Warning: WARNING: destroy_process_group() was not called before program exit, which can leak resources. For more info, please see https://pytorch.org/docs/stable/distributed.html#shutdown (function operator())
(APIServer pid=1033505) Traceback (most recent call last):
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/bin/vllm", line 7, in <module>
(APIServer pid=1033505)     sys.exit(main())
(APIServer pid=1033505)              ^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/cli/main.py", line 73, in main
(APIServer pid=1033505)     args.dispatch_function(args)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/cli/serve.py", line 60, in cmd
(APIServer pid=1033505)     uvloop.run(run_server(args))
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/uvloop/__init__.py", line 96, in run
(APIServer pid=1033505)     return __asyncio.run(
(APIServer pid=1033505)            ^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/asyncio/runners.py", line 195, in run
(APIServer pid=1033505)     return runner.run(main)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/asyncio/runners.py", line 118, in run
(APIServer pid=1033505)     return self._loop.run_until_complete(task)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/uvloop/__init__.py", line 48, in wrapper
(APIServer pid=1033505)     return await main
(APIServer pid=1033505)            ^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 1319, in run_server
(APIServer pid=1033505)     await run_server_worker(listen_address, sock, args, **uvicorn_kwargs)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 1338, in run_server_worker
(APIServer pid=1033505)     async with build_async_engine_client(
(APIServer pid=1033505)                ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 210, in __aenter__
(APIServer pid=1033505)     return await anext(self.gen)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 173, in build_async_engine_client
(APIServer pid=1033505)     async with build_async_engine_client_from_engine_args(
(APIServer pid=1033505)                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 210, in __aenter__
(APIServer pid=1033505)     return await anext(self.gen)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/entrypoints/openai/api_server.py", line 214, in build_async_engine_client_from_engine_args
(APIServer pid=1033505)     async_llm = AsyncLLM.from_vllm_config(
(APIServer pid=1033505)                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 205, in from_vllm_config
(APIServer pid=1033505)     return cls(
(APIServer pid=1033505)            ^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/async_llm.py", line 132, in __init__
(APIServer pid=1033505)     self.engine_core = EngineCoreClient.make_async_mp_client(
(APIServer pid=1033505)                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 122, in make_async_mp_client
(APIServer pid=1033505)     return AsyncMPClient(*client_args)
(APIServer pid=1033505)            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 824, in __init__
(APIServer pid=1033505)     super().__init__(
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/core_client.py", line 479, in __init__
(APIServer pid=1033505)     with launch_core_engines(vllm_config, executor_class, log_stats) as (
(APIServer pid=1033505)          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/contextlib.py", line 144, in __exit__
(APIServer pid=1033505)     next(self.gen)
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 921, in launch_core_engines
(APIServer pid=1033505)     wait_for_engine_startup(
(APIServer pid=1033505)   File "/root/anaconda3/envs/vllm/lib/python3.12/site-packages/vllm/v1/engine/utils.py", line 980, in wait_for_engine_startup
(APIServer pid=1033505)     raise RuntimeError(
(APIServer pid=1033505) RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}

Expected Behavior

One of the following should happen:

  1. vLLM detects that the model is not a MoE architecture and rejects the configuration early with a clear, user-facing error such as --enable-return-routed-experts is only supported for MoE models, before any model loading occurs, or
  2. The flag is silently ignored for non-MoE models with a warning.

In either case, the server should not proceed through model loading, torch.compile, and KV cache setup only to crash with an internal AttributeError.

Suggested Fix

Add a model architecture compatibility check in init_routed_experts_capturer (or earlier, at config validation time) that verifies hf_config has a num_experts_per_tok attribute before proceeding. If the attribute is absent, raise a clear ValueError explaining that --enable-return-routed-experts requires a MoE model. This is consistent with how --enable-expert-parallel is already validated via pydantic.

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.

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 - 💡(How to fix) Fix [Bug]: --enable-return-routed-experts crashes with AttributeError on non-MoE models after full model load (missing architecture compatibility check)