File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525import sys
2626from typing import Any
2727
28- # Must be set before vllm is imported — vllm reads these at import time.
29- # v0 engine has stable LoRA + tensor-parallel support; v1 does not.
28+ # Must be set before torch/vllm are imported — read at import/init time.
29+ # Disable torch.compile globally: vLLM's vocab_parallel_embedding has a
30+ # @torch.compile'd function (get_masked_input_and_mask) that invokes Triton,
31+ # which tries to compile cuda_utils.c via gcc and needs python3.12-dev headers
32+ # that are not installed on this server. TORCHDYNAMO_DISABLE=1 makes all
33+ # @torch.compile decorators fall back to eager execution.
34+ os .environ ["TORCHDYNAMO_DISABLE" ] = "1"
3035# spawn (not fork) avoids CUDA/NCCL re-init issues across worker processes.
31- os .environ ["VLLM_USE_V1" ] = "0"
3236os .environ ["VLLM_WORKER_MULTIPROC_METHOD" ] = "spawn"
3337
3438import torch
@@ -99,10 +103,6 @@ def vllm_generate(
99103 dtype = "bfloat16" ,
100104 max_model_len = 2048 ,
101105 tensor_parallel_size = n_gpus ,
102- # Disable CUDA graph capture and torch.compile/inductor AOT compilation.
103- # The server lacks python3.12-dev headers, which Triton needs to compile
104- # cuda_utils.c; enforce_eager bypasses that compilation entirely.
105- enforce_eager = True ,
106106 )
107107
108108 lora_request = LoRARequest ("adapter" , 1 , checkpoint )
You can’t perform that action at this time.
0 commit comments