Skip to content
Closed
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
9 changes: 5 additions & 4 deletions backends/cuda/tests/test_int4_quantized_gemm.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import contextlib
import os
import pickle
import re
import statistics
import tempfile
import types
Expand Down Expand Up @@ -887,10 +888,10 @@ def linear(x):
)
source = "\n".join(code)
name = autotuner.fn.fn.__name__
self.assertIn(f"def {name}(", source)
block = source[
source.rindex("user_autotune(", 0, source.index(f"def {name}(")) :
]
# A module-level kernel's def is renamed to Inductor's kernel name: name plus a suffix.
kernel_def = re.search(rf"^def {re.escape(name)}\w*\(", source, re.MULTILINE)
self.assertIsNotNone(kernel_def, source)
block = source[source.rindex("user_autotune(", 0, kernel_def.start()) :]
configs = block[: block.index("],")]
self.assertEqual(configs.count("'num_warps'"), 1)
_check_close(self, compiled, eager)
Expand Down
Loading