Skip to content

Commit

Permalink
remove scale parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
yardeny-sony committed Sep 25, 2024
1 parent c2ab94d commit 0f8aab7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions tests/common_tests/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ def __init__(self, unit_test,
use_fuzzy_validation=False
):
"""
:param use_fuzzy_validation: Allow similar (instead of exact) float output when comparing to original float
model against the no_quantization output model
:param use_fuzzy_validation: Allow similar (instead of exact) outputs when comparing the original float
model output against the no_quantization model output.
"""

self.unit_test = unit_test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ def forward(self, q, k, v):
attn_mask=self.attn_mask,
dropout_p=self.dropout_p,
is_causal=self.is_causal,
scale=self.scale
# scale=self.scale
)
return x


class ScaledDotProductAttentionTest(BasePytorchTest):
"""
This test checks the MultiHeadAttention as a single layer with add_bias_kv feature.
This test checks the scaled_dot_product_attention (SDPA) substitution using a single SDPA layer.
"""
def __init__(self, unit_test, dropout_p=0.0, scale=None, attn_mask=None, is_causal=False):
super().__init__(unit_test)
Expand All @@ -47,9 +47,8 @@ def create_inputs_shape(self):

def _test_substitution_structure_output(self, post_substitution_nodes):
"""
:param orig_graph: The original float model graph before substitution
:param new_graph: The post substitutions graph
:return: True if the new graph after scaled_dot_product_attention substitution is in the correct structure.
:param post_substitution_nodes: The graph nodes after the SDPA substitution
raise Exception if case the post_substitution_nodes doesn't match the expected_nodes_counter
"""
expected_nodes_counter = {
'DummyPlaceHolder': 3,
Expand Down

0 comments on commit 0f8aab7

Please sign in to comment.