forked from NVIDIA/Megatron-LM
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1efaebf
commit c390b79
Showing
3 changed files
with
107 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
ARG BASE_DOCKER=rocm/pytorch:latest | ||
FROM $BASE_DOCKER | ||
|
||
ARG PYTORCH_ROCM_ARCH_OVERRIDE="gfx942" | ||
ENV WORKSPACE_DIR=/workspace | ||
ENV STAGE_DIR=/workspace/installs | ||
RUN mkdir -p $WORKSPACE_DIR | ||
RUN mkdir -p ${STAGE_DIR} | ||
WORKDIR $WORKSPACE_DIR | ||
|
||
RUN pip3 install \ | ||
numpy==1.26.4 \ | ||
scipy \ | ||
einops \ | ||
flask-restful \ | ||
nltk \ | ||
pytest \ | ||
pytest-cov \ | ||
pytest_mock \ | ||
pytest-csv \ | ||
pytest-random-order \ | ||
sentencepiece \ | ||
wrapt \ | ||
zarr \ | ||
wandb \ | ||
tensorstore==0.1.45 \ | ||
pytest_mock \ | ||
pybind11 \ | ||
setuptools==69.5.1 \ | ||
datasets \ | ||
tiktoken \ | ||
pynvml | ||
|
||
RUN pip3 install "huggingface_hub[cli]" | ||
RUN python3 -m nltk.downloader punkt_tab | ||
|
||
|
||
# Install Causal-Conv1d and its dependencies | ||
WORKDIR ${STAGE_DIR} | ||
ENV CAUSAL_CONV1D_FORCE_BUILD=TRUE | ||
ENV MAMBA_FORCE_BUILD=TRUE | ||
ENV HIP_ARCHITECTURES=${PYTORCH_ROCM_ARCH_OVERRIDE} | ||
RUN git clone https://github.com/Dao-AILab/causal-conv1d causal-conv1d &&\ | ||
cd causal-conv1d &&\ | ||
git show --oneline -s &&\ | ||
pip install . | ||
|
||
# Install mamba | ||
WORKDIR ${STAGE_DIR} | ||
RUN git clone https://github.com/state-spaces/mamba mamba &&\ | ||
cd mamba &&\ | ||
git show --oneline -s &&\ | ||
pip install --no-build-isolation . | ||
|
||
# Clone TE repo and submodules | ||
WORKDIR ${STAGE_DIR} | ||
ENV NVTE_FRAMEWORK=pytorch | ||
ENV PYTORCH_ROCM_ARCH=${PYTORCH_ROCM_ARCH_OVERRIDE} | ||
ENV NVTE_USE_HIPBLASLT=1 | ||
RUN git clone --recursive https://github.com/ROCmSoftwarePlatform/TransformerEngine-private.git &&\ | ||
cd TransformerEngine-private &&\ | ||
pip install . | ||
|
||
WORKDIR $WORKSPACE_DIR | ||
RUN git clone https://github.com/ROCm/Megatron-LM.git Megatron-LM &&\ | ||
cd Megatron-LM &&\ | ||
git checkout rocm_dev &&\ | ||
pip install -e . | ||
|
||
WORKDIR $WORKSPACE_DIR/Megatron-LM | ||
|
||
# record configuration for posterity | ||
RUN pip list | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
export HIP_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 | ||
torchrun --nproc_per_node=8 -m pytest -m "not flaky and not nternal and not failing_on_rocm_mi250 and not failing_on_rocm" --csv test_report.csv Megatron-LM/tests/unit_tests/ |