Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into heh/modular_speechlm_…
Browse files Browse the repository at this point in the history
…nightly

Signed-off-by: stevehuang52 <[email protected]>
  • Loading branch information
stevehuang52 committed Jan 31, 2024
2 parents d8b2ffc + 1fede57 commit 7f7a487
Show file tree
Hide file tree
Showing 593 changed files with 59,216 additions and 3,646 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ coverage.xml
.git
**/*.nemo
**/*.ckpt
workspace
nemo_experiments
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Add a one line overview of what this PR aims to accomplish.
# Add a code snippet demonstrating how to use this
```

# Jenkins CI
To run Jenkins, a NeMo User with write access must comment `jenkins` on the PR.

# Before your PR is "Ready for review"
**Pre checks**:
- [ ] Make sure you read and followed [Contributor guidelines](https://github.com/NVIDIA/NeMo/blob/main/CONTRIBUTING.md)
Expand Down
51 changes: 40 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ARG REQUIRE_AIS_CLI=false

# Ensure apt-get won't prompt for selecting options
ENV DEBIAN_FRONTEND=noninteractive
# libavdevice-dev rerquired for latest torchaudio
# libavdevice-dev required for latest torchaudio
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
Expand All @@ -42,24 +42,43 @@ RUN apt-get update && \
libavdevice-dev && \
rm -rf /var/lib/apt/lists/*

WORKDIR /workspace/
# libtool, ... , libgts-dev are required for graphviz
# graphviz is required for k2 and pynini visualization
RUN apt-get update && \
apt-get install -y \
libtool \
libltdl-dev \
automake \
autoconf \
bison \
flex \
tcl \
ghostscript \
libgd-dev \
fontconfig \
libcairo2-dev \
libpango1.0-dev \
libgts-dev && \
rm -rf /var/lib/apt/lists/*

WORKDIR /workspace/
# Install megatron core, this can be removed once 0.3 pip package is released
# We leave it here in case we need to work off of a specific commit in main
RUN git clone https://github.com/NVIDIA/Megatron-LM.git && \
cd Megatron-LM && \
git checkout 375395c187ff64b8d56a1cd40572bc779864b1bd && \
git checkout e122536b7645edcb7ebf099b5c92a443f7dbf8e7 && \
pip install .

# Distributed Adam support for multiple dtypes
# Apex bugfix for PyTorch 23.11 container: https://github.com/NVIDIA/apex/pull/1760
RUN git clone https://github.com/NVIDIA/apex.git && \
cd apex && \
git checkout 52e18c894223800cb611682dce27d88050edf1de && \
pip install install -v --no-build-isolation --disable-pip-version-check --no-cache-dir --config-settings "--build-option=--cpp_ext --cuda_ext --fast_layer_norm --distributed_adam --deprecated_fused_adam" ./
git checkout c07a4cf67102b9cd3f97d1ba36690f985bae4227 && \
pip install -v --no-build-isolation --disable-pip-version-check --no-cache-dir --config-settings "--build-option=--cpp_ext --cuda_ext --fast_layer_norm --distributed_adam --deprecated_fused_adam" ./

# Transformer Engine 1.2.0
RUN git clone https://github.com/NVIDIA/TransformerEngine.git && \
cd TransformerEngine && \
git fetch origin a03f8bc9ae004e69aae4902fdd4a6d81fd95bc89 && \
git fetch origin 4f9662fbe621671f5f905e772fc1138953af77f6 && \
git checkout FETCH_HEAD && \
git submodule init && git submodule update && \
NVTE_FRAMEWORK=pytorch NVTE_WITH_USERBUFFERS=1 MPI_HOME=/usr/local/mpi pip install .
Expand All @@ -83,19 +102,29 @@ RUN INSTALL_MSG=$(/bin/bash /tmp/torchaudio_build/scripts/installers/install_tor

# install nemo dependencies
WORKDIR /tmp/nemo
ENV LHOTSE_REQUIRE_TORCHAUDIO=0
COPY requirements .
RUN for f in $(ls requirements*.txt); do pip3 install --disable-pip-version-check --no-cache-dir -r $f; done

# install flash attention dependencies
# install flash attention
RUN pip install flash-attn
# pinned triton version for flash-attention https://github.com/HazyResearch/flash-attention/blob/main/flash_attn/flash_attn_triton.py#L3
RUN pip install triton==2.0.0.dev20221202
# install numba for latest containers
RUN pip install numba>=0.57.1

COPY scripts /tmp/nemo/scripts/
# install correct graphviz version (k2 and pynini visualization tool), skip if installation fails
RUN INSTALL_MSG=$(/bin/bash /tmp/nemo/scripts/installers/install_graphviz.sh --docker); INSTALL_CODE=$?; \
echo ${INSTALL_MSG}; \
if [ ${INSTALL_CODE} -ne 0 ]; then \
echo "graphviz installation failed"; \
if [ "${REQUIRE_K2}" = true ]; then \
exit ${INSTALL_CODE}; \
else echo "Skipping failed graphviz installation"; fi \
else echo "graphviz installed successfully"; fi

# install k2, skip if installation fails
COPY scripts /tmp/nemo/scripts/
RUN INSTALL_MSG=$(/bin/bash /tmp/nemo/scripts/speech_recognition/k2/setup.sh); INSTALL_CODE=$?; \
RUN INSTALL_MSG=$(/bin/bash /tmp/nemo/scripts/installers/install_k2.sh); INSTALL_CODE=$?; \
echo ${INSTALL_MSG}; \
if [ ${INSTALL_CODE} -ne 0 ]; then \
echo "k2 installation failed"; \
Expand Down
Loading

0 comments on commit 7f7a487

Please sign in to comment.