Skip to content

Mingxue-Xu/TransformerCompression

 
 

Repository files navigation

Transformer Compression with SliceGPT

Customized repo forked from TransformerCompression of the paper SliceGPT (ICLR'24).

Python Environment

$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt

Configurations (aka args)

Set argparse.Namespace with the local configuration file rather than the bash shell as the original repo did . To set the experiment arguments, edit the desired configurations (args) in configs/*.yaml. The configurations setting rules for different purposes are as follows:

Slicing

Leave model-path and sliced-model-path blank and fill model with the model name in huggingface.

Additional models supports on the top of Supported models:

Evaluating language task performance

Perplexity

Supported datasets: wikitext2, ptb, alpaca.

1. Unsliced

The same args as slicing, except for setting model-path the same as model. Then in experiments/run_slicegpt.py:

kwargs = prepare_slicing(slicing_args)
slicing_main(slicing_args, kwargs)
2. Sliced

Except for the args of unsliced setting, set sliced-model-path with the local path that stores the sliced model.

prepare_slicing(slicing_args)

Others

TBC.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.7%
  • Shell 0.3%