only_train_once_personal_footprint  by tianyic

DNN training/compression framework (research paper)

Created 3 years ago
310 stars

Top 86.7% on SourcePulse

GitHubView on GitHub
Project Summary

This repository provides the deprecated PyTorch implementation of Only Train Once (OTO), an automatic, architecture-agnostic framework for simultaneous DNN training and compression via structured pruning and erasing operators. It targets researchers and practitioners seeking to achieve high performance and reduced model size in a single training pass without fine-tuning.

How It Works

OTO employs a two-stage process. First, it constructs a pruning dependency graph to partition DNN variables into "Pruning Zero-Invariant Groups" (PZIGs), representing minimal structural units that must be pruned together. Second, a hybrid structured sparse optimizer (e.g., HESSO) identifies redundant PZIGs by formulating a structured sparsity problem. These identified PZIGs are then removed, resulting in a pruned model that maintains the exact same output as the original, thus eliminating the need for post-training fine-tuning.

Quick Start & Requirements

  • Install via pip: pip install only_train_once or clone the repository.
  • Requires PyTorch >= 2.0.
  • Example usage and tutorials are available: tutorials

Highlighted Details

  • Supports CNNs, Diffusion models, and LLMs.
  • Achieves one-shot training and compression without fine-tuning.
  • Offers automatic, architecture-agnostic pruning and erasing operators.
  • Includes a sanity check for compliance on custom DNNs.

Maintenance & Community

The project has migrated to microsoft/only_train_once. This repository is deprecated but maintained for historical purposes. Key publications include OTOv1 (NeurIPS 2021), OTOv2 (ICLR 2023), OTOv3 (preprint), and LoRAShear (LLM pruning, preprint).

Licensing & Compatibility

The repository does not explicitly state a license. However, the migration to microsoft/only_train_once suggests a potential shift to a Microsoft-approved license. Users should verify licensing for commercial or closed-source integration.

Limitations & Caveats

This is a deprecated PyTorch implementation. The official, actively maintained version is at microsoft/only_train_once. Some advanced features like the HESSO optimizer's technical report and official erasing mode are still pending release or under review.

Health Check
Last Commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
1 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Wing Lian Wing Lian(Founder of Axolotl AI), and
2 more.

sparsegpt by IST-DASLab

0.5%
836
Code for massive language model one-shot pruning (ICML 2023 paper)
Created 2 years ago
Updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Wei-Lin Chiang Wei-Lin Chiang(Cofounder of LMArena), and
3 more.

sparseml by neuralmagic

0.1%
2k
Sparsification toolkit for optimized neural networks
Created 4 years ago
Updated 3 months ago
Feedback? Help us improve.