Skip to content

Commit 37da98b

Browse files
committed
Raise error when autotune_with_torch_compile_fusion is set without torch_compile_fusion
Previously, setting autotune_with_torch_compile_fusion=True without torch_compile_fusion=True was silently ignored. Now it raises FusionAutotuneRequiresTorchCompileFusion at Settings construction time.
1 parent b7b43b5 commit 37da98b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

helion/exc.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,14 @@ class IncompatibleInterpretModes(BaseError):
310310
message = "TRITON_INTERPRET=1 and HELION_INTERPRET=1 cannot be used together. Please use only one of these debug modes at a time."
311311

312312

313+
class FusionAutotuneRequiresTorchCompileFusion(BaseError):
314+
location_suffix = ""
315+
message = (
316+
"autotune_with_torch_compile_fusion=True requires torch_compile_fusion=True. "
317+
"Either enable torch_compile_fusion or disable autotune_with_torch_compile_fusion."
318+
)
319+
320+
313321
class MissingEnableTile(BaseError):
314322
message = (
315323
"HELION_BACKEND=tileir requires the Triton TileIR driver to be active. "

helion/runtime/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,9 @@ def __init__(self, **settings: object) -> None:
677677
if self.backend == "tileir" and os.environ.get("ENABLE_TILE", "0") != "1":
678678
raise exc.MissingEnableTile
679679

680+
if self.autotune_with_torch_compile_fusion and not self.torch_compile_fusion:
681+
raise exc.FusionAutotuneRequiresTorchCompileFusion
682+
680683
self._check_ref_eager_mode_before_print_output_code()
681684

682685
def to_dict(self) -> dict[str, object]:

0 commit comments

Comments
 (0)