Wildfire spread understanding via scverse/geospatial analogies (burn-time-as-pseudotime, Rothermel-style kernels). POC: Palisades/Eaton/Bordeaux.
  • Jupyter Notebook 82.3%
  • Python 16.2%
  • HTML 0.9%
  • Shell 0.6%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-10-29 20:58:22 +00:00
.opencode/skills/browser-automation acq: per-fire raster data (4 fires) + multi-resolution xarray cubes 2026-08-18 00:48:37 +00:00
data M7b: GPU fire-model pixel shortest path — negative speedup, exact fidelity 2026-10-23 01:03:31 +00:00
notebooks notebooks: squidpy intro, real-fire graphs, fire-CA squidpy prototype 2026-08-16 01:49:26 +00:00
plans M7b: GPU fire-model pixel shortest path — negative speedup, exact fidelity 2026-10-23 01:03:31 +00:00
report report/submissions: paste-ready drafts for 4 scverse contributions 2026-10-23 01:24:15 +00:00
scripts M7b: GPU fire-model pixel shortest path — negative speedup, exact fidelity 2026-10-23 01:03:31 +00:00
.env.example fire-scverse: burn-time-as-pseudotime POC + covariate layers (Palisades/Eaton/Bordeaux) 2026-08-07 04:46:02 +00:00
.gitignore M0: GPU stack bootstrap on DGX Spark (GB10) 2026-10-18 16:35:45 +00:00
AGENTS.md docs: re-align purpose to scverse-on-DGX-Spark benchmark 2026-10-18 16:25:53 +00:00
lessons_learned.md M7b: GPU fire-model pixel shortest path — negative speedup, exact fidelity 2026-10-23 01:03:31 +00:00
next_steps.md docs: lock future direction to scverse x fire-spread only 2026-10-29 20:58:22 +00:00
opencode.json acq: per-fire raster data (4 fires) + multi-resolution xarray cubes 2026-08-18 00:48:37 +00:00
README.md docs: refresh all benchmark numbers to the final 2026-10-22 watchdog run 2026-10-23 01:10:09 +00:00
requirements-gpu.lock.txt M0: GPU stack bootstrap on DGX Spark (GB10) 2026-10-18 16:35:45 +00:00
requirements.lock.txt fire-scverse: burn-time-as-pseudotime POC + covariate layers (Palisades/Eaton/Bordeaux) 2026-08-07 04:46:02 +00:00
results.md docs: refresh all benchmark numbers to the final 2026-10-22 watchdog run 2026-10-23 01:10:09 +00:00
results_bench.md M7b: GPU fire-model pixel shortest path — negative speedup, exact fidelity 2026-10-23 01:03:31 +00:00
results_cellrank.md Plan B/C: CellRank kernel directionality + Bordeaux perimeter enrichment 2026-08-17 04:37:21 +00:00
run_background.sh directions A-C unattended run: diffusion kernel, squidpy link, Bordeaux truth probe 2026-08-14 13:45:23 +00:00
scverse_analogies.md fire-scverse: burn-time-as-pseudotime POC + covariate layers (Palisades/Eaton/Bordeaux) 2026-08-07 04:46:02 +00:00
wildfire_spread_basics.md fire-scverse: burn-time-as-pseudotime POC + covariate layers (Palisades/Eaton/Bordeaux) 2026-08-07 04:46:02 +00:00
work_log.md docs: lock future direction to scverse x fire-spread only 2026-10-29 20:58:22 +00:00

fire-scverse

A scverse-on-NVIDIA-DGX-Spark benchmark harness for geospatial wildfire data. Wildfire is the driving problem; scverse is the toolkit; the DGX Spark GPU is the thing under test.

Purpose (re-aligned 2026-10-18)

The project's question is not "what causes fire spread" — that was asked, and the honest answer is "for our fires, distance-from-ignition, nothing else" (see Fire-science status). The purpose is now:

Demonstrate and measure where a scverse-based geospatial analysis pipeline gets decisive GPU acceleration on the DGX Spark — and prove the GPU path stays faithful to the CPU result.

