Skip to content

Commit 5516bc4

Browse files
authored
Merge branch 'intel:sycl' into int-buffers
2 parents 0809026 + 6fbd7f0 commit 5516bc4

File tree

8,453 files changed

+503444
-275803
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

8,453 files changed

+503444
-275803
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
BasedOnStyle: LLVM
2+
LineEnding: LF

.github/renovate.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
"config:recommended"
5+
],
6+
"includePaths": [".github/**"],
7+
"schedule": "* 0 * * 1",
8+
"minimumReleaseAge": "3 days",
9+
"assignees": ["boomanaiden154"],
10+
"ignorePaths": [".github/workflows/containers/**"],
11+
"groupName": "[Github] Update GHA Dependencies"
12+
}

.github/workflows/gha-codeql.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Github Actions CodeQL
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '30 0 * * *'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
codeql:
19+
name: 'Github Actions CodeQL'
20+
runs-on: ubuntu-24.04
21+
permissions:
22+
security-events: write
23+
steps:
24+
- name: Checkout LLVM
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
with:
27+
sparse-checkout: |
28+
.github/
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
31+
with:
32+
languages: actions
33+
queries: security-extended
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# This file defines a workflow that runs the libc++ benchmarks when a comment is added to the PR.
2+
#
3+
# The comment is of the form:
4+
#
5+
# /libcxx-bot benchmark <path-to-benchmarks-to-run>
6+
#
7+
# That will cause the specified benchmarks to be run on the PR and on the pull-request target, and
8+
# their results to be compared.
9+
10+
name: Benchmark libc++
11+
12+
permissions:
13+
contents: read
14+
15+
on:
16+
issue_comment:
17+
types:
18+
- created
19+
- edited
20+
21+
env:
22+
CC: clang-22
23+
CXX: clang++-22
24+
25+
jobs:
26+
run-benchmarks:
27+
permissions:
28+
pull-requests: write
29+
30+
if: >-
31+
github.event.issue.pull_request &&
32+
contains(github.event.comment.body, '/libcxx-bot benchmark')
33+
34+
runs-on: llvm-premerge-libcxx-next-runners # TODO: This should run on a dedicated set of machines
35+
steps:
36+
- uses: actions/setup-python@v6
37+
with:
38+
python-version: '3.10'
39+
40+
- name: Extract information from the PR
41+
id: vars
42+
run: |
43+
python3 -m venv .venv
44+
source .venv/bin/activate
45+
python -m pip install pygithub
46+
47+
cat <<EOF | python >> ${GITHUB_OUTPUT}
48+
import github
49+
repo = github.Github("${{ github.token }}").get_repo("${{ github.repository }}")
50+
pr = repo.get_pull(${{ github.event.issue.number }})
51+
print(f"pr_base={pr.base.sha}")
52+
print(f"pr_head={pr.head.sha}")
53+
EOF
54+
BENCHMARKS=$(echo "${{ github.event.comment.body }}" | sed -nE 's/\/libcxx-bot benchmark (.+)/\1/p')
55+
echo "benchmarks=${BENCHMARKS}" >> ${GITHUB_OUTPUT}
56+
57+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
58+
with:
59+
ref: ${{ steps.vars.outputs.pr_head }}
60+
fetch-depth: 0
61+
fetch-tags: true # This job requires access to all the Git branches so it can diff against (usually) main
62+
path: repo # Avoid nuking the workspace, where we have the Python virtualenv
63+
64+
- name: Run baseline
65+
run: |
66+
source .venv/bin/activate && cd repo
67+
python -m pip install -r libcxx/utils/requirements.txt
68+
baseline_commit=$(git merge-base ${{ steps.vars.outputs.pr_base }} ${{ steps.vars.outputs.pr_head }})
69+
./libcxx/utils/test-at-commit --commit ${baseline_commit} -B build/baseline -- -sv -j1 --param optimization=speed ${{ steps.vars.outputs.benchmarks }}
70+
./libcxx/utils/consolidate-benchmarks build/baseline | tee baseline.lnt
71+
72+
- name: Run candidate
73+
run: |
74+
source .venv/bin/activate && cd repo
75+
./libcxx/utils/test-at-commit --commit ${{ steps.vars.outputs.pr_head }} -B build/candidate -- -sv -j1 --param optimization=speed ${{ steps.vars.outputs.benchmarks }}
76+
./libcxx/utils/consolidate-benchmarks build/candidate | tee candidate.lnt
77+
78+
- name: Compare baseline and candidate runs
79+
run: |
80+
source .venv/bin/activate && cd repo
81+
./libcxx/utils/compare-benchmarks baseline.lnt candidate.lnt | tee results.txt
82+
83+
- name: Update comment with results
84+
run: |
85+
source .venv/bin/activate && cd repo
86+
cat <<EOF | python
87+
import github
88+
repo = github.Github("${{ github.token }}").get_repo("${{ github.repository }}")
89+
pr = repo.get_pull(${{ github.event.issue.number }})
90+
comment = pr.get_issue_comment(${{ github.event.comment.id }})
91+
with open('results.txt', 'r') as f:
92+
benchmark_results = f.read()
93+
94+
new_comment_text = f"""
95+
{comment.body}
96+
97+
<details>
98+
<summary>
99+
Benchmark results:
100+
</summary>
101+
102+
\`\`\`
103+
{benchmark_results}
104+
\`\`\`
105+
106+
</details>
107+
"""
108+
109+
comment.edit(new_comment_text)
110+
EOF

