Skip to content

Commit

Permalink
Fix mpmath dependency (#2356)
Browse files Browse the repository at this point in the history
Summary:
- Fix mpmath dependency to allow tests to pass again; see

jianyicheng/mase-docker#9
nod-ai/SHARK-Studio#2095

Pull Request resolved: #2356

Reviewed By: spcyppt

Differential Revision: D54212358

Pulled By: q10

fbshipit-source-id: dfdf842069462a34514f78aee00cdb4a300392ce
  • Loading branch information
q10 authored and facebook-github-bot committed Feb 26, 2024
1 parent 90ba6e4 commit ad70943
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 10 deletions.
8 changes: 5 additions & 3 deletions .github/scripts/utils_build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,11 @@ install_build_tools () {

echo "[INSTALL] Installing build tools ..."
# NOTES:
# - Only the openblas package will install cblas.h directly into
# $CONDA_PREFIX/include directory
# - ncurses is needed to silence bad libtinfo6.so errors for ROCm+Clang builds
#
# - Only the openblas package will install <cblas.h> directly into
# $CONDA_PREFIX/include directory, which is required for FBGEMM tests
#
# - ncurses is needed to silence libtinfo6.so errors for ROCm+Clang builds
#
# shellcheck disable=SC2086
(exec_with_retries 3 conda install ${env_prefix} -c conda-forge -y \
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/fbgemm_gpu_ci_rocm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,6 @@ jobs:
- name: Create Conda Environment
run: . $PRELUDE; create_conda_environment $BUILD_ENV ${{ matrix.python-version }}

- name: Install Build Tools
run: . $PRELUDE; install_build_tools $BUILD_ENV

- name: Install PyTorch-ROCm Nightly
run: . $PRELUDE; install_pytorch_pip $BUILD_ENV nightly rocm/${{ matrix.rocm-version }}

Expand Down
6 changes: 6 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

breathe
sphinx_rtd_theme
6 changes: 6 additions & 0 deletions fbgemm_gpu/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# Note: Sphinx 7+ currently runs into an `Undefinederror("'style' is undefined")`
# We should eventually move to Sphinx 7+ to resolve
# https://github.com/sphinx-doc/sphinx/issues/1514
Expand Down
21 changes: 17 additions & 4 deletions fbgemm_gpu/docs/src/fbgemm_gpu-development/TestInstructions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ Testing FBGEMM_GPU
The tests (in the ``fbgemm_gpu/test/`` directory) and benchmarks (in the
``fbgemm_gpu/bench/`` directory) provide good examples on how to use FBGEMM_GPU.

FBGEMM_GPU Tests
~~~~~~~~~~~~~~~~
Setup the FBGEMM_GPU Test Environment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

After an environment is available from building / installing the FBGEMM_GPU
package, additional packages need to be installed for tests to run correctly:

.. code:: sh
# !! Run inside the Conda environment !!
# From the /fbgemm_gpu/ directory
python -m pip install -r requirements.txt
Running FBGEMM_GPU Tests
~~~~~~~~~~~~~~~~~~~~~~~~

To run the tests after building / installing the FBGEMM_GPU package:

Expand Down Expand Up @@ -60,8 +73,8 @@ For ROCm machines, testing against a ROCm GPU needs to be enabled with
python -m pytest -v -rsx -s -W ignore::pytest.PytestCollectionWarning split_table_batched_embeddings_test.py
FBGEMM_GPU Benchmarks
~~~~~~~~~~~~~~~~~~~~~
Running FBGEMM_GPU Benchmarks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To run the benchmarks:

Expand Down
13 changes: 13 additions & 0 deletions fbgemm_gpu/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

# NOTES:
#
# - A fixed version of mpmath is needed to work around an AttributeError; see:
# * https://github.com/nod-ai/SHARK/issues/2095
# * https://github.com/jianyicheng/mase-docker/pull/9

cmake
hypothesis
jinja2
mpmath==1.3.0
ninja
numpy
scikit-build
Expand Down

0 comments on commit ad70943

Please sign in to comment.