-
Notifications
You must be signed in to change notification settings - Fork 35
feat: gnn diagnostics tooling #353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: gnn diagnostics tooling #353
Conversation
Greptile OverviewGreptile SummaryThis PR introduces a comprehensive GNN diagnostics toolkit with utilities for analyzing model training and performance. The changes add a new example directory with scripts for environment verification, synthetic dataset generation, and multiple diagnostic visualizations including Hessian eigenvalue tracking, confusion matrices, and degree-based performance analysis. Key additions:
Previous review issues addressed:
The implementation is well-documented with clear docstrings, follows Python best practices, and provides practical diagnostic tools for GNN model analysis. Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User
participant Demo as synthetic_diagnostics_demo.py
participant Data as make_synthetic()
participant Model as MLP
participant Hessian as hessian_top_eigen.py
participant Degree as degree_decile_performance.py
participant Confusion as overall_confusion_matrix.py
participant Artifacts as artifacts/
User->>Demo: Run with CLI args
Demo->>Data: Generate synthetic dataset
Data-->>Demo: x, y, degrees (with degree-dependent labels)
Demo->>Model: Initialize MLP & optimizer
loop Training epochs
Demo->>Model: Forward pass
Model-->>Demo: Logits & loss
alt Step == plateau_step
Demo->>Demo: Reduce learning rate by plateau_lr_scale
end
Demo->>Model: Backward & optimizer step
alt Step % hessian_sample_every == 0
Demo->>Hessian: estimate_top_eigenvalue_vhp()
Hessian->>Model: Power iteration via VHP
Hessian-->>Demo: Top eigenvalue
Demo->>Demo: Store (step, eigenvalue)
end
end
Demo->>Model: Full inference on dataset
Model-->>Demo: Predictions
Demo->>Confusion: plot_overall_confusion_matrix()
Confusion->>Artifacts: Save confusion_matrix.png
Demo->>Degree: evaluate_by_degree_bucket()
Degree->>Degree: Compute percentile bins
Degree->>Degree: Calculate acc/F1 per bucket
Degree-->>Demo: results_df, confusions
Demo->>Degree: plot_performance()
Degree->>Artifacts: Save degree_performance.png
Demo->>Hessian: plot_curvature()
Hessian->>Artifacts: Save hessian_curve.png
Demo->>Artifacts: Save loss_curve.png
Demo-->>User: All diagnostics complete
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, 1 comment
python/cugraph-pyg/cugraph_pyg/examples/gnn_diagnostics/synthetic_diagnostics_demo.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9 files reviewed, 3 comments
python/cugraph-pyg/cugraph_pyg/examples/gnn_diagnostics/synthetic_diagnostics_demo.py
Outdated
Show resolved
Hide resolved
python/cugraph-pyg/cugraph_pyg/examples/gnn_diagnostics/degree_decile_performance.py
Outdated
Show resolved
Hide resolved
…ins to percentile based bins
Summary
artifacts/.