Skip to content

Commit 58cbc67

Browse files
authored
Reduce log volume by moving output code logging behind HELION_PRINT_OUTPUT_CODE=1 (#1233)
1 parent 7caeaa2 commit 58cbc67

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

helion/runtime/kernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,10 @@ def compile_config(
528528
self.maybe_log_repro(log.warning, self.fake_args, config=config)
529529
raise
530530
if allow_print:
531-
log.info("Output code: \n%s", triton_code)
532531
log.info("Output code written to: %s", module.__file__)
533532
log.debug("Debug string: \n%s", LazyString(lambda: self._debug_str()))
534533
if self.settings.print_output_code:
534+
log.info("Output code: \n%s", triton_code)
535535
print(triton_code, file=sys.stderr)
536536
rv = getattr(module, self.kernel.name)
537537
self._compile_cache[config] = rv

test/test_logging.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def add(x, y):
8989

9090
x = torch.randn(4, device=DEVICE)
9191

92+
add.settings.print_output_code = True
9293
with self.assertLogs("helion.runtime.kernel", level="DEBUG") as cm:
9394
add(x, x)
9495
self.assertTrue(

0 commit comments

Comments
 (0)