-
Notifications
You must be signed in to change notification settings - Fork 44
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
[PoC] Use SYCL runtime wheel instead of PTDB and g++ or clang instead of dpc++ to compile the kernel launcher #1717
Comments
From what I've experienced - https://pypi.org/project/intel-sycl-rt/ is the same package as used in conda https://anaconda.org/conda-forge/intel-sycl-rt with the exception we need to set some environment variables to find libraries within python environment. In fact I was able to create POC dockerfile with support of https://github.com/IntelPython/dpctl and https://github.com/IntelPython/numba-dpex |
The only thing that we need to ask release team to publish 2024.1.4 release of this package (the same that used in PTDB I guess) |
There are multiple rt package to fit different purposes here listed here: https://github.com/conda-forge/intel-compiler-repack-feedstock/blob/main/recipe/meta.yaml and there should be corresponding package on pypi. We just need to ask release team to keep pypi in sync. |
So, I was able to create triton runtime environment without PTDB/Oneapi toolkit: SummaryI've used PTDB 0.5.2.18 to build upstream pytorch (main branch) and intel's triton (llvm-target branch) with some patches. I also did repack of Environment setuppython3.9 -m venv ./.venv
source ./.venv/bin/activate
pip install --upgrade pip
pip install ./intel_sycl_rt-2024.1.2-py2.py3-none-manylinux1_x86_64.whl ./torch-2.5.0a0+git7f58740-cp39-cp39-linux_x86_64.whl ./triton-3.0.0-cp39-cp39-linux_x86_64.whl
pip install dpcpp_cpp_rt==2024.1.2 numpy matplotlib pandas
sed -i "s/\/opt\/anaconda1anaconda2anaconda3/$(print ${VIRTUAL_ENV} | sed 's/\//\\\//g')/g" $VIRTUAL_ENV/etc/OpenCL/vendors/*
rm -rf ~/.triton
export LIBRARY_PATH=$LIBRARY_PATH:$VIRTUAL_ENV/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$VIRTUAL_ENV/lib
export CPATH=$CPATH:$VIRTUAL_ENV/include/sycl
mkdir -p $VIRTUAL_ENV/lib/python3.9/site-packages/intel_extension_for_pytorch Now you can run tutorial by (will use clang++):
Or with g++
Building wheelsPytorchVersion: upstream main branch
Build options: static mkl linking TritonVersion: upstream intel's triton
Patched sycl runtimeVersion: 2024.1.2 wget https://files.pythonhosted.org/packages/cc/1e/d74e608f0c040e4f72dbfcd3b183f39570f054d08de39cc431f153220d90/intel_sycl_rt-2024.1.2-py2.py3-none-manylinux1_x86_64.whl
wheel unpack intel_sycl_rt-2024.1.2-py2.py3-none-manylinux1_x86_64.whl
mkdir -p ./intel_sycl_rt-2024.1.2/intel_sycl_rt-2024.1.2.data/data/include
cp -r /opt/intel/oneapi/compiler/2024.1/include/sycl ./intel_sycl_rt-2024.*/intel_sycl_rt-2024.*.data/data/include/
wheel pack intel_sycl_rt-2024.1.2 --build headers_patch |
UPD: with #1857 you only need |
I wonder where |
You need to build it. I guess intel triton's nightly builds will work too. |
I see that |
how did you overcome this? |
I've just copied a new file on the top of the original file. I wonder if it is possible to keep a name with |
I have most test passed locally with this approach (though I've modified it a bit). The next step is to make it work in CI.
|
@leshikus thank you for confirming. As far as I see, it is pretty much the same with the difference:
|
yes, there are differences; both conda and venv are used; I'm testing PR right now; #2000
|
@vlad-penkin what do you think about our strategic direction, should it be conda, venv or both? Or none |
@leshikus these are probably just pip packages, according to the pytorch build script:
It might also be necessary to use: |
Add support to https://pypi.org/project/intel-sycl-rt/ wheel package that is described #1717 --------- Signed-off-by: Anatoly Myachev <[email protected]> Co-authored-by: Anatoly Myachev <[email protected]>
Add support to https://pypi.org/project/intel-sycl-rt/ wheel package that is described intel#1717 --------- Signed-off-by: Anatoly Myachev <[email protected]> Co-authored-by: Anatoly Myachev <[email protected]>
Expected results:
The text was updated successfully, but these errors were encountered: