Skip to content

Enable dpclang sycl compiler#3287

Open
dvrogozh wants to merge 1 commit intointel:mainfrom
dvrogozh:intel-llvm-2
Open

Enable dpclang sycl compiler#3287
dvrogozh wants to merge 1 commit intointel:mainfrom
dvrogozh:intel-llvm-2

Conversation

@dvrogozh
Copy link
Copy Markdown
Contributor

@dvrogozh dvrogozh commented Apr 8, 2026

dpclang compiler is an open source version of the closed source Intel DPC++ compiler. dpclang is being supported by Intel in the https://github.com/intel/llvm public repository and got recently packaged into upcoming Ubuntu 26.04 LTS.

This commit enables minimal support of dpclang compiler in PyTorch building towards fully open source PyTorch stack on Linux. Limitations:

  • Kineto, XCCL and oneMKL paths were not enabled and might require additional work
  • SYCL-TLA, oneDNN and Pytorch itself might require additional changes to properly handle dpclang compiler as it does not support __INTEL_LLVM_COMPILER macro

We will address above limitations in the follow up patches. At the moment the following procedure can be used to build PyTorch for XPU with dpclang compiler on Ubuntu 26.04:

  • Do NOT activate oneAPI environment
  • Install open source DPC++ compiler, OpenCL and few other tools with:
apt-get install dpclang-6 ocl-icd-opencl-dev pkg-config libze-dev
  • Build PyTorch as follows:
XPU_SYCL_COMPILER=dpclang USE_KINETO=0 USE_ONEMKL_XPU=0 \
  python3 setup.py develop

The dependency from pytorch/pytorch#179763 is weak in a sense that the change is transparent to the current production build of the PyTorch for XPU using oneAPI DL Essentials. The change in torch-xpu-ops is only required for the build with the dpclang.

Needs: pytorch/pytorch#179763

CC: @guangyey @EikanWang @chuanqi129 @frenchwr

`dpclang` compiler is an open source version of the closed source Intel
DPC++ compiler. `dpclang` is being supported by Intel in the https://github.com/intel/llvm
public repository and got recently packaged into upcoming Ubuntu 26.04 LTS.

This commit enables minimal support of `dpclang` compiler in PyTorch building
towards fully open source PyTorch stack on Linux. Limitations:

* Kineto, XCCL and oneMKL paths were not enabled and might require additional work
* SYCL-TLA, oneDNN and Pytorch itself might require additional changes to properly
  handle dpclang compiler as it does not support `__INTEL_LLVM_COMPILER` macro

We will address above limitations in the follow up patches. At the moment
the following procedure can be used to build PyTorch for XPU with `dpclang`
compiler on Ubuntu 26.04:

* Do NOT activate oneAPI environment
* Install open source DPC++ compiler, OpenCL and few other tools with:
```
apt-get install dpclang-6 ocl-icd-opencl-dev pkg-config libze-dev
```
* Build PyTorch as follows:

```
XPU_SYCL_COMPILER=dpclang USE_KINETO=0 USE_ONEMKL_XPU=0 \
  python3 setup.py develop
```

Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
dvrogozh added a commit to dvrogozh/pytorch that referenced this pull request Apr 8, 2026
`dpclang` compiler is an open source version of the closed source Intel
DPC++ compiler. `dpclang` is being supported by Intel in the https://github.com/intel/llvm
public repository and got recently packaged into upcoming Ubuntu 26.04 LTS.

This commit enables minimal support of `dpclang` compiler in PyTorch building
towards fully open source PyTorch stack on Linux. Limitations:

* Kineto, XCCL and oneMKL paths were not enabled and might require additional work
* SYCL-TLA, oneDNN and Pytorch itself might require additional changes to properly
  handle dpclang compiler as it does not support `__INTEL_LLVM_COMPILER` macro

We will address above limitations in the follow up patches. At the moment
the following procedure can be used to build PyTorch for XPU with `dpclang`
compiler on Ubuntu 26.04:

* Do NOT activate oneAPI environment
* Install open source DPC++ compiler, OpenCL and few other tools with:
```
apt-get install dpclang-6 ocl-icd-opencl-dev pkg-config libze-dev
```
* Build PyTorch as follows:

```
XPU_SYCL_COMPILER=dpclang USE_KINETO=0 USE_ONEMKL_XPU=0 \
  python3 setup.py develop
```

The dependency from intel/torch-xpu-ops#3287 is weak in
a sense that the change is transparent to the current production build of the
PyTorch for XPU using oneAPI DL Essentials. The change in torch-xpu-ops is only
required for the build with the `dpclang`.

Needs: intel/torch-xpu-ops#3287
Signed-off-by: Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
@dvrogozh dvrogozh requested review from EikanWang and guangyey April 9, 2026 15:13
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.

1 participant