Skip to content

Commit

Permalink
Update to v0.5.0
Browse files Browse the repository at this point in the history
Update python package and documentation from v0.4.2 to v0.5.0

[ committed by @mellis13 ]
[ reviewed by @ashao ]
  • Loading branch information
mellis13 authored Jul 7, 2023
2 parents 7e04b09 + f3ede10 commit a9018e0
Show file tree
Hide file tree
Showing 133 changed files with 5,003 additions and 3,277 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ jobs:
cp -r doc-branch/docs/* ./docs/
rm -rf doc-branch
- name: build documentation with docker
- name: Build documentation with docker
run: make docks

- name: Commit files
run: |
git add -A
git add -Af
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git commit -m "Update develop documentation"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-10.15]
os: [ubuntu-20.04, macos-12]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -123,4 +123,4 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI }}
#repository_url: https://test.pypi.org/legacy/
#repository_url: https://test.pypi.org/legacy/
11 changes: 9 additions & 2 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-10.15, ubuntu-20.04] # Operating systems
os: [macos-12, ubuntu-20.04] # Operating systems
compiler: [8] # GNU compiler version
rai: [1.2.5, 1.2.7] # Redis AI versions
py_v: [3.8, 3.9, '3.10'] # Python versions
exclude:
# Do not build with Redis AI 1.2.5 on MacOS
- os: macos-10.15
- os: macos-12
rai: 1.2.5
# Do not build Redis AI 1.2.5 with py3.10
# as wheels for dependecies are not availble
Expand Down Expand Up @@ -128,3 +128,10 @@ jobs:
with:
fail_ci_if_error: true
files: ./coverage.xml

- name: Run mypy
# TF 2.6.2 has a dep conflict with new mypy versions
if: (matrix.rai != '1.2.5')
run: |
python -m pip install .[mypy]
make check-mypy
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __pycache__
htmlcov
smartsim.egg-info
tests/test_output
docs/*

# Dependencies
smartsim/_core/.third-party
Expand Down
4 changes: 2 additions & 2 deletions .wci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
language: Python

release:
version: 0.4.2
date: 2023-04-12
version: 0.5.0
date: 2023-07-06

documentation:
general: https://www.craylabs.org/docs/overview.html
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include requirements.txt
include Makefile
graft smartsim/

6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ check-lint:
@pylint --rcfile=.pylintrc ./smartsim


# help: check-mypy - run static type check
.PHONY: check-mypy
check-mypy:
@mypy --config-file=./pyproject.toml


# help:
# help: Documentation
# help: -------
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ before using it on your system. Each tutorial is a Jupyter notebook that can be
which will run a jupyter lab with the tutorials, SmartSim, and SmartRedis installed.

```bash
docker pull ghcr.io/craylabs/smartsim-tutorials:v0.4.2
docker run -p 8888:8888 ghcr.io/craylabs/smartsim-tutorials:v0.4.2
docker pull ghcr.io/craylabs/smartsim-tutorials:v0.4.1
docker run -p 8888:8888 ghcr.io/craylabs/smartsim-tutorials:v0.4.1
# click on link to open jupyter lab
```

Expand Down Expand Up @@ -452,7 +452,7 @@ which will run a jupyter lab with the tutorials, SmartSim, and SmartRedis instal

```bash
docker pull ghcr.io/craylabs/smartsim-tutorials:v1
docker run -p 8888:8888 ghcr.io/craylabs/smartsim-tutorials:v0.4.2
docker run -p 8888:8888 ghcr.io/craylabs/smartsim-tutorials:v0.4.1
```
Each of the following examples can be found in the
[SmartSim documentation](https://www.craylabs.org/docs/tutorials/getting_started/getting_started.html).
Expand Down
47 changes: 42 additions & 5 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import json
import os
import inspect
import shutil
import pytest
import psutil
import shutil
Expand All @@ -44,13 +43,15 @@
from smartsim._core.config import CONFIG
from smartsim.error import SSConfigError
from subprocess import run
import sys


# Globals, yes, but its a testing file
test_path = os.path.dirname(os.path.abspath(__file__))
test_dir = os.path.join(test_path, "tests", "test_output")
test_launcher = CONFIG.test_launcher
test_device = CONFIG.test_device
test_num_gpus = CONFIG.test_num_gpus
test_nic = CONFIG.test_interface
test_alloc_specs_path = os.getenv("SMARTSIM_TEST_ALLOC_SPEC_SHEET_PATH", None)
test_port = CONFIG.test_port
Expand All @@ -73,6 +74,7 @@ def print_test_configuration():
global test_nic
global test_alloc_specs_path
global test_port

print("TEST_SMARTSIM_LOCATION:", smartsim.__path__)
print("TEST_PATH:", test_path)
print("TEST_LAUNCHER:", test_launcher)
Expand Down Expand Up @@ -511,7 +513,7 @@ def _test_dir_path(caller_function, caller_fspath):
return dir_path

@staticmethod
def get_test_dir(caller_function=None, caller_fspath=None):
def get_test_dir(caller_function=None, caller_fspath=None, level=1):
"""Get path to test output.
This function should be called without arguments from within
Expand All @@ -530,7 +532,7 @@ def get_test_dir(caller_function=None, caller_fspath=None):
:rtype: str
"""
if not caller_function or not caller_fspath:
caller_frame = inspect.stack()[1]
caller_frame = inspect.stack()[level]
caller_fspath = caller_frame.filename
caller_function = caller_frame.function

Expand All @@ -541,7 +543,7 @@ def get_test_dir(caller_function=None, caller_fspath=None):
return dir_path

@staticmethod
def make_test_dir(caller_function=None, caller_fspath=None):
def make_test_dir(caller_function=None, caller_fspath=None, level=1):
"""Create test output directory and return path to it.
This function should be called without arguments from within
Expand All @@ -558,7 +560,7 @@ def make_test_dir(caller_function=None, caller_fspath=None):
:rtype: str
"""
if not caller_function or not caller_fspath:
caller_frame = inspect.stack()[1]
caller_frame = inspect.stack()[level]
caller_fspath = caller_frame.filename
caller_function = caller_frame.function

Expand Down Expand Up @@ -591,3 +593,38 @@ class MLUtils:
def get_test_device():
global test_device
return test_device

@staticmethod
def get_test_num_gpus():
return test_num_gpus

@pytest.fixture
def coloutils():
return ColoUtils

class ColoUtils:
def setup_test_colo(fileutils, db_type, exp, db_args):
"""Setup things needed for setting up the colo pinning tests"""
# get test setup
test_dir = fileutils.make_test_dir(level=2)
sr_test_script = fileutils.get_test_conf_path("send_data_local_smartredis.py")

# Create an app with a colo_db which uses 1 db_cpu
colo_settings = exp.create_run_settings(exe=sys.executable, exe_args=sr_test_script)
colo_model = exp.create_model(f"colocated_model", colo_settings)
colo_model.set_path(test_dir)

if db_type in ['tcp', "deprecated"]:
db_args["port"] = 6780
db_args["ifname"] = "lo"

colocate_fun = {
"tcp": colo_model.colocate_db_tcp,
"deprecated": colo_model.colocate_db,
"uds":colo_model.colocate_db_uds
}
colocate_fun[db_type](**db_args)
# assert model will launch with colocated db
assert colo_model.colocated
# Check to make sure that limit_db_cpus made it into the colo settings
return colo_model
4 changes: 3 additions & 1 deletion doc/_static/version_names.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"version_names":[
"develop (unstable)",
"0.4.2 (stable)",
"0.5.0 (stable)",
"0.4.2",
"0.4.1",
"0.4.0",
"0.3.2"
],
"version_urls": [
"https://www.craylabs.org/develop/overview.html",
"https://www.craylabs.org/docs/overview.html",
"https://www.craylabs.org/docs/versions/0.4.2/overview.html",
"https://www.craylabs.org/docs/versions/0.4.1/overview.html",
"https://www.craylabs.org/docs/versions/0.4.0/overview.html",
"https://www.craylabs.org/docs/versions/0.3.2/overview.html"
Expand Down
11 changes: 9 additions & 2 deletions doc/api/smartsim_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ Model
Model.colocate_db
Model.colocate_db_tcp
Model.colocate_db_uds
Model.colocated
Model.add_ml_model
Model.add_script
Model.add_function
Model.params_to_args
Model.register_incoming_entity
Model.enable_key_prefixing
Expand All @@ -451,12 +455,15 @@ Ensemble
.. autosummary::

Ensemble.__init__
Ensemble.models
Ensemble.add_model
Ensemble.add_ml_model
Ensemble.add_script
Ensemble.add_function
Ensemble.attach_generator_files
Ensemble.register_incoming_entity
Ensemble.enable_key_prefixing
Ensemble.models
Ensemble.query_key_prefixing
Ensemble.register_incoming_entity

.. autoclass:: Ensemble
:members:
Expand Down
100 changes: 96 additions & 4 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,98 @@ Jump to :ref:`SmartRedis Changelog <changelog>`
SmartSim
========

0.5.0
------------------

Released on 6 July 2023

Description

A full list of changes and detailed notes can be found below:

- Update SmartRedis dependency to v0.4.1
- Fix tests for db models and scripts
- Fix add_ml_model() and add_script() documentation, tests, and code
- Remove `requirements.txt` and other places where dependencies were defined
- Replace `limit_app_cpus` with `limit_db_cpus` for co-located orchestrators
- Remove wait time associated with Experiment launch summary
- Update and rename Redis conf file
- Migrate from redis-py-cluster to redis-py
- Update full test suite to not require a TF wheel at test time
- Update doc strings
- Remove deprecated code
- Relax the coloredlogs version
- Update Fortran tutorials for SmartRedis
- Add support for multiple network interface binding in Orchestrator and Colocated DBs
- Add typehints and static analysis

Detailed notes

- Updates SmartRedis to the most current release (PR316_)
- Fixes and enhancements to documentation (PR317_, PR314_, PR287_)
- Various fixes and enhancements to the test suite (PR315_, PR312_, PR310_, PR302_, PR283_)
- Fix a defect in the tests related to database models and scripts that was
causing key collisions when testing on workload managers (PR313_)
- Remove `requirements.txt` and other places where dependencies were defined. (PR307_)
- Fix defect where dictionaries used to create run settings can be changed
unexpectedly due to copy-by-ref (PR305_)
- The underlying code for Model.add_ml_model() and Model.add_script() was fixed
to correctly handle multi-GPU configurations. Tests were updated to run on
non-local launchers. Documentation was updated and fixed. Also, the default
testing interface has been changed to lo instead of ipogif. (PR304_)
- Typehints have been added. A makefile target `make check-mypy` executes static
analysis with mypy. (PR295_, PR301_, PR303_)
- Replace `limit_app_cpus` with `limit_db_cpus` for co-located orchestrators.
This resolves some incorrect behavior/assumptions about how the application
would be pinned. Instead, users should directly specify the binding options in
their application using the options appropriate for their launcher (PR306_)
- Simplify code in `random_permutations` parameter generation strategy (PR300_)
- Remove wait time associated with Experiment launch summary (PR298_)
- Update Redis conf file to conform with Redis v7.0.5 conf file (PR293_)
- Migrate from redis-py-cluster to redis-py for cluster status checks (PR292_)
- Update full test suite to no longer require a tensorflow wheel to be available at test time. (PR291_)
- Correct spelling of colocated in doc strings (PR290_)
- Deprecated launcher-specific orchestrators, constants, and ML
utilities were removed. (PR289_)
- Relax the coloredlogs version to be greater than 10.0 (PR288_)
- Update the Github Actions runner image from `macos-10.15`` to `macos-12``. The
former began deprecation in May 2022 and was finally removed in May 2023. (PR285_)
- The Fortran tutorials had not been fully updated to show how to handle
return/error codes. These have now all been updated. (PR284_)
- Orchestrator and Colocated DB now accept a list of interfaces to bind to. The
argument name is still `interface` for backward compatibility reasons. (PR281_)
- Typehints have been added to public APIs. A makefile target to execute static
analysis with mypy is available `make check-mypy`. (PR295_)

.. _PR317: https://github.com/CrayLabs/SmartSim/pull/317
.. _PR316: https://github.com/CrayLabs/SmartSim/pull/316
.. _PR315: https://github.com/CrayLabs/SmartSim/pull/314
.. _PR314: https://github.com/CrayLabs/SmartSim/pull/314
.. _PR313: https://github.com/CrayLabs/SmartSim/pull/313
.. _PR312: https://github.com/CrayLabs/SmartSim/pull/312
.. _PR310: https://github.com/CrayLabs/SmartSim/pull/310
.. _PR307: https://github.com/CrayLabs/SmartSim/pull/307
.. _PR306: https://github.com/CrayLabs/SmartSim/pull/306
.. _PR305: https://github.com/CrayLabs/SmartSim/pull/305
.. _PR304: https://github.com/CrayLabs/SmartSim/pull/304
.. _PR303: https://github.com/CrayLabs/SmartSim/pull/303
.. _PR302: https://github.com/CrayLabs/SmartSim/pull/302
.. _PR301: https://github.com/CrayLabs/SmartSim/pull/301
.. _PR300: https://github.com/CrayLabs/SmartSim/pull/300
.. _PR298: https://github.com/CrayLabs/SmartSim/pull/298
.. _PR295: https://github.com/CrayLabs/SmartSim/pull/295
.. _PR293: https://github.com/CrayLabs/SmartSim/pull/293
.. _PR292: https://github.com/CrayLabs/SmartSim/pull/292
.. _PR291: https://github.com/CrayLabs/SmartSim/pull/291
.. _PR290: https://github.com/CrayLabs/SmartSim/pull/290
.. _PR289: https://github.com/CrayLabs/SmartSim/pull/289
.. _PR288: https://github.com/CrayLabs/SmartSim/pull/288
.. _PR287: https://github.com/CrayLabs/SmartSim/pull/287
.. _PR285: https://github.com/CrayLabs/SmartSim/pull/285
.. _PR284: https://github.com/CrayLabs/SmartSim/pull/284
.. _PR283: https://github.com/CrayLabs/SmartSim/pull/283
.. _PR281: https://github.com/CrayLabs/SmartSim/pull/281

0.4.2
-----

Expand All @@ -24,10 +116,10 @@ support to allow users to colocate their models with an orchestrator using
Unix domain sockets and support for launching models as batch jobs.

Additionally, SmartSim has updated its tool chains to provide a better user
experience. Notably, SmarSim can now be used with Python 3.10, Redis 7.0.5, and
experience. Notably, SmarSim can now be used with Python 3.10, Redis 7.0.5, and
RedisAI 1.2.7. Furthermore, SmartSim now utilizes SmartRedis's aggregation lists to
streamline the use and extension of ML data loaders, making working with popular
machine learning frameworks in SmartSim a breeze.
machine learning frameworks in SmartSim a breeze.

A full list of changes and detailed notes can be found below:

Expand Down Expand Up @@ -64,9 +156,9 @@ Detailed Notes
- Fix bug in colocated database entrypoint stemming from uninitialized variables. This bug affects PyTorch models being loaded into the database. (PR237_)
- The release of RedisAI 1.2.7 allows us to update support for recent versions of PyTorch, Tensorflow, and ONNX (PR234_)
- Make installation of correct Torch backend more reliable according to instruction from PyTorch
- In addition to TCP, add UDS support for colocating an orchestrator with models. Methods
- In addition to TCP, add UDS support for colocating an orchestrator with models. Methods
`Model.colocate_db_tcp` and `Model.colocate_db_uds` were added to expose this functionality.
The `Model.colocate_db` method remains and uses TCP for backward compatibility (PR246_)
The `Model.colocate_db` method remains and uses TCP for backward compatibility (PR246_)

.. _PR270: https://github.com/CrayLabs/SmartSim/pull/270
.. _PR264: https://github.com/CrayLabs/SmartSim/pull/264
Expand Down
Loading

0 comments on commit a9018e0

Please # to comment.