.github/workflows/pr-code-lint.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: "Code lint"
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
- 'users/**'
11+
paths:
12+
- 'clang-tools-extra/clang-tidy/**'
13+
- '.github/workflows/pr-code-lint.yml'
14+
15+
jobs:
16+
code_linter:
17+
if: github.repository_owner == 'llvm'
18+
runs-on: ubuntu-24.04
19+
defaults:
20+
run:
21+
shell: bash
22+
container:
23+
image: 'ghcr.io/llvm/ci-ubuntu-24.04:latest'
24+
timeout-minutes: 60
25+
concurrency:
26+
group: ${{ github.workflow }}-${{ github.ref }}
27+
cancel-in-progress: true
28+
steps:
29+
- name: Fetch LLVM sources
30+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
31+
with:
32+
fetch-depth: 2
33+
34+
- name: Get changed files
35+
id: changed-files
36+
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1
37+
with:
38+
separator: ","
39+
skip_initial_fetch: true
40+
base_sha: 'HEAD~1'
41+
sha: 'HEAD'
42+
43+
- name: Listed files
44+
env:
45+
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
46+
run: |
47+
echo "Changed files:"
48+
echo "$CHANGED_FILES"
49+
50+
- name: Install clang-tidy
51+
uses: aminya/setup-cpp@17c11551771948abc5752bbf3183482567c7caf0 # v1.1.1
52+
with:
53+
clang-tidy: 20.1.8
54+
55+
- name: Setup Python env
56+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
57+
with:
58+
python-version: '3.12'
59+
60+
- name: Install Python dependencies
61+
run: python3 -m pip install -r llvm/utils/git/requirements_linting.txt
62+
63+
# TODO: create special mapping for 'codegen' targets, for now build predefined set
64+
# TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies
65+
- name: Configure and CodeGen
66+
run: |
67+
git config --global --add safe.directory '*'
68+
69+
. <(git diff --name-only HEAD~1...HEAD | python3 .ci/compute_projects.py)
70+
71+
if [[ "${projects_to_build}" == "" ]]; then
72+
echo "No projects to analyze"
73+
exit 0
74+
fi
75+
76+
cmake -G Ninja \
77+
-B build \
78+
-S llvm \
79+
-DLLVM_ENABLE_ASSERTIONS=OFF \
80+
-DLLVM_ENABLE_PROJECTS="${projects_to_build}" \
81+
-DCMAKE_CXX_COMPILER=clang++ \
82+
-DCMAKE_C_COMPILER=clang \
83+
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
84+
-DLLVM_INCLUDE_TESTS=OFF \
85+
-DCLANG_INCLUDE_TESTS=OFF \
86+
-DCMAKE_BUILD_TYPE=Release
87+
88+
ninja -C build \
89+
clang-tablegen-targets \
90+
genconfusable # for "ConfusableIdentifierCheck.h"
91+
92+
- name: Run code linter
93+
env:
94+
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
95+
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
96+
run: |
97+
echo "[]" > comments &&
98+
python3 llvm/utils/git/code-lint-helper.py \
99+
--token ${{ secrets.GITHUB_TOKEN }} \
100+
--issue-number $GITHUB_PR_NUMBER \
101+
--start-rev HEAD~1 \
102+
--end-rev HEAD \
103+
--verbose \
104+
--changed-files "$CHANGED_FILES"
105+
106+
- name: Upload results
107+
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0
108+
if: always()
109+
with:
110+
name: workflow-args
111+
path: |
112+
comments

