|
40 | 40 |
|
41 | 41 | echo "config_file: ${config_file}" |
42 | 42 |
|
43 | | -# save the hostname to a file |
44 | | - |
45 | | -# if SLURM_NODEID is 0 |
| 43 | +# if SLURM_NODEID is 0, save the hostname to a file |
46 | 44 | if [ "${SLURM_NODEID}" = "0" ]; then |
47 | 45 | mkdir -p ${log_dir}/hostnames/ |
48 | 46 | echo $(hostname) > ${log_dir}/hostnames/${role}_${instance_id}.txt |
49 | 47 | echo "hostname saved to ${log_dir}/hostnames/${role}_${instance_id}.txt" |
50 | 48 | fi |
51 | 49 |
|
52 | | -#check if nsys is enabled |
| 50 | +nsys_prefix="" |
53 | 51 | if [ "${enable_nsys}" != "true" ]; then |
54 | 52 | echo "nsys is not enabled, start normal flow" |
55 | | - trtllm-llmapi-launch ${numa_bind_cmd} trtllm-serve ${model_path} --host $(hostname) --port ${port} --extra_llm_api_options ${config_file} |
56 | 53 | else |
57 | | - nsys_prefix="" |
58 | 54 | nsys_file=${log_dir}/nsys_worker_proc_${role}_${instance_id}_${SLURM_PROCID} |
59 | 55 | export TLLM_PROFILE_RECORD_GC=1 |
60 | 56 | export TLLM_NVTX_DEBUG=1 |
61 | | - nsys_prefix="nsys profile -e \"NSYS_MPI_STORE_TEAMS_PER_RANK=1\" -o ${nsys_file} -f true -t cuda,nvtx,python-gil -c cudaProfilerApi --cuda-graph-trace node --capture-range-end=stop --gpu-metrics-devices=none" |
| 57 | + export NSYS_MPI_STORE_TEAMS_PER_RANK=1 |
62 | 58 | export TLLM_PROFILE_START_STOP=${profile_range} |
63 | 59 | echo "nsys is enabled on ${role} GPUs, TLLM_PROFILE_START_STOP=${profile_range}" |
64 | | - ${nsys_prefix} trtllm-llmapi-launch ${numa_bind_cmd} \ |
65 | | - trtllm-serve ${model_path} \ |
66 | | - --host $(hostname) --port ${port} \ |
67 | | - --extra_llm_api_options ${config_file} |
| 60 | + nsys_prefix="nsys profile -o ${nsys_file} -f true -t cuda,nvtx,python-gil -c cudaProfilerApi --cuda-graph-trace node --capture-range-end=stop --gpu-metrics-devices=none" |
68 | 61 | fi |
| 62 | + |
| 63 | +${nsys_prefix} trtllm-llmapi-launch ${numa_bind_cmd} \ |
| 64 | + trtllm-serve ${model_path} \ |
| 65 | + --host $(hostname) --port ${port} \ |
| 66 | + --extra_llm_api_options ${config_file} |
0 commit comments