aws-samples / aws-samples/amazon-sagemaker-generativeai
Unable to deploy with vllm
- Dominant language
- Jupyter Notebook
- Stars
- 218
- Forks
- 129
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
I finally figured out the way to deploy with the Dockerfile for vllm. But using the fine tuned gpt-oss model from the notebook i see this error in cloudwatch logs
```
timestamp,message
1756143981557,'"-------------------------------------------------------------------"
1756143981557,vLLM engine args: [--port 8080 --tensor-parallel-size 1 --quantization mxfp4 --gpu-memory-utilization 0.95 --async-scheduling true --dtype bfloat16 --model /opt/ml/model --served-model-name model]
1756143986557,'"-------------------------------------------------------------------"
1756143989824,INFO 08-25 10:46:27 [__init__.py:241] Automatically detected platform cuda.
1756143989824,#033[1;36m(APIServer pid=1)#033[0;0m INFO 08-25 10:46:29 [api_server.py:1805] vLLM API server version 0.10.1.1
1756143994557,"#033[1;36m(APIServer pid=1)#033[0;0m INFO 08-25 10:46:29 [utils.py:326] non-default args: {'model_tag': 'true', 'port': 8080, 'model': '/opt/ml/model', 'dtype': 'bfloat16', 'quantization': 'mxfp4', 'served_model_name': ['model'], 'gpu_memory_utilization': 0.95, 'async_scheduling': True}"
1756143995336,#033[1;36m(APIServer pid=1)#033[0;0m INFO 08-25 10:46:35 [__init__.py:711] Resolved architecture: GptOssForCausalLM
1756143995336,#033[1;36m(APIServer pid=1)#033[0;0m WARNING 08-25 10:46:35 [__init__.py:2819] Casting torch.float16 to torch.bfloat16.
1756143995336,#033[1;36m(APIServer pid=1)#033[0;0m INFO 08-25 10:46:35 [__init__.py:1750] Using max model len 131072
1756143995838,#033[1;36m(APIServer pid=1)#033[0;0m WARNING 08-25 10:46:35 [__init__.py:1171] mxfp4 quantization is not fully optimized yet. The speed can be slower than non-quantized models.
1756143995838,#033[1;36m(APIServer pid=1)#033[0;0m INFO 08-25 10:46:35 [arg_utils.py:1211] Using mp-based distributed executor backend for async scheduling.
1756143995838,#033[1;36m(APIServer pid=1)#033[0;0m INFO 08-25 10:46:35 [scheduler.py:222] Chunked prefill is enabled with max_num_batched_tokens=2048.
1756144000557,#033[1;36m(APIServer pid=1)#033[0;0m INFO 08-25 10:46:35 [config.py:273] Overriding max cuda graph capture size to 1024 for performance.
1756144002605,INFO 08-25 10:46:40 [__init__.py:241] Automatically detected platform cuda.
1756144002605,#033[1;36m(EngineCore_0 pid=75)#033[0;0m INFO 08-25 10:46:42 [core.py:636] Waiting for init message from front-end.
1756144002605,"#033[1;36m(EngineCore_0 pid=75)#033[0;0m INFO 08-25 10:46:42 [core.py:74] Initializing a V1 LLM engine (v0.10.1.1) with config: model='/opt/ml/model', speculative_config=None, tokenizer='/opt/ml/model', skip_tokenizer_init=False, tokenizer_mode=auto, revision=None, override_neuron_config={}, 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, disable_custom_all_reduce=False, quantization=mxfp4, enforce_eager=False, kv_cache_dtype=auto, device_config=cuda, decoding_config=DecodingConfig(backend='auto', disable_fallback=False, disable_any_whitespace=False, disable_additional_properties=False, reasoning_backend='GptOss'), observability_config=ObservabilityConfig(show_hidden_metrics_for_version=None, otlp_traces_endpoint=None, collect_detailed_traces=None), seed=0, served_model_name=model, enable_prefix_caching=True, chunked_prefill_enabled=True, use_async_output_proc=True, pooler_config=None, compilation_config={""level"":3,""debug_dump_path"":"""",""cache_dir"":"""",""backend"":"""",""custom_ops"":[],""splitting_ops"":[""vllm.unified_attention"",""vllm.unified_attention_with_output"",""vllm.mamba_mixer2""],""use_inductor"":true,""compile_sizes"":[],""inductor_compile_config"":{""enable_auto_functionalized_v2"":false},""inductor_passes"":{},""cudagraph_mode"":1,""use_cudagraph"":true,""cudagraph_num_of_warmups"":1,""cudagraph_capture_sizes"":[1024,1008,992,976,960,944,928,912,896,880,864,848,832,816,800,784,768,752,736,720,704,688,672,656,640,624,608,592,576,560,544,528,512,496,480,464,448,432,416,400,384,368,352,336,320,304,288,272,256,248,240,232,224,216,208,200,192,184,176,168,160,152,144,136,128,120,112,104,96,88,80,72,64,56,48,40,32,24,16,8,4,2,1],""cudagraph_copy_inputs"":false,""full_cuda_graph"":false,""pass_config"":{},""max_capture_size"":1024,""local_cache_dir"":null}"
1756144002605,#033[1;36m(EngineCore_0 pid=75)#033[0;0m WARNING 08-25 10:46:42 [multiproc_worker_utils.py:273] Reducing Torch parallelism from 4 threads to 1 to avoid unnecessary CPU contention. Set OMP_NUM_THREADS in the external environment to tune this value as needed.
1756144005861,"#033[1;36m(EngineCore_0 pid=75)#033[0;0m INFO 08-25 10:46:42 [shm_broadcast.py:289] vLLM message queue communication handle: Handle(local_reader_ranks=[0], buffer_handle=(1, 16777216, 10, 'psm_9b63c8c3'), local_subscribe_addr='ipc:///tmp/a453ab04-9391-4ddc-b1e3-a1b444ea55fe', remote_subscribe_addr=None, remote_addr_ipv6=False)"
1756144008368,INFO 08-25 10:46:45 [__init__.py:241] Automatically detected platform cuda.
1756144008619,"#033[1;36m(VllmWorker pid=96)#033[0;0m INFO 08-25 10:46:48 [shm_broadcast.py:289] vLLM message queue communication handle: Handle(local_reader_ranks=[0], buffer_handle=(1, 10485760, 10, 'psm_4d0c0d08'), local_subscribe_addr='ipc:///tmp/cc9b3589-93d0-4132-9a27-0f754b5b113f', remote_subscribe_addr=None, remote_addr_ipv6=False)"
1756144008619,"#033[1;36m(VllmWorker pid=96)#033[0;0m INFO 08-25 10:46:48 [parallel_state.py:1134] rank 0 in world size 1 is assigned as DP rank 0, PP rank 0, TP rank 0, EP rank 0"
1756144008619,#033[1;36m(VllmWorker pid=96)#033[0;0m INFO 08-25 10:46:48 [topk_topp_sampler.py:50] Using FlashInfer for top-p & top-k sampling.
1756144008869,#033[1;36m(VllmWorker pid=96)#033[0;0m INFO 08-25 10:46:48 [gpu_model_runner.py:1953] Starting to load model /opt/ml/model...
1756144009120,#033[1;36m(VllmWorker pid=96)#033[0;0m INFO 08-25 10:46:48 [gpu_model_runner.py:1985] Loading model from scratch...
1756144009120,#033[1;36m(VllmWorker pid=96)#033[0;0m INFO 08-25 10:46:48 [cuda.py:285] Using Triton backend on V1 engine.
1756144009120,#033[1;36m(VllmWorker pid=96)#033[0;0m INFO 08-25 10:46:48 [triton_attn.py:257] Using vllm unified attention for TritonAttentionImpl
1756144011375,"#033[1;36m(VllmWorker pid=96)#033[0;0m #015Loading safetensors checkpoint shards: 0% Completed | 0/13 [00:00"", line 198, in _run_module_as_main"
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File """", line 88, in _run_code"
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py"", line 1920, in "
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m uvloop.run(run_server(args))
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/uvloop/__init__.py"", line 109, in run"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m return __asyncio.run(
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/lib/python3.12/asyncio/runners.py"", line 195, in run"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m return runner.run(main)
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/lib/python3.12/asyncio/runners.py"", line 118, in run"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m return self._loop.run_until_complete(task)
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""uvloop/loop.pyx"", line 1518, in uvloop.loop.Loop.run_until_complete"
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/uvloop/__init__.py"", line 61, in wrapper"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m return await main
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py"", line 1850, in run_server"
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m await run_server_worker(listen_address, sock, args, **uvicorn_kwargs)"
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py"", line 1870, in run_server_worker"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m async with build_async_engine_client(
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/lib/python3.12/contextlib.py"", line 210, in __aenter__"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m return await anext(self.gen)
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py"", line 178, in build_async_engine_client"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m async with build_async_engine_client_from_engine_args(
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/lib/python3.12/contextlib.py"", line 210, in __aenter__"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m return await anext(self.gen)
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/entrypoints/openai/api_server.py"", line 220, in build_async_engine_client_from_engine_args"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m async_llm = AsyncLLM.from_vllm_config(
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/utils/__init__.py"", line 1557, in inner"
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m return fn(*args, **kwargs)"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/async_llm.py"", line 174, in from_vllm_config"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m return cls(
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/async_llm.py"", line 120, in __init__"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m self.engine_core = EngineCoreClient.make_async_mp_client(
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core_client.py"", line 102, in make_async_mp_client"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m return AsyncMPClient(*client_args)
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core_client.py"", line 767, in __init__"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m super().__init__(
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/core_client.py"", line 446, in __init__"
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m with launch_core_engines(vllm_config, executor_class,"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/lib/python3.12/contextlib.py"", line 144, in __exit__"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m next(self.gen)
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/utils.py"", line 706, in launch_core_engines"
1756144013378,#033[1;36m(APIServer pid=1)#033[0;0m wait_for_engine_startup(
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m File ""/usr/local/lib/python3.12/dist-packages/vllm/v1/engine/utils.py"", line 759, in wait_for_engine_startup"
1756144013378,"#033[1;36m(APIServer pid=1)#033[0;0m raise RuntimeError(""Engine core initialization failed. """
1756144014882,#033[1;36m(APIServer pid=1)#033[0;0m RuntimeError: Engine core initialization failed. See root cause above. Failed core proc(s): {}
1756144014882,'"-------------------------------------------------------------------"
1756144014882,vLLM engine args: [--port 8080 --tensor-parallel-size 1 --quantization mxfp4 --gpu-memory-utilization 0.95 --async-scheduling true --dtype bfloat16 --model /opt/ml/model --served-model-name model]
```
Contributor guide
Research direction
Start with the Dockerfile and the fine-tuning notebook, then compare their model output with the vLLM engine arguments and the failing load path in vllm/model_executor/models/gpt_oss.py. Reproduce the CloudWatch failure and trace the tensor-size mismatch during safetensors loading; done means the model loads and the deployment starts serving requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, docker, jupyter-notebook
- Domain
- cloud, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100