Skip to content

P1-FEATURE-DEBUG-001: Debug Command — Interactive Mode (experimental) #153

@DingmaomaoBJTU

Description

@DingmaomaoBJTU

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

  • wmk debug (or wmk build --debug-mode) command implemented
  • --step export|analyze|optimize|quantize flag: run only up to that stage
  • After each stage, dump ONNX graph summary (node count, op types, input/output shapes)
  • --inspect flag: show detailed graph before/after chosen stage
  • Experimental flag clearly communicated in CLI output and docs
  • All existing tests pass

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

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Task.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions