deepspeedai / deepspeedai/DeepSpeed

ZeroQuant not compressing and making BERT slower

Open
#2,239 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

Describe the bug
I was expecting a compressed & faster BERT model after running the BERT ZeroQuant example in DeepSpeedExamples. However, the clean model isn't any smaller (still 417.7 MB) or faster (in fact, it's slower) than the original.

To Reproduce

  1. Go to Google Colab and change to GPU runtime
  2. Run the following:
    pip install deepspeed==0.7.0
    git clone https://github.com/microsoft/DeepSpeedExamples
    cd DeepSpeedExamples/model_compression/bert
    (In the zero_quant.sh file, change master_port (e.g. to 9995) and task to sst2 & eval_batch_size to 32 (otherwise you'll get CUDA out of memory))
    bash bash_script/ZeroQuant/zero_quant.sh

Expected behavior
I expected the final clean model to be a compressed version of the original one, thus being smaller & faster but it isn't.

ds_report output
image

System info (please complete the following information):

  • OS: Ubuntu 18.04.6 LTS
  • 1 Tesla T4 GPU
  • Tried with both 3.7.13 and 3.9

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with DeepSpeedExamples/model_compression/bert/bash_script/ZeroQuant/zero_quant.sh and reproduce the command with the stated BERT, SST-2, batch-size, and GPU settings. Compare the original and final clean model sizes and inference speed, then trace the example's compression and evaluation steps. Done means identifying why compression is absent or slower and confirming the corrected behavior with the example.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.