From bf264e0e24971fc05ec42b571de7b8df84043a51 Mon Sep 17 00:00:00 2001 From: Vincent Moens Date: Thu, 5 Oct 2023 12:43:23 -0400 Subject: [PATCH] v0.2.0 branch (#1609) --- .github/unittest/linux/scripts/run_all.sh | 6 +- .../linux_distributed/scripts/install.sh | 6 +- .../linux_examples/scripts/run_all.sh | 4 +- .../linux_libs/scripts_brax/install.sh | 6 +- .../linux_libs/scripts_d4rl/install.sh | 6 +- .../linux_libs/scripts_envpool/install.sh | 6 +- .../linux_libs/scripts_gym/install.sh | 2 +- .../linux_libs/scripts_habitat/install.sh | 4 +- .../linux_libs/scripts_jumanji/install.sh | 6 +- .../linux_libs/scripts_pettingzoo/install.sh | 6 +- .../linux_libs/scripts_rlhf/install.sh | 6 +- .../scripts_robohive/install_and_run_test.sh | 6 +- .../linux_libs/scripts_sklearn/install.sh | 6 +- .../linux_libs/scripts_smacv2/install.sh | 6 +- .../linux_libs/scripts_vmas/install.sh | 6 +- .../linux_olddeps/scripts_gym_0_13/install.sh | 2 +- .../unittest/linux_optdeps/scripts/install.sh | 4 +- .../windows_optdepts/scripts/install.sh | 2 +- .github/workflows/benchmarks.yml | 4 +- .github/workflows/benchmarks_pr.yml | 4 +- .github/workflows/docs.yml | 4 +- .github/workflows/nightly_build.yml | 18 +++--- .github/workflows/wheels.yml | 22 +++---- CONTRIBUTING.md | 2 +- README.md | 15 +++-- docs/source/conf.py | 2 +- setup.py | 57 ++++++++++--------- version.txt | 2 +- 28 files changed, 114 insertions(+), 106 deletions(-) diff --git a/.github/unittest/linux/scripts/run_all.sh b/.github/unittest/linux/scripts/run_all.sh index 35bb2b21764..f682abe47f5 100755 --- a/.github/unittest/linux/scripts/run_all.sh +++ b/.github/unittest/linux/scripts/run_all.sh @@ -124,9 +124,9 @@ git submodule sync && git submodule update --init --recursive printf "Installing PyTorch with %s\n" "${CU_VERSION}" if [[ "$TORCH_VERSION" == "nightly" ]]; then if [ "${CU_VERSION:-}" == cpu ] ; then - pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu + pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu else - pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CU_VERSION + pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION fi elif [[ "$TORCH_VERSION" == "stable" ]]; then if [ "${CU_VERSION:-}" == cpu ] ; then @@ -146,7 +146,7 @@ python -c "import functorch" pip3 install git+https://github.com/pytorch/torchsnapshot # install tensordict -pip3 install git+https://github.com/pytorch-labs/tensordict.git +pip3 install git+https://github.com/pytorch/tensordict.git printf "* Installing torchrl\n" python setup.py develop diff --git a/.github/unittest/linux_distributed/scripts/install.sh b/.github/unittest/linux_distributed/scripts/install.sh index d0f3f7a132e..95eda22aecb 100755 --- a/.github/unittest/linux_distributed/scripts/install.sh +++ b/.github/unittest/linux_distributed/scripts/install.sh @@ -28,9 +28,9 @@ git submodule sync && git submodule update --init --recursive printf "Installing PyTorch with %s\n" "${CU_VERSION}" if [ "${CU_VERSION:-}" == cpu ] ; then - pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu + pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu else - pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CU_VERSION + pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION fi # smoke test @@ -40,7 +40,7 @@ python -c "import functorch" pip install git+https://github.com/pytorch/torchsnapshot # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git printf "* Installing torchrl\n" python setup.py develop diff --git a/.github/unittest/linux_examples/scripts/run_all.sh b/.github/unittest/linux_examples/scripts/run_all.sh index 02fd5cadc4a..6bf73ff1b95 100755 --- a/.github/unittest/linux_examples/scripts/run_all.sh +++ b/.github/unittest/linux_examples/scripts/run_all.sh @@ -146,7 +146,7 @@ version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" git submodule sync && git submodule update --init --recursive printf "Installing PyTorch with %s\n" "${CU_VERSION}" -pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CU_VERSION +pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION # smoke test python -c "import functorch" @@ -155,7 +155,7 @@ python -c "import functorch" pip install git+https://github.com/pytorch/torchsnapshot # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git printf "* Installing torchrl\n" python setup.py develop diff --git a/.github/unittest/linux_libs/scripts_brax/install.sh b/.github/unittest/linux_libs/scripts_brax/install.sh index 1b3f34cb0bd..b3a42967935 100755 --- a/.github/unittest/linux_libs/scripts_brax/install.sh +++ b/.github/unittest/linux_libs/scripts_brax/install.sh @@ -30,13 +30,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall --progress-bar off + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall --progress-bar off else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall --progress-bar off + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall --progress-bar off fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git --progress-bar off +pip install git+https://github.com/pytorch/tensordict.git --progress-bar off # smoke test python -c "import functorch;import tensordict" diff --git a/.github/unittest/linux_libs/scripts_d4rl/install.sh b/.github/unittest/linux_libs/scripts_d4rl/install.sh index 437900b3323..feb922d14b8 100755 --- a/.github/unittest/linux_libs/scripts_d4rl/install.sh +++ b/.github/unittest/linux_libs/scripts_d4rl/install.sh @@ -33,13 +33,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import functorch;import tensordict" diff --git a/.github/unittest/linux_libs/scripts_envpool/install.sh b/.github/unittest/linux_libs/scripts_envpool/install.sh index 5899209cc46..c62a2de25fb 100755 --- a/.github/unittest/linux_libs/scripts_envpool/install.sh +++ b/.github/unittest/linux_libs/scripts_envpool/install.sh @@ -28,16 +28,16 @@ git submodule sync && git submodule update --init --recursive printf "Installing PyTorch with %s\n" "${CU_VERSION}" if [ "${CU_VERSION:-}" == cpu ] ; then - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu118 + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu118 fi # smoke test python -c "import functorch" # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict +pip install git+https://github.com/pytorch/tensordict printf "* Installing torchrl\n" python setup.py develop diff --git a/.github/unittest/linux_libs/scripts_gym/install.sh b/.github/unittest/linux_libs/scripts_gym/install.sh index 959269c1b16..718e4f37e3a 100755 --- a/.github/unittest/linux_libs/scripts_gym/install.sh +++ b/.github/unittest/linux_libs/scripts_gym/install.sh @@ -46,7 +46,7 @@ fi pip install -U --force-reinstall charset-normalizer # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import tensordict" diff --git a/.github/unittest/linux_libs/scripts_habitat/install.sh b/.github/unittest/linux_libs/scripts_habitat/install.sh index 82170d7fd8b..316cf9e3225 100755 --- a/.github/unittest/linux_libs/scripts_habitat/install.sh +++ b/.github/unittest/linux_libs/scripts_habitat/install.sh @@ -20,10 +20,10 @@ version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" git submodule sync && git submodule update --init --recursive printf "Installing PyTorch with %s\n" "${CU_VERSION}" -pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall +pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall # install tensordict -pip3 install git+https://github.com/pytorch-labs/tensordict.git +pip3 install git+https://github.com/pytorch/tensordict.git # smoke test python3 -c "import functorch;import tensordict" diff --git a/.github/unittest/linux_libs/scripts_jumanji/install.sh b/.github/unittest/linux_libs/scripts_jumanji/install.sh index 91671e8d985..ee6c747315c 100755 --- a/.github/unittest/linux_libs/scripts_jumanji/install.sh +++ b/.github/unittest/linux_libs/scripts_jumanji/install.sh @@ -30,13 +30,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import functorch;import tensordict" diff --git a/.github/unittest/linux_libs/scripts_pettingzoo/install.sh b/.github/unittest/linux_libs/scripts_pettingzoo/install.sh index cb36c7cc48a..0c7bc8f402b 100755 --- a/.github/unittest/linux_libs/scripts_pettingzoo/install.sh +++ b/.github/unittest/linux_libs/scripts_pettingzoo/install.sh @@ -30,13 +30,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import tensordict" diff --git a/.github/unittest/linux_libs/scripts_rlhf/install.sh b/.github/unittest/linux_libs/scripts_rlhf/install.sh index 76c10f36e6c..25a73fd6dff 100755 --- a/.github/unittest/linux_libs/scripts_rlhf/install.sh +++ b/.github/unittest/linux_libs/scripts_rlhf/install.sh @@ -33,13 +33,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import tensordict" diff --git a/.github/unittest/linux_libs/scripts_robohive/install_and_run_test.sh b/.github/unittest/linux_libs/scripts_robohive/install_and_run_test.sh index 08548f9a4bf..68fe922ec5d 100755 --- a/.github/unittest/linux_libs/scripts_robohive/install_and_run_test.sh +++ b/.github/unittest/linux_libs/scripts_robohive/install_and_run_test.sh @@ -41,13 +41,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import tensordict" diff --git a/.github/unittest/linux_libs/scripts_sklearn/install.sh b/.github/unittest/linux_libs/scripts_sklearn/install.sh index 437900b3323..feb922d14b8 100755 --- a/.github/unittest/linux_libs/scripts_sklearn/install.sh +++ b/.github/unittest/linux_libs/scripts_sklearn/install.sh @@ -33,13 +33,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import functorch;import tensordict" diff --git a/.github/unittest/linux_libs/scripts_smacv2/install.sh b/.github/unittest/linux_libs/scripts_smacv2/install.sh index cb36c7cc48a..0c7bc8f402b 100755 --- a/.github/unittest/linux_libs/scripts_smacv2/install.sh +++ b/.github/unittest/linux_libs/scripts_smacv2/install.sh @@ -30,13 +30,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import tensordict" diff --git a/.github/unittest/linux_libs/scripts_vmas/install.sh b/.github/unittest/linux_libs/scripts_vmas/install.sh index cb36c7cc48a..0c7bc8f402b 100755 --- a/.github/unittest/linux_libs/scripts_vmas/install.sh +++ b/.github/unittest/linux_libs/scripts_vmas/install.sh @@ -30,13 +30,13 @@ if [ "${CU_VERSION:-}" == cpu ] ; then # conda install -y pytorch torchvision cpuonly -c pytorch-nightly # use pip to install pytorch as conda can frequently pick older release # conda install -y pytorch cpuonly -c pytorch-nightly - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu --force-reinstall else - pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall + pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu116 --force-reinstall fi # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import tensordict" diff --git a/.github/unittest/linux_olddeps/scripts_gym_0_13/install.sh b/.github/unittest/linux_olddeps/scripts_gym_0_13/install.sh index fc29520cb85..f55daf8e8ce 100755 --- a/.github/unittest/linux_olddeps/scripts_gym_0_13/install.sh +++ b/.github/unittest/linux_olddeps/scripts_gym_0_13/install.sh @@ -46,7 +46,7 @@ fi pip install -U --force-reinstall charset-normalizer # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import tensordict" diff --git a/.github/unittest/linux_optdeps/scripts/install.sh b/.github/unittest/linux_optdeps/scripts/install.sh index 6a4cb8b0732..e7d48b4cb9b 100755 --- a/.github/unittest/linux_optdeps/scripts/install.sh +++ b/.github/unittest/linux_optdeps/scripts/install.sh @@ -20,10 +20,10 @@ version="$(python -c "print('.'.join(\"${CUDA_VERSION}\".split('.')[:2]))")" git submodule sync && git submodule update --init --recursive printf "Installing PyTorch with %s\n" "${CU_VERSION}" -pip3 install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/$CU_VERSION +pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/$CU_VERSION # install tensordict -pip install git+https://github.com/pytorch-labs/tensordict.git +pip install git+https://github.com/pytorch/tensordict.git # smoke test python -c "import functorch" diff --git a/.github/unittest/windows_optdepts/scripts/install.sh b/.github/unittest/windows_optdepts/scripts/install.sh index 55c536ac729..565535a2f1e 100644 --- a/.github/unittest/windows_optdepts/scripts/install.sh +++ b/.github/unittest/windows_optdepts/scripts/install.sh @@ -57,7 +57,7 @@ fi #python -m pip install pip --upgrade # install tensordict -pip3 install git+https://github.com/pytorch-labs/tensordict +pip3 install git+https://github.com/pytorch/tensordict # smoke test python -c """ diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 77d695fc76f..1a2384a1df1 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -31,7 +31,7 @@ jobs: - name: Setup Environment run: | python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu - python -m pip install git+https://github.com/pytorch-labs/tensordict + python -m pip install git+https://github.com/pytorch/tensordict python setup.py develop python -m pip install pytest pytest-benchmark python -m pip install dm_control @@ -94,7 +94,7 @@ jobs: - name: Setup Environment run: | python3 -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu118 - python3 -m pip install git+https://github.com/pytorch-labs/tensordict + python3 -m pip install git+https://github.com/pytorch/tensordict python3 setup.py develop python3 -m pip install pytest pytest-benchmark python3 -m pip install dm_control diff --git a/.github/workflows/benchmarks_pr.yml b/.github/workflows/benchmarks_pr.yml index 091581cb557..e44c683a6d6 100644 --- a/.github/workflows/benchmarks_pr.yml +++ b/.github/workflows/benchmarks_pr.yml @@ -30,7 +30,7 @@ jobs: - name: Setup Environment run: | python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu - python -m pip install git+https://github.com/pytorch-labs/tensordict + python -m pip install git+https://github.com/pytorch/tensordict python setup.py develop python -m pip install pytest pytest-benchmark python -m pip install dm_control @@ -105,7 +105,7 @@ jobs: - name: Setup Environment run: | python3 -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu118 - python3 -m pip install git+https://github.com/pytorch-labs/tensordict + python3 -m pip install git+https://github.com/pytorch/tensordict python3 setup.py develop python3 -m pip install pytest pytest-benchmark python3 -m pip install dm_control diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 16acc4aa5ac..bc0ae7be205 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -60,7 +60,7 @@ jobs: #pip3 install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu118 --quiet --root-user-action=ignore - name: Install tensordict run: | - pip3 install git+https://github.com/pytorch-labs/tensordict.git --quiet --root-user-action=ignore + pip3 install git+https://github.com/pytorch/tensordict.git --quiet --root-user-action=ignore - name: Install TorchRL run: | python3 setup.py develop @@ -88,7 +88,7 @@ jobs: apt-get update && apt-get install -y rsync - name: Pull TensorDict docs run: | - git clone --branch gh-pages https://github.com/pytorch-labs/tensordict.git docs/_local_build/tensordict + git clone --branch gh-pages https://github.com/pytorch/tensordict.git docs/_local_build/tensordict rm -rf docs/_local_build/tensordict/.git - name: Get output time run: echo "The time was ${{ steps.build.outputs.time }}" diff --git a/.github/workflows/nightly_build.yml b/.github/workflows/nightly_build.yml index 80cb4dccf7d..923a3f3dfc1 100644 --- a/.github/workflows/nightly_build.yml +++ b/.github/workflows/nightly_build.yml @@ -45,7 +45,7 @@ jobs: - name: Install PyTorch nightly run: | export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH" - python3 -mpip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/${{ matrix.cuda_support[1] }} + python3 -mpip install --pre torch --index-url https://download.pytorch.org/whl/nightly/${{ matrix.cuda_support[1] }} - name: Build TorchRL Nightly run: | rm -r dist || true @@ -84,7 +84,7 @@ jobs: uses: actions/checkout@v2 - name: Install PyTorch nightly run: | - python3 -mpip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu + python3 -mpip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu - name: Build TorchRL Nightly run: | rm -r dist || true @@ -117,7 +117,7 @@ jobs: uses: actions/checkout@v2 - name: Install PyTorch Nightly run: | - python3 -mpip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu + python3 -mpip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu - name: Upgrade pip run: | python3 -mpip install --upgrade pip @@ -126,7 +126,7 @@ jobs: python3 -mpip install numpy pytest --no-cache-dir - name: Install tensordict run: | - python3 -mpip install git+https://github.com/pytorch-labs/tensordict.git + python3 -mpip install git+https://github.com/pytorch/tensordict.git - name: Download built wheels uses: actions/download-artifact@v2 with: @@ -232,14 +232,14 @@ jobs: - name: Install PyTorch Nightly run: | export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH" - python3 -mpip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/${{ matrix.cuda_support[1] }} + python3 -mpip install --pre torch --index-url https://download.pytorch.org/whl/nightly/${{ matrix.cuda_support[1] }} - name: Upgrade pip run: | export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH" python3 -mpip install --upgrade pip - name: Install tensordict run: | - python3 -mpip install git+https://github.com/pytorch-labs/tensordict.git + python3 -mpip install git+https://github.com/pytorch/tensordict.git - name: Install test dependencies run: | export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH" @@ -290,7 +290,7 @@ jobs: - name: Install PyTorch nightly shell: bash run: | - python3 -mpip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu + python3 -mpip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu - name: Build TorchRL nightly shell: bash run: | @@ -323,7 +323,7 @@ jobs: - name: Install PyTorch Nightly shell: bash run: | - python3 -mpip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu + python3 -mpip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu - name: Upgrade pip shell: bash run: | @@ -334,7 +334,7 @@ jobs: python3 -mpip install numpy pytest --no-cache-dir - name: Install tensordict run: | - python3 -mpip install git+https://github.com/pytorch-labs/tensordict.git + python3 -mpip install git+https://github.com/pytorch/tensordict.git - name: Download built wheels uses: actions/download-artifact@v2 with: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index ca3075e7baa..302c0350c6f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -4,7 +4,7 @@ on: types: [opened, synchronize, reopened] push: branches: - - release/0.1.1 + - release/0.2.0 concurrency: # Documentation suggests ${{ github.head_ref }}, but that's only available on pull_request/pull_request_target triggers, so using ${{ github.ref }}. @@ -19,7 +19,7 @@ jobs: strategy: matrix: python_version: [["3.8", "cp38-cp38"], ["3.9", "cp39-cp39"], ["3.10", "cp310-cp310"], ["3.11", "cp311-cp311"]] - cuda_support: [["", "--extra-index-url https://download.pytorch.org/whl/cpu", "\"['cpu', '11.3', '11.6']\"", "cpu"]] + cuda_support: [["", "--index-url https://download.pytorch.org/whl/cpu", "\"['cpu', '11.3', '11.6']\"", "cpu"]] container: pytorch/manylinux-${{ matrix.cuda_support[3] }} steps: - name: Checkout torchrl @@ -32,7 +32,7 @@ jobs: run: | export PATH="/opt/python/${{ matrix.python_version[1] }}/bin:$PATH" python3 -mpip install wheel - BUILD_VERSION=0.1.1 python3 setup.py bdist_wheel + BUILD_VERSION=0.2.0 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 @@ -67,12 +67,12 @@ jobs: uses: actions/checkout@v2 - name: Install PyTorch RC run: | - python3 -mpip install torch --extra-index-url https://download.pytorch.org/whl/cpu + python3 -mpip install torch --index-url https://download.pytorch.org/whl/cpu - name: Build wheel run: | export CC=clang CXX=clang++ python3 -mpip install wheel - BUILD_VERSION=0.1.1 python3 setup.py bdist_wheel + BUILD_VERSION=0.2.0 python3 setup.py bdist_wheel - name: Upload wheel for the test-wheel job uses: actions/upload-artifact@v2 with: @@ -99,12 +99,12 @@ jobs: - name: Install PyTorch RC shell: bash run: | - python3 -mpip install torch --extra-index-url https://download.pytorch.org/whl/cpu + python3 -mpip install torch --index-url https://download.pytorch.org/whl/cpu - name: Build wheel shell: bash run: | python3 -mpip install wheel - BUILD_VERSION=0.1.1 python3 setup.py bdist_wheel + BUILD_VERSION=0.2.0 python3 setup.py bdist_wheel - name: Upload wheel for the test-wheel job uses: actions/upload-artifact@v2 with: @@ -134,13 +134,13 @@ jobs: uses: actions/checkout@v2 - name: Install PyTorch RC run: | - python3 -mpip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu + python3 -mpip install torch torchvision --index-url https://download.pytorch.org/whl/cpu - name: Upgrade pip run: | python3 -mpip install --upgrade pip - name: Install tensordict run: | - python3 -mpip install git+https://github.com/pytorch-labs/tensordict.git + python3 -mpip install git+https://github.com/pytorch/tensordict.git - name: Install test dependencies run: | python3 -mpip install numpy pytest pytest-cov codecov unittest-xml-reporting pillow>=4.1.1 scipy av networkx expecttest pyyaml @@ -184,7 +184,7 @@ jobs: - name: Install PyTorch RC shell: bash run: | - python3 -mpip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu + python3 -mpip install torch torchvision --index-url https://download.pytorch.org/whl/cpu - name: Upgrade pip shell: bash run: | @@ -192,7 +192,7 @@ jobs: - name: Install tensordict shell: bash run: | - python3 -mpip install git+https://github.com/pytorch-labs/tensordict.git + python3 -mpip install git+https://github.com/pytorch/tensordict.git - name: Install test dependencies shell: bash run: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 843a9712369..9f532397241 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,7 +15,7 @@ pip install tensordict-nightly ``` or the git version of the library: ``` -pip install git+https://github.com/pytorch-labs/tensordict +pip install git+https://github.com/pytorch/tensordict ``` Once cloned, make sure you install torchrl in develop mode by running diff --git a/README.md b/README.md index aacfd0930b4..9220fdbcd10 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![pytorch](https://circleci.com/gh/pytorch/rl.svg?style=shield)](https://circleci.com/gh/pytorch/rl) +[![Unit-tests](https://github.com/pytorch/rl/actions/workflows/test-linux-gpu.yml/badge.svg)](https://github.com/pytorch/rl/actions/workflows/test-linux-gpu.yml) [![Documentation](https://img.shields.io/badge/Documentation-blue.svg)](https://pytorch.org/rl/) [![Benchmarks](https://img.shields.io/badge/Benchmarks-blue.svg)](https://pytorch.github.io/rl/dev/bench/) [![codecov](https://codecov.io/gh/pytorch/rl/branch/main/graph/badge.svg?token=HcpK1ILV6r)](https://codecov.io/gh/pytorch/rl) @@ -50,7 +50,7 @@ We have some introductory videos for you to get to know the library better, chec RL algorithms are very heterogeneous, and it can be hard to recycle a codebase across settings (e.g. from online to offline, from state-based to pixel-based learning). -TorchRL solves this problem through [`TensorDict`](https://github.com/pytorch-labs/tensordict/), +TorchRL solves this problem through [`TensorDict`](https://github.com/pytorch/tensordict/), a convenient data structure(1) that can be used to streamline one's RL codebase. With this tool, one can write a *complete PPO training script in less than 100 @@ -219,7 +219,7 @@ to be easily recycled across settings. ``` -TensorDict comes with a dedicated [`tensordict.nn`](https://pytorch-labs.github.io/tensordict/reference/nn.html) +TensorDict comes with a dedicated [`tensordict.nn`](https://pytorch.github.io/tensordict/reference/nn.html) module that contains everything you might need to write your model with it. And it is `functorch` and `torch.compile` compatible! @@ -256,7 +256,7 @@ And it is `functorch` and `torch.compile` compatible! ``` - Check [TensorDict tutorials](https://pytorch-labs.github.io/tensordict/) to + Check [TensorDict tutorials](https://pytorch.github.io/tensordict/) to learn more! @@ -384,7 +384,7 @@ And it is `functorch` and `torch.compile` compatible! ``` -- various tools for distributed learning (e.g. [memory mapped tensors](https://github.com/pytorch-labs/tensordict/blob/main/tensordict/memmap.py))(2); +- various tools for distributed learning (e.g. [memory mapped tensors](https://github.com/pytorch/tensordict/blob/main/tensordict/memmap.py))(2); - various [architectures](torchrl/modules/models/) and models (e.g. [actor-critic](torchrl/modules/tensordict_module/actors.py))(1):
Code @@ -470,7 +470,7 @@ And it is `functorch` and `torch.compile` compatible! ### Advantage computation ```python from torchrl.objectives.value.functional import vec_td_lambda_return_estimate - advantage = vec_td_lambda_return_estimate(gamma, lmbda, next_state_value, reward, done) + advantage = vec_td_lambda_return_estimate(gamma, lmbda, next_state_value, reward, done, terminated) ```
@@ -493,12 +493,15 @@ A series of [examples](examples/) are provided with an illustrative purpose: - [DQN and Rainbow](examples/dqn/dqn.py) - [DDPG](examples/ddpg/ddpg.py) - [IQL](examples/iql/iql.py) +- [CQL](examples/iql/cql.py) - [TD3](examples/td3/td3.py) - [A2C](examples/a2c_old/a2c.py) - [PPO](examples/ppo/ppo.py) - [SAC](examples/sac/sac.py) - [REDQ](examples/redq/redq.py) - [Dreamer](examples/dreamer/dreamer.py) +- [Decision Transformers](examples/decision_transformer) +- [RLHF](examples/rlhf) and many more to come! diff --git a/docs/source/conf.py b/docs/source/conf.py index 497a0df4fdb..00acf6b67ed 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -73,7 +73,7 @@ intersphinx_mapping = { "torch": ("https://pytorch.org/docs/stable/", None), - "tensordict": ("https://pytorch-labs.github.io/tensordict/", None), + "tensordict": ("https://pytorch.github.io/tensordict/", None), # "torchrl": ("https://pytorch.org/rl/", None), "torchaudio": ("https://pytorch.org/audio/stable/", None), "torchtext": ("https://pytorch.org/text/stable/", None), diff --git a/setup.py b/setup.py index 20f63bb3064..2d768354bb1 100644 --- a/setup.py +++ b/setup.py @@ -169,7 +169,7 @@ def _main(argv): if is_nightly: tensordict_dep = "tensordict-nightly" else: - tensordict_dep = "tensordict>=0.1.1" + tensordict_dep = "tensordict>=0.2.0" if is_nightly: version = get_nightly_version() @@ -189,6 +189,35 @@ def _main(argv): long_description = (this_directory / "README.md").read_text() sys.argv = [sys.argv[0]] + unknown + extra_requires = { + "atari": [ + "gym", + "atari-py", + "ale-py", + "gym[accept-rom-license]", + "pygame", + ], + "dm_control": ["dm_control"], + "gym_continuous": ["gymnasium", "mujoco"], + "rendering": ["moviepy"], + "tests": ["pytest", "pyyaml", "pytest-instafail", "scipy"], + "utils": [ + "tensorboard", + "wandb", + "tqdm", + "hydra-core>=1.1", + "hydra-submitit-launcher", + "git", + ], + "checkpointing": [ + "torchsnapshot", + ], + "marl": ["vmas>=1.2.10", "pettingzoo>=1.24.1"], + } + extra_requires["all"] = set() + for key in list(extra_requires.keys()): + extra_requires["all"] = extra_requires["all"].union(extra_requires[key]) + extra_requires["all"] = sorted(extra_requires["all"]) setup( # Metadata name=name, @@ -213,31 +242,7 @@ def _main(argv): "cloudpickle", tensordict_dep, ], - extras_require={ - "atari": [ - "gym<=0.24", - "atari-py", - "ale-py", - "gym[accept-rom-license]", - "pygame", - ], - "dm_control": ["dm_control"], - "gym_continuous": ["mujoco-py", "mujoco"], - "rendering": ["moviepy"], - "tests": ["pytest", "pyyaml", "pytest-instafail", "scipy"], - "utils": [ - "tensorboard", - "wandb", - "tqdm", - "hydra-core>=1.1", - "hydra-submitit-launcher", - "git", - ], - "checkpointing": [ - "torchsnapshot", - ], - "marl": ["vmas>=1.2.10", "pettingzoo>=1.24.1"], - }, + extras_require=extra_requires, zip_safe=False, classifiers=[ "Programming Language :: Python :: 3.8", diff --git a/version.txt b/version.txt index 17e51c385ea..0ea3a944b39 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.1.1 +0.2.0