neural-compressor icon indicating copy to clipboard operation
neural-compressor copied to clipboard

Support `auto_round` integration 3.x

Open Kaihui-intel opened this issue 1 year ago • 3 comments

Type of Change

feature

Description

  • [x] update config params
  • [x] update get_autoround_default_run_fn
  • [x] update prepare/convert
  • [x] return paking model
  • [x] enhance ut
  • [x] support lm_head
  • [ ] pre-ci version

Expected Behavior & Potential Risk

the expected behavior that triggered by this PR

How has this PR been tested?

how to reproduce the test (including hardware information)

Dependency Change?

any library dependency introduced or removed

Kaihui-intel avatar May 22 '24 07:05 Kaihui-intel

⛈️ Required checks status: Has failure 🔴

Warning If you do not have the access to re-run the Probot, please contact XuehaoSun for help. If you push a new commit, all of the workflow will be re-triggered.

Groups summary

🟢 Code Scan Tests workflow
Check ID Status Error details
Code-Scan success
Code-Scan (Bandit Code Scan Bandit) success
Code-Scan (DocStyle Code Scan DocStyle) success
Code-Scan (Pylint Code Scan Pylint) success

These checks are required after the changes to neural_compressor/torch/algorithms/weight_only/autoround.py, neural_compressor/torch/algorithms/weight_only/utility.py, neural_compressor/torch/quantization/algorithm_entry.py, neural_compressor/torch/quantization/config.py, neural_compressor/torch/utils/environ.py.

🟢 Model Tests 3x workflow
Check ID Status Error details
Model-Test-3x success
Model-Test-3x (Generate Report GenerateReport) success
Model-Test-3x (Run PyTorch Model opt_125m_woq_gptq_int4) success
Model-Test-3x (Run PyTorch Model opt_125m_woq_gptq_int4_dq_bnb) success
Model-Test-3x (Run PyTorch Model opt_125m_woq_gptq_int4_dq_ggml) success

These checks are required after the changes to neural_compressor/torch/algorithms/weight_only/autoround.py, neural_compressor/torch/algorithms/weight_only/utility.py, neural_compressor/torch/quantization/algorithm_entry.py, neural_compressor/torch/quantization/config.py, neural_compressor/torch/utils/environ.py.

🔴 Unit Tests basic workflow
Check ID Status Error details
UT-Basic failure
UT-Basic (Coverage Compare CollectDatafiles) no_status
UT-Basic (Unit Test FWKs adaptor Test FWKs adaptor) success
UT-Basic (Unit Test FWKs adaptor baseline Test FWKs adaptor baseline) success
UT-Basic (Unit Test ITEX Test ITEX) success
UT-Basic (Unit Test ITEX baseline Test ITEX baseline) success
UT-Basic (Unit Test Pruning Test PyTorch Pruning) success
UT-Basic (Unit Test Pruning Test TensorFlow Pruning) success
UT-Basic (Unit Test Pruning baseline Test PyTorch Pruning baseline) success
UT-Basic (Unit Test Pruning baseline Test TensorFlow Pruning baseline) failure download
UT-Basic (Unit Test TF newAPI Test TF newAPI) success
UT-Basic (Unit Test TF newAPI baseline Test TF newAPI baseline) success
UT-Basic (Unit Test User facing API Test User facing API) success
UT-Basic (Unit Test User facing API baseline Test User facing API baseline) success
UT-Basic (Unit Test other basic case Test other basic case) success
UT-Basic (Unit Test other cases baseline Test other cases baseline) success

These checks are required after the changes to .azure-pipelines/scripts/ut/env_setup.sh.

🟢 Unit Tests basic no coverage workflow
Check ID Status Error details
UT-Basic-No-Coverage success
UT-Basic-No-Coverage (Unit Test FWKs adaptor Test FWKs adaptor) success
UT-Basic-No-Coverage (Unit Test Pruning Test PyTorch Pruning) success
UT-Basic-No-Coverage (Unit Test Pruning Test TensorFlow Pruning) success
UT-Basic-No-Coverage (Unit Test User facing API Test User facing API) success
UT-Basic-No-Coverage (Unit Test other basic case Test other basic case) success

These checks are required after the changes to .azure-pipelines/scripts/ut/env_setup.sh.

🔴 Unit Tests 3x-PyTorch workflow
Check ID Status Error details
UT-3x-Torch failure
UT-3x-Torch (Coverage Compare CollectDatafiles) no_status
UT-3x-Torch (Unit Test 3x Torch Unit Test 3x Torch) success
UT-3x-Torch (Unit Test 3x Torch baseline Unit Test 3x Torch baseline) failure download

These checks are required after the changes to neural_compressor/torch/algorithms/weight_only/autoround.py, neural_compressor/torch/algorithms/weight_only/utility.py, neural_compressor/torch/quantization/algorithm_entry.py, neural_compressor/torch/quantization/config.py, neural_compressor/torch/utils/environ.py, test/3x/torch/quantization/weight_only/test_autoround.py.


Thank you for your contribution! 💜

Note This comment is automatically generated and will be updates every 180 seconds within the next 6 hours. If you have any other questions, contact chensuyue or XuehaoSun for help.

github-actions[bot] avatar May 22 '24 07:05 github-actions[bot]

Can we 1) create an InputCaptureModule during the prepare stage and 2) initialize an original AutoRound at the convert stage, receiving a) the original model and b) the data captured by the InputCaptureModule as a dataset?

Thanks, synced offline with yi&xin, now we have adopted this suggestion. https://github.com/intel/neural-compressor/pull/1810/commits/8b549224a7ad52359c1727edad0cdb54b806daf1

Kaihui-intel avatar May 24 '24 03:05 Kaihui-intel

Aligned workflow for AutoRound in INC.

Perpare

  1. Replace model with new forward to collect data for model inference

Calibration

calibration(model) # user provided

Convert

  1. Re-build dataloader or customized dataloader used in calibration(model)
  2. Pass dataloader and configuration to AutoRound

xin3he avatar May 24 '24 08:05 xin3he