Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/sycl' into llvmspirv_pulldown
Browse files Browse the repository at this point in the history
 Conflicts:
	sycl/test/check_device_code/vector/vector_math_ops.cpp
  • Loading branch information
jsji committed Dec 17, 2024
2 parents eb615f5 + 839f0af commit 5ca9829
Show file tree
Hide file tree
Showing 85 changed files with 1,003 additions and 556 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/sycl-containers-igc-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ on:
- sycl
paths:
- 'devops/actions/build_container/**'
- 'devops/scripts/**'
- 'devops/dependencies-igc-dev.json'
- '.github/workflows/sycl-containers-igc-dev.yaml'
pull_request:
paths:
- 'devops/actions/build_container/**'
- 'devops/scripts/**'
- 'devops/dependencies-igc-dev.json'
- '.github/workflows/sycl-containers-igc-dev.yaml'

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/sycl-containers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jobs:
file: ubuntu2204_build
tag: latest
build_args: ""
- name: Build Ubuntu 24.04 oneAPI Docker image
file: ubuntu2404_build_oneapi
tag: latest
build_args: ""
- name: Intel Drivers Ubuntu 22.04 Docker image
file: ubuntu2204_intel_drivers
tag: latest
Expand Down Expand Up @@ -74,6 +78,7 @@ jobs:
file: ${{ matrix.file }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
sycl_ci_passwd: ${{ secrets.DOCKER_SUDO_PASSWORD }}
tags: |
ghcr.io/${{ github.repository }}/${{ matrix.file }}:${{ matrix.tag }}-${{ github.sha }}
ghcr.io/${{ github.repository }}/${{ matrix.file }}:${{ matrix.tag }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/sycl-linux-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,8 @@ jobs:
install_dev_igc_driver: >-
${{ !contains(matrix.target_devices, 'ext_oneapi_cuda') &&
!contains(matrix.target_devices, 'ext_oneapi_hip') &&
matrix.use_igc_dev && contains(needs.detect_changes.outputs.filters, 'devigccfg') ||
matrix.use_igc_dev &&
(contains(needs.detect_changes.outputs.filters, 'devigccfg') || contains(needs.detect_changes.outputs.filters, 'drivers')) ||
'false' }}
# Run only if the PR does not have the 'ci-no-devigc' label.
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || 'false'}}
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/sycl-rel-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ on:

permissions: read-all

env:
# NOTE: so that GitHub Actions can trigger the scheduled workflow run - the
# workflow file should be on the default branch. Therefore every job should
# checkout the release branch.
SYCL_REL_BRANCH: "draft-sycl-rel-6_0_0"

jobs:
# To avoid unnecessary scheduled runs this job checks if there are new commits
# since the last run. More precisely, it checks if the last commit is older
Expand All @@ -25,7 +19,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.SYCL_REL_BRANCH }}
ref: draft-sycl-rel-6_0_0
- run: git show --quiet | tee -a $GITHUB_STEP_SUMMARY

- id: is_new_commit
Expand All @@ -45,7 +39,7 @@ jobs:
build_artifact_suffix: v6
build_configure_extra_args: '--hip --cuda'
merge_ref: ''
ref: ${{ env.SYCL_REL_BRANCH }}
ref: draft-sycl-rel-6_0_0

# We upload the build for people to download/use, override its name and
# prefer widespread gzip compression.
Expand Down Expand Up @@ -113,7 +107,7 @@ jobs:
tests_selector: ${{ matrix.tests_selector }}
extra_lit_opts: ${{ matrix.extra_lit_opts }}
reset_intel_gpu: ${{ matrix.reset_intel_gpu }}
ref: ${{ env.SYCL_REL_BRANCH }}
ref: draft-sycl-rel-6_0_0
merge_ref: ''
sycl_toolchain_artifact: sycl_linux_default
sycl_toolchain_archive: ${{ needs.ubuntu2204_build.outputs.artifact_archive_name }}
Expand All @@ -127,7 +121,7 @@ jobs:
# We upload both Linux/Windows build via Github's "Releases"
# functionality, make sure Linux/Windows names follow the same pattern.
artifact_archive_name: sycl_windows.tar.gz
build_ref: ${{ env.SYCL_REL_BRANCH }}
build_ref: draft-sycl-rel-6_0_0

