From bd154c94a78e7cc5eab1a7c0484c1148a6e3810d Mon Sep 17 00:00:00 2001 From: DanilBaibak Date: Thu, 15 Feb 2024 16:31:47 +0100 Subject: [PATCH 1/5] Fixed import for importlib --- torchrl/_extension.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/torchrl/_extension.py b/torchrl/_extension.py index 5eb820cb86f..a9e52dbf9a4 100644 --- a/torchrl/_extension.py +++ b/torchrl/_extension.py @@ -3,18 +3,17 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -import importlib +import importlib.util import warnings def is_module_available(*modules: str) -> bool: - r"""Returns if a top-level module with :attr:`name` exists *without** importing it. + """Returns if a top-level module with :attr:`name` exists *without** importing it. This is generally safer than try-catch block around a `import X`. It avoids third party libraries breaking assumptions of some of our tests, e.g., setting multiprocessing start method when imported (see librosa/#747, torchvision/#544). - """ return all(importlib.util.find_spec(m) is not None for m in modules) From 9378be69f0fc33da51c024d96aa04551431d9d81 Mon Sep 17 00:00:00 2001 From: DanilBaibak Date: Fri, 16 Feb 2024 11:00:56 +0100 Subject: [PATCH 2/5] Get different python versions for testing purpose --- .github/workflows/build-wheels-m1.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wheels-m1.yml b/.github/workflows/build-wheels-m1.yml index 84fe79d09d2..1c2d00295e7 100644 --- a/.github/workflows/build-wheels-m1.yml +++ b/.github/workflows/build-wheels-m1.yml @@ -25,6 +25,7 @@ jobs: os: macos-arm64 test-infra-repository: pytorch/test-infra test-infra-ref: main + limit-pr-builds: false # TODO - needs to be removed before merging build: needs: generate-matrix strategy: From 9fcacb740e97c10b3c6a02bcf5dbd5cd51f702e2 Mon Sep 17 00:00:00 2001 From: DanilBaibak Date: Fri, 16 Feb 2024 11:04:40 +0100 Subject: [PATCH 3/5] Cleanup --- .github/workflows/build-wheels-m1.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-wheels-m1.yml b/.github/workflows/build-wheels-m1.yml index 1c2d00295e7..84fe79d09d2 100644 --- a/.github/workflows/build-wheels-m1.yml +++ b/.github/workflows/build-wheels-m1.yml @@ -25,7 +25,6 @@ jobs: os: macos-arm64 test-infra-repository: pytorch/test-infra test-infra-ref: main - limit-pr-builds: false # TODO - needs to be removed before merging build: needs: generate-matrix strategy: From 5dc05ddc91cfe0c512131d7f38d01ce21e71ba06 Mon Sep 17 00:00:00 2001 From: DanilBaibak Date: Fri, 16 Feb 2024 13:29:15 +0100 Subject: [PATCH 4/5] Try to build M1 binaries for all python versions --- .github/workflows/build-wheels-m1.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-wheels-m1.yml b/.github/workflows/build-wheels-m1.yml index 84fe79d09d2..82971c8233d 100644 --- a/.github/workflows/build-wheels-m1.yml +++ b/.github/workflows/build-wheels-m1.yml @@ -19,12 +19,12 @@ permissions: jobs: generate-matrix: - uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@Remove-Builds-Limits-for-Testing with: package-type: wheel os: macos-arm64 test-infra-repository: pytorch/test-infra - test-infra-ref: main + test-infra-ref: Remove-Builds-Limits-for-Testing build: needs: generate-matrix strategy: From 849d9b121a9b0a609b6e5ecf9b9ee2068310b8e3 Mon Sep 17 00:00:00 2001 From: vmoens Date: Wed, 21 Feb 2024 14:30:09 -0800 Subject: [PATCH 5/5] amend --- test/smoke_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/smoke_test.py b/test/smoke_test.py index 313c786088c..c6500deb5e8 100644 --- a/test/smoke_test.py +++ b/test/smoke_test.py @@ -14,3 +14,5 @@ def test_imports(): from torchrl.envs.gym_like import GymLikeEnv # noqa: F401 from torchrl.modules import SafeModule # noqa: F401 from torchrl.objectives.common import LossModule # noqa: F401 + + PrioritizedReplayBuffer(alpha=1.1, beta=1.1)