https://github.com/ds2-lab/elf
Everything You Always Wanted to Know About Storage Compressibility of Pre-Trained ML Models but Were Afraid to Ask (VLDB'24)
https://github.com/ds2-lab/elf
Last synced: about 1 year ago
JSON representation
Everything You Always Wanted to Know About Storage Compressibility of Pre-Trained ML Models but Were Afraid to Ask (VLDB'24)
- Host: GitHub
- URL: https://github.com/ds2-lab/elf
- Owner: ds2-lab
- License: mit
- Created: 2024-04-18T05:58:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-19T21:27:49.000Z (about 2 years ago)
- Last Synced: 2025-03-29T03:32:02.385Z (about 1 year ago)
- Language: Python
- Size: 58.6 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ELF
ELF (Exponent-Less Float-point encoding) is a simple yet effective, near-lossless floating-point compression method, that transforms floating-point parameters within pre-trained models (PTMs) in such a way that the common exponent field of the transformed parameters can be completely eliminated to save storage space. ELF is embarrassingly parallel via data parallelism, achieving an extreme compression & decompression speed.
We also developed ELVES, a compression framework integrating ELF and several other data reduction methods. ELVES uses the most effective method to compress PTMs that exhibit different patterns.
## Publication
Everything You Always Wanted to Know About Storage Compressibility of Pre-Trained ML Models but Were Afraid to Ask (VLDB'24 to appear).
The preprint of our VLDB'24 paper can be viewed at: https://arxiv.org/abs/2402.13429.
This branch contains the source code of ELF & ELVES.
## ELF Build
Package Installation
```bash
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y gcc g++ libeigen3-dev make python3-pip
```
Build ELF and DE
```bash
mkdir build
make
```
## ELVES Compression Examples
Package Installation
```
pip3 install -r requirements.txt
```
Run the Example
```
cd ELVES
python3 main.py
```
## ELF Usage
```
./build/elf_pthread -c -i ELVES/model_compressed/elves_compression/distilbert-base-cased/fl_weights/f32_65783040.bin -p f32 -o ELVES/model_compressed/elves_compression/distilbert-base-cased/exponential_dedup/f32/ -n 65783040
```
### Parameter Explanation
| Parameter | Explanation |
|:----------|:----------|
| -i | input binary file |
| -p | parameter type: f16 for floating 16, f32 for floating 32, f64 for floating 64 |
| -n | parameter number |
| -c | compression |
| -d | decompression |
| -o | output folder specified |