|
24 | 24 | # TP does NOT reduce expert memory — increase EP instead. |
25 | 25 | # Recommended: TP=2, EP=32, PP=1 (64 GPUs, 8 nodes). |
26 | 26 | # |
27 | | -# Loads the HF checkpoint, converts to Megatron in-memory, and runs efficient |
28 | | -# text generation via examples/inference/text_generation.py. |
| 27 | +# Megatron inference engine support is not yet available for this architecture. |
| 28 | +# This launcher defaults to the older slow sanity-check generation path for now. |
| 29 | +# |
| 30 | +# Loads the HF checkpoint, converts to Megatron in-memory, and runs greedy |
| 31 | +# text generation via examples/conversion/hf_to_megatron_generate_text.py. |
29 | 32 | # |
30 | 33 | # Requirements: transformers >= 5.2.0 |
31 | 34 | # |
@@ -61,12 +64,12 @@ MODEL_NAME="${MODEL_NAME:-GLM-5}" |
61 | 64 | # Use the direct local snapshot path to avoid 64 processes calling |
62 | 65 | # snapshot_download simultaneously (causes Lustre race conditions). |
63 | 66 | HF_MODEL_PATH="${HF_HOME}/hub/models--zai-org--${MODEL_NAME}/snapshots/$(ls ${HF_HOME}/hub/models--zai-org--${MODEL_NAME}/snapshots/ | head -1)" |
64 | | -TP=2 |
65 | | -EP=32 |
66 | | -PP=1 |
| 67 | +TP="${TP:-2}" |
| 68 | +EP="${EP:-32}" |
| 69 | +PP="${PP:-1}" |
67 | 70 |
|
68 | | -PROMPT="What is artificial intelligence?" |
69 | | -MAX_NEW_TOKENS=100 |
| 71 | +PROMPT="${PROMPT:-What is artificial intelligence?}" |
| 72 | +MAX_NEW_TOKENS="${MAX_NEW_TOKENS:-100}" |
70 | 73 |
|
71 | 74 | # ── Environment ─────────────────────────────────────────────────────────── |
72 | 75 | export TORCH_NCCL_AVOID_RECORD_STREAMS=1 |
@@ -114,12 +117,11 @@ print(m.group(1) + m.group(2) if m else s.split(',')[0]) |
114 | 117 | --node_rank=\$SLURM_PROCID \ |
115 | 118 | --master_addr=\$MASTER_ADDR \ |
116 | 119 | --master_port=29500 \ |
117 | | - examples/inference/text_generation.py \ |
| 120 | + examples/conversion/hf_to_megatron_generate_text.py \ |
118 | 121 | --hf_model_path $HF_MODEL_PATH \ |
119 | 122 | --prompt '$PROMPT' \ |
120 | 123 | --max_new_tokens $MAX_NEW_TOKENS \ |
121 | | - --tp $TP --ep $EP --pp $PP \ |
122 | | - --use-coordinator |
| 124 | + --tp $TP --ep $EP --pp $PP |
123 | 125 | " |
124 | 126 |
|
125 | 127 | echo "======================================" |
|
0 commit comments