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

docs: Add FAQ on backend support on Apple silicon Macs #2118

Closed
wants to merge 3 commits into from
Closed
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
34 changes: 34 additions & 0 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,40 @@ Use the :code:`--backend` option for :code:`pyhf cls` to specify a tensor backen
The default backend is NumPy.
For more information see :code:`pyhf cls --help`.

Why can't ``pip`` find compatible backends on PyPI for Apple silicon Macs?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Unfortunately, at this time |tensorflow Issue 57185|_ of ``pyhf``'s backends
support wheels for Apple silicon Macs (``osx-arm64``) under common names on PyPI.
If you are installing wheels from PyPI on an ``osx-arm64`` machine, you will only
be able to use a subset of all the backends through the provided extras.

To install the dependencies for the TensorFlow backend you'll need to manually
specify that ``tensorflow-macos`` is required

.. code-block:: console

python -m pip install pyhf tensorflow-macos tensorflow-probability

Similarly, if you want to install the TensorFlow backend dependencies along with the
other backends included in the ``[backends]`` extra you'll need to specify the extras
as well

.. code-block:: console

python -m pip install 'pyhf[torch,jax,minuit]' tensorflow-macos tensorflow-probability
Comment on lines +41 to +54
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexander-held I think this should work to actually get things installed. Though I think it is going to be annoying to get a full developer environment setup at the moment given that the test extra also pulls in the backends extra and so will break here.


An alternative would be to create a |micromamba|_ environment and install the
backends individually from `conda-forge <https://prefix.dev/channels/conda-forge/>`__
as all the backends have conda-forge releases compatible with ``linux-64``,
``osx-64``, and ``osx-arm64``.

.. |tensorflow Issue 57185| replace:: not all
.. _`tensorflow Issue 57185`: https://github.com/tensorflow/tensorflow/issues/57185

.. |micromamba| replace:: ``micromamba``
.. _`micromamba`: https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html

I installed an old ``pyhf`` release from PyPI, why am I getting an error from a dependency?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down