Rename supports_static_cache to can_compile_fullgraph (#39505)
* update all * Apply suggestions from code review Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com> * apply suggestions * fix copies --------- Co-authored-by: Joao Gante <joaofranciscocardosogante@gmail.com>
This commit is contained in:
committed by
GitHub
parent
b357cbb19d
commit
eb1a007f7f
@@ -1764,7 +1764,7 @@ class GenerationTesterMixin:
|
||||
to verify that the cache length is indeed set correctly and we don't run out of index when slicing the cache.
|
||||
"""
|
||||
for model_class in self.all_generative_model_classes:
|
||||
if not model_class._supports_static_cache:
|
||||
if not model_class._can_compile_fullgraph:
|
||||
self.skipTest(reason="This model does not support the static cache format")
|
||||
|
||||
config, inputs_dict = self.prepare_config_and_inputs_for_generate()
|
||||
@@ -1984,7 +1984,7 @@ class GenerationTesterMixin:
|
||||
"""
|
||||
set_model_tester_for_less_flaky_test(self)
|
||||
for model_class in self.all_generative_model_classes:
|
||||
if not model_class._supports_static_cache:
|
||||
if not model_class._can_compile_fullgraph:
|
||||
self.skipTest(reason="This model does not support the static cache format")
|
||||
|
||||
config, inputs_dict = self.prepare_config_and_inputs_for_generate()
|
||||
@@ -2087,8 +2087,8 @@ class GenerationTesterMixin:
|
||||
set_model_tester_for_less_flaky_test(self)
|
||||
for model_class in self.all_generative_model_classes:
|
||||
# 1. Test exclusion criteria
|
||||
if not model_class._supports_static_cache:
|
||||
self.skipTest("This model doesn't support static cache (= no expectations of compilation support)")
|
||||
if not model_class._can_compile_fullgraph:
|
||||
self.skipTest("This model doesn't support compilation without graph breaks")
|
||||
|
||||
# 2. Prepares two sets of inputs
|
||||
config, inputs_dict = self.prepare_config_and_inputs_for_generate(batch_size=4)
|
||||
@@ -2201,8 +2201,8 @@ class GenerationTesterMixin:
|
||||
In essence, it's the same as `test_greedy_generate_dict_outputs`, but with automatic compilation triggered.
|
||||
"""
|
||||
for model_class in self.all_generative_model_classes:
|
||||
if not model_class._supports_static_cache:
|
||||
self.skipTest("This model doesn't support static cache (= no expectations of compilation support)")
|
||||
if not model_class._can_compile_fullgraph:
|
||||
self.skipTest("This model doesn't support compilation without graph breaks")
|
||||
|
||||
config, inputs_dict = self.prepare_config_and_inputs_for_generate()
|
||||
if self.has_attentions:
|
||||
|
||||
@@ -4415,7 +4415,7 @@ class ModelTesterMixin:
|
||||
set_model_tester_for_less_flaky_test(self)
|
||||
|
||||
for model_class in self.all_generative_model_classes:
|
||||
if not model_class._supports_static_cache:
|
||||
if not model_class._can_compile_fullgraph:
|
||||
self.skipTest(f"{model_class.__name__} is not guaranteed to work with custom 4D attention masks")
|
||||
config, _ = self.model_tester.prepare_config_and_inputs_for_common()
|
||||
set_config_for_less_flaky_test(config)
|
||||
|
||||
Reference in New Issue
Block a user