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

[BYOC] Enable bfloat16 in DNNL BYOC #11111

Merged
merged 18 commits into from
May 26, 2022
Merged

Conversation

yangulei
Copy link
Contributor

Enable bfloat16 in DNNL BYOC following the path:

[float32 graph] --> <AMP> --> [bfloat16 graph] --> <BYOC> --> [TVM + oneDNN module]

Main work include:

  • Enable more data types in DNNL json runtime (only bfloat16 has been tested so far).
  • Consider dtype while querying optimal DNNL layout.
  • Add tests for bf16 DNNL BYOC.

With those improvements, a float32 graph could be converted to bfloat16 through AMP, and then be lowered by native codegen or consumed by oneDNN and finally inference in bfloat16 mode now.

@yangulei yangulei force-pushed the upstream_byoc_bf16 branch from be5f228 to e2fcfd1 Compare April 26, 2022 02:53
@yangulei yangulei force-pushed the upstream_byoc_bf16 branch 4 times, most recently from 41e9720 to 4caede4 Compare May 26, 2022 00:38
@yangulei
Copy link
Contributor Author

yangulei commented May 26, 2022

Relative modifications since the original PR:

All the CI checks have passed now, what a long journey.
@masahi Could you please help to review this PR, thanks.

@@ -37,6 +37,8 @@
ids=["compile", "run"],
)

bf16_supported = "avx512" in open("/proc/cpuinfo", "r").read()
Copy link
Member

Choose a reason for hiding this comment

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

Probably need more precise detection, but ok.

@masahi masahi merged commit 8135860 into apache:main May 26, 2022
@masahi
Copy link
Member

masahi commented May 26, 2022

cc @AndrewZhaoLuo this is cool (the first e2e run of AMP + bf16!!)

@yangulei
Copy link
Contributor Author

Thanks a lot.
We are working on the e2e performance optimization in DNNL-BYOC 😄

liaopeiyuan added a commit to zk-ml/tachikoma that referenced this pull request Sep 14, 2022
for simplicity in DNNL run-time; we need to remove TR, and maybe move to apache#11111
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.

2 participants