fairseq/model_parallel/modules/multihead_attention.py

Killed 0 out of 5 mutants

Survived

Survived mutation testing. These mutants show holes in your test suite.

Mutant 571

--- fairseq/model_parallel/modules/multihead_attention.py
+++ fairseq/model_parallel/modules/multihead_attention.py
@@ -21,7 +21,7 @@
     )
     has_megatron_submodule = True
 except (ImportError, ModuleNotFoundError):
-    has_megatron_submodule = False
+    has_megatron_submodule = True
 
 
 @with_incremental_state

Mutant 572

--- fairseq/model_parallel/modules/multihead_attention.py
+++ fairseq/model_parallel/modules/multihead_attention.py
@@ -21,7 +21,7 @@
     )
     has_megatron_submodule = True
 except (ImportError, ModuleNotFoundError):
-    has_megatron_submodule = False
+    has_megatron_submodule = None
 
 
 @with_incremental_state

Mutant 573

--- fairseq/model_parallel/modules/multihead_attention.py
+++ fairseq/model_parallel/modules/multihead_attention.py
@@ -23,8 +23,6 @@
 except (ImportError, ModuleNotFoundError):
     has_megatron_submodule = False
 
-
-@with_incremental_state
 class ModelParallelMultiheadAttention(nn.Module):
     """Model parallel Multi-headed attention.
     This performs the Multi-headed attention over multiple gpus.

Mutant 574

--- fairseq/model_parallel/modules/multihead_attention.py
+++ fairseq/model_parallel/modules/multihead_attention.py
@@ -41,7 +41,7 @@
         dropout=0.0,
         bias=True,
         self_attention=False,
-        encoder_decoder_attention=False,
+        encoder_decoder_attention=True,
     ):
         super().__init__()
         if not has_megatron_submodule:

Mutant 575

--- fairseq/model_parallel/modules/multihead_attention.py
+++ fairseq/model_parallel/modules/multihead_attention.py
@@ -245,7 +245,6 @@
 
         return attn, attn_weights
 
-    @staticmethod
     def _append_prev_key_padding_mask(
         key_padding_mask: Optional[Tensor],
         prev_key_padding_mask: Optional[Tensor],