Open
Conversation
Contributor
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
|
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/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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
artifacts/.