Skip to content

Latest commit

 

History

History
149 lines (109 loc) · 5.45 KB

README.md

File metadata and controls

149 lines (109 loc) · 5.45 KB

FusionBench Project Template

python pytorch lightning hydra black isort

FusionBench is a PyTorch-based comprehensive benchmark/toolkit for deep model fusion. This repository serves as a template for creating new projects based on FusionBench. It includes all the necessary configurations and boilerplate code to get started quickly.

Click on Use this template to initialize new repository.

Introduction

FusionBench Project Template is designed to help researchers and developers quickly set up a new project for deep model fusion using PyTorch and FusionBench. This template provides a well-organized project structure, pre-configured settings, and essential tools to streamline the development process. Key features include:

  • Hydra Configuration: Simplifies the management of complex configurations.
  • PyTorch Lightning: Facilitates the training and evaluation of models.
  • Pre-configured Linters: Ensures code quality with tools like Black and isort.
  • Jupyter Notebooks: Supports interactive development and experimentation.
  • Modular Design: Encourages clean and maintainable code with a clear separation of concerns.

By using this template, you can focus on developing and experimenting with your fusion models without worrying about the initial setup and configuration.

Project Structure

The directory structure of new project looks like this:

├── .github                   <- Github Actions workflows
├── .vscode                   <- VSCode settings
├── config                    <- Hydra configs
│   ├── hydra                    <- Hydra configs
│   ├── fabric                   <- Fabric configs
│   ├── fabric_logger            <- Fabric logger configs
│   ├── method                   <- Method configs
│   ├── modelpool                <- Model pool configs
│   ├── taskpool                 <- Task pool configs
│   │
│   └── main.yaml            <- Main config for training
│
├── notebooks              <- Jupyter notebooks. Here you can place 
|                             some example code and notebooks.
|
├── scripts                <- Shell scripts
│
├── src                    <- Source code
│   ├── data                     <- Data classes
│   ├── models                   <- Model classes
│   ├── method                   <- Method classes
│   ├── modelpool                <- Model pool classes
|   ├── taskpool                 <- Task pool classes
│   └── utils                    <- Utility functions
|
├── tests                  <- Tests of any kind
│
├── .gitignore                <- List of files ignored by git
├── requirements.txt          <- File for installing python dependencies
├── setup.py                  <- File for installing project as a package
└── README.md

Acknowledgement

This template is motivated by Lightning-Hydra-Template.




Note

DELETE EVERYTHING ABOVE FOR YOUR PROJECT


Your Project Name

PyTorch Lightning Config: Hydra Template

Description

What it does

Installation

Pip

# clone project
git clone https://github.com/YourGithubName/your-repo-name
cd your-repo-name

# [OPTIONAL] create conda environment
conda create -n myenv python=3.9
conda activate myenv

# install pytorch according to instructions
# https://pytorch.org/get-started/

# install requirements
pip install -r requirements.txt

Conda

# clone project
git clone https://github.com/YourGithubName/your-repo-name
cd your-repo-name

# create conda environment and install dependencies
conda env create -n myenv python=3.12

# activate conda environment
conda activate myenv

How to run

run my method

fusion_bench \
    --config-path $PWD/config --config-name main \
    # method=...
    # method.option_1=...
    # modelpool=...
    # ...

or

bash scripts/run_experiments.sh