Datasets:
Tasks:
Tabular Regression
Formats:
parquet
Size:
< 1K
ArXiv:
Tags:
sparse-matrices
linear-systems
preconditioners
numerical-linear-algebra
suitesparse
scientific-computing
License:
| license: cc-by-4.0 | |
| task_categories: | |
| - tabular-regression | |
| tags: | |
| - sparse-matrices | |
| - linear-systems | |
| - preconditioners | |
| - numerical-linear-algebra | |
| - suitesparse | |
| - scientific-computing | |
| - benchmark | |
| size_categories: | |
| - n<1K | |
| configs: | |
| - config_name: manifest | |
| data_files: manifest.parquet | |
| # MatrixPFN SuiteSparse Evaluation Set | |
| A curated subset of the [SuiteSparse Matrix Collection](https://sparse.tamu.edu/) for benchmarking learned preconditioners on sparse linear systems, matching the evaluation criteria from the GNP paper ([arXiv 2406.00809v3](https://arxiv.org/abs/2406.00809v3)). | |
| ## Dataset Description | |
| - **Source:** [SuiteSparse Matrix Collection](https://sparse.tamu.edu/) | |
| - **License:** CC-BY 4.0 | |
| - **Total matrices:** 867 | |
| - **Format:** Matrix Market (.mtx) | |
| - **Size on disk:** ~5.7 GB (1.9 GB compressed) | |
| | Property | Value | | |
| |---|---| | |
| | Rows/Cols | 1,000 - 100,000 | | |
| | Nonzeros | 1,314 - 1,990,919 | | |
| | Shape | Square | | |
| | Type | Real, non-SPD | | |
| | Problem domains | 50 categories | | |
| ### Domain Distribution (top 10) | |
| | Count | Domain | | |
| |---|---| | |
| | 123 | Circuit simulation | | |
| | 75 | Computational fluid dynamics | | |
| | 69 | Optimization | | |
| | 67 | Optimal control | | |
| | 59 | Economic | | |
| | 49 | Chemical process simulation | | |
| | 47 | Undirected weighted graph | | |
| | 32 | Circuit simulation (frequency-domain) | | |
| | 31 | 2D/3D problem | | |
| | 30 | Eigenvalue/model reduction | | |
| ## Dataset Structure | |
| ``` | |
| . | |
| ├── README.md | |
| ├── manifest.parquet # Matrix metadata (browsable in HF Dataset Viewer) | |
| ├── suitesparse_manifest.json # Full manifest with all 867 matrix metadata | |
| ├── suitesparse.tar.gz # All 867 matrices (1.9 GB compressed, ~5.7 GB extracted) | |
| │ └── suitesparse/ | |
| │ ├── 2D_27628_bjtcai/ | |
| │ │ └── 2D_27628_bjtcai.mtx | |
| │ ├── ACTIVSg2000/ | |
| │ │ └── ACTIVSg2000.mtx | |
| │ └── ... # 867 matrix directories | |
| ├── benchmark_results/ | |
| │ └── benchmark_gnp_paper.jsonl # FGMRES benchmark: 838 matrices × 6 preconditioners | |
| └── ablation_results/ | |
| ├── ablation_edge_features.json # Study 1: 3 seeds, 500 epochs (original) | |
| ├── ablation_edge_features_v2.json # Study 2: 3 seeds, 500 epochs (pre-Dirichlet fix) | |
| └── ablation_edge_features_v3.json # Study 3: 5 seeds, 1000 epochs (definitive) | |
| ``` | |
| ### manifest.parquet | |
| Browsable in the HuggingFace Dataset Viewer. Fields: | |
| | Column | Type | Description | | |
| |---|---|---| | |
| | `id` | int | SuiteSparse matrix ID | | |
| | `group` | str | Collection group (e.g. "HB", "SNAP") | | |
| | `name` | str | Matrix name | | |
| | `rows` | int | Number of rows | | |
| | `cols` | int | Number of columns | | |
| | `nnz` | int | Number of nonzeros | | |
| | `kind` | str | Problem domain | | |
| ### benchmark_results/ | |
| JSONL file with FGMRES solver results for 838/867 matrices (29 timed out/OOM) using 6 preconditioners. | |
| **FGMRES settings** (matching GNP paper): restart=10, max_iters=100, rtol=1e-8. | |
| Per-entry fields: matrix properties (symmetry, diagonal dominance, scaling factor, zero diagonal count), and per-preconditioner results (construction time/status, convergence, iterations, residual history, Iter-AUC, Time-AUC). | |
| #### Benchmark Results Summary | |
| | Preconditioner | Converged | Construction Failed | Not Converged | | |
| |---|---|---|---| | |
| | **ILU(0)** | **376 (44.9%)** | 309 (36.9%) | 153 (18.3%) | | |
| | AMG (AIR) | 206 (24.6%) | 16 (1.9%) | 616 (73.5%) | | |
| | GMRES-Inner | 107 (12.8%) | 0 (0.0%) | 731 (87.2%) | | |
| | None | 64 (7.6%) | 0 (0.0%) | 774 (92.4%) | | |
| | Block Jacobi | 41 (4.9%) | 577 (68.9%) | 220 (26.3%) | | |
| | Jacobi | 33 (3.9%) | 603 (72.0%) | 202 (24.1%) | | |
| **Iter-AUC win rates** (best preconditioner per matrix): | |
| ILU 41.1% · GMRES-Inner 33.9% · AMG 24.4% · Rest 0.5% | |
| **Key findings:** | |
| - 525/838 (62.6%) matrices solved by at least one preconditioner | |
| - 313/838 (37.4%) matrices unsolved by any classical method | |
| - 72% of matrices have zero diagonal entries (→ Jacobi family construction failure) | |
| - ILU dominates small matrices (<5K), AMG becomes competitive at >10K | |
| - ILU ∪ AMG covers 511/838 (61.0%); 327 matrices (39.0%) have both ILU and AMG failing | |
| **Comparison with GNP paper** (arXiv 2406.00809v3, same 867 matrices): | |
| | Metric | Ours | GNP paper | | |
| |---|---|---| | |
| | ILU construction failures | 309 (36.9%) | 348 (40.1%) | | |
| | AMG construction failures | 16 (1.9%) | 62 (7.2%) | | |
| | ILU iter-AUC win rate | 41.1% | ~40% | | |
| | AMG iter-AUC win rate | 24.4% | ~25% | | |
| | GNP iter-AUC win rate | — | ~25% | | |
| | GNP construction failures | — | 0 (0.0%) | | |
| ### ablation_results/ | |
| GCN vs MPNN ablation studies comparing `ContextResGCN` (GCN with Gershgorin-normalized adjacency) against `ContextResMPNN` (explicit edge function with sum aggregation). | |
| **FGMRES settings**: restart=30, max_iters=300, rtol=1e-6. Training on diffusion + advection only, evaluated on diffusion, advection, and graph_laplacian (OOD). Grid sizes: 16, 24, 32 (train) + 48 (OOD). | |
| #### Study 3 Results (definitive, 5 seeds × 1000 epochs) | |
| | Domain | Model | Convergence | Avg Iterations | | |
| |---|---|---|---| | |
| | Diffusion | GCN | **800/800 (100%)** | 90.5 | | |
| | Diffusion | MPNN | **800/800 (100%)** | 85.7 | | |
| | Advection | GCN | **800/800 (100%)** | 87.2 | | |
| | Advection | MPNN | **800/800 (100%)** | 83.0 | | |
| | Graph Laplacian (OOD) | GCN | **400/400 (100%)** | 63.1 | | |
| | Graph Laplacian (OOD) | MPNN | **0/400 (0%)** | — | | |
| **Training loss** (nearly identical): GCN 0.091 vs MPNN 0.092. | |
| MPNN is competitive on in-distribution domains but catastrophically fails on OOD graph topology (Barabási-Albert graphs with power-law degree distribution). Root cause: MPNN's explicit edge function overfits to training topology; GCN's Gershgorin-normalized adjacency is degree-invariant by construction. See [ADR-04](https://github.com/Csed-dev/MatrixPFN/blob/main/docs/adr/04-gcn-over-mpnn.md) and [ADR-08](https://github.com/Csed-dev/MatrixPFN/blob/main/docs/adr/08-mpnn-generalization-failure.md). | |
| ## Dataset Creation | |
| ### Selection Criteria | |
| Matches the GNP paper evaluation set: | |
| - Square matrices only (`rows == cols`) | |
| - Real-valued (not complex) | |
| - Non-SPD (not symmetric positive definite) | |
| - 1,000 to 100,000 rows | |
| - Less than 2,000,000 nonzeros | |
| ### Source Data | |
| All matrices originate from the [SuiteSparse Matrix Collection](https://sparse.tamu.edu/), downloaded unmodified in Matrix Market format via [ssgetpy](https://github.com/drdarshan/ssgetpy). | |
| ## Usage | |
| ### Download and extract all matrices | |
| ```python | |
| import subprocess | |
| from pathlib import Path | |
| from huggingface_hub import hf_hub_download | |
| DATA_DIR = Path("data") | |
| DATA_DIR.mkdir(exist_ok=True) | |
| hf_hub_download( | |
| repo_id="Csed-dev/matrixpfn-suitesparse", | |
| repo_type="dataset", | |
| filename="suitesparse.tar.gz", | |
| local_dir=DATA_DIR, | |
| ) | |
| subprocess.run(["tar", "xzf", str(DATA_DIR / "suitesparse.tar.gz"), "-C", str(DATA_DIR)], check=True) | |
| (DATA_DIR / "suitesparse.tar.gz").unlink() | |
| ``` | |
| ### Load a single matrix | |
| ```python | |
| from scipy.io import mmread | |
| matrix = mmread("data/suitesparse/ACTIVSg2000/ACTIVSg2000.mtx") | |
| print(f"Shape: {matrix.shape}, NNZ: {matrix.nnz}") | |
| ``` | |
| ### Browse the manifest | |
| ```python | |
| from datasets import load_dataset | |
| manifest = load_dataset("Csed-dev/matrixpfn-suitesparse", "manifest") | |
| print(manifest["train"].to_pandas().head()) | |
| ``` | |
| ## Considerations | |
| - Matrix Market (.mtx) files are not natively streamable via `datasets`. Use `hf_hub_download` or `snapshot_download` for the sparse matrices. | |
| - Some matrices may have near-singular or zero diagonals, causing preconditioner construction failures (documented in benchmark results). | |
| - The benchmark results use spectral-radius scaling (dividing by the infinity norm) before solving. | |
| ## Citation | |
| This dataset is a redistribution of matrices from the SuiteSparse Matrix Collection under the CC-BY 4.0 license. | |
| **Required citations:** | |
| ```bibtex | |
| @article{Davis2011, | |
| author = {Timothy A. Davis and Yifan Hu}, | |
| title = {The University of Florida Sparse Matrix Collection}, | |
| journal = {ACM Transactions on Mathematical Software}, | |
| volume = {38}, | |
| number = {1}, | |
| year = {2011}, | |
| doi = {10.1145/2049662.2049663} | |
| } | |
| @article{Kolodziej2019, | |
| author = {Scott P. Kolodziej and Mohsen Aznaveh and Matthew Bullock and Jarrett David and Timothy A. Davis and Matthew Henderson and Yifan Hu and Read Sandstrom}, | |
| title = {The SuiteSparse Matrix Collection Website Interface}, | |
| journal = {Journal of Open Source Software}, | |
| volume = {4}, | |
| number = {35}, | |
| pages = {1244}, | |
| year = {2019}, | |
| doi = {10.21105/joss.01244} | |
| } | |
| ``` | |
| Individual matrices may have additional citations. See https://sparse.tamu.edu/ for per-matrix metadata. | |
| ## License | |
| CC-BY 4.0 (inherited from SuiteSparse Matrix Collection) | |