.github/workflows/sycl-detect-changes.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ jobs:
6767
- devops/dependencies-igc-dev.json
6868
benchmarks:
6969
- 'devops/scripts/benchmarks/**'
70+
- 'devops/actions/run-tests/benchmark/**'
71+
- '.github/workflows/sycl-ur-perf-benchmarking.yml'
7072
perf-tests:
7173
- sycl/test-e2e/PerformanceTests/**
7274
esimd:

.github/workflows/sycl-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
touch .nojekyll
6565
# Update benchmarking dashboard configuration
6666
cat << EOF > benchmarks/config.js
67-
remoteDataUrl = 'https://raw.githubusercontent.com/intel/llvm-ci-perf-results/refs/heads/unify-ci/';
67+
remoteDataUrl = 'https://raw.githubusercontent.com/intel/llvm/refs/heads/sycl-benchmark-ci-results/';
6868
defaultCompareNames = ["Baseline_PVC_L0"];
6969
EOF
7070
# Upload the generated docs as an artifact and deploy to GitHub Pages.

.github/workflows/sycl-linux-build.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -286,20 +286,9 @@ jobs:
286286

287287
- name: Install utilities
288288
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' }}
289-
# TODO replace utility installation with a single CMake target
290289
run: |
291-
cmake --build $GITHUB_WORKSPACE/build --target utils/FileCheck/install
292-
cmake --build $GITHUB_WORKSPACE/build --target utils/count/install
293-
cmake --build $GITHUB_WORKSPACE/build --target utils/not/install
294-
cmake --build $GITHUB_WORKSPACE/build --target utils/lit/install
295-
cmake --build $GITHUB_WORKSPACE/build --target utils/llvm-lit/install
296-
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-size
297-
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-cov
298-
cmake --build $GITHUB_WORKSPACE/build --target install-llvm-profdata
299-
cmake --build $GITHUB_WORKSPACE/build --target install-compiler-rt
300-
# This is required to perform the DeviceConfigFile consistency test, see
301-
# sycl/test-e2e/Basic/device_config_file_consistency.cpp.
302-
cmake --install $GITHUB_WORKSPACE/build --component DeviceConfigFile
290+
cmake --build $GITHUB_WORKSPACE/build --target install-sycl-test-utilities
291+
303292
- name: Additional Install for "--shared-libs" build
304293
if: ${{ always() && !cancelled() && steps.build.conclusion == 'success' && contains(inputs.build_configure_extra_args, '--shared-libs') }}
305294
run: |

.github/workflows/sycl-linux-precommit-aws.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ jobs:
6363
e2e-cuda:
6464
needs: [aws-start]
6565
uses: ./.github/workflows/sycl-linux-run-tests.yml
66+
permissions:
67+
contents: write
68+
packages: read
6669
with:
6770
name: CUDA E2E
6871
runner: '["aws_cuda-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}"]'

.github/workflows/sycl-linux-precommit.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- sycl
1010
- sycl-rel-**
1111
# Do not run builds if changes are only in the following locations
12+
# Note: benchmark-related paths are the same as in sycl-ur-perf-benchmarking.yml (to run there instead)
1213
paths-ignore:
1314
- '.github/ISSUE_TEMPLATE/**'
1415
- '.github/CODEOWNERS'
@@ -32,6 +33,9 @@ on:
3233
- 'unified-runtime/test/**'
3334
- 'unified-runtime/third_party/**'
3435
- 'unified-runtime/tools/**'
36+
- 'devops/scripts/benchmarks/**'
37+
- 'devops/actions/run-tests/benchmark/**'
38+
- '.github/workflows/sycl-ur-perf-benchmarking.yml'
3539

3640
concurrency:
3741
# Cancel a currently running workflow from the same PR, branch or tag.
@@ -140,6 +144,9 @@ jobs:
140144
E2E:
141145
needs: [build, detect_changes, compat_read_exclude]
142146
if: ${{ always() && !cancelled() && needs.build.outputs.build_conclusion == 'success' }}
147+
permissions:
148+
contents: write
149+
packages: read
143150
strategy:
144151
fail-fast: false
145152
matrix:
@@ -225,31 +232,11 @@ jobs:
225232
skip_run: ${{matrix.use_igc_dev && contains(github.event.pull_request.labels.*.name, 'ci-no-devigc') || 'false'}}
226233
env: ${{ matrix.env || (contains(needs.detect_changes.outputs.filters, 'esimd') && '{}' || '{"LIT_FILTER_OUT":"ESIMD/"}') }}
227234

228-
test_benchmark_scripts:
229-
needs: [build, detect_changes]
230-
if: |
231-
always() && !cancelled()
232-
&& needs.build.outputs.build_conclusion == 'success'
233-
&& contains(needs.detect_changes.outputs.filters, 'benchmarks')
234-
uses: ./.github/workflows/sycl-linux-run-tests.yml
235-
with:
236-
name: Benchmark suite precommit testing
237-
runner: '["PVC_PERF"]'
238-
image: ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest
239-
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
240-
target_devices: 'level_zero:gpu'
241-
tests_selector: benchmarks
242-
benchmark_upload_results: false
243-
benchmark_preset: 'Minimal'
244-
benchmark_dry_run: true
245-
benchmark_exit_on_failure: true
246-
repo_ref: ${{ github.sha }}
247-
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
248-
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}
249-
toolchain_decompress_command: ${{ needs.build.outputs.toolchain_decompress_command }}
250-
251235
test-perf:
252236
needs: [build, detect_changes]
237+
permissions:
238+
contents: write
239+
packages: read
253240
if: |
254241
always() && !cancelled()
255242
&& needs.build.outputs.build_conclusion == 'success'

0 commit comments

Comments
 (0)