Lakonik/LakonLab

Official implementation of AsymFlow, pi-Flow, GMFlow

What it solves

LakonLab provides a high-performance infrastructure for training and experimenting with large-scale diffusion models. It addresses the complexity of managing distributed training, memory-efficient fine-tuning, and standardized evaluation for advanced generative flow models.

How it works

The codebase is built on PyTorch and utilizes the MMCV configuration system. It includes specialized solvers for flow-based models, such as the FlowSDEScheduler, which allows for adjustable diffusion coefficients to support different sampling methods. It optimizes memory usage during LoRA fine-tuning by tying base weights between teacher, student, and EMA models, and supports distributed training across multiple GPUs using DDP and FSDP.

Who it’s for

It is designed for researchers and developers working on generative AI who need a robust, scalable framework to implement and evaluate state-of-the-art diffusion and flow-matching models. It is particularly useful for those looking to reproduce results from academic papers like AsymFlow, pi-Flow, and GMFlow.

Highlights

  • Advanced Flow Solvers: Includes generic SDE solvers for few-step generation and flow-based sampling.
  • Memory Efficiency: Implements weight tying for LoRA fine-tuning to reduce memory overhead.
  • Flexible Storage: Supports loading data and checkpoints from local filesystems, AWS S3, HuggingFace, and HTTP/HTTPS URLs.
  • Comprehensive Evaluation: Built-in support for standard metrics like FID, KID, CLIP similarity, and HPSv3, with tools to export results to external benchmarks.
  • Distributed Training: Seamlessly handles DDP, FSDP, and FSDP2 with support for mixed precision and gradient accumulation.

Related

  • Project
  • Project
  • Project
  • Project
  • Dispatch