apiVersion:apps/v1kind:Deploymentmetadata:name:vllm-nsys-injectspec:replicas:1selector:matchLabels:app:vllm-nsystemplate:metadata:labels:app:vllm-nsysspec:hostPID:truevolumes:-name:nsys-binemptyDir:{}-name:profile-outputemptyDir:{}-name:dshmemptyDir:medium:MemorysizeLimit:16Gi# 1. nsys가 포함된 공식 이미지에서 바이너리만 볼륨으로 복사
initContainers:-name:copy-nsys# Nsight Systems가 내장된 NVIDIA 공식 devel 이미지 사용
image:nvidia/cuda:12.4.1-devel-ubuntu22.04command:["/bin/sh","-c"]args:-|cp -r /opt/nvidia/nsight-systems/* /nsys-target/volumeMounts:-name:nsys-binmountPath:/nsys-target# 2. 원본 vLLM 이미지는 수정 없이 그대로 실행
containers:-name:vllmimage:vllm/vllm-openai:latestsecurityContext:capabilities:add:["SYS_ADMIN","SYS_PTRACE"]env:-name:VLLM_WORKER_MULTIPROC_METHODvalue:"spawn"command:["/bin/sh","-c"]args:-|# 복사된 경로에서 nsys 실행 파일 찾아서 실행
NSYS_PATH=$(find /nsys -name nsys -type f | head -n 1)$NSYS_PATH profile \--trace=cuda,nvtx,osrt \--trace-fork-before-exec=true \--cuda-graph-trace=node \--capture-range=cudaProfilerApi \--capture-range-end=repeat \-o /profiles/vllm_trace_%p \vllm serve meta-llama/Llama-3.1-8B-Instruct \--profiler-config '{"profiler":"cuda"}'
resources:limits:nvidia.com/gpu:1volumeMounts:-name:nsys-binmountPath:/nsys-name:profile-outputmountPath:/profiles-name:dshmmountPath:/dev/shm
Top comments (0)
Subscribe
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)