Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FP8 PTQ With Physical Dependency 0515 #64333

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

YZW-explorer
Copy link

@YZW-explorer YZW-explorer commented May 15, 2024

PR Category

Execute Infrastructure

PR Types

New features

Description

添加适配fp8的量化反量化层,代码体现在python/paddle/nn/quant/fp8format.py中以及python/paddle/quantization/init.py中
添加调用fp8量化反量化的ptq逻辑,代码体现在python/paddle/quantization/fp8ptq.py python/paddle/quantization/fp8quantize.py
Paddle库设计逻辑:
python/paddle/nn/quant/fp8format.py
定义FP8ConvertibleQuantedLayer、FP8LinearQuanterDequanter、FP8LinearQuanter、FP8LinearDequanter用以根据在PaddleSlim中新定义的FP8UniformObserver统计的abs_max和fp8的取值范围计算出的scale执行量化和反量化运算。
python/paddle/quantization/fp8quantize.py
定义FP8QuantedLinear该类继承自FP8ConvertibleQuantedLayer,用以在执行_convert_to_quant_layers函数的时候将普通的Linear替换,定义FP8Quantization用以对接只属于FP8量化的逻辑
python/paddle/quantization/fp8ptq.py
定义FP8PTQ该类继承自FP8Quantization,用以暴露给PaddleNLP中定义的llm/fp8quant.py执行FP8 PTQ逻辑
python/paddle/quantization/init.py
将FP8PTQ添加到__init__中方便外部调用

Copy link

paddle-bot bot commented May 15, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label May 15, 2024
Copy link

paddle-ci-bot bot commented May 24, 2024

Sorry to inform you that 3bb1c63's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant