Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 3 additions & 1 deletion tests/models/model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class ModelTest(unittest.TestCase):
SYM = True

DISABLE_FLASH_ATTN = False
ACCEPT_USE_FLASH_ATTEN2_ARG = True

INFERENCE_PROMPT = "The capital city of France is named"
INFERENCE_RESULT_KEYWORDS = ["paris"]
Expand Down Expand Up @@ -186,7 +187,8 @@ def quantModel(self, model_id_or_path, trust_remote_code=False, torch_dtype="aut
has_attn_implementation = Version(transformers.__version__) >= Version("4.46.0")
if has_attn_implementation:
args["attn_implementation"] = "eager"
args["use_flash_attention_2"] = False
if self.ACCEPT_USE_FLASH_ATTEN2_ARG:
args["use_flash_attention_2"] = False

log.info(f"args: {args}")
model = GPTQModel.load(
Expand Down
1 change: 1 addition & 0 deletions tests/models/test_cohere2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class TestCohere2(ModelTest):
QUANT_ARC_MAX_DELTA_FLOOR_PERCENT = 0.15
EVAL_BATCH_SIZE = 4
DISABLE_FLASH_ATTN = True
ACCEPT_USE_FLASH_ATTEN2_ARG = False

def test_cohere2(self):
self.quant_lm_eval()
1 change: 1 addition & 0 deletions tests/models/test_gptj.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TestGptJ(ModelTest):
TORCH_DTYPE = torch.float16
INPUTS_MAX_LENGTH = 1024
DISABLE_FLASH_ATTN = True
ACCEPT_USE_FLASH_ATTEN2_ARG = False

def test_gptj(self):
self.quant_lm_eval()
Expand Down