e2e-win:
needs: build-win
Expand All @@ -142,7 +136,7 @@ jobs:
runner: '["Windows","gen12"]'
sycl_toolchain_archive: ${{ needs.build-win.outputs.artifact_archive_name }}
extra_lit_opts: --param gpu-intel-gen12=True
ref: ${{ env.SYCL_REL_BRANCH }}
ref: draft-sycl-rel-6_0_0

cuda-aws-start:
needs: [ubuntu2204_build]
Expand All @@ -151,7 +145,7 @@ jobs:
secrets: inherit
with:
mode: start
ref: ${{ env.SYCL_REL_BRANCH }}
ref: draft-sycl-rel-6_0_0

cuda-run-tests:
needs: [ubuntu2204_build, cuda-aws-start]
Expand All @@ -163,7 +157,7 @@ jobs:
image: ghcr.io/intel/llvm/ubuntu2204_build:latest-0300ac924620a51f76c4929794637b82790f12ab
image_options: -u 1001 --gpus all --cap-add SYS_ADMIN --env NVIDIA_DISABLE_REQUIRE=1
target_devices: ext_oneapi_cuda:gpu
ref: ${{ env.SYCL_REL_BRANCH }}
ref: draft-sycl-rel-6_0_0
merge_ref: ''

sycl_toolchain_artifact: sycl_linux_default
Expand All @@ -177,4 +171,4 @@ jobs:
secrets: inherit
with:
mode: stop
ref: ${{ env.SYCL_REL_BRANCH }}
ref: draft-sycl-rel-6_0_0
16 changes: 10 additions & 6 deletions .github/workflows/sycl-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,19 @@ jobs:
name: Build + LIT
runs-on: [Windows, build]
environment: WindowsCILock
# TODO use cached checkout
outputs:
build_conclusion: ${{ steps.build.conclusion }}
steps:
- uses: actions/checkout@v4
with:
path: src
ref: ${{ inputs.build_ref || github.sha }}
fetch-depth: 1
sparse-checkout: |
devops/actions
ref: ${{ inputs.ref || github.sha }}
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: amd64
- name: Setup oneAPI env
uses: ./src/devops/actions/setup_windows_oneapi_env
uses: ./devops/actions/setup_windows_oneapi_env
if: ${{ always() && !cancelled() && inputs.compiler == 'icx' }}
- name: Set env
run: |
Expand All @@ -96,7 +95,12 @@ jobs:
echo "CCACHE_DIR=D:\github\_work\cache\${{ inputs.build_cache_suffix }}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CCACHE_MAXSIZE=10G" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Register cleanup after job is finished
uses: ./src/devops/actions/cleanup
uses: ./devops/actions/cleanup
- uses: ./devops/actions/cached_checkout
with:
path: src
ref: ${{ inputs.build_ref || github.sha }}
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
- name: Configure
shell: cmd
env:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/sycl-windows-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,29 @@ jobs:
environment: WindowsCILock
env: ${{ fromJSON(inputs.env) }}
steps:
# TODO: use cached_checkout
- uses: actions/checkout@v4
with:
persist-credentials: false
sparse-checkout: |
devops/actions
ref: ${{ inputs.ref || github.sha }}
path: llvm
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
with:
arch: amd64
- name: Setup oneAPI env
uses: ./llvm/devops/actions/setup_windows_oneapi_env
uses: ./devops/actions/setup_windows_oneapi_env
if: ${{ always() && !cancelled() && inputs.compiler == 'icx' }}
- name: Set env
run: |
git config --system core.longpaths true
git config --global core.autocrlf false
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Register cleanup after job is finished
uses: ./llvm/devops/actions/cleanup
uses: ./devops/actions/cleanup
- uses: ./devops/actions/cached_checkout
with:
path: llvm
ref: ${{ inputs.build_ref || github.sha }}
cache_path: "D:\\\\github\\\\_work\\\\repo_cache\\\\"
- name: Download compiler toolchain
uses: actions/download-artifact@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions devops/actions/build_container/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ inputs:
file:
description: "Dockerfile"
required: true
sycl_ci_passwd:
description: "Password to assign to sycl_ci user within a container"
required: true

