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

[GPU] Fp8 compute backports #2266

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

kealan-barbieri
Copy link
Contributor

@kealan-barbieri kealan-barbieri commented Dec 13, 2024

Description

Backport of mixed fp8 support, additional scale support for compute primitivies.

Checklist

General

  • Do all unit and benchdnn tests (make test and make test_benchdnn_*) pass locally for each commit?
  • Have you formatted the code using clang-format?

@kealan-barbieri kealan-barbieri added platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel backport labels Dec 13, 2024
@kealan-barbieri kealan-barbieri requested review from a team as code owners December 13, 2024 17:46
@github-actions github-actions bot removed the backport label Dec 13, 2024
&& utils::one_of(mask_wei, 0, with_groups ? 3 : 1),
VCHECK_CONV_UNIMPL(utils::one_of(mask_wei, 0, with_groups ? 3 : 1)
&& utils::one_of(mask_dst, 0, 2)
&& utils::one_of(mask_src, 0, 3),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, please, clarify why mask=3 for src but mask=2 for dst?

| smask_t::zero_points_runtime_data_type
| smask_t::scales_runtime_groups
| smask_t::scales_runtime_data_type;

if (engine->kind() == engine_kind::gpu)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here and below seems duplicated. Could you, please, consolidate it?

src/common/matmul.cpp Outdated Show resolved Hide resolved
src/common/matmul.cpp Outdated Show resolved Hide resolved
src/common/matmul_pd.hpp Outdated Show resolved Hide resolved
src/common/matmul_pd.hpp Outdated Show resolved Hide resolved
@@ -195,7 +207,13 @@ struct matmul_pd_t : public primitive_desc_t {
sc.group_dims_[0] == 1
&& K() % sc.group_dims_[1] == 0);
} else {
ok = ok && (mask == 0);
ok = ok
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here must be a check for fp8 versus classic quantization.

tests/benchdnn/inputs/matmul/option_set_fp8_mixed Outdated Show resolved Hide resolved
tests/benchdnn/inputs/matmul/option_set_fp8_mixed Outdated Show resolved Hide resolved
@@ -185,7 +185,7 @@ struct base_cfg_t {
}
const int64_t safe_digits = get_safe_digits();
const int64_t safe_n_acc = (1LL << safe_digits) / max_value;
return safe_n_acc;
return std::max((int64_t)1L, safe_n_acc);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Returning safe_n_acc = 0 is intentional here, it says that input values are not reasonable. When it happened it returned zero?

@kealan-barbieri kealan-barbieri force-pushed the kealanba/compute_backports branch from ded32f2 to 8aa5c64 Compare December 13, 2024 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:gpu-intel Codeowner: @oneapi-src/onednn-gpu-intel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants