Always produce kernel_info.json (#163715)

Summary: Always produce kernel_info.json so zoomer can use this json to populate GPU traces

Test Plan: CI

Differential Revision: D82762435

Pull Request resolved: https://github.com/pytorch/pytorch/pull/163715
Approved by: https://github.com/angelayi
This commit is contained in:
Shangdi Yu
2025-09-25 19:38:49 +00:00
committed by PyTorch MergeBot
parent 21a41edd4f
commit ebfc87e303

View File

@ -2495,16 +2495,16 @@ end
if config.aot_inductor.package:
generated_files.append(output_so)
if config.aot_inductor.package:
if config.trace.provenance_tracking_level != 0:
kernel_info = torch._inductor.debug.create_kernel_information_json()
kernel_info_json = os.path.join(
wrapper_path_operator.parent, "kernel_information.json"
)
with open(kernel_info_json, "w") as f:
f.write(json.dumps(kernel_info, indent=4))
generated_files.append(kernel_info_json)
if config.trace.provenance_tracking_level != 0:
kernel_info = torch._inductor.debug.create_kernel_information_json()
kernel_info_json = os.path.join(
wrapper_path_operator.parent, "kernel_information.json"
)
with open(kernel_info_json, "w") as f:
f.write(json.dumps(kernel_info, indent=4))
generated_files.append(kernel_info_json)
if config.aot_inductor.package:
# We want to return the directory that contains all the AOTI
# generated files, not just the so
# return os.path.split(output_so)[0]