Get started
Setup
Recommended: Use the provided Docker container for a consistent environment. See CONTRIBUTING.md for Docker setup instructions. Otherwise, create a new conda environment with conda create -y -n fastgen python=3.12.3 pip; conda activate fastgen.
Installation
On ARM64, PyPI only provides CPU builds of PyTorch, so install the CUDA build first:
Credentials (Optional)
For W&B logging, get your API key and save it to credentials/wandb_api.txt or set the WANDB_API_KEY environment variable.
Without either of these, W&B will prompt for your API key interactively.
For more details, including S3 storage and other environment variables, see fastgen/configs/README.md.
Quick Start
Before running the following commands, download the CIFAR-10 dataset and pretrained EDM models:
For other datasets and models, see fastgen/networks/README.md and fastgen/datasets/README.md.
Basic Training
If you run out-of-memory, try a smaller batch-size, e.g., dataloader_train.batch_size=32, which automatically uses gradient accumulation to match the global batch-size.
Expected Output: See the training log for a link to the run on wandb.ai. Training outputs go to $FASTGEN_OUTPUT_ROOT/{project}/{group}/{name}/, where name defaults to the config file’s name without .py (see Run Directory). With default settings, outputs are organized as follows:
DDP/FSDP2 Training
For multi-GPU training, use DDP:
For large models, use FSDP2 for model sharding by replacing trainer.ddp=True with trainer.fsdp=True.
Inference
For other inference modes and FID evaluations, see scripts/README.md. FastGen-distilled models can also be served with:
- FlashDreams for optimized streaming inference of Self-Forcing models.
- vLLM-Omni for DMD2 model inference.
Command-Line Overrides
Override any config parameter using Hydra-style syntax (note the - separator):
Use +key=value for a key the config does not define yet; see fastgen/configs/README.md.