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

[XPU][LLVMIR] Generate opencl.kernels named metadata #2923

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

victor-eds
Copy link
Contributor

When converting tt.func to llvm.func, attach a triton_gen.opencl_kernels attribute to be handled during translation to LLVM IR. Then, add an opencl.kernels named metadata with MDNodes referencing kernel functions in the module.

Closes #2869

When converting `tt.func` to `llvm.func`, attach a
`triton_gen.opencl_kernels` attribute to be handled during translation
to LLVM IR. Then, add an `opencl.kernels` named metadata with
`MDNodes` referencing kernel functions in the module.

Signed-off-by: Victor Perez <victor.perez@codeplay.com>
@victor-eds victor-eds requested review from whitneywhtsang, etiotto and a team December 4, 2024 11:34
@victor-eds victor-eds self-assigned this Dec 4, 2024
@victor-eds
Copy link
Contributor Author

Running https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/12160033320/job/33911430010 for integration with #2845 and measuring performance impact of both PRs combined.

@whitneywhtsang
Copy link
Contributor

@victor-eds
Copy link
Contributor Author

@victor-eds
Copy link
Contributor Author

IGC compilation breaks only for given sub-group size-local size combination (16, 64). I'll fill a ticket in for that.

@victor-eds
Copy link
Contributor Author

Will hold this PR till IGC gets a fix.

@victor-eds victor-eds marked this pull request as draft December 4, 2024 15:04
handleTritonGenOpenCLKernelsAttr(Operation *op,
LLVM::ModuleTranslation &moduleTranslation) {
auto mlirFunc = dyn_cast<LLVM::LLVMFuncOp>(op);
if (!mlirFunc)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also make sure the function is a kernel (with isKernel(op)) ?

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'll look into that when I get back to this.

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.

Attach opencl.kernels metadata
3 participants