Skip to content

fix(sa-eval): run cleanup on SKIP_* / exception paths#890

Open
DingmaomaoBJTU wants to merge 1 commit into
mainfrom
qiowu/fix_sa_eval_skip_cleanup
Open

fix(sa-eval): run cleanup on SKIP_* / exception paths#890
DingmaomaoBJTU wants to merge 1 commit into
mainfrom
qiowu/fix_sa_eval_skip_cleanup

Conversation

@DingmaomaoBJTU

Copy link
Copy Markdown
Collaborator

Summary

  • "�valuate_model" + in + "scripts/e2e_eval/run_sa_eval.py" + has 5 early-return paths via + "_skip_result" + (SKIP_BUILD / SKIP_EXPORT / SKIP_GRAPH_OPT / SKIP_SA_PRE / SKIP_SA_POST) that bypassed the trailing + "cleanup_onnx_artifacts" + call. Only the all-stages-succeed path cleaned up. So any model that failed mid-pipeline left its intermediate ONNX + external-data files on disk even when run with + "--cleanup" + .

For LLMs whose + "winml build" + partially succeeded before the next stage aborted, this is multi-GB per model. Observed in practice: one + "Qwen/Qwen2.5-1.5B-Instruct" + SKIP_GRAPH_OPT folder leaked 22.9 GB ( + "�xport.onnx.data" + 6.78GB ×2 + + "graph_optimized.onnx.data" + 3.1GB + a lot of + "onnx__MatMul_*" + / weight external-data files).

Fix

Move the + "cleanup_onnx_artifacts" + invocation out of + "�valuate_model" + 's success path and into a + " ry/finally" + around the call site in the main loop. Now + "--cleanup" + runs regardless of which return path is taken (COMPLETE, any SKIP_*, or exception), matching the flag's documented semantics.

evaluate_model has 5 early-return paths via _skip_result that bypassed the trailing cleanup_onnx_artifacts call, so any model that failed mid-pipeline (e.g. SKIP_GRAPH_OPT for LLMs whose graph_optimize step aborts) leaked multi-GB ONNX external-data files. One Qwen2.5-1.5B SKIP_GRAPH_OPT folder alone leaked 22.9 GB.

Move the cleanup invocation from evaluate_model's success path into a try/finally in the main loop so --cleanup runs regardless of which return path is taken (SKIP_BUILD / SKIP_EXPORT / SKIP_GRAPH_OPT / SKIP_SA_PRE / SKIP_SA_POST or exception).
@DingmaomaoBJTU DingmaomaoBJTU requested a review from a team as a code owner June 15, 2026 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant