Skip to content

Commit

Permalink
Add installation and inference instructions for Mac (NVIDIA#6377)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Bataev <[email protected]>
Signed-off-by: hsiehjackson <[email protected]>
  • Loading branch information
artbataev authored and hsiehjackson committed Jun 2, 2023
1 parent 30a9991 commit 2f89f2f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/source/asr/results.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,21 @@ Alternatively, you can change the attention model after loading a checkpoint:
att_context_size=[64, 64]
)
Inference on Apple M-Series GPU
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To perform inference on Apple Mac M-Series GPU (``mps`` PyTorch device), use PyTorch 2.0 or higher (see :ref:`mac-installation` section). Environment variable ``PYTORCH_ENABLE_MPS_FALLBACK=1`` should be set, since not all operations in PyTorch are currently implemented on ``mps`` device.

If ``allow_mps=true`` flag is passed to ``speech_to_text_eval.py``, the ``mps`` device will be selected automatically.

.. code-block:: python
PYTORCH_ENABLE_MPS_FALLBACK=1 python speech_to_text_eval.py \
(...other parameters...) \
allow_mps=true
Fine-tuning on Different Datasets
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
31 changes: 31 additions & 0 deletions docs/source/starthere/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,37 @@ If you chose to work with the ``main`` branch, we recommend using `NVIDIA's PyTo
-p 8888:8888 -p 6006:6006 --ulimit memlock=-1 --ulimit \
stack=67108864 --device=/dev/snd nvcr.io/nvidia/pytorch:21.05-py3
.. _mac-installation:

Mac computers with Apple silicon
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To install NeMo on Mac with Apple M-Series GPU:

- install `Homebrew <https://brew.sh>`_ package manager

- create a new Conda environment

- install PyTorch 2.0 or higher

- run the following code:

.. code-block:: shell
# install mecab using Homebrew, required for sacrebleu for NLP collection
brew install mecab
# install pynini using Conda, required for text normalization
conda install -c conda-forge pynini
# install Cython manually
pip install cython
# clone the repo and install in development mode
git clone https://github.com/NVIDIA/NeMo
cd NeMo
./reinstall.sh
`FAQ <https://github.com/NVIDIA/NeMo/discussions>`_
---------------------------------------------------
Expand Down

0 comments on commit 2f89f2f

Please sign in to comment.