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

[Opset13][FP8] FakeConvert evaluate and reference impl #21034

Merged
merged 62 commits into from
Nov 24, 2023

Conversation

mitruska
Copy link
Contributor

@mitruska mitruska commented Nov 13, 2023

Details:

Based on: POC by @andreyanufr

  • Enabled types: fp32, fp16, bf16
  • Created reference function and moved the code from the op class and evaluate
  • Updated Evaluate approach
  • destination_type as string is a temp solution, can be updated to ov::element_type when possible
  • Added tests

The following mapping for the POC names can be applied:

  • f8e4m3 -> "HF8" -> convertfp16_hf8_bias7
  • f8e5m2 -> "BF8" -> convertfp16_bf8
  • Usage of simple loop for single element scale and per channel scale (aligned with POC),
    added usage of autobroadcast_select to enable other numpy broadcast cases.

Follow ups TO DO:

  • More tests for data/scale/shift different shapes
  • Tests refactor (Move the tests from eval to template tests)

Spec PR:

Tickets:

  • 119976

@github-actions github-actions bot added category: Core OpenVINO Core (aka ngraph) category: IE Tests OpenVINO Test: plugins and common category: CPP API OpenVINO CPP API bindings labels Nov 13, 2023
@mitruska mitruska added the WIP work in progress label Nov 13, 2023
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Outdated Show resolved Hide resolved
src/core/src/op/fake_convert.cpp Show resolved Hide resolved
src/core/reference/src/op/fake_convert.cpp Show resolved Hide resolved
@mitruska mitruska merged commit 63e7e2d into openvinotoolkit:master Nov 24, 2023
nikita-malininn added a commit to openvinotoolkit/nncf that referenced this pull request Dec 15, 2023
### Changes

- Added FP8 implementation
- Added `Mode` parameter

### Reason for changes

- New FP8 implementation

### Related tickets

- 119805

### Tests

- `tests/openvino/native/quantization/test_graphs.py`
- `tests/openvino/native/test_model_transformer.py`

On top of openvinotoolkit/openvino#21034 -
**Merged**
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Core OpenVINO Core (aka ngraph) category: CPP API OpenVINO CPP API bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants