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

[OpenCL] Refactor OpenCL runtime to support SPIRV binary ingestion #14792

Merged
merged 13 commits into from
May 9, 2023

Conversation

masahi
Copy link
Member

@masahi masahi commented May 6, 2023

This is the first step toward supporting Intel XMX (tensorcore equivalent of Intel dGPUs). They expose XMX via spirv, and such spirv modules can be consumed by their OpenCL runtime. It is going to be a long game, since their extension is not even in the spirv toolchain yet. I have the simplest test case of XMX tensorization (m8n8k16 matmul) working using this script but beyond that I've been struggling with strange correctness issues (see intel/intel-graphics-compiler#279).

For now, I'm abusing the existing -device target option to decide when to enable spirv code gen for the opencl target (target = "opencl -device=spirv"). I don't have a strong opinion on this, suggestions welcome.

The next steps are going to be

@echuraev @tqchen @csullivan

@tvm-bot
Copy link
Collaborator

tvm-bot commented May 6, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

Generated by tvm-bot

@masahi masahi changed the title [OpenCL] Refactor OpenCL runtime to support SPIRV binary ingestion. [OpenCL] Refactor OpenCL runtime to support SPIRV binary ingestion May 6, 2023
@masahi masahi force-pushed the opencv-spirv-new branch 2 times, most recently from e321e73 to daaff73 Compare May 7, 2023 21:06
src/runtime/opencl/opencl_module.cc Outdated Show resolved Hide resolved
src/target/source/codegen_opencl.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@echuraev echuraev left a comment

Choose a reason for hiding this comment

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

In general LGTM. Several minor comments.

src/runtime/spirv/spirv_shader.h Outdated Show resolved Hide resolved
src/target/spirv/spirv_utils.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@echuraev echuraev left a comment

Choose a reason for hiding this comment

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

LGTM. Thank you!

@echuraev echuraev merged commit 182de86 into apache:main May 9, 2023
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.

3 participants