File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
examples/speculative_decoding/collect_hidden_states Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 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" ;
2021python3 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 \
23- --output-dir /mnt/md0/eagle-hidden-states/llama1b/daring_anteater/
24+ --output-dir /mnt/md0/eagle-hidden-states/llama1b/daring_anteater/
25+
Original file line number Diff line number Diff line change 2525INPUT_FILE=synthetic_conversations/daring-anteater.jsonl
2626OUTPUT_DIR=/mnt/md0/eagle-hidden-states/llama1b/daring_anteater/
2727DP_SIZE=8
28+ MODEL=meta-llama/Llama-3.2-1B-Instruct
29+ export TLLM_LOG_LEVEL=" error" ;
2830
2931split -n l/$DP_SIZE --numeric-suffixes=0 -d --additional-suffix=.jsonl $INPUT_FILE /tmp/part-
3032
3133for i in $( seq 0 $(( DP_SIZE- 1 )) )
3234do
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+
3441done
3542wait
3643
37- rm /tmp/part-* .jsonl
44+ rm /tmp/part-* .jsonl
You can’t perform that action at this time.
0 commit comments