fix(sa-eval): run cleanup on SKIP_* / exception paths#890
Open
DingmaomaoBJTU wants to merge 1 commit into
Open
fix(sa-eval): run cleanup on SKIP_* / exception paths#890DingmaomaoBJTU wants to merge 1 commit into
DingmaomaoBJTU wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.