diff --git a/.github/scripts/m1_script.sh b/.github/scripts/m1_script.sh index 2df580b5801..4226b2beb32 100644 --- a/.github/scripts/m1_script.sh +++ b/.github/scripts/m1_script.sh @@ -1,3 +1,3 @@ #!/bin/bash -export BUILD_VERSION=0.2.0 +export BUILD_VERSION=0.2.1 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 302c0350c6f..74bf3fe509a 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -4,7 +4,7 @@ on: types: [opened, synchronize, reopened] push: branches: - - release/0.2.0 + - release/0.2.1 concurrency: # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. @@ -32,7 +32,7 @@ jobs: run: | export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH" python3 -mpip install wheel - BUILD_VERSION=0.2.0 python3 setup.py bdist_wheel + BUILD_VERSION=0.2.1 python3 setup.py bdist_wheel # NB: wheels have the linux_x86_64 tag so we rename to manylinux1 # find . -name 'dist/*whl' -exec bash -c ' mv $0 ${0/linux/manylinux1}' {} \; # pytorch/pytorch binaries are also manylinux_2_17 compliant but they @@ -72,7 +72,7 @@ jobs: run: | export CC=clang CXX=clang++ python3 -mpip install wheel - BUILD_VERSION=0.2.0 python3 setup.py bdist_wheel + BUILD_VERSION=0.2.1 python3 setup.py bdist_wheel - name: Upload wheel for the test-wheel job uses: actions/upload-artifact@v2 with: @@ -104,7 +104,7 @@ jobs: shell: bash run: | python3 -mpip install wheel - BUILD_VERSION=0.2.0 python3 setup.py bdist_wheel + BUILD_VERSION=0.2.1 python3 setup.py bdist_wheel - name: Upload wheel for the test-wheel job uses: actions/upload-artifact@v2 with: diff --git a/README.md b/README.md index 9220fdbcd10..d7c8eed9497 100644 --- a/README.md +++ b/README.md @@ -539,7 +539,7 @@ conda activate torch_rl Depending on the use of functorch that you want to make, you may want to install the latest (nightly) PyTorch release or the latest stable version of PyTorch. See [here](https://pytorch.org/get-started/locally/) for a detailed list of commands, -including `pip3` or windows/OSX compatible installation commands. +including `pip3` or other special installation instructions. **Torchrl** @@ -547,34 +547,43 @@ You can install the **latest stable release** by using ``` pip3 install torchrl ``` -This should work on linux and MacOs (not M1). For Windows and M1/M2 machines, one -should install the library locally (see below). +This should work on linux, Windows 10 and OsX (Intel or Silicon chips). +On certain Windows machines (Windows 11), one should install the library locally (see below). The **nightly build** can be installed via ``` pip install torchrl-nightly ``` +which we currently only ship for Linux and OsX (Intel) machines. +Importantly, the nightly builds require the nightly builds of PyTorch too. To install extra dependencies, call ``` -pip3 install "torchrl[atari,dm_control,gym_continuous,rendering,tests,utils]" +pip3 install "torchrl[atari,dm_control,gym_continuous,rendering,tests,utils,marl,checkpointing]" ``` or a subset of these. -Alternatively, as the library is at an early stage, it may be wise to install -it in develop mode as this will make it possible to pull the latest changes and -benefit from them immediately. -Start by cloning the repo: +One may also desire to install the library locally. Three main reasons can motivate this: +- the nightly/stable release isn't available for one's platform (eg, Windows 11, nightlies for Apple Silicon etc.); +- contributing to the code; +- install torchrl with a previous version of PyTorch (note that this should also be doable via a regular install followed + by a downgrade to a previous pytorch version -- but the C++ binaries will not be available.) + +To install the library locally, start by cloning the repo: ``` git clone https://github.com/pytorch/rl ``` -Go to the directory where you have cloned the torchrl repo and install it +Go to the directory where you have cloned the torchrl repo and install it (after +installing `ninja`) ``` cd /path/to/torchrl/ -pip install -e . +pip install ninja -U +python setup.py develop ``` +(unfortunately, `pip install -e .` will not work). + On M1 machines, this should work out-of-the-box with the nightly build of PyTorch. If the generation of this artifact in MacOs M1 doesn't work correctly or in the execution the message `(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))` appears, then try @@ -619,36 +628,44 @@ pip3 install wandb **Troubleshooting** -If a `ModuleNotFoundError: No module named ‘torchrl._torchrl` errors occurs, +If a `ModuleNotFoundError: No module named ‘torchrl._torchrl` errors occurs (or +a warning indicating that the C++ binaries could not be loaded), it means that the C++ extensions were not installed or not found. -One common reason might be that you are trying to import torchrl from within the -git repo location. Indeed the following code snippet should return an error if -torchrl has not been installed in `develop` mode: -``` -cd ~/path/to/rl/repo -python -c 'from torchrl.envs.libs.gym import GymEnv' -``` -If this is the case, consider executing torchrl from another location. - -On **MacOs**, we recommend installing XCode first. -With Apple Silicon M1 chips, make sure you are using the arm64-built python -(e.g. [here](https://betterprogramming.pub/how-to-install-pytorch-on-apple-m1-series-512b3ad9bc6)). Running the following lines of code - -``` -wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py -python collect_env.py -``` -should display -``` -OS: macOS *** (arm64) -``` -and not -``` -OS: macOS **** (x86_64) -``` -Versioning issues can cause error message of the type ```undefined symbol``` and such. For these, refer to the [versioning issues document](knowledge_base/VERSIONING_ISSUES.md) for a complete explanation and proposed workarounds. +- One common reason might be that you are trying to import torchrl from within the + git repo location. The following code snippet should return an error if + torchrl has not been installed in `develop` mode: + ``` + cd ~/path/to/rl/repo + python -c 'from torchrl.envs.libs.gym import GymEnv' + ``` + If this is the case, consider executing torchrl from another location. +- If you're not importing torchrl from within its repo location, it could be + caused by a problem during the local installation. Check the log after the + `python setup.py develop`. One common cause is a g++/C++ version discrepancy + and/or a problem with the `ninja` library. +- If the problem persists, feel free to open an issue on the topic in the repo, + we'll make our best to help! +- On **MacOs**, we recommend installing XCode first. + With Apple Silicon M1 chips, make sure you are using the arm64-built python + (e.g. [here](https://betterprogramming.pub/how-to-install-pytorch-on-apple-m1-series-512b3ad9bc6)). + Running the following lines of code + ``` + wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py + python collect_env.py + ``` + should display + ``` + OS: macOS *** (arm64) + ``` + and not + ``` + OS: macOS **** (x86_64) + ``` +Versioning issues can cause error message of the type ```undefined symbol``` +and such. For these, refer to the [versioning issues document](knowledge_base/VERSIONING_ISSUES.md) +for a complete explanation and proposed workarounds. ## Asking a question diff --git a/setup.py b/setup.py index 2d768354bb1..07880010189 100644 --- a/setup.py +++ b/setup.py @@ -71,8 +71,8 @@ def _get_pytorch_version(is_nightly): # if "PYTORCH_VERSION" in os.environ: # return f"torch=={os.environ['PYTORCH_VERSION']}" if is_nightly: - return "torch>=2.1.0.dev" - return "torch" + return "torch>=2.2.0.dev" + return "torch>=2.1.0" def _get_packages(): diff --git a/version.txt b/version.txt index 0ea3a944b39..0c62199f16a 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.2.0 +0.2.1