That flips the success metric from statistical claims (Spearman rho, Jaccard) to speedup × problem size × fidelity:

  • scale — push the analysis to pixel-level data (10m/30m cubes are already 1.6M–16.3M px × 42–76 vars per fire; ~10⁷–10⁹ values), not the ~10²–10³ h3 cells the CPU pipeline collapses to.
  • speedup — wall-clock GPU vs CPU on identical inputs.
  • fidelity — GPU must reproduce the CPU statistics within a stated tolerance (correctness gate, not a modelling claim).

The word spark stays deliberately double: the ignition spark that seeds a fire model, and the DGX Spark that runs it.

Goals

  1. Make the Spark GPU earn its keep on real fire workloads. Move the expensive parts onto the GB10 (Grace Blackwell, aarch64, CUDA 13, ~119 GiB unified): GPU spatial statistics, GPU optimal transport (moscot / OTT-JAX), GPU graph / CellRank kernels, and GPU raster + columnar I/O (cuDF, KvikIO).
  2. Show scverse is a real toolkit for geospatial fire data. Load geospatial rasters + burn-time into AnnData / SpatialData, build spread graphs with sq.gr.spatial_neighbors, run squidpy spatial stats and CellRank kernels, and treat the arrival-time field as pseudotime — at a scale where the scverse abstractions and their GPU backends are the natural route, not a re-skin.

Candidate GPU workloads (benchmark status)

Workload CPU path today GPU target Status
Spatial autocorrelation (Moran's I / Geary's C) over 10⁷–10⁸ px sq.gr.spatial_autocorr (scipy) cupy / rapids-singlecell M2 done — 20.6× kernel (real 10.5M px) / 16.8× @1e8, |ΔI|≤8.4e-5
Neighborhood enrichment, co-occurrence, Ripley sq.gr.* on small graphs GPU spatial stats at scale M3 done — 16.8× permutation @10.5M px, counts exact vs squidpy
Front registration / rate inference CPU OT / ad-hoc moscot + OTT-JAX on GPU M4 done — 20.6–53.0×, plan fidelity ≤2.4e-4, 60 s gate met
Graph kernels / pseudotime networkx + scipy CellRank + cupy M5 done — 20.2× @10.5M px, rel Δ 1.2e-9
Raster + parquet I/O xarray / pandas KvikIO, cuDF not started

Success criteria

  • Pixel-level (10m/30m) cubes are first-class inputs; benchmark at ≥10⁷ px.
  • A GPU path runs the same statistics and matches the CPU result within a stated tolerance (fidelity gate).
  • Measured speedup reported per workload, on this hardware.
  • Also state where the GPU does not help (see What the GPU does NOT help).

Feasibility (verified 2026-10-18)

The aarch64 + CUDA 13 GPU stack is available for GB10. Verified from PyPI wheels:

package aarch64/cu13 note
cupy-cuda13x 14.2 yes (cp312) GPU arrays
cudf-cu13, cugraph-cu13, cuml-cu13, kvikio-cu13 26.10 yes I/O, graphs, ML
jax-cuda13-plugin 0.11.2 yes bump jax 0.11.0 → 0.11.2 to match
torch 2.14 yes CUDA wheel needs the pytorch cu13 index (PyPI aarch64 is CPU)
rapids-singlecell 0.18 pure-python deps resolve
cuspatial-cu13 alpha only (0.0.0a0) gap: GPU spatial joins/distance blocked

M0 done (2026-10-18): .venv-gpu exists with cupy-cuda13x 14.2, cudf-cu13 / kvikio-cu13 26.10 and jax[cuda13] 0.11.2 (locked in requirements-gpu.lock.txt). Verified on-device: cupy sees the GB10 (compute capability 12.1, driver 13000), jax.devices() == [CudaDevice(id=0)], cudf runs a GPU DataFrame op. rapids-singlecell is blocked — PyPI ships sdist only and the build needs python3.12-dev (not installed, no passwordless sudo); cupy + cudf cover the flagship benchmark without it.

