-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathgenerate_internlm3_8b_ptd.sh
More file actions
56 lines (51 loc) · 1.76 KB
/
generate_internlm3_8b_ptd.sh
File metadata and controls
56 lines (51 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# The number of parameters is not aligned
export CUDA_DEVICE_MAX_CONNECTIONS=1
# modify script model path and tokenizer path
TOKENIZER_PATH="your tokenizer directory path"
CHECKPOINT="your model directory path"
# Change for multinode config
MASTER_ADDR=localhost
MASTER_PORT=6001
NNODES=1
NODE_RANK=0
NPUS_PER_NODE=8
WORLD_SIZE=$(($NPUS_PER_NODE*$NNODES))
DISTRIBUTED_ARGS="--nproc_per_node $NPUS_PER_NODE --nnodes $NNODES --node_rank $NODE_RANK --master_addr $MASTER_ADDR --master_port $MASTER_PORT"
python -m torch.distributed.launch $DISTRIBUTED_ARGS inference.py \
--tensor-model-parallel-size 2 \
--pipeline-model-parallel-size 4 \
--num-layers 48 \
--hidden-size 4096 \
--ffn-hidden-size 10240 \
--position-embedding-type rope \
--use-rotary-position-embeddings \
--rotary-base 50000000 \
--group-query-attention \
--num-query-groups 2 \
--seq-length 4096 \
--max-new-tokens 256 \
--micro-batch-size 1 \
--num-attention-heads 32 \
--max-position-embeddings 32768 \
--padded-vocab-size 128512 \
--attention-dropout 0.0 \
--hidden-dropout 0.0 \
--swiglu \
--load "${CHECKPOINT}" \
--tokenizer-type PretrainedFromHF \
--tokenizer-name-or-path "${TOKENIZER_PATH}" \
--tokenizer-not-use-fast \
--bf16 \
--normalization RMSNorm \
--norm-epsilon 1e-5 \
--untie-embeddings-and-output-weights \
--disable-bias-linear \
--attention-softmax-in-fp32 \
--exit-on-missing-checkpoint \
--seed 42 \
--make-vocab-size-divisible-by 1 \
--use-mcore-models \
--dynamic-factor 6.0 \
--transformer-impl local \
| tee logs/generate_internlm3_8b.log