Giter Site home page Giter Site logo

infobatch's Introduction

InfoBatch

ICLR 2024 Oral | [Paper] | [Code]

InfoBatch is a tool for lossless deep learning training acceleration. It achieves lossless training speed-up by unbiased dynamic data pruning.

image

News

[2024/1/17] ๐Ÿ”ฅ New version with only 3 lines of change comes! Note that one should use a per-sample loss (to update the score and calculate batch loss)

[2024/1/16] ๐Ÿ”ฅ Our work got accepted to ICLR 2024 (oral)! A new version with only 3 lines of change will be updated soon. Experiments included in the paper (and beyond) will be gradually updated with detail.

[2023/8/1] ๐Ÿ”ฅ InfoBatch can now losslessly save 40.9% on CIFAR100 and ImageNet. We are updating paper content and preparing for public code.

TODO List

  • Plug-and-Play Implementation of InfoBatch
  • PyPI Registration
  • Experiment: Classification on Cifar
  • Experiment: Classification on ImageNet
  • Experiment: Segmentation
  • Experiment: Diffusion
  • Experiment: Instruction Finetuning
  • Experiment: Detection (YOLOv8) on COCO
  • Paper: Updated on Openreview

Contents

Install

Install InfoBatch via

pip install git+https://github.com/NUS-HPC-AI-Lab/InfoBatch

Or you can clone this repo and install it locally.

git clone https://github.com/NUS-HPC-AI-Lab/InfoBatch
cd InfoBatch
pip install -e .

Get Started

To adapt your code with InfoBatch, just download and import InfoBatch, and change the following three lines:

image

Note that one should use a per-sample loss to update the score and calculate batch loss; if the learning rate scheduler is epoch-based, adjust its steps accordingly at beginning of each epoch.

For research studies and more flexible codes, you can refer to the code in research.

Experiments

Cifar

To run the CIFAR-100 example with baseline, run with delta=0:

python3 examples/cifar_example.py \
  --model r50 --optimizer lars --max-lr 5.2 --delta 0.0

To run the CIFAR-100 example with InfoBatch, run the following:

python3 examples/cifar_example.py \
  --model r50 --optimizer lars --max-lr 5.2 --delta 0.875 --ratio 0.5 --use_info_batch

Our example also supports mixed precision training and distributed data parallelism with the following command:

CUDA_VISIBLE_DEVICES=0,1 python3 -m torch.distributed.launch --use_env --nnodes=1 --nproc_per_node=2 \
  --master_addr=127.0.0.1 --master_port=23456 --node_rank=0 cifar_example.py \
  --use_ddp --use_info_batch --fp16 \
  --model r50 --optimizer lars --max-lr 5.2 --delta 0.875 --ratio 0.5

You may observe a performance drop when using the Distributed Data-Parallel (DDP) training approach compared to the Data Parallel (DP) approach on multiple GPUs, especially in versions prior to Pytorch 1.11. However, this is not specific to our algorithm itself.

Citation

@inproceedings{
  qin2024infobatch,
  title={InfoBatch: Lossless Training Speed Up by Unbiased Dynamic Data Pruning},
  author={Qin, Ziheng and Wang, Kai and Zheng, Zangwei and Gu, Jianyang and Peng, Xiangyu and Zhaopan Xu and Zhou, Daquan and Lei Shang and Baigui Sun and Xuansong Xie and You, Yang},
  booktitle={The Twelfth International Conference on Learning Representations},
  year={2024},
  url={https://openreview.net/forum?id=C61sk5LsK6}
}

infobatch's People

Contributors

henryqin1997 avatar tiandunx avatar zhengzangw avatar kaiwang960112 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.