diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8-foss-2023a-CUDA-12.1.1.eb b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8-foss-2023a-CUDA-12.1.1.eb new file mode 100644 index 000000000000..a98cf39994a7 --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8-foss-2023a-CUDA-12.1.1.eb @@ -0,0 +1,121 @@ +easyblock = 'PythonBundle' + +name = 'PyTorch3D' +version = '0.7.8' +versionsuffix = '-CUDA-%(cudaver)s' + +homepage = "https://pytorch3d.org/" +description = """PyTorch3D is FAIR's library of reusable components for deep learning with 3D data.""" + +toolchain = {'name': 'foss', 'version': '2023a'} + +builddependencies = [ + # Building + ('hatchling', '1.18.0'), + # Testing + ('Python-bundle-PyPI', '2023.06'), # pytest + ('scikit-image', '0.22.0'), + ('OpenCV', '4.8.1', versionsuffix + '-contrib'), + ('plotly.py', '5.16.0'), + ('SQLAlchemy', '2.0.25'), + ('visdom', '0.2.4'), +] + +dependencies = [ + ('Python', '3.11.3'), + ('CUDA', '12.1.1', '', SYSTEM), + ('tqdm', '4.66.1'), + ('PyTorch-bundle', '2.1.2', versionsuffix), # for portalocker, torchvision + ('imageio', '2.33.1'), + ('IPython', '8.14.0'), + ('PyOpenGL', '3.1.7'), + ('PyCUDA', '2024.1', versionsuffix), +] + +sanity_pip_check = True +use_pip = True + +exts_list = [ + ('termcolor', '2.3.0', { + 'checksums': ['b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a'], + }), + ('yacs', '0.1.8', { + 'checksums': ['efc4c732942b3103bea904ee89af98bcd27d01f0ac12d8d4d369f1e7a2914384'], + }), + ('iopath', '0.1.10', { + 'checksums': ['3311c16a4d9137223e20f141655759933e1eda24f8bff166af834af3c645ef01'], + }), + ('antlr4-python3-runtime', '4.9.3', { + 'modulename': 'antlr4', + 'checksums': ['f224469b4168294902bb1efa80a8bf7855f24c99aef99cbefc1bcd3cce77881b'], + }), + ('omegaconf', '2.3.0', { + 'checksums': ['d5d4b6d29955cc50ad50c46dc269bcd92c6e00f5f90d23ab5fee7bfca4ba4cc7'], + }), + ('lpips', '0.1.4', { + 'checksums': ['3846331df6c69688aec3d300a5eeef6c529435bc8460bd58201c3d62e56188fa'], + }), + (name, version, { + 'patches': [ + 'PyTorch3D-0.7.8_fix-opengl-test-hang.patch', + 'PyTorch3D-0.7.8_use-installdir-in-test.patch', + 'PyTorch3D-0.7.8_squeeze-1-channel-imgs-in-test.patch', + 'PyTorch3D-0.7.8_bar-dataclass-immutable-in-test.patch', + 'PyTorch3D-0.7.8_remove-relative-sys-path-insert.patch', + 'PyTorch3D-0.7.8_fix-kwarg-only-in-test.patch', + 'PyTorch3D-0.7.8_fix-test_io_off-np-error-msg.patch', + 'PyTorch3D-0.7.8_fix-data_path-in-test-cow.patch', + ], + 'source_tmpl': 'V%(version)s.tar.gz', + 'source_urls': ['https://github.com/facebookresearch/%(namelower)s/archive'], + 'checksums': [ + {'V0.7.8.tar.gz': 'd91298b17ec203fbcea62587e4e9c36b1ef717f98114d6919ff9acece5ea0f99'}, + {'PyTorch3D-0.7.8_fix-opengl-test-hang.patch': + 'f23cac69535f4c72857688b9fcb8dbd1813a857653ea38e84d958e212b45d139'}, + {'PyTorch3D-0.7.8_use-installdir-in-test.patch': + '02298334e742c6cf85c4656afe706530dad9bf91ff75cc39d221a8621bd398b2'}, + {'PyTorch3D-0.7.8_squeeze-1-channel-imgs-in-test.patch': + 'b0ae109c4cce9cfdb7eeab7155b826944a1ffdbd9613c3ba217d310614642d59'}, + {'PyTorch3D-0.7.8_bar-dataclass-immutable-in-test.patch': + '82d1162410b8217557dffba9c1bbb21db3f9eaccaa1398cba4c0fa74ff50cf69'}, + {'PyTorch3D-0.7.8_remove-relative-sys-path-insert.patch': + 'b1f1da4a9b610a139c13efb733e564d17213daa714cbd83dcf3217ea68687936'}, + {'PyTorch3D-0.7.8_fix-kwarg-only-in-test.patch': + '4a1036e9c3a51655155d88a86051f6469a10fbbb5d2dee57dc0fefba9b95e5bf'}, + {'PyTorch3D-0.7.8_fix-test_io_off-np-error-msg.patch': + '72a2c811783bdb30615fbc25ae0c550718a5fa0c65d5eb6bfafa43330a770d96'}, + {'PyTorch3D-0.7.8_fix-data_path-in-test-cow.patch': + 'e08380207e4eb994cece7d3b052ecc21358695b267c0dd52b9c630830d3a66b8'} + + ], + 'testinstall': True, + 'runtest': ( + # Running in srcdir will make pytorch3d overshadow testinstall + 'ln -s $PWD/tests/ ../tests' + ' && ln -s $PWD/docs ../docs' # includes data used in tests + ' && ln -s $PWD/website ../website' # used in test_build (consider skipping instead) + ' && cd ../' + # Run tests + ' && pytest -ra tests/' + # Flaky (see https://github.com/facebookresearch/pytorch3d/issues/1914) + ' --deselect=tests/test_knn.py::TestKNN::test_knn_vs_python_square_cuda' + ' --deselect=tests/test_points_alignment.py::TestICP::test_heterogeneous_inputs' + ' --deselect=tests/test_render_meshes.py::TestRenderMeshes::test_simple_sphere_elevated_camera' + # Requires multiple GPUs + #' --deselect=tests/test_pointclouds.py::TestPointclouds::test_to_list' + #' --deselect=tests/test_pointclouds.py::TestPointclouds::test_to_tensor' + #' --deselect=tests/test_render_multigpu.py::TestRenderMeshesMultiGPU::test_mesh_renderer_opengl_to' + #' --deselect=tests/test_render_multigpu.py::TestRenderMeshesMultiGPU::test_mesh_renderer_to' + #' --deselect=tests/test_render_multigpu.py::TestRenderMeshesMultiGPU::test_render_meshes' + #' --deselect=tests/test_render_multigpu.py::TestRenderMeshesMultiGPU::test_render_meshes_opengl' + #' --deselect=tests/test_rendering_utils.py::TestTensorProperties::test_to' + # Something is wrong with test_opengl_utils.py, run separately + ' --ignore=tests/test_opengl_utils.py' + ' && pytest -ra tests/test_opengl_utils.py' + # Seems harmless, see https://github.com/facebookresearch/pytorch3d/issues/1759#issuecomment-2003868471 + ' --deselect tests/test_opengl_utils.py::TestOpenGLUtils::test_no_egl_error' + ), + }), +] + +moduleclass = 'tools' diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_bar-dataclass-immutable-in-test.patch b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_bar-dataclass-immutable-in-test.patch new file mode 100644 index 000000000000..0e39878cdf25 --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_bar-dataclass-immutable-in-test.patch @@ -0,0 +1,25 @@ +From e3bec5a44cbe20aa4dd2470855943c1572e5feac Mon Sep 17 00:00:00 2001 +From: Viktor Rehnberg +Date: Fri, 1 Nov 2024 15:01:51 +0000 +Subject: [PATCH] Make Bar dataclass immutable + +--- + tests/implicitron/test_config.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/implicitron/test_config.py b/tests/implicitron/test_config.py +index 471451b..2ae4f4a 100644 +--- a/tests/implicitron/test_config.py ++++ b/tests/implicitron/test_config.py +@@ -246,7 +246,7 @@ class TestConfig(unittest.TestCase): + + enable_get_default_args(Foo) + +- @dataclass() ++ @dataclass(frozen=True) + class Bar: + aa: int = 9 + bb: int = 9 +-- +2.39.3 + diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-data_path-in-test-cow.patch b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-data_path-in-test-cow.patch new file mode 100644 index 000000000000..3ec505e6682e --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-data_path-in-test-cow.patch @@ -0,0 +1,35 @@ +From 13d4d579c23d2c7b9b858b7ea60f1bc0df2629a5 Mon Sep 17 00:00:00 2001 +From: Viktor Rehnberg +Date: Thu, 7 Nov 2024 15:59:34 +0000 +Subject: [PATCH] Fix path to cow.obj in test + +--- + tests/implicitron/test_data_cow.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tests/implicitron/test_data_cow.py b/tests/implicitron/test_data_cow.py +index 801863e..6471cf0 100644 +--- a/tests/implicitron/test_data_cow.py ++++ b/tests/implicitron/test_data_cow.py +@@ -14,7 +14,7 @@ from pytorch3d.implicitron.dataset.rendered_mesh_dataset_map_provider import ( + ) + from pytorch3d.implicitron.tools.config import expand_args_fields + from pytorch3d.renderer import FoVPerspectiveCameras +-from tests.common_testing import TestCaseMixin ++from tests.common_testing import get_pytorch3d_dir, TestCaseMixin + + + inside_re_worker = os.environ.get("INSIDE_RE_WORKER", False) +@@ -29,7 +29,8 @@ class TestDataCow(TestCaseMixin, unittest.TestCase): + self._runtest(use_point_light=False, num_views=4) + + def _runtest(self, **kwargs): +- provider = RenderedMeshDatasetMapProvider(**kwargs) ++ data_file = get_pytorch3d_dir() / "docs" / "tutorials" / "data" / "cow_mesh" / "cow.obj" ++ provider = RenderedMeshDatasetMapProvider(data_file=data_file, **kwargs) + dataset_map = provider.get_dataset_map() + known_matrix = torch.zeros(1, 4, 4) + known_matrix[0, 0, 0] = 1.7321 +-- +2.39.3 + diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-kwarg-only-in-test.patch b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-kwarg-only-in-test.patch new file mode 100644 index 000000000000..4e474ed2382d --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-kwarg-only-in-test.patch @@ -0,0 +1,25 @@ +From 2c9d00ccb10e1f2e14b0742b46e8b2de88465d2c Mon Sep 17 00:00:00 2001 +From: Viktor Rehnberg +Date: Mon, 4 Nov 2024 15:55:15 +0000 +Subject: [PATCH] Fix kwarg only in test_extending_data_frame build + +--- + tests/implicitron/test_extending_orm_types.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/implicitron/test_extending_orm_types.py b/tests/implicitron/test_extending_orm_types.py +index e6ceb86..c15f7fa 100644 +--- a/tests/implicitron/test_extending_orm_types.py ++++ b/tests/implicitron/test_extending_orm_types.py +@@ -87,7 +87,7 @@ class CanineFrameDataBuilder( + sequence_annotation: types.SequenceAnnotation, + load_blobs: bool = True, + ) -> CanineFrameData: +- frame_data = super().build(frame_annotation, sequence_annotation, load_blobs) ++ frame_data = super().build(frame_annotation, sequence_annotation, load_blobs=load_blobs) + frame_data.num_dogs = frame_annotation.num_dogs or 101 + frame_data.magnetic_field_average_flux_density = ( + frame_annotation.magnetic_field.average_flux_density +-- +2.39.3 + diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-opengl-test-hang.patch b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-opengl-test-hang.patch new file mode 100644 index 000000000000..c5517b3d6e72 --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-opengl-test-hang.patch @@ -0,0 +1,53 @@ +From 81d82980bc82fd605f27cca87f89ba08af94db3d Mon Sep 17 00:00:00 2001 +From: Jeremy Reizenstein +Date: Wed, 6 Nov 2024 11:40:42 -0800 +Subject: [PATCH] Fix ogl test hang + +Summary: See https://github.com/facebookresearch/pytorch3d/issues/1908 + +Reviewed By: MichaelRamamonjisoa + +Differential Revision: D65280253 + +fbshipit-source-id: ec05902c5f2f7eb9ddd92bda0045cc3564b8c091 +--- + pytorch3d/renderer/opengl/opengl_utils.py | 19 +++++++++---------- + 1 file changed, 9 insertions(+), 10 deletions(-) + +diff --git a/pytorch3d/renderer/opengl/opengl_utils.py b/pytorch3d/renderer/opengl/opengl_utils.py +index 8201b307..73b1800c 100755 +--- a/pytorch3d/renderer/opengl/opengl_utils.py ++++ b/pytorch3d/renderer/opengl/opengl_utils.py +@@ -184,7 +184,7 @@ def __init__(self, width: int, height: int, cuda_device_id: int = 0) -> None: + """ + # Lock used to prevent multiple threads from rendering on the same device + # at the same time, creating/destroying contexts at the same time, etc. +- self.lock = threading.Lock() ++ self.lock = threading.RLock() + self.cuda_device_id = cuda_device_id + self.device = _get_cuda_device(self.cuda_device_id) + self.width = width +@@ -224,15 +224,14 @@ def active_and_locked(self): + Throws: + EGLError when the context cannot be made current or make non-current. + """ +- self.lock.acquire() +- egl.eglMakeCurrent(self.dpy, self.surface, self.surface, self.context) +- try: +- yield +- finally: +- egl.eglMakeCurrent( +- self.dpy, egl.EGL_NO_SURFACE, egl.EGL_NO_SURFACE, egl.EGL_NO_CONTEXT +- ) +- self.lock.release() ++ with self.lock: ++ egl.eglMakeCurrent(self.dpy, self.surface, self.surface, self.context) ++ try: ++ yield ++ finally: ++ egl.eglMakeCurrent( ++ self.dpy, egl.EGL_NO_SURFACE, egl.EGL_NO_SURFACE, egl.EGL_NO_CONTEXT ++ ) + + def get_context_info(self) -> Dict[str, Any]: + """ diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-test_io_off-np-error-msg.patch b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-test_io_off-np-error-msg.patch new file mode 100644 index 000000000000..2760eb3762c1 --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_fix-test_io_off-np-error-msg.patch @@ -0,0 +1,62 @@ +From dd2a11b5fc671523628783b63220c29621f8063c Mon Sep 17 00:00:00 2001 +From: Jeremy Reizenstein +Date: Wed, 6 Nov 2024 11:13:59 -0800 +Subject: [PATCH] Fix OFF for new numpy errors + +Summary: Error messages have changed around numpy version 2, making existing code fail. + +Reviewed By: MichaelRamamonjisoa + +Differential Revision: D65280674 + +fbshipit-source-id: b3ae613ea8f0f4ae20fb6e5e816314b8c10e6c65 +--- + pytorch3d/io/off_io.py | 2 +- + tests/test_io_off.py | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/pytorch3d/io/off_io.py b/pytorch3d/io/off_io.py +index 78b4390d4..421816101 100644 +--- a/pytorch3d/io/off_io.py ++++ b/pytorch3d/io/off_io.py +@@ -84,7 +84,7 @@ def _read_faces_lump( + ) + data = np.loadtxt(file, dtype=np.float32, ndmin=2, max_rows=n_faces) + except ValueError as e: +- if n_faces > 1 and "Wrong number of columns" in e.args[0]: ++ if n_faces > 1 and "number of columns" in e.args[0]: + file.seek(old_offset) + return None + raise ValueError("Not enough face data.") from None +diff --git a/tests/test_io_off.py b/tests/test_io_off.py +index 6a5dc669a..c92f65de1 100644 +--- a/tests/test_io_off.py ++++ b/tests/test_io_off.py +@@ -286,15 +286,15 @@ def load(lines): + + lines2 = lines.copy() + lines2[0] = "6 2 0" +- with self.assertRaisesRegex(ValueError, "Wrong number of columns at line 5"): ++ with self.assertRaisesRegex(ValueError, "number of columns"): + load(lines2) + + lines2[0] = "5 1 0" +- with self.assertRaisesRegex(ValueError, "Wrong number of columns at line 5"): ++ with self.assertRaisesRegex(ValueError, "number of columns"): + load(lines2) + + lines2[0] = "16 2 0" +- with self.assertRaisesRegex(ValueError, "Wrong number of columns at line 5"): ++ with self.assertRaisesRegex(ValueError, "number of columns"): + load(lines2) + + lines2[0] = "3 3 0" +@@ -312,7 +312,7 @@ def load(lines): + + lines2 = lines.copy() + lines2[2] = "7.3 4.2 8.3 932" +- with self.assertRaisesRegex(ValueError, "Wrong number of columns at line 2"): ++ with self.assertRaisesRegex(ValueError, "number of columns"): + load(lines2) + + lines2[1] = "7.3 4.2 8.3 932" diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_remove-relative-sys-path-insert.patch b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_remove-relative-sys-path-insert.patch new file mode 100644 index 000000000000..32ebd5c1e61d --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_remove-relative-sys-path-insert.patch @@ -0,0 +1,102 @@ +From 5c93f99d8277c102a69e7485be40f3a0633803b7 Mon Sep 17 00:00:00 2001 +From: Viktor Rehnberg +Date: Fri, 1 Nov 2024 14:34:26 +0000 +Subject: [PATCH] Remove hardcoded sys.path.insert + +--- + tests/pulsar/create_multiview.py | 1 - + tests/pulsar/test_channels.py | 1 - + tests/pulsar/test_depth.py | 1 - + tests/pulsar/test_forward.py | 1 - + tests/pulsar/test_hands.py | 1 - + tests/pulsar/test_ortho.py | 1 - + tests/pulsar/test_small_spheres.py | 1 - + 7 files changed, 7 deletions(-) + +diff --git a/tests/pulsar/create_multiview.py b/tests/pulsar/create_multiview.py +index 7dfc9c5..1df1d70 100644 +--- a/tests/pulsar/create_multiview.py ++++ b/tests/pulsar/create_multiview.py +@@ -11,7 +11,6 @@ from os import path + + + # Making sure you can run this, even if pulsar hasn't been installed yet. +-sys.path.insert(0, path.join(path.dirname(__file__), "..", "..")) + + + def create_multiview(): +diff --git a/tests/pulsar/test_channels.py b/tests/pulsar/test_channels.py +index adbf4e5..717b97c 100644 +--- a/tests/pulsar/test_channels.py ++++ b/tests/pulsar/test_channels.py +@@ -15,7 +15,6 @@ import torch + from ..common_testing import TestCaseMixin + + +-sys.path.insert(0, path.join(path.dirname(__file__), "..", "..")) + devices = [torch.device("cuda"), torch.device("cpu")] + + +diff --git a/tests/pulsar/test_depth.py b/tests/pulsar/test_depth.py +index 023571a..2957b37 100644 +--- a/tests/pulsar/test_depth.py ++++ b/tests/pulsar/test_depth.py +@@ -18,7 +18,6 @@ import torch + from ..common_testing import TestCaseMixin + + # Making sure you can run this, even if pulsar hasn't been installed yet. +-sys.path.insert(0, path.join(path.dirname(__file__), "..", "..")) + + devices = [torch.device("cuda"), torch.device("cpu")] + IN_REF_FP = path.join(path.dirname(__file__), "reference", "nr0000-in.pth") +diff --git a/tests/pulsar/test_forward.py b/tests/pulsar/test_forward.py +index d8cddbf..b8d723f 100644 +--- a/tests/pulsar/test_forward.py ++++ b/tests/pulsar/test_forward.py +@@ -17,7 +17,6 @@ import torch + + + # Making sure you can run this, even if pulsar hasn't been installed yet. +-sys.path.insert(0, path.join(path.dirname(__file__), "..", "..")) + LOGGER = logging.getLogger(__name__) + devices = [torch.device("cuda"), torch.device("cpu")] + +diff --git a/tests/pulsar/test_hands.py b/tests/pulsar/test_hands.py +index 128b228..4983b3a 100644 +--- a/tests/pulsar/test_hands.py ++++ b/tests/pulsar/test_hands.py +@@ -16,7 +16,6 @@ from ..common_testing import TestCaseMixin + + + # Making sure you can run this, even if pulsar hasn't been installed yet. +-sys.path.insert(0, path.join(path.dirname(__file__), "..", "..")) + devices = [torch.device("cuda"), torch.device("cpu")] + + +diff --git a/tests/pulsar/test_ortho.py b/tests/pulsar/test_ortho.py +index 3da5ea7..b5df716 100644 +--- a/tests/pulsar/test_ortho.py ++++ b/tests/pulsar/test_ortho.py +@@ -15,7 +15,6 @@ import torch + + + # Making sure you can run this, even if pulsar hasn't been installed yet. +-sys.path.insert(0, path.join(path.dirname(__file__), "..")) + devices = [torch.device("cuda"), torch.device("cpu")] + + +diff --git a/tests/pulsar/test_small_spheres.py b/tests/pulsar/test_small_spheres.py +index d1282c7..7871d3d 100644 +--- a/tests/pulsar/test_small_spheres.py ++++ b/tests/pulsar/test_small_spheres.py +@@ -15,7 +15,6 @@ import torch + from torch import nn + + +-sys.path.insert(0, path.join(path.dirname(__file__), "..")) + devices = [torch.device("cuda"), torch.device("cpu")] + + +-- +2.39.3 + diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_squeeze-1-channel-imgs-in-test.patch b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_squeeze-1-channel-imgs-in-test.patch new file mode 100644 index 000000000000..224d142cd7d5 --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_squeeze-1-channel-imgs-in-test.patch @@ -0,0 +1,108 @@ +From 3da5408763fc84d60dfcdf39bcb32c93010e2748 Mon Sep 17 00:00:00 2001 +From: Viktor Rehnberg +Date: Fri, 1 Nov 2024 14:56:59 +0000 +Subject: [PATCH] Squeeze channel dimension just in case + +imsave only works with 3 channels, in case of 1 channel, squeeze will +get rid of the channel dimension. +--- + tests/pulsar/test_forward.py | 20 ++++++++++---------- + 1 file changed, 10 insertions(+), 10 deletions(-) + +diff --git a/tests/pulsar/test_forward.py b/tests/pulsar/test_forward.py +index da79028..e4f7158 100644 +--- a/tests/pulsar/test_forward.py ++++ b/tests/pulsar/test_forward.py +@@ -68,7 +68,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_bg_weight.png", + ), +- (result * 255.0).cpu().to(torch.uint8).numpy(), ++ (result * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + imageio.imsave( + path.join( +@@ -76,7 +76,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_bg_weight_hits.png", + ), +- (hits * 255.0).cpu().to(torch.uint8).numpy(), ++ (hits * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + self.assertEqual(hits[500, 500, 0].item(), 1.0) + self.assertTrue( +@@ -131,7 +131,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_basic_3chan.png", + ), +- (result * 255.0).cpu().to(torch.uint8).numpy(), ++ (result * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + imageio.imsave( + path.join( +@@ -139,7 +139,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_basic_3chan_hits.png", + ), +- (hits * 255.0).cpu().to(torch.uint8).numpy(), ++ (hits * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + self.assertEqual(hits[500, 500, 0].item(), 1.0) + self.assertTrue( +@@ -194,7 +194,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_basic_1chan.png", + ), +- (result * 255.0).cpu().to(torch.uint8).numpy(), ++ (result * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + imageio.imsave( + path.join( +@@ -202,7 +202,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_basic_1chan_hits.png", + ), +- (hits * 255.0).cpu().to(torch.uint8).numpy(), ++ (hits * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + self.assertEqual(hits[500, 500, 0].item(), 1.0) + self.assertTrue( +@@ -256,7 +256,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_basic_8chan.png", + ), +- (result[:, :, 5:8] * 255.0).cpu().to(torch.uint8).numpy(), ++ (result[:, :, 5:8] * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + imageio.imsave( + path.join( +@@ -264,7 +264,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_basic_8chan_hits.png", + ), +- (hits * 255.0).cpu().to(torch.uint8).numpy(), ++ (hits * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + self.assertEqual(hits[500, 500, 0].item(), 1.0) + self.assertTrue( +@@ -316,7 +316,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_principal_point.png", + ), +- (result * 255.0).cpu().to(torch.uint8).numpy(), ++ (result * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + self.assertTrue( + np.allclose( +@@ -343,7 +343,7 @@ class TestForward(unittest.TestCase): + "test_out", + "test_forward_TestForward_test_principal_point.png", + ), +- (result * 255.0).cpu().to(torch.uint8).numpy(), ++ (result * 255.0).cpu().to(torch.uint8).squeeze(2).numpy(), + ) + self.assertTrue( + np.allclose( +-- +2.39.3 + diff --git a/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_use-installdir-in-test.patch b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_use-installdir-in-test.patch new file mode 100644 index 000000000000..3fb385310891 --- /dev/null +++ b/easybuild/easyconfigs/p/PyTorch3D/PyTorch3D-0.7.8_use-installdir-in-test.patch @@ -0,0 +1,40 @@ +From ecd50ceee3d475887d7d70759f27767ac121d55f Mon Sep 17 00:00:00 2001 +From: Viktor Rehnberg +Date: Thu, 31 Oct 2024 17:03:39 +0000 +Subject: [PATCH] Get install dir based on importlib + +--- + tests/implicitron/test_build.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tests/implicitron/test_build.py b/tests/implicitron/test_build.py +index 646497f..cc255d6 100644 +--- a/tests/implicitron/test_build.py ++++ b/tests/implicitron/test_build.py +@@ -9,6 +9,7 @@ import os + import sys + import unittest + import unittest.mock ++from pathlib import Path + + from tests.common_testing import get_pytorch3d_dir + +@@ -20,6 +21,7 @@ class TestBuild(unittest.TestCase): + # which may fail if there are import cycles. + + with unittest.mock.patch.dict(sys.modules): ++ root_dir = Path(importlib.util.find_spec("pytorch3d").origin) + for module in list(sys.modules): + # If any of pytorch3d is already imported, + # the test would be pointless. +@@ -30,7 +32,6 @@ class TestBuild(unittest.TestCase): + # so make sure it has been imported here. + import torchvision.utils # noqa + +- root_dir = get_pytorch3d_dir() / "pytorch3d" + # Exclude opengl-related files, as Implicitron is decoupled from opengl + # components which will not work without adding a dep on pytorch3d_opengl. + ignored_modules = ( +-- +2.39.3 + diff --git a/easybuild/easyconfigs/v/visdom/visdom-0.2.4-gfbf-2023a.eb b/easybuild/easyconfigs/v/visdom/visdom-0.2.4-gfbf-2023a.eb new file mode 100644 index 000000000000..2863b755245e --- /dev/null +++ b/easybuild/easyconfigs/v/visdom/visdom-0.2.4-gfbf-2023a.eb @@ -0,0 +1,42 @@ +easyblock = 'PythonBundle' + +name = 'visdom' +version = '0.2.4' + +homepage = 'https://github.com/fossasia/visdom' +description = """ +A flexible tool for creating, organizing, and sharing visualizations of live, +rich data. Supports Torch and Numpy.""" + +toolchain = {'name': 'gfbf', 'version': '2023a'} + +dependencies = [ + ('Python', '3.11.3'), + ('SciPy-bundle', '2023.07'), + ('networkx', '3.1'), + ('Pillow-SIMD', '9.5.0'), +] + +use_pip = True +sanity_pip_check = True + +exts_list = [ + ('tornado', '6.3.2', { + 'checksums': ['4b927c4f19b71e627b13f3db2324e4ae660527143f9e1f2e2fb404f3a187e2ba'], + }), + ('jsonpointer', '2.4', { + 'checksums': ['585cee82b70211fa9e6043b7bb89db6e1aa49524340dde8ad6b63206ea689d88'], + }), + ('jsonpatch', '1.33', { + 'checksums': ['9fcd4009c41e6d12348b4a0ff2563ba56a2923a7dfee731d004e212e1ee5030c'], + }), + ('websocket-client', '1.7.0', { + 'modulename': 'websocket', + 'checksums': ['10e511ea3a8c744631d3bd77e61eb17ed09304c413ad42cf6ddfa4c7787e8fe6'], + }), + (name, version, { + 'checksums': ['84a911d3c8814a056d54812b381bd938cb44bcfc503a85fe0f701502bb720574'], + }), +] + +moduleclass = 'lib'