@@ -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
0 commit comments