Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inductor config BC change #382

Merged
merged 6 commits into from
Jun 16, 2024
Merged
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
12 changes: 8 additions & 4 deletions test/integration/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,11 @@ def test_weight_only_quant_force_mixed_mm(self, device, dtype):
if dtype == torch.bfloat16 and torch.cuda.get_device_capability() < (8, 0):
self.skipTest("test requires SM capability of at least (8, 0).")
from torch._inductor import config
mixed_mm_key, mixed_mm_val = ("mixed_mm_choice", "triton") if TORCH_VERSION_AFTER_2_4 else ("force_mixed_mm", True)

with config.patch({
"epilogue_fusion": True,
"force_mixed_mm": True
mixed_mm_key: mixed_mm_val,
}):
for x_shape in [[2, 4], [5, 5, 5, 4], [1, 4, 4]]:
torch._dynamo.reset()
Expand All @@ -887,7 +889,7 @@ def test_weight_only_quant_force_mixed_mm(self, device, dtype):
m_c = torch.compile(m, mode="max-autotune")
y_wo, (code,) = run_and_get_code(m_c, x)
sqnr = compute_error(y_ref, y_wo)
self.assertGreaterEqual(sqnr, 42.75)
self.assertGreaterEqual(sqnr, 42.50)
if device == "cuda":
self.assertTrue("mixed_mm" in code, f"got code: {code}")

Expand All @@ -900,9 +902,11 @@ def test_weight_only_quant_use_mixed_mm(self, device, dtype):
self.skipTest("test requires SM capability of at least (8, 0).")
torch.manual_seed(0)
from torch._inductor import config
mixed_mm_key, mixed_mm_val = ("mixed_mm_choice", "triton") if TORCH_VERSION_AFTER_2_4 else ("force_mixed_mm", True)

with config.patch({
"epilogue_fusion": False,
"force_mixed_mm": True
mixed_mm_key: mixed_mm_val,
}):
for x_shape in [[2, 4], [5, 5, 5, 4], [1, 4, 4]]:
torch._dynamo.reset()
Expand All @@ -913,7 +917,7 @@ def test_weight_only_quant_use_mixed_mm(self, device, dtype):
m_c = torch.compile(m, mode="max-autotune")
y_wo, (code,) = run_and_get_code(m_c, x)
sqnr = compute_error(y_ref, y_wo)
self.assertGreater(sqnr, 43.0)
self.assertGreater(sqnr, 42.75)


class TestSaveLoadMeta(unittest.TestCase):
Expand Down
Loading