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

graph: backend: dnnl: enhance fp8 matmul patterns #2316

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

Conversation

wzt1997
Copy link
Contributor

@wzt1997 wzt1997 commented Dec 26, 2024

Description

Enhance support for fp8 MatMul patterns in oneDNN Graph.

  • Support more fp8 MatMul patterns.
  • Add more test cases in benchdnn graph.

@wzt1997 wzt1997 added the component:graph-api Codeowner: @oneapi-src/onednn-graph label Dec 26, 2024
@wzt1997 wzt1997 self-assigned this Dec 26, 2024
@wzt1997 wzt1997 requested review from a team as code owners December 26, 2024 05:45
@github-actions github-actions bot added the component:tests Codeowner: @oneapi-src/onednn-arch label Dec 26, 2024
@@ -0,0 +1,365 @@
{
"version": "3.0.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

please update the json with the latest version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reminding. Have fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@wzt1997 changing the version number only is not enough. Some new fields are still missing in this json file: fpmath_mode_apply_to_int, input_ports, output_ports, etc. It's confusing that a json file with version = 3.7.0 but without these fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I partly agree with you. For input_ports and output_ports, I agree we should align them in the test cases( although it seems they are ignored and do not affect the testing currently ).
But, for other fields such as fpmath_mode_apply_to_int, according to the semantic, it only affects integral inputs, hence it does not have to appear here.

Copy link
Contributor

@TaoLv TaoLv Jan 2, 2025

Choose a reason for hiding this comment

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

We don't have other reliable ways to generate graph json files except dumping them from the library. If this one is dumped with v3.7 (as suggested by the version number), it should contain these fields, no matter if they take effect or not.

according to the semantic, it only affects integral inputs, hence it does not have to appear here.

Actually, that's what we want to test: users will always dump json file with fpmath_mode_apply_to_int in it and tests it with benchdnn. Benchnn + library should work properly when the field is provided in the json file.

Copy link
Contributor Author

@wzt1997 wzt1997 Jan 2, 2025

Choose a reason for hiding this comment

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

OK. I've updated the test case. Also it's found that there are many other test case with version=3.7.0 do not match the requirement, such as the single dynamic dequantize and gated-mlp. If necessary, we may need to enhance them with dumped json files as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

The gated-mlp case was added before fpmath_mode_apply_to_int was introduced into the library. I would not insist on upgrading all legacy cases to the latest version of the library. Instead, I suggest when a new case is being added, it should comply with the latest version of the library.

@wzt1997 wzt1997 force-pushed the zhitao/graph-enhance-f8-matmul branch from b4c9269 to 59e5f36 Compare December 26, 2024 08:59
@wzt1997 wzt1997 force-pushed the zhitao/graph-enhance-f8-matmul branch 4 times, most recently from b24ddda to 8db9e19 Compare January 3, 2025 01:43
@wzt1997 wzt1997 force-pushed the zhitao/graph-enhance-f8-matmul branch from 8db9e19 to bed46bd Compare January 3, 2025 06:43
@wzt1997
Copy link
Contributor Author

wzt1997 commented Jan 3, 2025

make test
enable benchdnn_nightly
disable benchdnn_all
enable benchdnn_graph

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:graph-api Codeowner: @oneapi-src/onednn-graph component:tests Codeowner: @oneapi-src/onednn-arch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants