Skip to content

Commit 1bb192e

Browse files
authored
[Release] 0.2.1 (#1642)
1 parent e353b20 commit 1bb192e

File tree

5 files changed

+62
-45
lines changed

5 files changed

+62
-45
lines changed

.github/scripts/m1_script.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
export BUILD_VERSION=0.2.0
3+
export BUILD_VERSION=0.2.1

.github/workflows/wheels.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
types: [opened, synchronize, reopened]
55
push:
66
branches:
7-
- release/0.2.0
7+
- release/0.2.1
88

99
concurrency:
1010
# 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:
3232
run: |
3333
export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH"
3434
python3 -mpip install wheel
35-
BUILD_VERSION=0.2.0 python3 setup.py bdist_wheel
35+
BUILD_VERSION=0.2.1 python3 setup.py bdist_wheel
3636
# NB: wheels have the linux_x86_64 tag so we rename to manylinux1
3737
# find . -name 'dist/*whl' -exec bash -c ' mv $0 ${0/linux/manylinux1}' {} \;
3838
# pytorch/pytorch binaries are also manylinux_2_17 compliant but they
@@ -72,7 +72,7 @@ jobs:
7272
run: |
7373
export CC=clang CXX=clang++
7474
python3 -mpip install wheel
75-
BUILD_VERSION=0.2.0 python3 setup.py bdist_wheel
75+
BUILD_VERSION=0.2.1 python3 setup.py bdist_wheel
7676
- name: Upload wheel for the test-wheel job
7777
uses: actions/upload-artifact@v2
7878
with:
@@ -104,7 +104,7 @@ jobs:
104104
shell: bash
105105
run: |
106106
python3 -mpip install wheel
107-
BUILD_VERSION=0.2.0 python3 setup.py bdist_wheel
107+
BUILD_VERSION=0.2.1 python3 setup.py bdist_wheel
108108
- name: Upload wheel for the test-wheel job
109109
uses: actions/upload-artifact@v2
110110
with:

README.md

+54-37
Original file line numberDiff line numberDiff line change
@@ -539,42 +539,51 @@ conda activate torch_rl
539539
Depending on the use of functorch that you want to make, you may want to
540540
install the latest (nightly) PyTorch release or the latest stable version of PyTorch.
541541
See [here](https://pytorch.org/get-started/locally/) for a detailed list of commands,
542-
including `pip3` or windows/OSX compatible installation commands.
542+
including `pip3` or other special installation instructions.
543543

544544
**Torchrl**
545545

546546
You can install the **latest stable release** by using
547547
```
548548
pip3 install torchrl
549549
```
550-
This should work on linux and MacOs (not M1). For Windows and M1/M2 machines, one
551-
should install the library locally (see below).
550+
This should work on linux, Windows 10 and OsX (Intel or Silicon chips).
551+
On certain Windows machines (Windows 11), one should install the library locally (see below).
552552

553553
The **nightly build** can be installed via
554554
```
555555
pip install torchrl-nightly
556556
```
557+
which we currently only ship for Linux and OsX (Intel) machines.
558+
Importantly, the nightly builds require the nightly builds of PyTorch too.
557559

558560
To install extra dependencies, call
559561
```
560-
pip3 install "torchrl[atari,dm_control,gym_continuous,rendering,tests,utils]"
562+
pip3 install "torchrl[atari,dm_control,gym_continuous,rendering,tests,utils,marl,checkpointing]"
561563
```
562564
or a subset of these.
563565

564-
Alternatively, as the library is at an early stage, it may be wise to install
565-
it in develop mode as this will make it possible to pull the latest changes and
566-
benefit from them immediately.
567-
Start by cloning the repo:
566+
One may also desire to install the library locally. Three main reasons can motivate this:
567+
- the nightly/stable release isn't available for one's platform (eg, Windows 11, nightlies for Apple Silicon etc.);
568+
- contributing to the code;
569+
- install torchrl with a previous version of PyTorch (note that this should also be doable via a regular install followed
570+
by a downgrade to a previous pytorch version -- but the C++ binaries will not be available.)
571+
572+
To install the library locally, start by cloning the repo:
568573
```
569574
git clone https://github.com/pytorch/rl
570575
```
571576

572-
Go to the directory where you have cloned the torchrl repo and install it
577+
Go to the directory where you have cloned the torchrl repo and install it (after
578+
installing `ninja`)
573579
```
574580
cd /path/to/torchrl/
575-
pip install -e .
581+
pip install ninja -U
582+
python setup.py develop
576583
```
577584

585+
(unfortunately, `pip install -e .` will not work).
586+
578587
On M1 machines, this should work out-of-the-box with the nightly build of PyTorch.
579588
If the generation of this artifact in MacOs M1 doesn't work correctly or in the execution the message
580589
`(mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))` appears, then try
@@ -619,36 +628,44 @@ pip3 install wandb
619628

620629
**Troubleshooting**
621630

622-
If a `ModuleNotFoundError: No module named ‘torchrl._torchrl` errors occurs,
631+
If a `ModuleNotFoundError: No module named ‘torchrl._torchrl` errors occurs (or
632+
a warning indicating that the C++ binaries could not be loaded),
623633
it means that the C++ extensions were not installed or not found.
624-
One common reason might be that you are trying to import torchrl from within the
625-
git repo location. Indeed the following code snippet should return an error if
626-
torchrl has not been installed in `develop` mode:
627-
```
628-
cd ~/path/to/rl/repo
629-
python -c 'from torchrl.envs.libs.gym import GymEnv'
630-
```
631-
If this is the case, consider executing torchrl from another location.
632-
633-
On **MacOs**, we recommend installing XCode first.
634-
With Apple Silicon M1 chips, make sure you are using the arm64-built python
635-
(e.g. [here](https://betterprogramming.pub/how-to-install-pytorch-on-apple-m1-series-512b3ad9bc6)). Running the following lines of code
636-
637-
```
638-
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
639-
python collect_env.py
640-
```
641-
should display
642-
```
643-
OS: macOS *** (arm64)
644-
```
645-
and not
646-
```
647-
OS: macOS **** (x86_64)
648-
```
649634

650-
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.
635+
- One common reason might be that you are trying to import torchrl from within the
636+
git repo location. The following code snippet should return an error if
637+
torchrl has not been installed in `develop` mode:
638+
```
639+
cd ~/path/to/rl/repo
640+
python -c 'from torchrl.envs.libs.gym import GymEnv'
641+
```
642+
If this is the case, consider executing torchrl from another location.
643+
- If you're not importing torchrl from within its repo location, it could be
644+
caused by a problem during the local installation. Check the log after the
645+
`python setup.py develop`. One common cause is a g++/C++ version discrepancy
646+
and/or a problem with the `ninja` library.
647+
- If the problem persists, feel free to open an issue on the topic in the repo,
648+
we'll make our best to help!
649+
- On **MacOs**, we recommend installing XCode first.
650+
With Apple Silicon M1 chips, make sure you are using the arm64-built python
651+
(e.g. [here](https://betterprogramming.pub/how-to-install-pytorch-on-apple-m1-series-512b3ad9bc6)).
652+
Running the following lines of code
653+
```
654+
wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
655+
python collect_env.py
656+
```
657+
should display
658+
```
659+
OS: macOS *** (arm64)
660+
```
661+
and not
662+
```
663+
OS: macOS **** (x86_64)
664+
```
651665

666+
Versioning issues can cause error message of the type ```undefined symbol```
667+
and such. For these, refer to the [versioning issues document](knowledge_base/VERSIONING_ISSUES.md)
668+
for a complete explanation and proposed workarounds.
652669

653670
## Asking a question
654671

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ def _get_pytorch_version(is_nightly):
7171
# if "PYTORCH_VERSION" in os.environ:
7272
# return f"torch=={os.environ['PYTORCH_VERSION']}"
7373
if is_nightly:
74-
return "torch>=2.1.0.dev"
75-
return "torch"
74+
return "torch>=2.2.0.dev"
75+
return "torch>=2.1.0"
7676

7777

7878
def _get_packages():

version.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.0
1+
0.2.1

0 commit comments

Comments
 (0)