vLLM CUDA Graph 디스패치

vLLM CUDA Graph 디스패치 A workflow diagram generated by Archify. 01 / 기동 1회: 구성 · 컴파일 · 캡처 02 / 스텝마다: 배치 디스패치 03 / CUDAGraphWrapper EX / 그래프 없이 실행 enforce_eager? · VllmConfig 플래그 · 기동 1회: 구성 · 컴파일 · 캡처 enforce_eager? VllmConfig 플래그 cudagraph_mode · NONE · PIECEWISE · FULL · 기동 1회: 구성 · 컴파일 · 캡처 cudagraph_mode NONE · PIECEWISE · FULL 모델 컴파일 · 워밍업 · compile_or_warm_up_model() · 기동 1회: 구성 · 컴파일 · 캡처 모델 컴파일 · 워밍업 compile_or_warm_up_model() capture_model() · 큰 배치부터 캡처 · 기동 1회: 구성 · 컴파일 · 캡처 capture_model() 큰 배치부터 캡처 드래프터 그래프 · V1 PIECEWISE / V2 분리 · 기동 1회: 구성 · 컴파일 · 캡처 드래프터 그래프 V1 PIECEWISE / V2 분리 배치 서술자 계산 · uniform_decode · 패딩 · 스텝마다: 배치 디스패치 배치 서술자 계산 uniform_decode · 패딩 dispatch() · FULL → PIECEWISE → NONE · 스텝마다: 배치 디스패치 dispatch() FULL → PIECEWISE → NONE forward context · set_forward_context() · CUDAGraphWrapper forward context set_forward_context() 그래프 replay · 없으면 최초 1회 capture · CUDAGraphWrapper 그래프 replay 없으면 최초 1회 capture eager 강제 · mode · cudagraph 모두 NONE · 그래프 없이 실행 eager 강제 mode · cudagraph 모두 NONE eager 실행 · compiled runnable 직접 호출 · 그래프 없이 실행 eager 실행 compiled runnable 직접 호출 캡처 건너뜀 컴파일 크기 num_tokens spec decode true runtime_mode 강제 아님 NONE · 불일치 모드 일치 서빙 시작 워밍업 후 Legend 실행 단계 판단 · 게이트 컨텍스트 전달

CUDAGraphMode

  • • PIECEWISE는 어텐션(splitting_ops)에서 끊어 조각만 replay
  • • FULL_AND_PIECEWISE는 uniform decode만 FULL로 처리

드래프터는 target과 따로 간다

  • • V1: target이 FULL이어도 드래프터는 PIECEWISE, 아니면 NONE
  • • V2: draft prefill은 target 모드, draft decode는 FULL_DECODE_ONLY 아니면 NONE