Initialize rebalanced 2B MoE project
This commit is contained in:
5
scripts/README.md
Normal file
5
scripts/README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
# Scripts
|
||||
|
||||
- `sync_pretrain_data_into_repo.sh`: 200B 数据构建完成后,把数据目录同步到 `dataset/pretrain/data/`,默认优先 hardlink。
|
||||
- `wait_and_sync_pretrain_data.sh`: 后台等待当前 200B 构建进程结束,然后自动同步数据。
|
||||
- `train_nemo_megatron_2b_moe.sh`: NeMo/Megatron 训练入口占位,包含 image、mount、路径检查。
|
||||
32
scripts/sync_pretrain_data_into_repo.sh
Executable file
32
scripts/sync_pretrain_data_into_repo.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SRC="${SRC:-/mnt/beegfs/yi/laoyao_2b_moe_pretraining_dataset/train/pretrain_rebalanced_web40_edu20_chinese10_science10_logic10_math5_code5_200b_v1_20260701}"
|
||||
DST="${DST:-/mnt/beegfs/yi/laoyao_2b_moe/dataset/pretrain/data/pretrain_rebalanced_web40_edu20_chinese10_science10_logic10_math5_code5_200b_v1_20260701}"
|
||||
LOG="${LOG:-/mnt/beegfs/yi/laoyao_2b_moe_pretraining_dataset/logs/wait_build_rebalanced_200b_20260701_130058.log}"
|
||||
|
||||
mkdir -p "$(dirname "$DST")"
|
||||
|
||||
if pgrep -f "build_rebalanced_pretrain_dataset.py --target-tokens 200000000000" >/dev/null; then
|
||||
echo "pretrain builder is still running; not syncing yet" >&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
if [ ! -d "$SRC" ]; then
|
||||
echo "source dataset directory does not exist: $SRC" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! grep -q "rebalanced_pretrain_done\|completed\|wrote manifest\|finished" "$LOG" 2>/dev/null; then
|
||||
echo "warning: completion marker not found in log; syncing existing directory anyway" >&2
|
||||
fi
|
||||
|
||||
rm -rf "$DST"
|
||||
mkdir -p "$DST"
|
||||
if cp -al "$SRC"/. "$DST"/ 2>/tmp/laoyao_sync_cp_al.err; then
|
||||
echo "synced with hardlinks: $DST"
|
||||
else
|
||||
echo "hardlink copy failed, falling back to rsync copy" >&2
|
||||
cat /tmp/laoyao_sync_cp_al.err >&2 || true
|
||||
rsync -a --info=progress2 "$SRC"/ "$DST"/
|
||||
fi
|
||||
20
scripts/train_nemo_megatron_2b_moe.sh
Executable file
20
scripts/train_nemo_megatron_2b_moe.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
REPO_ROOT="${REPO_ROOT:-/mnt/beegfs/yi/laoyao_2b_moe}"
|
||||
IMAGE="${IMAGE:-nvcr.io/nvidia/nemo:26.06}"
|
||||
CONFIG="${CONFIG:-$REPO_ROOT/training/nemo_megatron/pretrain_2b_moe_200b.yaml}"
|
||||
DATA_DIR="$REPO_ROOT/dataset/pretrain/data/pretrain_rebalanced_web40_edu20_chinese10_science10_logic10_math5_code5_200b_v1_20260701"
|
||||
|
||||
if [ ! -d "$DATA_DIR" ]; then
|
||||
echo "pretrain data is missing under repo; run scripts/sync_pretrain_data_into_repo.sh after the 200B build finishes" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$REPO_ROOT/runs" "$REPO_ROOT/logs"
|
||||
|
||||
docker run --rm --gpus all --ipc=host --network=host \
|
||||
-v /mnt/beegfs:/mnt/beegfs \
|
||||
-w "$REPO_ROOT" \
|
||||
"$IMAGE" \
|
||||
bash -lc "echo TODO: launch NeMo/Megatron pretraining with $CONFIG; ls -lh $CONFIG"
|
||||
8
scripts/wait_and_sync_pretrain_data.sh
Executable file
8
scripts/wait_and_sync_pretrain_data.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
INTERVAL_SECONDS="${INTERVAL_SECONDS:-300}"
|
||||
while pgrep -f "build_rebalanced_pretrain_dataset.py --target-tokens 200000000000" >/dev/null; do
|
||||
date "+[%F %T] pretrain builder still running; waiting..."
|
||||
sleep "$INTERVAL_SECONDS"
|
||||
done
|
||||
bash /mnt/beegfs/yi/laoyao_2b_moe/scripts/sync_pretrain_data_into_repo.sh
|
||||
Reference in New Issue
Block a user