Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/CrayLabs/SmartSim into s…
Browse files Browse the repository at this point in the history
…lurm-het-jobs
  • Loading branch information
al-rigazzi committed Aug 25, 2023
2 parents 7313f45 + d7a6b60 commit 32f38fa
Show file tree
Hide file tree
Showing 28 changed files with 1,075 additions and 504 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Install SmartSim (with ML backends)
run: |
python -m pip install git+https://github.com/CrayLabs/SmartRedis.git@develop#egg=smartredis
python -m pip install .[dev,ml]
python -m pip install .[dev,ml-cpu]
- name: Install ML Runtimes with Smart (with pt, tf, and onnx support)
if: (matrix.py_v != '3.10')
Expand Down
7 changes: 7 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,10 @@ max-try-statements=7

# Maximum level of inheritance, bumping up to account for db mixins
max-parents=25


[TYPECHECK]

# Pylint is kinda rough at determining what is and is not an attr in C extensions
# leave this work to mypy, which tends to be more reliable
ignored-modules=torch
9 changes: 9 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ To be released at some future point in time

Description

- Mitigated additional suppressed pylint errors
- Fix colocated db preparation bug when using `JsrunSettings`
- Enabled additional mypy checks
- Additional typehints
- Log ignored error messages from `sacct`
- Fix malformed logging format strings
- Fix bug when user specify CPU and devices greater than 1
Expand All @@ -28,14 +31,20 @@ Description

Detailed Notes

- Created public proprties where appropriate to mitigate `protected-access` errors (PR341_)
- Fix a failure to execute `_prep_colocated_db` due to incorrect named attr check (PR339_)
- Enabled and mitigated mypy `disallow_any_generics` and `warn_return_any` (PR338_)
- Add typehints to `smartsim._core.launcher.step.*` (PR334_)
- Log errors reported from slurm WLM when attempts to retrieve status fail (PR331_, PR332_)
- Fix incorrectly formatted positional arguments in log format strings (PR330_)
- Add error if user calls get_allocation with reserved keywords in slurm get_allocation (PR325_)
- Add error when user requests CPU with devices greater than 1 within add_ml_model and add_script (PR324_)
- Update pylint dependency, update .pylintrc, mitigate non-breaking issues, suppress api breaks (PR311_)

.. _PR341: https://github.com/CrayLabs/SmartSim/pull/341
.. _PR339: https://github.com/CrayLabs/SmartSim/pull/339
.. _PR338: https://github.com/CrayLabs/SmartSim/pull/338
.. _PR334: https://github.com/CrayLabs/SmartSim/pull/334
.. _PR332: https://github.com/CrayLabs/SmartSim/pull/332
.. _PR331: https://github.com/CrayLabs/SmartSim/pull/331
.. _PR330: https://github.com/CrayLabs/SmartSim/pull/330
Expand Down
56 changes: 28 additions & 28 deletions doc/installation_instructions/basic.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Basic

The base prerequisites to install SmartSim and SmartRedis are:

- Python 3.7-3.9
- Python 3.8-3.10
- Pip
- Cmake 3.13.x (or later)
- C compiler
Expand All @@ -41,7 +41,7 @@ GPU Support
The machine-learning backends have additional requirements in order to
use GPUs for inference

- `CUDA Toolkit 11 (11.4 recommended) <https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html>`_
- `CUDA Toolkit 11 (tested with 11.8) <https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html>`_
- `cuDNN 8 (tested with 8.2.1 and 8.4.0) <https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#download>`_
- OS: Linux
- GPU: Nvidia
Expand All @@ -66,11 +66,11 @@ Supported Versions
* - MacOS
- x86_64
- Not supported
- 3.7 - 3.9
- 3.8 - 3.10
* - Linux
- x86_64
- Nvidia
- 3.7 - 3.9
- 3.8 - 3.10


.. note::
Expand All @@ -81,7 +81,7 @@ Supported Versions

Native support for various machine learning libraries and their
versions is dictated by our dependency on RedisAI_ 1.2.7. Users
can also select RedisAI 1.2.3 or 1.2.5 (though that also limits
can also select RedisAI 1.2.5 (though that also limits
the version of the ML libraries).

+------------------+----------+-------------+---------------+
Expand All @@ -91,8 +91,6 @@ the version of the ML libraries).
+------------------+----------+-------------+---------------+
| 1.2.5 | 1.9.0 | 2.6.0 | 1.9.0 |
+------------------+----------+-------------+---------------+
| 1.2.3 | 1.7.0 | 2.5.2 | 1.9.0 |
+------------------+----------+-------------+---------------+

TensorFlow_ 2.0 and Keras_ are supported through `graph freezing`_.

Expand All @@ -116,10 +114,10 @@ MacOS-only
==========

We recommend users and contributors install brew_ for managing installed
packages. For contributors, the following brew packages can be helpful:
packages. For contributors, the following brew packages can be helpful:

- openmpi_ for building and running parallel SmartRedis examples
- doxygen_ for building the documention
- doxygen_ for building the documentation
- cmake_ for building SmartSim and SmartRedis from source