runs:
using: "composite"
Expand All @@ -41,3 +44,4 @@ runs:
file: ${{ github.workspace }}/devops/containers/${{ inputs.file }}.Dockerfile
secrets: |
github_token=${{ github.token }}
sycl_ci_passwd=${{ inputs.sycl_ci_passwd }}
53 changes: 53 additions & 0 deletions devops/containers/ubuntu2404_build_oneapi.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM nvidia/cuda:12.6.3-devel-ubuntu24.04

ENV DEBIAN_FRONTEND=noninteractive

USER root

# Install SYCL prerequisites
COPY scripts/install_build_tools.sh /install.sh
RUN /install.sh

SHELL ["/bin/bash", "-ec"]

# Install oneAPI

# Make the directory if it doesn't exist yet.
# This location is recommended by the distribution maintainers.
RUN mkdir --parents --mode=0755 /etc/apt/keyrings
# Download the key, convert the signing-key to a full
# keyring required by apt and store in the keyring directory
RUN wget https://repo.radeon.com/rocm/rocm.gpg.key -O - | \
gpg --dearmor | tee /etc/apt/keyrings/rocm.gpg > /dev/null && \
# Add rocm repo
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/amdgpu/6.3/ubuntu noble main" \
| tee /etc/apt/sources.list.d/amdgpu.list && \
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/rocm.gpg] https://repo.radeon.com/rocm/apt/6.3 noble main" \
| tee --append /etc/apt/sources.list.d/rocm.list && \
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
| tee /etc/apt/preferences.d/rocm-pin-600 && \
echo -e 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' \
| tee /etc/apt/preferences.d/rocm-pin-600 && \
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor \
| tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \
| tee /etc/apt/sources.list.d/oneAPI.list && \
apt update
# Install the ROCM kernel driver and oneAPI
RUN apt install -yqq rocm-dev intel-oneapi-compiler-dpcpp-cpp && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# By default Ubuntu sets an arbitrary UID value, that is different from host
# system. When CI passes default UID value of 1001, some of LLVM tools fail to
# discover user home directory and fail a few LIT tests. Fixes UID and GID to
# 1001, that is used as default by GitHub Actions.
RUN groupadd -g 1001 sycl && useradd sycl -u 1001 -g 1001 -m -s /bin/bash
# Add sycl user to video/irc groups so that it can access GPU
RUN usermod -aG video sycl
RUN usermod -aG irc sycl

COPY scripts/docker_entrypoint.sh /docker_entrypoint.sh

ENTRYPOINT ["/docker_entrypoint.sh"]

