[Inductor] add cuda compile cmd to autotuning logging (#160906)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/160906
Approved by: https://github.com/henrylhtsang
This commit is contained in:
Michael Lazos
2025-08-18 11:32:27 -07:00
committed by PyTorch MergeBot
parent 41b3e80a55
commit 5cf6567c1f

View File

@ -144,6 +144,7 @@ _IS_WINDOWS = sys.platform == "win32"
LOCK_TIMEOUT = 600
output_code_log = torch._logging.getArtifactLogger(__name__, "output_code")
autotuning_log = torch._logging.getArtifactLogger(__name__, "autotuning")
log = logging.getLogger(__name__)
@ -3736,7 +3737,10 @@ def cuda_compile_command(
res = f"{_cuda_compiler()} {' '.join(options)} -o {dst_file} {src_file}"
else:
raise NotImplementedError(f"Unsupported output file suffix {dst_file_ext}!")
log.debug("CUDA command: %s", res)
if log.isEnabledFor(logging.DEBUG):
log.debug("CUDA command: %s", res)
else:
autotuning_log.debug("CUDA command: %s", res)
return res