Skip to content

Commit d69a1c3

Browse files
committed
add slurm support in scripts
Signed-off-by: h-guo18 <[email protected]>
1 parent 450c773 commit d69a1c3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

examples/speculative_decoding/collect_hidden_states/run_trtllm_compute_hiddens.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# This script computes hidden states using TensorRT-LLM and saves them to
1818
# the specified output directory.
1919

20+
export TLLM_LOG_LEVEL="error";
2021
python3 collect_hidden_states/compute_hidden_states_trtllm.py \
2122
--model meta-llama/Llama-3.2-1B-Instruct \
2223
--input-file synthetic_conversations/daring-anteater.jsonl \

examples/speculative_decoding/collect_hidden_states/run_trtllm_compute_hiddens_dp.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,19 @@
2525
INPUT_FILE=synthetic_conversations/daring-anteater.jsonl
2626
OUTPUT_DIR=/mnt/md0/eagle-hidden-states/llama1b/daring_anteater/
2727
DP_SIZE=8
28+
MODEL=meta-llama/Llama-3.2-1B-Instruct
29+
export TLLM_LOG_LEVEL="error";
2830

2931
split -n l/$DP_SIZE --numeric-suffixes=0 -d --additional-suffix=.jsonl $INPUT_FILE /tmp/part-
3032

3133
for i in $(seq 0 $((DP_SIZE-1)))
3234
do
33-
CUDA_VISIBLE_DEVICES=$i python3 collect_hidden_states/compute_hidden_states_trtllm.py --model meta-llama/Llama-3.2-1B-Instruct --input-file /tmp/part-0${i}.jsonl --output-dir $OUTPUT_DIR --dp-rank $i &
35+
36+
export CUDA_VISIBLE_DEVICES=$i; python3 collect_hidden_states/compute_hidden_states_trtllm.py --model $MODEL --input-file /tmp/part-0${i}.jsonl --output-dir $OUTPUT_DIR --dp-rank $i &
37+
38+
# #On SLURM:
39+
# PORT=$((10012 + i)); export TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR="tcp://127.0.0.1:$PORT"; trtllm-llmapi-launch python3 collect_hidden_states/compute_hidden_states_trtllm.py --model $MODEL --input-file /tmp/part-0${i}.jsonl --output-dir $OUTPUT_DIR --dp-rank $i
40+
3441
done
3542
wait
3643

0 commit comments

Comments
 (0)