[HybridCache] disable automatic compilation (#36620)
This commit is contained in:
@@ -2118,6 +2118,9 @@ class GenerationTesterMixin:
|
||||
Tests that `.generate` is compatible with torch.compile without graph breaks, keeping the same results.
|
||||
⚠️ Runs two sequential generations to ensure the cache doesn't get stuck after the first compiled run! ⚠️
|
||||
"""
|
||||
# Monkey-patching the HybridCache at test-time to continue testing compilation support
|
||||
HybridCache.is_compileable = True
|
||||
|
||||
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)")
|
||||
@@ -2214,6 +2217,9 @@ class GenerationTesterMixin:
|
||||
Tests that all optional outputs are behaving as expected when compilation is triggered.
|
||||
In essence, it's the same as `test_greedy_generate_dict_outputs`, but with automatic compilation triggered.
|
||||
"""
|
||||
# Monkey-patching the HybridCache at test-time to continue testing compilation support
|
||||
HybridCache.is_compileable = True
|
||||
|
||||
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)")
|
||||
|
||||
Reference in New Issue
Block a user