Skip to content

Commit

Permalink
Support compatibility with lower version compilers (#1308)
Browse files Browse the repository at this point in the history
Device code compression is a feature that is only available in compiler
2025.0.1 and above. It is not available in lower versions. Compatibility
with lower versions is required.
  • Loading branch information
chunhuanMeng authored Jan 23, 2025
1 parent c249df9 commit c04452f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/_windows_ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ jobs:
call conda install -y libuv
call conda install -y rust
git config --system core.longpaths true
git config --global core.symlinks true
git config --global core.fsmonitor false
powershell -Command "Set-ItemProperty -Path "HKLM:\\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1"
git status
git show -s
git submodule sync && git submodule update --init --recursive
Expand Down Expand Up @@ -106,7 +109,7 @@ jobs:
set MAX_JOBS=4
python setup.py bdist_wheel > build_torch_wheel_log.log
echo "[INFO] begin to install torch whls"
for /r C:\runner\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do (
for /r C:\actions-runner\_work\torch-xpu-ops\pytorch\dist %%i in (torch*.whl) do (
set TORCH_WHL=%%i
)
echo "[INFO] the torch version is %TORCH_WHL%"
Expand All @@ -127,14 +130,14 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: Torch-XPU-Windows-Log-${{ github.event.pull_request.number || github.sha }}
path: 'C:\runner\actions-runner\_work\torch-xpu-ops\pytorch\build_torch_wheel_log.log'
path: 'C:\actions-runner\_work\torch-xpu-ops\pytorch\build_torch_wheel_log.log'

- name: Upload Windows binary
if: ${{ ! cancelled() }}
uses: actions/upload-artifact@v4
with:
name: Torch-XPU-Windows-Binary-${{ github.event.pull_request.number || github.sha }}
path: 'C:\runner\actions-runner\_work\torch-xpu-ops\pytorch\dist'
path: 'C:\actions-runner\_work\torch-xpu-ops\pytorch\dist'

- name: Run XPU OP Extended UT
if: contains(inputs.ut, 'op_extended') || github.event_name == 'schedule'
Expand Down
8 changes: 8 additions & 0 deletions cmake/SYCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ if(OCLOC_EXEC)
endif()
endif()

# find detailed date of compiler
execute_process(
COMMAND icpx --version
OUTPUT_VARIABLE ICX_VERSION_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
string(REGEX REPLACE ".*\\.([0-9]+)\\).*" "\\1" ICX_DATE ${ICX_VERSION_OUTPUT})

find_package(SYCL REQUIRED)
if(NOT SYCL_FOUND)
message("Can NOT find SYCL cmake helpers module!")
Expand Down
2 changes: 1 addition & 1 deletion src/BuildOnLinux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if(BUILD_SEPARATE_OPS)
# Decouple with PyTorch cmake definition.
install(TARGETS ${sycl_lib} DESTINATION "${TORCH_INSTALL_LIB_DIR}")
endforeach()
elseif(BUILD_SPLIT_KERNEL_LIB)
elseif(BUILD_SPLIT_KERNEL_LIB OR __INTEL_LLVM_COMPILER LESS 20250001 OR ICX_DATE LESS 20241211)
# Split SYCL kernels into 4 libraries as categories 1) Unary+Binary 2) Reduce 3) Foreach 4) Others.
set(ATen_XPU_SYCL_UNARY_BINARY_SRCS)
set(ATen_XPU_SYCL_REDUCE_SRCS)
Expand Down
2 changes: 1 addition & 1 deletion src/BuildOnWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if(BUILD_SEPARATE_OPS)
# Decouple with PyTorch cmake definition.
install(TARGETS ${sycl_lib} DESTINATION "${TORCH_INSTALL_LIB_DIR}")
endforeach()
elseif(BUILD_SPLIT_KERNEL_LIB)
elseif(BUILD_SPLIT_KERNEL_LIB OR __INTEL_LLVM_COMPILER LESS 20250001 OR ICX_DATE LESS 20241211)
# Split SYCL kernels into 2 libraries as categories 1) Unary+Binary 2) Others.
set(ATen_XPU_SYCL_BINARY_SRCS)
set(ATen_XPU_SYCL_UNARY_SRCS)
Expand Down

0 comments on commit c04452f

Please sign in to comment.