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

support fp8 cast WOQ #1746

Merged
merged 5 commits into from
Apr 26, 2024
Merged

support fp8 cast WOQ #1746

merged 5 commits into from
Apr 26, 2024

Conversation

xin3he
Copy link
Contributor

@xin3he xin3he commented Apr 24, 2024

Type of Change

feature

Description

https://jira.devtools.intel.com/browse/ILITV-3505
support fp8 cast WOQ using official PyTorch >= 2.2

Expected Behavior & Potential Risk

Torch supports 4 fp8 dtypes as shown below. In INC, we use short strings for mapping.

FP8_MAPPING = {
    "fp8_e5m2": torch.float8_e5m2,
    "fp8_e5m2fnuz": torch.float8_e5m2fnuz,
    "fp8_e4m3fn": torch.float8_e4m3fn,
    "fp8_e4m3fnuz": torch.float8_e4m3fnuz,
}

An introduction to the differences between FP8 data types:
Float8E4M3FN, Float8E4M3FNUZ, Float8E5M2, Float8E5M2FNUZ
stablehlo/rfcs/20230321-fp8_fnuz.md at main · openxla/stablehlo (github.com)

How has this PR been tested?

local test

Signed-off-by: xin3he <xin3.he@intel.com>
Signed-off-by: xin3he <xin3.he@intel.com>
@xin3he xin3he marked this pull request as draft April 24, 2024 06:03
Copy link

github-actions bot commented Apr 24, 2024

⚡ Required checks status: All passing 🟢

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/rtn.py, neural_compressor/torch/algorithms/weight_only/utility.py, neural_compressor/torch/quantization/config.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/rtn.py, neural_compressor/torch/algorithms/weight_only/utility.py, neural_compressor/torch/quantization/config.py.

🟢 Unit Tests 3x-PyTorch workflow
Check ID Status Error details
UT-3x-Torch success
UT-3x-Torch (Coverage Compare CollectDatafiles) success
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) success

These checks are required after the changes to neural_compressor/torch/algorithms/weight_only/rtn.py, neural_compressor/torch/algorithms/weight_only/utility.py, neural_compressor/torch/quantization/config.py, test/3x/torch/quantization/weight_only/test_rtn.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.

Signed-off-by: xin3he <xin3.he@intel.com>
@xin3he xin3he marked this pull request as ready for review April 24, 2024 07:10
@chensuyue chensuyue merged commit 57ed613 into master Apr 26, 2024
26 of 27 checks passed
@chensuyue chensuyue deleted the xinhe/woq_fp8 branch April 26, 2024 06:07
zehao-intel pushed a commit that referenced this pull request Apr 26, 2024
Signed-off-by: xin3he <xin3.he@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants