Skip to content

intel/intel-xpu-backend-for-triton

Repository files navigation

Intel® XPU Backend for Triton*

This is the development repository of Intel® XPU Backend for Triton*, a new OpenAI Triton backend for Intel GPUs. Triton is a language and compiler for writing highly efficient custom deep learning primitives. The aim of Triton is to provide an open-source environment to write fast code at higher productivity than CUDA, but also with higher flexibility than other existing DSLs. Intel® XPU Backend for Triton* is a module used by Triton to provide a reasonable tradeoff between performance and productivity on Intel GPUs.

Setup Guide

Intel® XPU Backend for Triton* serves as a backend for OpenAI Triton. One should build from the Triton repo, instead of building from intel-xpu-backend-for-triton.

Prerequisites

Intel® XPU Backend for Triton* requires PyTorch for building, and Intel® Extension for PyTorch* for running kernels on XPU.

Please follow installation guide for Intel® Extension for PyTorch* for the detailed process and make sure the associated driver and Intel® oneAPI Base Toolkit are installed correctly.

Note that these two should be built from the source for now.

Build Intel GPUs backend

# Clone OpenAI/Triton
git clone https://github.com/openai/triton.git
cd triton
# Clone submodules
git submodule sync && git submodule update --init --recursive --jobs 0

Since we are at the active development stage, it is recommended to check to latest commit for intel-xpu-backend-for-triton:

cd third_party/intel_xpu_backend
git checkout main && git pull

Now Build Triton with Intel XPU backend enabled:

cd {triton-root-dir}
cd python
TRITON_CODEGEN_INTEL_XPU_BACKEND=1 python setup.py develop

If you encountered any problem, please refer to the wiki first.

Usage Guide

Please refer to the HowToRun.md for more information.

Known Limitations

For known limitations, please refer to the wiki page for known limitations.

Contributing

It is a warm welcome for any contributions from the community, please refer to the contribution guidelines and code of conduct.

License

MIT License. As found in LICENSE file.

Security

See Intel's Security Center for information on how to report a potential security issue or vulnerability.

See also: Security Policy