@@ -43,8 +43,12 @@ setup_workspace() {
4343 # The Docker container has vLLM pre-installed, we shouldn't run from source
4444 cd /tmp/workspace
4545
46- # Create the profiling directory if it doesn't exist
47- mkdir -p " $( dirname " ${VLLM_TORCH_PROFILER_DIR/# \~ / $HOME } " ) " 2> /dev/null || true
46+ # Create the profiling directory (no need for tilde expansion now)
47+ echo " Creating profiling directory: ${VLLM_TORCH_PROFILER_DIR} "
48+ mkdir -p " ${VLLM_TORCH_PROFILER_DIR} "
49+
50+ # Ensure the directory is writable
51+ chmod 755 " ${VLLM_TORCH_PROFILER_DIR} "
4852}
4953
5054wait_for_server () {
@@ -131,14 +135,36 @@ main() {
131135 install_dependencies
132136 setup_workspace
133137
138+ # Debug: Show environment variables
139+ echo " DEBUG: VLLM_TORCH_PROFILER_DIR=${VLLM_TORCH_PROFILER_DIR:- not set} "
140+
134141 # Clean up any existing processes first
135142 kill_gpu_processes
136143
137144 # Main execution phase
138145 if start_vllm_server; then
139146 run_profiling
140147 cleanup_server
141- echo " Profiling completed. Artifacts will be available in ${VLLM_TORCH_PROFILER_DIR:- default profiler directory} ."
148+
149+ # Debug: Check if profiling files were created
150+ echo " DEBUG: Checking profiling directory: ${VLLM_TORCH_PROFILER_DIR} "
151+ if [ -d " ${VLLM_TORCH_PROFILER_DIR} " ]; then
152+ echo " DEBUG: Profiling directory exists"
153+ ls -la " ${VLLM_TORCH_PROFILER_DIR} " || echo " DEBUG: Directory is empty or inaccessible"
154+ find " ${VLLM_TORCH_PROFILER_DIR} " -type f 2> /dev/null | head -10 | while read file; do
155+ echo " DEBUG: Found profiling file: ${file} "
156+ done
157+ else
158+ echo " DEBUG: Profiling directory does not exist!"
159+ fi
160+
161+ # Also check if any profiling files were created in current directory
162+ echo " DEBUG: Checking current directory for profiling artifacts:"
163+ find . -name " *.json" -o -name " *.trace" -o -name " *.pt" 2> /dev/null | head -5 | while read file; do
164+ echo " DEBUG: Found artifact in current dir: ${file} "
165+ done
166+
167+ echo " Profiling completed. Artifacts should be available in ${VLLM_TORCH_PROFILER_DIR:- default profiler directory} ."
142168 else
143169 echo " Failed to start vLLM server. Exiting."
144170 exit 1
0 commit comments