xuan-luo's picture
download
raw
1.34 kB
#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MEGATRON_DIR="${ROOT}/third_party/Megatron-LM"
MEGATRON_COMMIT="5d3107a924ecdbcdae9de68cdfa06e7dfc638a92"
PYTHON="${PYTHON:-python3}"
if [[ ! -d "${MEGATRON_DIR}/.git" ]]; then
echo "Megatron-LM not found at ${MEGATRON_DIR}"
exit 1
fi
current_commit="$(git -C "${MEGATRON_DIR}" rev-parse HEAD)"
if [[ "${current_commit}" != "${MEGATRON_COMMIT}" ]]; then
echo "Warning: Megatron-LM is at ${current_commit}, expected ${MEGATRON_COMMIT}"
fi
"${PYTHON}" -m pip install --upgrade pip setuptools wheel
"${PYTHON}" -m pip install -e "${MEGATRON_DIR}[training]"
"${PYTHON}" -m pip install \
"git+https://github.com/NVIDIA-NeMo/Emerging-Optimizers.git@v0.3.0"
"${PYTHON}" - <<'PY'
import torch
import megatron.core
import emerging_optimizers
try:
import transformer_engine.pytorch
except ImportError as error:
raise SystemExit(
"Transformer Engine is not importable. Install the build matching this "
"environment's CUDA/PyTorch ABI, or use an NVIDIA PyTorch/NeMo container."
) from error
print("PyTorch:", torch.__version__)
print("CUDA:", torch.version.cuda)
print("Megatron-Core import: OK")
print("Megatron editable path:", __import__("megatron.core").core.__file__)
PY
echo "DeltaKV env bootstrap complete."

Xet Storage Details

Size:
1.34 kB
·
Xet hash:
9939bab6d8d407b2b5be267588f583966b57ea6dfc3a13c57854eabb5e54a989

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.