Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add installation and ASR inference instructions for Mac #6377

Merged
merged 1 commit into from
Apr 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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