-
Notifications
You must be signed in to change notification settings - Fork 17
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
Various changes #549
Various changes #549
Changes from 17 commits
89d4eca
67f6445
b1884c3
baf0329
4928227
5134a85
7a63505
a51c435
bc3b80a
44a0dbb
4c3a3da
b3ec07a
1d01b7b
116c1c8
b231983
83c8e57
2ab5771
024c2b4
74840b9
0e7c845
d8bf788
1ae98d9
047ed5f
71c6215
dc7f1ae
b1f2600
368df35
c7bb2b7
1c79873
4a06cca
b923298
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ Installing a Development Version | |
1. Fork both the ``scico`` and ``scico-data`` repositories, creating | ||
copies of these repositories in your own git account. | ||
|
||
2. Make sure that you have Python 3.8 or later installed in order to | ||
2. Make sure that you have Python 3.10 or later installed in order to | ||
create a conda virtual environment. | ||
|
||
3. Clone your fork from the source repo. | ||
|
@@ -26,11 +26,11 @@ Installing a Development Version | |
|
||
git clone --recurse-submodules [email protected]:<username>/scico.git | ||
|
||
4. Create a conda environment using Python 3.8 or later, e.g.: | ||
4. Create a conda environment using Python 3.10 or later, e.g.: | ||
|
||
:: | ||
|
||
conda create -n scico python=3.9 | ||
conda create -n scico python=3.11 | ||
|
||
5. Activate the created conda virtual environment: | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,20 +5,26 @@ Installing SCICO | |
|
||
SCICO requires Python version 3.8 or later. (Version 3.10 is | ||
recommended as it is the version under which SCICO has been most | ||
thoroughly tested.) It is supported on both Linux and MacOS, but is | ||
not currently supported on Windows due to the limited support for | ||
``jaxlib`` on Windows. However, Windows users can use SCICO via the | ||
`Windows Subsystem for Linux | ||
thoroughly tested, and is the minimum supported Python version for | ||
the most recent versions of JAX.) It is supported on both Linux and | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "It is supported..." -> "SCICO is supported" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
MacOS, but is not currently supported on Windows due to the limited | ||
support for ``jaxlib`` on Windows. However, Windows users can use | ||
SCICO via the `Windows Subsystem for Linux | ||
<https://docs.microsoft.com/en-us/windows/wsl/about>`_ (WSL). Guides | ||
exist for using WSL with `CPU only | ||
<https://docs.microsoft.com/en-us/windows/wsl/install-win10>`_ and | ||
with `GPU support | ||
<https://docs.microsoft.com/en-us/windows/win32/direct3d12/gpu-cuda-in-wsl>`_. | ||
|
||
While not required, installation of SCICO and its dependencies within a `Conda <https://conda.io/projects/conda/en/latest/user-guide/index.html>`_ environment | ||
is recommended. `Scripts <https://github.com/lanl/scico/tree/main/misc/conda>`_ | ||
are provided for creating a `miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ installation and an environment including all primary SCICO dependencies as well as dependencies | ||
for usage example, testing, and building the documentation. | ||
exist for using WSL with | ||
`CPU only <https://docs.microsoft.com/en-us/windows/wsl/install-win10>`_ | ||
and with | ||
`GPU support <https://docs.microsoft.com/en-us/windows/win32/direct3d12/gpu-cuda-in-wsl>`_. | ||
|
||
While not required, installation of SCICO and its dependencies within a | ||
`Conda <https://conda.io/projects/conda/en/latest/user-guide/index.html>`_ | ||
environment is recommended. | ||
`Scripts <https://github.com/lanl/scico/tree/main/misc/conda>`_ | ||
are provided for creating a | ||
`miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ | ||
installation and an environment including all primary SCICO dependencies | ||
as well as dependencies for usage example, testing, and building the | ||
documentation. | ||
|
||
|
||
From PyPI | ||
|
@@ -108,31 +114,22 @@ a version with GPU support: | |
2. Install the version of jaxlib with GPU support, as described in the `JAX installation | ||
instructions <https://jax.readthedocs.io/en/latest/installation.html>`_. | ||
In the simplest case, the appropriate command is | ||
:: | ||
|
||
pip install --upgrade "jax[cuda11]" | ||
|
||
for CUDA 11, or | ||
:: | ||
|
||
pip install --upgrade "jax[cuda12]" | ||
|
||
for CUDA 12, but it may be necessary to explicitly specify the | ||
``jaxlib`` version if the most recent release is not yet supported | ||
by SCICO (as specified in the ``requirements.txt`` file), or if | ||
using a version of CUDA older than 11.4, or CuDNN older than 8.2, | ||
in which case the command would be of the form | ||
:: | ||
|
||
pip install --upgrade "jaxlib==0.4.2+cuda11.cudnn82" -f https://storage.googleapis.com/jax-releases/jax_cuda_releases.html | ||
|
||
with appropriate substitution of ``jaxlib``, CUDA, and CuDNN version | ||
numbers. | ||
by SCICO (as specified in the ``requirements.txt`` file). | ||
|
||
|
||
The script `misc/envinfo.py <https://github.com/lanl/scico/blob/main/misc/envinfo.py>`_ | ||
The script | ||
`misc/gpu/envinfo.py <https://github.com/lanl/scico/blob/main/misc/gpu/envinfo.py>`_ | ||
in the source distribution is provided as an aid to debugging GPU support | ||
issues. | ||
issues. The script | ||
`misc/gpu/availgpu.py <https://github.com/lanl/scico/blob/main/misc/gpu/availgpu.py>`_ | ||
can be used to automatically recommend a setting of the CUDA_VISIBLE_DEVICES | ||
environment variable that excludes GPUs that are already in use. | ||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
Miscellaneous | ||
============= | ||
|
||
This directory is a temporary location for content for which there is no immediately obvious correct location. | ||
This directory is a temporary location for content for which there is no | ||
obviously more appropriate location: | ||
|
||
- ``conda``: Scripts intended to faciliate the installation of miniconda and an environment with all SCICO requirements. | ||
- ``gpu``: Scripts for debugging and managing JAX use of GPUs. | ||
- ``pytest``: Scripts for specialized use of ``pytest``. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,11 +19,11 @@ To install miniconda in ``/opt/conda`` do | |
./install_conda.sh -y /opt/conda | ||
|
||
|
||
To create a conda environment called ``py39`` with default Python version (3.9) and without GPU support | ||
To create a conda environment called ``py310`` with default Python version (3.10) and without GPU support | ||
|
||
:: | ||
|
||
./make_conda_env.sh -y -e py39 | ||
./make_conda_env.sh -y -e py310 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this env should be called There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
||
|
||
To include GPU support, follow the `jax installation instructions <https://github.com/google/jax#pip-installation-gpu-cuda>`__ after | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
GPU Utility Scripts | ||
=================== | ||
|
||
These scripts are intended for debugging and managing JAX use of GPUs: | ||
|
||
- ``availgpu.py``: Automatically recommend a setting of the ``CUDA_VISIBLE_DEVICES`` environment variable that excludes GPUs that are already in use. | ||
- ``envinfo.py``: An aid to debugging JAX GPU access. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Specialized Pytest Usage | ||
======================== | ||
|
||
These scripts support specialized ``pytest`` usage: | ||
|
||
- ``pytest_cov.sh``: This script runs ``scico`` unit tests using the ``pytest-cov`` plugin for test coverage analysis. | ||
- ``pytest_fast.sh``: This script runs ``pytest`` tests in parallel using the ``pytest-xdist`` plugin. Some tests (those that do not function correctly when run in parallel) are run separately. | ||
- ``pytest_time.sh``: This script runs each ``scico`` unit test module and lists them all in order of decreasing run time. | ||
|
||
All of these scripts must be run from the repository root directory. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2020-2022 by SCICO Developers | ||
# Copyright (C) 2020-2024 by SCICO Developers | ||
# All rights reserved. BSD 3-clause License. | ||
# This file is part of the SCICO package. Details of the copyright and | ||
# user license can be found in the 'LICENSE' file distributed with the | ||
# package. | ||
|
||
"""Support functions for determining the package version.""" | ||
|
||
import ast | ||
import os | ||
import re | ||
import sys | ||
from ast import parse | ||
from subprocess import PIPE, Popen | ||
from typing import Any, Optional, Tuple, Union | ||
|
@@ -43,14 +41,7 @@ def variable_assign_value(path: str, var: str) -> Any: | |
try: | ||
# See http://stackoverflow.com/questions/2058802 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could link directly to the answer used, which I think is https://stackoverflow.com/a/30471662 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
value_obj = parse(next(filter(lambda line: line.startswith(var), f))).body[0].value # type: ignore | ||
if sys.version_info.major == 3 and sys.version_info.minor == 7: | ||
if isinstance(value_obj, ast.Num): | ||
value = value_obj.n # type: ignore | ||
elif isinstance(value_obj, ast.Str): | ||
value = value_obj.s # type: ignore | ||
else: | ||
value = value_obj.s # type: ignore | ||
|
||
value = value_obj.value # type: ignore | ||
except StopIteration: | ||
raise RuntimeError(f"Could not find initialization of variable {var}") | ||
return value | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest
conda create -n temp "python>=3.10,<3.13"
as a more future-proof option.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe
conda create -n scico python=3.10
if that really is the version that is most thoroughly tested.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to 3.12, which is the current stable version, and also the version tested in scico CI.