Skip to content

Commit

Permalink
update commit (#6148)
Browse files Browse the repository at this point in the history
Signed-off-by: ericharper <[email protected]>
  • Loading branch information
ericharper authored Mar 8, 2023
1 parent 28b5f29 commit 95f7f99
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 32 deletions.
60 changes: 30 additions & 30 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ ARG REQUIRE_K2=false
ENV DEBIAN_FRONTEND=noninteractive
# libavdevice-dev rerquired for latest torchaudio
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y \
libsndfile1 sox \
libfreetype6 \
swig \
ffmpeg \
libavdevice-dev && \
rm -rf /var/lib/apt/lists/*
apt-get upgrade -y && \
apt-get install -y \
libsndfile1 sox \
libfreetype6 \
swig \
ffmpeg \
libavdevice-dev && \
rm -rf /var/lib/apt/lists/*

WORKDIR /tmp/

# TODO: Remove once this Apex commit (1/19/23) is included in PyTorch
# container
RUN git clone https://github.com/NVIDIA/apex.git && \
cd apex && \
git checkout c0a0b0f69d2d5a98bd141be12ee8e5eebd3ec7ca && \
pip3 install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--fast_layer_norm" --global-option="--distributed_adam" --global-option="--deprecated_fused_adam" ./
cd apex && \
git checkout a32d7a6dddcf4e39d241b0d139c222a97c91887d && \
pip3 install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--fast_layer_norm" --global-option="--distributed_adam" --global-option="--deprecated_fused_adam" ./

# uninstall stuff from base container
RUN pip3 uninstall -y sacrebleu torchtext
Expand All @@ -56,13 +56,13 @@ RUN pip3 uninstall -y sacrebleu torchtext
WORKDIR /tmp/torchaudio_build
COPY scripts/installers /tmp/torchaudio_build/scripts/installers/
RUN INSTALL_MSG=$(/bin/bash /tmp/torchaudio_build/scripts/installers/install_torchaudio_latest.sh); INSTALL_CODE=$?; \
echo ${INSTALL_MSG}; \
if [ ${INSTALL_CODE} -ne 0 ]; then \
echo "torchaudio installation failed"; \
if [ "${REQUIRE_TORCHAUDIO}" = true ]; then \
exit ${INSTALL_CODE}; \
else echo "Skipping failed torchaudio installation"; fi \
else echo "torchaudio installed successfully"; fi
echo ${INSTALL_MSG}; \
if [ ${INSTALL_CODE} -ne 0 ]; then \
echo "torchaudio installation failed"; \
if [ "${REQUIRE_TORCHAUDIO}" = true ]; then \
exit ${INSTALL_CODE}; \
else echo "Skipping failed torchaudio installation"; fi \
else echo "torchaudio installed successfully"; fi

# install nemo dependencies
WORKDIR /tmp/nemo
Expand All @@ -76,13 +76,13 @@ RUN /bin/bash /tmp/nemo/install_pynini.sh
# 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=$?; \
echo ${INSTALL_MSG}; \
if [ ${INSTALL_CODE} -ne 0 ]; then \
echo "k2 installation failed"; \
if [ "${REQUIRE_K2}" = true ]; then \
exit ${INSTALL_CODE}; \
else echo "Skipping failed k2 installation"; fi \
else echo "k2 installed successfully"; fi
echo ${INSTALL_MSG}; \
if [ ${INSTALL_CODE} -ne 0 ]; then \
echo "k2 installation failed"; \
if [ "${REQUIRE_K2}" = true ]; then \
exit ${INSTALL_CODE}; \
else echo "Skipping failed k2 installation"; fi \
else echo "k2 installed successfully"; fi

# copy nemo source into a scratch image
FROM scratch as nemo-src
Expand All @@ -95,16 +95,16 @@ ARG NEMO_VERSION=1.16.0
# Check that NEMO_VERSION is set. Build will fail without this. Expose NEMO and base container
# version information as runtime environment variable for introspection purposes
RUN /usr/bin/test -n "$NEMO_VERSION" && \
/bin/echo "export NEMO_VERSION=${NEMO_VERSION}" >> /root/.bashrc && \
/bin/echo "export BASE_IMAGE=${BASE_IMAGE}" >> /root/.bashrc
/bin/echo "export NEMO_VERSION=${NEMO_VERSION}" >> /root/.bashrc && \
/bin/echo "export BASE_IMAGE=${BASE_IMAGE}" >> /root/.bashrc

# Install NeMo
RUN --mount=from=nemo-src,target=/tmp/nemo cd /tmp/nemo && pip install ".[all]"

# Check install
RUN python -c "import nemo.collections.nlp as nemo_nlp" && \
python -c "import nemo.collections.tts as nemo_tts" && \
python -c "import nemo_text_processing.text_normalization as text_normalization"
python -c "import nemo.collections.tts as nemo_tts" && \
python -c "import nemo_text_processing.text_normalization as text_normalization"

# TODO: Update to newer numba 0.56.0RC1 for 22.03 container if possible
# install pinned numba version
Expand All @@ -123,7 +123,7 @@ COPY tutorials /workspace/nemo/tutorials
# COPY README.rst LICENSE /workspace/nemo/

RUN printf "#!/bin/bash\njupyter lab --no-browser --allow-root --ip=0.0.0.0" >> start-jupyter.sh && \
chmod +x start-jupyter.sh
chmod +x start-jupyter.sh

# Prepare AIS CLI
ARG AIS_VERSION=v1.3.15
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ Install it manually if not using the NVIDIA PyTorch container.

.. code-block:: bash
git clone https://github.com/ericharper/apex.git
git clone https://github.com/NVIDIA/apex.git
cd apex
git checkout nm_v1.15.0
git checkout a32d7a6dddcf4e39d241b0d139c222a97c91887d
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" --global-option="--fast_layer_norm" --global-option="--distributed_adam" --global-option="--deprecated_fused_adam" ./
Transformer Engine
Expand Down

0 comments on commit 95f7f99

Please sign in to comment.