Summary
Implement an interactive debug mode for wmk build that lets users step through the pipeline stage by stage, inspect the ONNX graph at each step, and apply optimizations selectively.
Context
When a model build fails, users need to understand at which stage it failed and why. Interactive mode loads the model without triggering the full pipeline, allowing selective stage execution and graph inspection.
This is experimental for May 1. From:
plans/release/0315_release_plan/P1_CHECKLIST.md (P1-FEATURE-001)
plans/release/0501_release_plan/P0_CHECKLIST.md (P1-FEATURE-003)
Current State
wmk build runs the full pipeline non-interactively
- No step-by-step mode or mid-pipeline inspection capability
- Build failures produce basic error messages without graph introspection
Desired State
wmk debug --step export (or similar) runs only the export stage and dumps the graph
- User can inspect the ONNX graph after each stage: export, optimize, quantize
- Apply optimizations selectively:
--apply-fusion --skip-qdq
- Useful for debugging "which optimization broke my model?"
Acceptance Criteria
Technical Notes
- Load model without triggering full pipeline: decouple stage execution from main flow
- Graph inspection: use
onnx.helper to print node/op summary; optionally integrate with Netron
- API design: the stage selection API must be clean enough to extend for future stages
Related Files
plans/release/0315_release_plan/feature-scale.md — P1.1 Debug Command Interactive Mode
plans/release/0501_release_plan/feature-scale.md — P1.3 Debug Command
plans/release/0315_release_plan/P1_CHECKLIST.md — P1-FEATURE-001
plans/release/0501_release_plan/P0_CHECKLIST.md — P1-FEATURE-003
modelkit/cli.py — CLI entry point
Summary
Implement an interactive debug mode for
wmk buildthat lets users step through the pipeline stage by stage, inspect the ONNX graph at each step, and apply optimizations selectively.Context
When a model build fails, users need to understand at which stage it failed and why. Interactive mode loads the model without triggering the full pipeline, allowing selective stage execution and graph inspection.
This is experimental for May 1. From:
plans/release/0315_release_plan/P1_CHECKLIST.md(P1-FEATURE-001)plans/release/0501_release_plan/P0_CHECKLIST.md(P1-FEATURE-003)Current State
wmk buildruns the full pipeline non-interactivelyDesired State
wmk debug --step export(or similar) runs only the export stage and dumps the graph--apply-fusion --skip-qdqAcceptance Criteria
wmk debug(orwmk build --debug-mode) command implemented--step export|analyze|optimize|quantizeflag: run only up to that stage--inspectflag: show detailed graph before/after chosen stageTechnical Notes
onnx.helperto print node/op summary; optionally integrate with NetronRelated Files
plans/release/0315_release_plan/feature-scale.md— P1.1 Debug Command Interactive Modeplans/release/0501_release_plan/feature-scale.md— P1.3 Debug Commandplans/release/0315_release_plan/P1_CHECKLIST.md— P1-FEATURE-001plans/release/0501_release_plan/P0_CHECKLIST.md— P1-FEATURE-003modelkit/cli.py— CLI entry point