Paper doi Dataset DOI

Home

PyTorchFire: A GPU-Accelerated Wildfire Simulator with Differentiable Cellular Automata

About The Project

Accurate and rapid prediction of wildfire trends is crucial for effective management and mitigation. However, the stochastic nature of fire propagation poses significant challenges in developing reliable simulators. In this paper, we introduce PyTorchFire, an open-access, PyTorch-based software that leverages GPU acceleration. With our redesigned differentiable wildfire Cellular Automata (CA) model, we achieve millisecond-level computational efficiency, significantly outperforming traditional CPU-based wildfire simulators on real-world-scale fires at high resolution. Real-time parameter calibration is made possible through gradient descent on our model, aligning simulations closely with observed wildfire behavior both temporally and spatially, thereby enhancing the realism of the simulations. Our PyTorchFire simulator, combined with real-world environmental data, demonstrates superior generalizability compared to supervised learning surrogate models. Its ability to predict and calibrate wildfire behavior in real-time ensures accuracy, stability, and efficiency. PyTorchFire has the potential to revolutionize wildfire simulation, serving as a powerful tool for wildfire prediction and management.

Getting Started

Notebook Examples

Installation

Install with minimal dependencies:

pip install pytorchfire

Install with dependencies for examples:

pip install 'pytorchfire[examples]'

Quick Start

To perform wildfire prediction:

from pytorchfire import WildfireModel

model = WildfireModel() # Create a model with default parameters and environment data
model = model.cuda() # Move the model to GPU
# model.reset(seed=seed) # Reset the model with a seed
for _ in range(100): # Run the model for 100 steps
    model.compute() # Compute the next state

To perform parameter calibration:

import torch
from pytorchfire import WildfireModel, BaseTrainer

model = WildfireModel()

trainer = BaseTrainer(model)

trainer.train()
trainer.evaluate()

Dataset

See at Our Dataset.

Reference

@article{xia2025pytorchfire,
 author = {Zeyu Xia and Sibo Cheng},
 copyright = {CC BY 4.0},
 doi = {10.1016/j.envsoft.2025.106401},
 issn = {1364-8152},
 journal = {Environmental Modelling & Software},
 keywords = {Wildfire simulation, Differentiable Cellular Automata, PyTorch-based software, Parallel computing techniques, GPU-acceleration},
 language = {English},
 month = {4},
 pages = {106401},
 title = {PyTorchFire: A GPU-accelerated wildfire simulator with Differentiable Cellular Automata},
 url = {https://www.sciencedirect.com/science/article/pii/S1364815225000854},
 volume = {188},
 year = {2025}
}

Contact

Zeyu Xia - zeyu.xia@virginia.edu

Sibo Cheng - sibo.cheng@enpc.fr