From df52aa11234d590b5d5b6cb26777dada8b21d145 Mon Sep 17 00:00:00 2001 From: lucidrains Date: Fri, 5 Jul 2024 17:25:06 -0700 Subject: [PATCH 1/5] force latest local attention --- meshgpt_pytorch/version.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meshgpt_pytorch/version.py b/meshgpt_pytorch/version.py index 7bf3831..57de876 100644 --- a/meshgpt_pytorch/version.py +++ b/meshgpt_pytorch/version.py @@ -1 +1 @@ -__version__ = '1.5.7' +__version__ = '1.5.9' diff --git a/setup.py b/setup.py index 08a15b3..89c69eb 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ 'environs', 'gateloop-transformer>=0.2.2', 'jaxtyping', - 'local-attention>=1.9.0', + 'local-attention>=1.9.9', 'numpy', 'pytorch-custom-utils>=0.0.9', 'rotary-embedding-torch>=0.6.4', From 5c1bef252102771b39e2549049fd29e2d87c50c2 Mon Sep 17 00:00:00 2001 From: lucidrains Date: Fri, 5 Jul 2024 17:27:31 -0700 Subject: [PATCH 2/5] fix tests --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 89c69eb..094a202 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ 'numpy', 'pytorch-custom-utils>=0.0.9', 'rotary-embedding-torch>=0.6.4', + 'sentencepiece', 'taylor-series-linear-attention>=0.1.6', 'torch>=2.1', 'torch_geometric', From 8fc8d813ee038fa20c252695da1da28c81465460 Mon Sep 17 00:00:00 2001 From: lucidrains Date: Sat, 6 Jul 2024 06:09:57 -0700 Subject: [PATCH 3/5] fix local attention not pickleable --- meshgpt_pytorch/version.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/meshgpt_pytorch/version.py b/meshgpt_pytorch/version.py index 57de876..84b3eef 100644 --- a/meshgpt_pytorch/version.py +++ b/meshgpt_pytorch/version.py @@ -1 +1 @@ -__version__ = '1.5.9' +__version__ = '1.5.10' diff --git a/setup.py b/setup.py index 094a202..ad584ad 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ 'environs', 'gateloop-transformer>=0.2.2', 'jaxtyping', - 'local-attention>=1.9.9', + 'local-attention>=1.9.11', 'numpy', 'pytorch-custom-utils>=0.0.9', 'rotary-embedding-torch>=0.6.4', From b82675dd4804d1bf6231721556c37daacee4fe4d Mon Sep 17 00:00:00 2001 From: Phil Wang Date: Mon, 8 Jul 2024 12:15:34 -0700 Subject: [PATCH 4/5] patch --- meshgpt_pytorch/meshgpt_pytorch.py | 7 ++++++- meshgpt_pytorch/version.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/meshgpt_pytorch/meshgpt_pytorch.py b/meshgpt_pytorch/meshgpt_pytorch.py index 451bec3..0ff95e5 100644 --- a/meshgpt_pytorch/meshgpt_pytorch.py +++ b/meshgpt_pytorch/meshgpt_pytorch.py @@ -157,7 +157,12 @@ def derive_angle(x, y, eps = 1e-5): def get_derived_face_features( face_coords: Float['b nf nvf 3'] # 3 or 4 vertices with 3 coordinates ): - shifted_face_coords = torch.cat((face_coords[:, :, -1:], face_coords[:, :, :-1]), dim = 2) + is_quad = face_coords.shape[-2] == 4 + face_coords_shift = 2 if is_quad else 1 # @sbriseid says quads need to be shifted by 2 + + # shift face coordinates depending on triangles or quads + + shifted_face_coords = torch.roll(face_coords, face_coords_shift, dims = (2,)) angles = derive_angle(face_coords, shifted_face_coords) diff --git a/meshgpt_pytorch/version.py b/meshgpt_pytorch/version.py index 84b3eef..c1bbb90 100644 --- a/meshgpt_pytorch/version.py +++ b/meshgpt_pytorch/version.py @@ -1 +1 @@ -__version__ = '1.5.10' +__version__ = '1.5.11' From d3e048618a286e748a662539c2c0b69562637caa Mon Sep 17 00:00:00 2001 From: Phil Wang Date: Mon, 8 Jul 2024 13:02:48 -0700 Subject: [PATCH 5/5] address https://github.com/lucidrains/meshgpt-pytorch/issues/92#issuecomment-2215070716 again --- meshgpt_pytorch/meshgpt_pytorch.py | 7 +++++-- meshgpt_pytorch/version.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/meshgpt_pytorch/meshgpt_pytorch.py b/meshgpt_pytorch/meshgpt_pytorch.py index 0ff95e5..ab4e330 100644 --- a/meshgpt_pytorch/meshgpt_pytorch.py +++ b/meshgpt_pytorch/meshgpt_pytorch.py @@ -158,14 +158,17 @@ def get_derived_face_features( face_coords: Float['b nf nvf 3'] # 3 or 4 vertices with 3 coordinates ): is_quad = face_coords.shape[-2] == 4 - face_coords_shift = 2 if is_quad else 1 # @sbriseid says quads need to be shifted by 2 # shift face coordinates depending on triangles or quads - shifted_face_coords = torch.roll(face_coords, face_coords_shift, dims = (2,)) + shifted_face_coords = torch.roll(face_coords, 1, dims = (2,)) angles = derive_angle(face_coords, shifted_face_coords) + if is_quad: + # @sbriseid says quads need to be shifted by 2 + shifted_face_coords = torch.roll(shifted_face_coords, 1, dims = (2,)) + edge1, edge2, *_ = (face_coords - shifted_face_coords).unbind(dim = 2) cross_product = torch.cross(edge1, edge2, dim = -1) diff --git a/meshgpt_pytorch/version.py b/meshgpt_pytorch/version.py index c1bbb90..b0ff349 100644 --- a/meshgpt_pytorch/version.py +++ b/meshgpt_pytorch/version.py @@ -1 +1 @@ -__version__ = '1.5.11' +__version__ = '1.5.12'