State of play (2026-10-20)

All of M2–M7 are measured on CPU and GPU (final numbers 2026-10-22); the benchmark suite is complete, including one honest "the GPU does NOT help" case (M7b).

CPU GPU status
M2 Moran's I ✅ ✅ 20.6× @10.5M px / 16.8× @1e8 done
M3 nhood enrichment ✅ ✅ 16.8× @10.5M px done
M4 OT front registration ✅ ✅ 36.4–53.0× (d100 gate: CPU 104.6 s > GPU 2.9 s) done
M5 CellRank at pixel scale ✅ 8,237.5 s @10.5M px ✅ 20.2× (407 s) done
M7 fire model at pixel scale ✅ 4.4M px, replicates the finding ✅ 0.06× — GPU loses, recorded done

Benchmark results

Full generated report: results_bench.md (regenerate with .venv/bin/python scripts/bench_report.py); machine-readable: data/analysis/bench_summary.csv. Hardware for every number below: NVIDIA GB10 (Grace Blackwell, aarch64, CUDA 13, 119.7 GiB unified). Metric is speedup × scale × fidelity — the GPU must reproduce the CPU statistic, not merely be fast.

Consolidated

(Final numbers after the 2026-10-22 watchdog run — the GPU recovered, so every row is a measured CPU-vs-GPU pair; 0 pending.)

workload N CPU (s) GPU (s) speedup fidelity
M2 Moran's I (kernel) 1,000,000 0.003 0.001 2.8× (0.4× e2e) |ΔI| 1.1e-07
M2 Moran's I (kernel) 100,000,000 1.217 0.072 16.8× (3.3× e2e) |ΔI| 8.4e-05
M2 Moran's I (real saumos 10m) 10,499,367 0.460 0.022 20.6× (5.6× e2e) |ΔI| 1.3e-05
M3 nhood permutation (k=6) 9,998,244 122.0 9.87 12.4× (6.3× join-count build) |Δz| 0 (aligned)
M3 nhood permutation (real saumos 10m) 10,469,736 207.7 12.4 16.8× |ΔC| 0 (exact)
M4 OT front registration (synthetic) 16,384 103.9 2.147 48.4× —
M4 OT front registration (real EMSR899 d100) 52,300 104.6 2.870 36.4× disp rel Δ 2e-06
M5 CellRank absorption times (real saumos 10m) 10,499,367 8,237.5 407.0 20.2× rel Δ 1.2e-09
M7b fire model (pixel, saumos 10m) 4,384,755 0.80 13.2 0.06× — GPU loses rel Δ 2.7e-05

M2 — GPU Moran's I (scripts/gpu_moran_bench.py, data/analysis/gpu_moran_bench.csv).

Row-standardized rook-contiguity weights over a raster; CPU = scipy.sparse, GPU = cupyx.scipy.sparse; GPU transfer timed separately from the kernel.

dataset n_px CPU GPU kernel kernel speedup e2e speedup |ΔI|
synthetic 1e6 1.0M 2.8 ms 1.0 ms 2.8× 0.4× 1.1e-7
synthetic 1e7 10.0M 141.3 ms 9.5 ms 14.8× 3.4× 1.5e-6
synthetic 1e8 100M 1217.3 ms 72.4 ms 16.8× 3.3× 8.4e-5
real palisades 30m 0.22M 7.0 ms 7.3 ms 1.0× 0.8× 5.9e-7
real saumos 10m 10.5M 460.0 ms 22.3 ms 20.6× 5.6× 1.3e-5

Fidelity vs classically-computed CPU: |ΔI| ≤ 8.4e-5. scverse anchor: matches sq.gr.spatial_autocorr to |ΔI|=5.1e-4 on a real raster. At ≤10⁶ px the GPU is break-even or slower (transfer + launch dominate); the payload is ≥10⁷ px.

M3 — GPU neighborhood enrichment / join counts