8 changes: 4 additions & 4 deletions devops/dependencies-igc-dev.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"linux": {
"igc_dev": {
"github_tag": "igc-dev-3db59df",
"version": "3db59df",
"updated_at": "2024-12-03T20:43:00Z",
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/2248119261/zip",
"github_tag": "igc-dev-e0d826a",
"version": "e0d826a",
"updated_at": "2024-12-17T21:18:30Z",
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/2327583926/zip",
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
}
}
Expand Down
3 changes: 3 additions & 0 deletions devops/scripts/install_drivers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ InstallIGFX () {
echo "Install libopencl-clang"
# Workaround only, will download deb and install with dpkg once fixed.
cp -d libopencl-clang.so.14* /usr/local/lib/
rm /usr/local/lib/libigc.so /usr/local/lib/libigc.so.1* && \
ln -s /usr/local/lib/libigc.so.2 /usr/local/lib/libigc.so && \
ln -s /usr/local/lib/libigc.so.2 /usr/local/lib/libigc.so.1
echo "Clean up"
rm *.deb libopencl-clang.so.14*
echo "$IGC_DEV_TAG" > /usr/local/lib/igc/IGCTAG.txt
Expand Down
25 changes: 20 additions & 5 deletions llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,26 @@ class IntelTargetInfo<string Name, list<Aspect> Aspects, list<int> subGroupSizes
// Note: only the "canonical" target names are listed here - see
// SYCL::gen::resolveGenDevice().
//
// TODO: instructions on how to get "???" values below are required. Currently
// device architectures below which have "???" in it are not fully supported.
//
// def : IntelTargetInfo<"intel_gpu_ptl_u", ???, ???>;
// def : IntelTargetInfo<"intel_gpu_ptl_h", ???, ???>;
// When adding the new Intel architectures, the ideal way to get these
// values is to run sycl-ls --verbose on the target machine. However,
// if you don't have access to the target machine, then you can look in
// the intel/compute-runtime source code to get the values. For
// the fp64 and atomic64 aspects, look for the definition
// of specific RuntimeCapabilityTable's. These will be defined in
// a file called hw_info_<device>.cpp. For example, for PVC, it
// would be hw_info_pvc.cpp. For fp16, this is supported by all
// Intel GPUs currently. (see definition of getDeviceExtensions in
// compiler_product_helper_base.inl). For the supported sub-group sizes,
// it is not as straightforward. They are defined per family in
// GfxCoreHelperHw<Family>::getDeviceSubGroupSizes and by default
// the default sub-group sizes are 8, 16, and 32. (see gfx_core_helper_base.inl)
// However, this can be overriden by specific families. For example,
// gfx_core_helper_xe_hpc_core.cpp defines the supported sub-group
// sizes to be 16 and 32, which corresponds to PVC having 16 and 32
// as sub-group sizes the supported sub-group sizes.

def : IntelTargetInfo<"intel_gpu_ptl_u", Fp16Fp64Atomic64, Sg16_32>;
def : IntelTargetInfo<"intel_gpu_ptl_h", Fp16Fp64Atomic64, Sg16_32>;
def : IntelTargetInfo<"intel_gpu_lnl_m", Fp16Fp64Atomic64, Sg16_32>;
def : IntelTargetInfo<"intel_gpu_bmg_g21", Fp16Fp64Atomic64, Sg16_32>;
def : IntelTargetInfo<"intel_gpu_arl_h", Fp16Fp64Atomic64, Sg8_16_32>;
Expand Down
14 changes: 7 additions & 7 deletions sycl/cmake/modules/UnifiedRuntimeTag.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# commit b7047f6c36ec17b8560c2f1cd9ac9521715a9127
# Merge: 73e5f3c6ff2d fcddf077c290
# Author: Martin Grant <martin.morrisongrant@codeplay.com>
# Date: Fri Dec 13 14:20:15 2024 +0000
# Merge pull request #2454 from Bensuo/l0_cmd-buf_multi-device
# Fix L0 command-buffer consumption of multi-device kernels
set(UNIFIED_RUNTIME_TAG b7047f6c36ec17b8560c2f1cd9ac9521715a9127)
# commit 39df0317814c164f5242eda8d6f08550f6268492
# Merge: 68d93efd be27d8f0
# Author: Kenneth Benzie (Benie) <k.benzie@codeplay.com>
# Date: Mon Dec 16 13:53:13 2024 +0000
# Merge pull request #2467 from nrspruit/fix_external_import_function_call
# [L0] Fix external semaphore import function calls to match the header
set(UNIFIED_RUNTIME_TAG 39df0317814c164f5242eda8d6f08550f6268492)
1 change: 0 additions & 1 deletion sycl/doc/EnvironmentVariables.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ variables in production code.</span>

| Environment variable | Values | Description |
| -------------------- | ------ | ----------- |
| `SYCL_PREFER_UR` | Integer | If non-0 then run through Unified Runtime if desired backend is supported there. Default is 0. |
| `SYCL_UR_TRACE` | Integer | Described [below](#sycl_ur_trace-options) | Enable specified level of tracing for UR. |
| `SYCL_QUEUE_THREAD_POOL_SIZE` | Positive integer | Number of threads in thread pool of queue. |
| `SYCL_DEVICELIB_NO_FALLBACK` | Any(\*) | Disable loading and linking of device library images |
Expand Down
16 changes: 16 additions & 0 deletions sycl/include/sycl/detail/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,22 @@ struct map_type<T, From, To, Rest...> {
template <typename T, typename... Ts>
constexpr bool check_type_in_v = ((std::is_same_v<T, Ts> || ...));

#if __has_builtin(__type_pack_element)
template <int N, typename... Ts>
using nth_type_t = __type_pack_element<N, Ts...>;
#else
template <int N, typename T, typename... Ts> struct nth_type {
using type = typename nth_type<N - 1, Ts...>::type;
};

template <typename T, typename... Ts> struct nth_type<0, T, Ts...> {
using type = T;
};

template <int N, typename... Ts>
using nth_type_t = typename nth_type<N, Ts...>::type;
#endif

} // namespace detail
} // namespace _V1
} // namespace sycl
Loading

0 comments on commit 5ca9829

Please sign in to comment.