Skip to content

Commit 005cb09

Browse files
authored
[DEBUG] Add knob to dump ptxas log (#7555)
1 parent 9d29969 commit 005cb09

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

python/triton/knobs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ class nvidia_knobs(base_knobs):
429429
dump_nvptx: env_bool = env_bool("NVPTX_ENABLE_DUMP")
430430
disable_ptxas_opt: env_bool = env_bool("DISABLE_PTXAS_OPT")
431431
mock_ptx_version: env_opt_str = env_opt_str("TRITON_MOCK_PTX_VERSION")
432+
dump_ptxas_log: env_bool = env_bool("TRITON_DUMP_PTXAS_LOG")
432433

433434
libdevice_path: env_opt_str = env_opt_str("TRITON_LIBDEVICE_PATH")
434435
libcuda_path: env_opt_str = env_opt_str("TRITON_LIBCUDA_PATH")

third_party/nvidia/backend/compiler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ def make_cubin(self, src, metadata, opt, capability):
435435
]
436436
try:
437437
subprocess.run(ptxas_cmd, check=True, close_fds=False, stderr=flog)
438+
if knobs.nvidia.dump_ptxas_log:
439+
with open(flog.name) as log_file:
440+
print(log_file.read())
441+
438442
if os.path.exists(fsrc.name):
439443
os.remove(fsrc.name)
440444
if os.path.exists(flog.name):

0 commit comments

Comments
 (0)