(scripts/gpu_nhood_bench.py, data/analysis/gpu_nhood_bench.csv). KxK join-count matrix C = Aᵀ B A and label-permutation z-scores (squidpy's neighborhood-enrichment machinery).

dataset n_px join counts (CPU→GPU) permutation loop (CPU→GPU) perm speedup |Δz|
synthetic 1e6 1.0M 0.07→0.15 s 5.63→0.97 s 5.8× 0 (aligned)
synthetic 1e7 10.0M 0.97→0.15 s 122.0→9.9 s 12.4× sampled
real saumos 10m 10.5M 3.23→0.33 s 207.7→12.4 s 16.8× sampled

Join counts are exact integers (float64) at every size (|ΔC|=0), and match sq.gr.interaction_matrix exactly (max|ΔC|=0). Where CPU/GPU share the permutation stream the z-scores are bit-identical (|Δz|=0).

M4 — GPU optimal transport / fire-front registration

(scripts/gpu_ot_bench.py, scripts/ot_baseline.py, data/analysis/gpu_ot_bench.csv). OTT-JAX Sinkhorn matches the front at time t to the front at time t+1; the transport cost and the mass-weighted mean front advance are the outputs. Points are sampled inside the h3 cells of each Copernicus EMSR899 snapshot (--densify K samples K points per cell), so the real perimeter-registration workload is pushed to pixel-ish scale.

case n CPU (s) GPU (s) speedup rel Δ (mean displacement)
synthetic front arc 4,096 5.06 0.098 51.6× —
synthetic front arc 16,384 103.9 2.147 48.4× —
synthetic front arc 32,768 237.0 5.884 40.3× —
real EMSR899 d25 11,550 5.453 0.175 31.2× 1.9e-05
real EMSR899 d50 18,450 13.71 0.439 31.2× 2.3e-04
real EMSR899 d50 23,100 18.90 0.625 30.2× 1.5e-04
real EMSR899 d50 26,150 21.84 0.704 31.0× 2.4e-05
real EMSR899 d100 36,900 77.5 1.750 44.3× 1.9e-04
real EMSR899 d100 46,200 96.4 2.571 37.5× 9.8e-05
real EMSR899 d100 52,300 104.6 2.870 36.4× 1.6e-06

Fidelity metric: the transport-plan mean displacement (the mass-weighted distance the front moves) matches CPU vs GPU to rel ≤ 2.4e-4 on every real case — the two backends produce the same transport plan. The three d100 cases are also the plan's gate: the CPU needs 77–105 s (> 60 s budget) while the GPU solves them in 1.7–2.9 s. ott's reg_ot_cost is not a valid cross-backend metric: it is derived from the Sinkhorn dual potentials, which are fixed only up to a constant shift, and in float32 on the GPU that shift does not cancel exactly, so the reported cost can differ in sign even when the plan is identical. results_bench.md shows it for transparency and labels it as such.

M5 — GPU CellRank-style directed kernel + pseudotime

(scripts/gpu_cellrank_bench.py, data/analysis/gpu_cellrank_bench.csv). The CellRank computation moved off the 70–957-cell h3 graphs onto pixel scale: a directed (Rothermel) transition matrix over the raster, and the mean time to absorption — the solve of (I − Q)t = 1 on the transient block, which is literally what CellRank's compute_absorption_times does.

scverse anchor: our solve vs the real cellrank package (CFLARE.compute_absorption_times, direct solver) on the 957-cell Bordeaux h3 graph, same transition matrix and same terminal states — max rel diff 2.7e-07 over 947 cells. That is what licenses running the same computation at pixel scale, where cellrank itself cannot run.

CPU vs GPU (GPU run 2026-10-22 by the watchdog; gpu_cellrank_bench_summary.csv):

dataset n_px CPU solve (s) GPU solve (s) speedup max rel Δ (t)
synthetic 100x100 10,000 0.032 0.178 0.2× 2.5e-9
synthetic 316x316 99,856 1.33 1.53 0.9× 3.9e-9
synthetic 1000x1000 1,000,000 52.99 19.35 2.7× 3.6e-8
real palisades 30m 222,665 2.73 2.23 1.2× 3.8e-9
real saumos 10m 10,499,367 8,237.5 (137 min) 407.0 (6.8 min) 20.2× 1.2e-9

That last row is the M5 gate: a real fire's pixel-scale CellRank computation takes 137 minutes on the CPU, 6.8 minutes on the GPU — 20.2×, with the solution vector identical to 1.2e-9. Fidelity is checked three ways — against a dense direct solve (2.4e-09), against a Monte-Carlo simulation of the chain itself (75.8 vs 75.4 steps, 0.6%), and against real CellRank (2.7e-07). scripts/test_gpu_cellrank.py guards all of this as a regression suite.

M7 — the FIRE MODEL at pixel scale

(scripts/fire_model_pixel.py, data/analysis/fire_model_pixel.csv). The actual fire model — Rothermel-weighted shortest path (edge weight = distance / spread-rate) over the burned pixels of the raster cubes, multi-source path from the earliest-burning pixels, correlated against the observed burn time.

fire res n_px distance fuel wind rothermel
palisades_2025 10m 1,163,189 0.766 0.762 0.776 0.779
eaton_2025 10m 689,524 0.216 0.216 0.236 0.240
saumos_2026 10m 4,384,755 0.882 0.879 0.891 0.894

The headline negative result replicates at pixel scale: distance and fuel agree to within 0.003 on every fire and resolution, and the full Rothermel directionality adds only +0.012. The h3-scale finding ("covariates are inert; the model is geometry") re-derived on 4.4M pixels instead of 751 h3 cells — and the h3 ordering is preserved, so it is the same measurement, not a different one.

The CPU win that came first (scripts/fire_model_speedup.py): the h3 model computed arrival times with one full Dijkstra per seed (up to 200) then took the min. But "min over seeds of d(seed, v)" is the multi-source shortest path, so it is one call — 82.8× faster on the real fires, with bit-identical fields and the committed ablation baseline reproduced exactly (all 72 rows, max |Δrho| = 0.0). The per-seed loop is O(n_seeds·E log V) and could not have run at pixel scale at all — the same reformulation the GPU path uses.

GPU (M7b, 2026-10-22): the GPU does NOT help this workload — 0.03–0.35× speedup at every scale. Saumos 10m 4.4M px: CPU 0.80–0.90 s vs GPU 12.4–13.2 s (~15× slower). Frontier label-correcting min-plus relax (cupyx.scatter_min) needs ~3,262 hop-diameter rounds of thin-front scatter plus a sync each round — a shape a tuned C priority-queue Dijkstra simply outruns. Fidelity is exact: arrival fields max rel diff 2.7e-05, rho |Δ| 3.4e-06 (fire_model_pixel_summary.csv). Weighted shortest path stays on the CPU — recorded honestly as a "does not help" case.

What the GPU does NOT help

Derived from the measurements, not asserted:

workload N speedup second stage why
M2 Moran's I 1.0M px 2.4× kernel 0.9× e2e transfer + launch dominate; the kernel win is eaten by the copy
M2 Moran's I (palisades 30m) 0.22M px 1.0× 0.8× e2e break-even at best
M3 nhood join 1.0M px 6.2× perm 0.6× join-count build the join-count build is slower on GPU at this size
M4 OT 88–523 pts 2–4× — the whole CPU job takes 2–6 ms; nothing to win
M7b fire model, pixel shortest path 4.4M px 0.06× — scipy's ONE multi-source Dijkstra (0.8 s) beats the GPU frontier relax (12–13 s); hop-diameter rounds of thin-front work + syncs

Read: the crossover sits between 10⁶ and 10⁷ px for the raster workloads and around 10³ points for OT, and weighted shortest path never crosses it — the M7b fire-model GPU solve is slower at every scale from 76k to 4.4M px. The actual fire-science pipeline in this repo runs on h3 res-8 graphs of 70–957 cells — far below the crossover. The GPU pays off only when the analysis is run at pixel scale, which is exactly the shift this project made.

Fire-science status (fidelity / scope, demoted from headline)

Retained because the pipeline is a faithful scverse port and the numbers set the fidelity baseline — not as a causal claim.

  • Burn-time-as-pseudotime reconstructs chronology for single-headed, wind-driven fires (Palisades/Eaton isochrone Jaccard 0.95 / 1.00; with-seeds rho 0.95–1.0).
  • Covariates are inert. Three independent ablations (GEE h3 cells, raster cubes, diffusion kernel) give fuel == distance, wind worse. The with-seeds result is a seed-distance tautology.
  • CellRank directionality is the one lift (rho 0.970 vs 0.422 with seeds), only when ignition seeds are known (results_cellrank.md).
  • Multi-front / flat fires unexplained (Bordeaux: Jaccard 0.42 against 5 EMSR899 snapshots; no single-source method flips it).

Full detail: results.md, results_cellrank.md.

Repository map

Path What it is
results_bench.md GPU benchmark report (M6): speedup × scale × fidelity per workload
data/analysis/bench_summary.csv Same, machine-readable (one row per workload × dataset)
results.md Capstone: ablation + perimeter growth + cube ablation + squidpy descriptive
results_cellrank.md CellRank kernel directionality (the one positive signal)
scverse_analogies.md scverse ↔ wildfire concept mapping
wildfire_spread_basics.md Fire-physics primer (Rothermel, CA formulations, spotting)
next_steps.md, work_log.md, lessons_learned.md Tracker / history / hard-won notes
plans/ Run books; see scverse_spark_benchmark_plan.md for the re-aligned plan
scripts/ acq_* (acquisition), burntime_pseudotime / diffusion_pseudotime / cellrank_kernels / squidpy_burntime (modelling), perimeter_growth* (validation), gpu_*_bench + ot_baseline + bench_report (GPU benchmarks)
data/parquet/ h3 cells, burn-time, covariates, pixel-cube matrices (tracked)
data/analysis/ Result CSVs (tracked); data/geodata/, data/raw/ gitignored

Quickstart

# one fire through the pseudotime model (CPU baseline)
.venv/bin/python scripts/burntime_pseudotime.py palisades_2025

# raster-cube ablation across fires x resolutions
.venv/bin/python scripts/run_ablation_all.py

# scverse layer: Moran's I / DPT / neighborhood enrichment
.venv/bin/python scripts/squidpy_burntime.py

# --- GPU benchmarks (need .venv-gpu; see M0 in plans/) ---
.venv-gpu/bin/python scripts/gpu_moran_bench.py                  # M2
.venv-gpu/bin/python scripts/gpu_nhood_bench.py                  # M3
.venv-gpu/bin/python scripts/gpu_ot_bench.py --tag gpu --source emsr899 --densify 50  # M4
.venv/bin/python scripts/ot_baseline.py         # M4: interleaved CPU/GPU, fair on a shared box
.venv-gpu/bin/python scripts/gpu_cellrank_bench.py --tag gpu --sizes 1e4 1e5 1e6  # M5
.venv/bin/python scripts/bench_report.py        # M6: regenerate results_bench.md

# regression tests for the M5 pipeline (CPU only, no GPU needed)
.venv/bin/python scripts/test_gpu_cellrank.py

Data acquisition needs the GEE service-account key in .env (gitignored). Repo operations (SSH port 2222, hygiene rules) are in AGENTS.md.

Data

Fires: palisades_2025, eaton_2025 (LA County, CA), saumos_2026 / bordeaux_2026 (Gironde, EMSR899), biscarrosse_2026 (Landes, EMSR902). Ground truth: NASA FIRMS daily detections and Copernicus EMSR rapid-mapping perimeters (5 timestamped snapshots for Bordeaux). Raster cubes at 10m/30m/100m/1km in data/geodata/cubes/ (gitignored, regenerable).