import sys, onnx_ir as ir from collections import Counter p=sys.argv[1] m=ir.load(p) g=m.graph print("=== INPUTS ===") for i in g.inputs: print(f" {i.name:38s} {i.dtype} {[d.value if hasattr(d,'value') else d for d in (i.shape or [])]}") print("=== OUTPUTS ===") for o in g.outputs: print(f" {o.name:38s} {o.dtype} {[d.value if hasattr(d,'value') else d for d in (o.shape or [])]}") print("=== OP COUNTS ===") c=Counter(n.op_type for n in g) for op,n in sorted(c.items(), key=lambda x:-x[1]): print(f" {op:32s} {n}") # GQA node attributes (head dims / window) print("=== GroupQueryAttention / Attention attrs (first few + unique) ===") seen=set() for n in g: if n.op_type in ("GroupQueryAttention","Attention"): attrs={a.name:(a.value if not hasattr(a.value,'shape') else 'tensor') for a in n.attributes.values()} key=(n.op_type, attrs.get('kv_num_heads'), attrs.get('q_num_heads'), attrs.get('num_heads'), attrs.get('local_window_size'), attrs.get('scale')) if key not in seen: seen.add(key); print(" ",key)