Skip to content

Commit

Permalink
Dump sarif diagnostics for failed onnx exports in benchmark (#115673)
Browse files Browse the repository at this point in the history
Summary:
X-link: pytorch/pytorch#115673
Approved by: https://github.com/thiagocrepaldi
ghstack dependencies: #115670

Reviewed By: jeanschmidt

Differential Revision: D52244277

fbshipit-source-id: 7c43535df8626c89cc6f5f25b38578b734b6dc69
  • Loading branch information
BowenBao authored and facebook-github-bot committed Dec 18, 2023
1 parent 1594d15 commit afe0209
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions userbenchmark/dynamo/dynamobench/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,11 @@ def run_n_iterations_onnx(model, inputs, n=2):
output_csv(
output_error_filename, parsed_error.headers, parsed_error.row
)
if context.onnx_model is not None:
e.onnx_program.save_diagnostics(
f"{context.onnx_model.model_dir}/"
f"{current_onnx_compiler}_{current_name}_{current_device}.sarif"
)

# Check also the raw exception that caused export failure.
# Skip if it is already analyzed by diagnostics.
Expand Down

0 comments on commit afe0209

Please sign in to comment.