Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore(pt): slim uts for dpa1 #4244

Merged
merged 5 commits into from
Oct 23, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 6 additions & 18 deletions source/tests/consistent/descriptor/test_dpa1.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@
(4,), # tebd_dim
("concat", "strip"), # tebd_input_mode
(True,), # resnet_dt
(True, False), # type_one_side
(False,), # type_one_side
iProzd marked this conversation as resolved.
Show resolved Hide resolved
(20,), # attn
(0, 2), # attn_layer
(True, False), # attn_dotr
(True,), # attn_dotr
([], [[0, 1]]), # excluded_types
(0.0,), # env_protection
(True, False), # set_davg_zero
(1.0,), # scaling_factor
(True, False), # normalize
(True,), # normalize
(None, 1.0), # temperature
(1e-5,), # ln_eps
(True, False), # smooth_type_embedding
(True,), # smooth_type_embedding
(True,), # concat_output_tebd
("float64",), # precision
(True, False), # use_econf_tebd
(False, True), # use_tebd_bias
(False,), # use_tebd_bias
)
class TestDPA1(CommonTest, DescriptorTest, unittest.TestCase):
@property
Expand Down Expand Up @@ -127,11 +127,9 @@ def data(self) -> dict:
def is_meaningless_zero_attention_layer_tests(
self,
attn_layer: int,
attn_dotr: bool,
normalize: bool,
temperature: Optional[float],
) -> bool:
return attn_layer == 0 and (attn_dotr or normalize or temperature is not None)
return attn_layer == 0 and (temperature is not None)

@property
def skip_pt(self) -> bool:
Expand All @@ -158,8 +156,6 @@ def skip_pt(self) -> bool:
) = self.param
return CommonTest.skip_pt or self.is_meaningless_zero_attention_layer_tests(
attn_layer,
attn_dotr,
normalize,
temperature,
)

Expand Down Expand Up @@ -188,8 +184,6 @@ def skip_dp(self) -> bool:
) = self.param
return CommonTest.skip_dp or self.is_meaningless_zero_attention_layer_tests(
attn_layer,
attn_dotr,
normalize,
temperature,
)

Expand Down Expand Up @@ -218,8 +212,6 @@ def skip_jax(self) -> bool:
) = self.param
return not INSTALLED_JAX or self.is_meaningless_zero_attention_layer_tests(
attn_layer,
attn_dotr,
normalize,
temperature,
)

Expand Down Expand Up @@ -250,8 +242,6 @@ def skip_array_api_strict(self) -> bool:
not INSTALLED_ARRAY_API_STRICT
or self.is_meaningless_zero_attention_layer_tests(
attn_layer,
attn_dotr,
normalize,
temperature,
)
)
Expand Down Expand Up @@ -290,8 +280,6 @@ def skip_tf(self) -> bool:
)
or self.is_meaningless_zero_attention_layer_tests(
attn_layer,
attn_dotr,
normalize,
temperature,
)
)
Expand Down
Loading