Skip to content

Commit 2854c13

Browse files
[Profiling] Update the S3 path to include model name in the vLLM Profiling workflow (#82)
* update the S3 path to include model name * fix name * add more relevant fields * fix * fix
1 parent f9591b3 commit 2854c13

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

.github/scripts/run_vllm_profiling.sh

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,36 +99,48 @@ run_profiling_tests() {
9999
kill_gpu_processes
100100

101101
# Create a profiling sub-directory for each test case to isolate the
102-
# generated traces (e.g. using the model name hierarchy)
103-
local sanitized_test_name="${TEST_NAME// /_}"
104-
local test_name_directory="${base_profiler_dir}/${sanitized_test_name}"
105-
mkdir -p "${test_name_directory}"
106-
chmod 755 "${test_name_directory}"
102+
# generated traces using the S3 path structure
103+
MODEL_NAME=$(echo "$server_params" | jq -r '.model')
104+
# Sanitize model name: Replace / with _
105+
local sanitized_model_name="${MODEL_NAME//\//_}"
106+
107+
# Build the directory path following S3 structure
108+
local profiler_directory="${base_profiler_dir}"
109+
profiler_directory+="/${sanitized_model_name}"
110+
profiler_directory+="/${DEVICE_NAME}"
111+
profiler_directory+="/${DEVICE_TYPE}"
112+
profiler_directory+="/${TEST_NAME}"
113+
profiler_directory+="/${S3_HEAD_SHA}"
114+
profiler_directory+="/${S3_GITHUB_RUN_ID}"
115+
profiler_directory+="/${S3_GITHUB_JOB}"
116+
echo "Creating profiling directory: ${profiler_directory}"
117+
mkdir -p "${profiler_directory}"
118+
chmod 755 "${profiler_directory}"
107119

108120
# Override the profiler output directory for this test only
109-
export VLLM_TORCH_PROFILER_DIR="${test_name_directory}"
121+
export VLLM_TORCH_PROFILER_DIR="${profiler_directory}"
110122

111123
# Run the profiling test
112124
if start_vllm_server "$server_args"; then
113125
run_profiling "$client_args"
114126
cleanup_server
115127

116128
# Debug: Check if profiling files were created
117-
echo "DEBUG: Checking profiling directory: $test_name_directory"
118-
if [ -d "$test_name_directory" ]; then
119-
echo "DEBUG: Profiling directory exists for test $TEST_NAME"
120-
ls -la "$test_name_directory" || echo "DEBUG: Directory is empty or inaccessible"
121-
find "$test_name_directory" -type f 2>/dev/null | head -10 | while read file; do
129+
echo "DEBUG: Checking profiling directory: $profiler_directory"
130+
if [ -d "$profiler_directory" ]; then
131+
echo "DEBUG: Profiling directory exists for model $MODEL_NAME"
132+
ls -la "$profiler_directory" || echo "DEBUG: Directory is empty or inaccessible"
133+
find "$profiler_directory" -type f 2>/dev/null | head -10 | while read file; do
122134
echo "DEBUG: Found profiling file: ${file}"
123135
rename_profiling_file "$file" "vllm"
124136
done
125137
else
126-
echo "DEBUG: Profiling directory does not exist for test $TEST_NAME!"
138+
echo "DEBUG: Profiling directory does not exist for model $MODEL_NAME!"
127139
fi
128140

129-
echo "Profiling test $TEST_NAME completed successfully."
141+
echo "Profiling test $MODEL_NAME completed successfully."
130142
else
131-
echo "Failed to start vLLM server for test $TEST_NAME."
143+
echo "Failed to start vLLM server for test $MODEL_NAME."
132144
continue
133145
fi
134146
done

.github/workflows/vllm-profiling.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,10 @@ jobs:
201201
-e VLLM_TORCH_PROFILER_DIR \
202202
-e CUDA_VISIBLE_DEVICES \
203203
-e VLLM_USE_V1 \
204-
-e DEVICE_NAME \
205204
-e ON_CPU="${ON_CPU}" \
205+
-e S3_HEAD_SHA="${HEAD_SHA}" \
206+
-e S3_GITHUB_RUN_ID="${GITHUB_RUN_ID}" \
207+
-e S3_GITHUB_JOB="${GITHUB_JOB}" \
206208
--ipc=host \
207209
--tty \
208210
--detach \
@@ -223,7 +225,7 @@ jobs:
223225
224226
UPLOAD_DATE=$(date -u +"%Y-%m-%d")
225227
echo "upload-date=${UPLOAD_DATE}" >> "${GITHUB_OUTPUT}"
226-
echo "s3-prefix=${UPLOAD_DATE}/${REPOSITORY}/${HEAD_SHA}/${GITHUB_RUN_ID}/${GITHUB_JOB}" >> "${GITHUB_OUTPUT}"
228+
echo "s3-prefix=${UPLOAD_DATE}/${REPOSITORY}" >> "${GITHUB_OUTPUT}"
227229
228230
- name: Upload profiling results to S3
229231
uses: seemethere/upload-artifact-s3@v5

0 commit comments

Comments
 (0)