Skip to content

Add comprehensive debugging utilities for model inspection and quantization analysis #468

@dvsav

Description

@dvsav

What

Let's add comprehensive debugging utilities to TICO that would enable users to:

  1. Analyze PyTorch computation graphs (torch.fx.GraphModule):

    • Print detailed graph structure with all nodes
    • Display node information: operation type, inputs, outputs, users
  2. Analyze Circle models (tico.serialize.circle_graph.CircleModel, CircleSubgraph):

    • Print Circle graph structure (tensors, operators, inputs/outputs)
    • Display Circle tensor information with quantization parameters
    • Show operator codes and their configurations

Why

Current Limitations:

  • TICO has minimal debugging functionality (only basic dump_exported_program.py)
  • No tools to visualize model structure or graph topology
  • No comprehensive quantization parameter inspection
  • Difficult to debug quantization issues without visibility into intermediate states
  • Hard to understand what transformations are applied during the conversion pipeline

Benefits:

  • Users can inspect models at every stage (original → prepared → quantized → Circle)
  • Easier to identify where quantization issues occur
  • Better understanding of how quantization parameters flow through the pipeline
  • Helps users understand TICO's internal workings
  • Makes it easier to learn the quantization pipeline
  • Provides examples of how to inspect model structures
  • Users can verify quantization parameters are correct
  • Can confirm that Circle conversion preserves quantization information
  • Can compare different quantization algorithms side-by-side

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions