Skip to content

Commit 07da911

Browse files
authored
[Frontend] Print reproducer in case of ptxas error (#7677)
@lezcano and I needed to do this anyway whilst debugging, and having this dump to stdout by default matches what we do when there's an error during an MLIR compilation pass
1 parent eda3535 commit 07da911

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

third_party/nvidia/backend/compiler.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,20 @@ def make_cubin(self, src, metadata, opt, capability):
458458
else:
459459
error = f'`ptxas` failed with error code {e.returncode}'
460460

461-
raise PTXASError(f"{error}\n"
462-
f"`ptxas` stderr:\n{log}\n"
463-
f'Repro command: {" ".join(ptxas_cmd)}\n')
461+
error = (f"{error}\n"
462+
f"`ptxas` stderr:\n{log}\n"
463+
f'Repro command: {" ".join(ptxas_cmd)}\n')
464+
465+
print(f"""
466+
467+
================================================================
468+
{error}
469+
470+
{src}
471+
================================================================
472+
please share the reproducer above with Triton project.
473+
""")
474+
raise PTXASError(error)
464475

465476
with open(fbin, 'rb') as f:
466477
cubin = f.read()

0 commit comments

Comments
 (0)