OpenBMB / OpenBMB/BMCook

int8量化感知训练,保存的模型依然是fp32

Open
#27 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
172
Forks
26
PR merge metrics
No merged PRs in 30d

Description

通过BMCook进行模型压缩,配置了quantization和distillation,训练的loss收敛的很好。但是保存模型的时候,发现保存的checkpoint文件并没有减少,分析发现线性层的参数还是fp32的。
另外bmtrain的优化器AdamOffloadOptimizer和AdamOptimizer也只支持参数保存为fp32和fp16,并没有实现参数保存为int8。

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 by reproducing the reported BMCook quantization and distillation configuration, then inspect how checkpoints serialize linear-layer parameters. Review the bmtrain AdamOffloadOptimizer and AdamOptimizer save paths mentioned in the issue. Done means the saved model and optimizer parameters use the intended int8 representation and the checkpoint size reflects that change.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.