.. _brew: https://brew.sh/
Expand All @@ -146,7 +144,8 @@ There are two stages for the installation of SmartSim.
Step 1: Install Python Package
==============================

We first recommend creating a new virtual environment:
We first recommend creating a new
`virtual environment <https://docs.python.org/3/library/venv.html>`_:

.. code-block:: bash
Expand All @@ -159,16 +158,17 @@ and install SmartSim from PyPI with the following command:
pip install smartsim
If you would like SmartSim to also install Machine Learning libraries that
can be used outside SmartSim to build SmartSim-compatible models, you
can request their installation through the ``ml`` flag as follows:
If you would like SmartSim to also install python machine learning libraries
that can be used outside SmartSim to build SmartSim-compatible models, you
can request their installation through the ``ml-*`` optional dependencies,
as follows:

.. code-block:: bash
# For bash
pip install smartsim[ml]
# or if using ZSH
pip install smartsim\[ml\]
# For CPU based models
pip install smartsim[ml-cpu]
# For CPU and CUDA based models
pip install smartsim[ml-cuda]
At this point, SmartSim is installed and can be used for more basic features.
If you want to use the machine learning features of SmartSim, you will need
Expand All @@ -187,7 +187,7 @@ To see all the installation options:

.. code-block:: bash
smart
smart --help
CPU Install
-----------
Expand All @@ -198,7 +198,7 @@ To install the default ML backends for CPU, run
# run one of the following
smart build --device cpu # install PT and TF for cpu
smart build --device cpu --onnx # install all backends (PT, TF, ONNX) on gpu
smart build --device cpu --onnx # install all backends (PT, TF, ONNX) on cpu
By default, ``smart`` will install PyTorch and TensorFlow backends
for use in SmartSim.
Expand Down Expand Up @@ -247,9 +247,9 @@ SmartSim does.
* - Platform
- Python Versions
* - MacOS
- 3.7 - 3.9
- 3.7 - 3.10
* - Linux
- 3.7 - 3.9
- 3.7 - 3.10

The Python client for SmartRedis is installed through ``pip`` as follows:

Expand All @@ -265,9 +265,9 @@ From Source
===========

This section will be geared towards contributors who want to install SmartSim
and SmartRedis from source. If you are installing from source for other reasons,
follow the steps below but use the distribution provided hosted on GitHub or
PyPI.
and SmartRedis from source for development purposes. If you are installing
from source for other reasons, follow the steps below but use the source
distributions provided on GitHub or PyPI.

.. _from-source:

Expand All @@ -281,14 +281,15 @@ First, clone SmartSim.
git clone https://github.com/CrayLabs/SmartSim smartsim
And then install SmartSim with pip in *editable* mode. This way, SmartSim is
installed in your virtual environment and available in PYTHONPATH, but the
installed in your virtual environment and available on `sys.path`, but the
source remains at the site of the clone instead of in site-packages.

.. code-block:: bash
cd smartsim
pip install -e .[dev,ml] # for bash users
pip install -e .\[dev,ml\] # for zsh users
pip install -e .[dev,ml-cpu] # for CPU only
# OR
pip install -e .[dev,ml-cuda] # for CUDA support
Use the now installed ``smart`` cli to install the machine learning runtimes.

Expand All @@ -306,4 +307,3 @@ Build the SmartRedis library
.. include:: ../../smartredis/doc/install/lib.rst



2 changes: 1 addition & 1 deletion doc/installation_instructions/platform/cray.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if these instructions do not work).
.. code-block:: bash
module use -a /lus/scratch/smartsim/local/modulefiles
module load cudatoolkit/11.4 cudnn git-lfs
module load cudatoolkit/11.8 cudnn git-lfs
module unload PrgEnv-cray PrgEnv-intel PrgEnv-gcc
module load PrgEnv-gnu
Expand Down
4 changes: 2 additions & 2 deletions doc/installation_instructions/site-install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ from source with the following steps replacing ``COMPILER_VERSION`` and
.. code:: bash
module use -a /lus/scratch/smartsim/local/modulefiles
module load cudatoolkit/11.4 cudnn smartsim-deps/COMPILER_VERSION/SMARTSIM_VERSION
pip install smartsim[ml]
module load cudatoolkit/11.8 cudnn smartsim-deps/COMPILER_VERSION/SMARTSIM_VERSION
pip install smartsim[ml-cuda]
smart build --only_python_packages --device gpu [--onnx]
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ module = [
"redis.cluster",
"keras",
"torch",
"smartsim._core.launcher.step.*", # hints incomplete
"smartsim.ml.torch.*", # must solve/ignore inheritance issues
]
ignore_missing_imports = true
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def has_ext_modules(_placeholder):
"types-setuptools",
],
# see smartsim/_core/_install/buildenv.py for more details
"ml": versions.ml_extras_required(),
**versions.ml_extras_required()
}


Expand Down
1 change: 1 addition & 0 deletions smartsim/_core/_cli/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

from smartsim._core._cli.cli import default_cli


def main() -> int:
smart_cli = default_cli()
return smart_cli.execute(sys.argv)
Expand Down
Loading

0 comments on commit 32f38fa

Please sign in to comment.