Skip to content

Commit f6a1102

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into private/udit/property_parsing
2 parents c29b6c7 + 097afdc commit f6a1102

File tree

97 files changed

+2604
-462
lines changed

Some content is hidden

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

97 files changed

+2604
-462
lines changed

.github/workflows/sycl-coverity.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
name: Coverity
22
on:
33
workflow_dispatch:
4+
inputs:
5+
description:
6+
description: 'Custom build description'
7+
required: true
8+
type: string
9+
default: 'Out-of-order Coverity scan'
10+
ref:
11+
description: 'Git ref to checkout and scan'
12+
required: true
13+
type: string
14+
default: 'sycl'
15+
416
schedule:
517
- cron: '0 0 * * 0'
618

@@ -27,7 +39,7 @@ jobs:
2739
- uses: ./devops/actions/cached_checkout
2840
with:
2941
path: src
30-
ref: ${{ github.sha }}
42+
ref: ${{ inputs.ref || github.sha }}
3143
cache_path: "/__w/repo_cache/"
3244

3345
- name: Get coverity tool
@@ -56,10 +68,15 @@ jobs:
5668

5769
- name: Submit build
5870
run: |
71+
default_description="${{ inputs.description }}"
72+
if [[ -z $default_description ]]; then
73+
default_description="Regular build"
74+
fi
75+
5976
# Initialize a build. Fetch a cloud upload url.
6077
curl -X POST \
61-
-d version="sycl: ${{ github.sha }}" \
62-
-d description="Regular build" \
78+
-d version="${{ inputs.ref || github.sha }}" \
79+
-d description="$default_description" \
6380
-d email=${{ secrets.COVERITY_EMAIL }} \
6481
-d token=${{ secrets.COVERITY_TOKEN }} \
6582
-d file_name="intel_llvm.tgz" \

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ on:
2323
- '.github/workflows/sycl-nightly.yml'
2424
- '.github/workflows/sycl-rel-nightly.yml'
2525
- '.github/workflows/sycl-rel-nightly-launch.yml'
26-
- '.github/workflows/trivy.yml'
26+
- '.github/workflows/sycl-trivy.yml'
27+
- '.github/workflows/sycl-coverity.yml'
2728
- 'devops/containers/**'
2829
- 'devops/actions/build_container/**'
2930
- 'unified-runtime/examples/**'
@@ -241,6 +242,7 @@ jobs:
241242
benchmark_upload_results: false
242243
benchmark_preset: 'Minimal'
243244
benchmark_dry_run: true
245+
benchmark_exit_on_failure: true
244246
repo_ref: ${{ github.sha }}
245247
toolchain_artifact: ${{ needs.build.outputs.toolchain_artifact }}
246248
toolchain_artifact_filename: ${{ needs.build.outputs.toolchain_artifact_filename }}

.github/workflows/sycl-linux-run-tests.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,12 @@ on:
140140
type: string
141141
default: 'false'
142142
required: False
143+
benchmark_exit_on_failure:
144+
description: |
145+
Whether or not to fail the workflow upon a failure.
146+
type: string
147+
default: 'false'
148+
required: False
143149

144150
workflow_dispatch:
145151
inputs:
@@ -211,6 +217,12 @@ on:
211217
- "build-only"
212218
- "run-only"
213219

220+
benchmark_exit_on_failure:
221+
type: choice
222+
options:
223+
- "true"
224+
- "false"
225+
214226
permissions:
215227
contents: read
216228
packages: read
@@ -358,6 +370,7 @@ jobs:
358370
save_name: ${{ inputs.benchmark_save_name }}
359371
preset: ${{ inputs.benchmark_preset }}
360372
dry_run: ${{ inputs.benchmark_dry_run }}
373+
exit_on_failure: ${{ inputs.benchmark_exit_on_failure }}
361374
build_ref: ${{ inputs.repo_ref }}
362375
env:
363376
RUNNER_TAG: ${{ inputs.runner }}
File renamed without changes.

.github/workflows/sycl-ur-perf-benchmarking.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ on:
4141
description: |
4242
Upload results to https://intel.github.io/llvm/benchmarks/.
4343
required: true
44+
exit_on_failure:
45+
type: string # true/false: workflow_dispatch does not support booleans
46+
description: |
47+
Fail benchmark script on any error. Limit number of iterations to just test correctness.
48+
required: false
49+
default: 'false'
4450
runner:
4551
type: string
4652
required: true
@@ -90,6 +96,13 @@ on:
9096
- false
9197
- true
9298
default: true
99+
exit_on_failure:
100+
description: Fail benchmark script on any error. Limit number of iterations to just test correctness.
101+
type: choice
102+
options:
103+
- false
104+
- true
105+
default: false
93106
runner:
94107
description: Self-hosted runner to use for the benchmarks
95108
type: choice
@@ -193,6 +206,7 @@ jobs:
193206
benchmark_upload_results: ${{ inputs.upload_results }}
194207
benchmark_save_name: ${{ needs.sanitize_inputs.outputs.benchmark_save_name }}
195208
benchmark_preset: ${{ inputs.preset }}
209+
benchmark_exit_on_failure: ${{ inputs.exit_on_failure }}
196210
repo_ref: ${{ needs.sanitize_inputs.outputs.build_ref }}
197211
toolchain_artifact: ${{ needs.build_sycl.outputs.toolchain_artifact }}
198212
toolchain_artifact_filename: ${{ needs.build_sycl.outputs.toolchain_artifact_filename }}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ on:
2222
- '.github/workflows/sycl-nightly.yml'
2323
- '.github/workflows/sycl-rel-nightly.yml'
2424
- '.github/workflows/sycl-rel-nightly-launch.yml'
25-
- '.github/workflows/trivy.yml'
25+
- '.github/workflows/sycl-trivy.yml'
26+
- '.github/workflows/sycl-coverity.yml'
2627
- 'devops/containers/**'
2728
- 'devops/actions/build_container/**'
2829
- 'devops/compat_ci_exclude.sycl-rel-6_2'

devops/actions/run-tests/benchmark/action.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ inputs:
3232
dry_run:
3333
type: string
3434
required: False
35+
exit_on_failure:
36+
type: string
37+
required: False
3538

3639
runs:
3740
using: "composite"
@@ -192,8 +195,10 @@ runs:
192195
sycl-ls
193196
echo "-----"
194197

195-
taskset -c "$CORES" ./devops/scripts/benchmarks/main.py \
196-
"$(realpath ./llvm_test_workdir)" \
198+
WORKDIR="$(realpath ./llvm_test_workdir)"
199+
if [ -n "$WORKDIR" ] && [ -d "$WORKDIR" ] && [[ "$WORKDIR" == *llvm_test_workdir* ]]; then rm -rf "$WORKDIR" ; fi
200+
201+
taskset -c "$CORES" ./devops/scripts/benchmarks/main.py "$WORKDIR" \
197202
--sycl "$(realpath ./toolchain)" \
198203
--ur "$(realpath ./ur/install)" \
199204
--adapter "$FORCELOAD_ADAPTER" \
@@ -204,7 +209,8 @@ runs:
204209
--preset "$PRESET" \
205210
--timestamp-override "$SAVE_TIMESTAMP" \
206211
--detect-version sycl,compute_runtime \
207-
--flamegraph inclusive
212+
${{ inputs.exit_on_failure == 'true' && '--exit-on-failure --iterations 1' || '' }}
213+
# TODO: add back: "--flamegraph inclusive" once works properly
208214

209215
echo "-----"
210216
python3 ./devops/scripts/benchmarks/compare.py to_hist \

devops/scripts/benchmarks/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ using the built compiler located in `~/llvm/build/` and
3636
installed Unified Runtime in directory `~/ur_install`,
3737
and then **run** the benchmarks for `adapter_name` adapter.
3838

39+
The scripts will try to reuse the files stored in `~/benchmarks_workdir/`.
40+
If any dependant projects binaries are already built, they will not be rebuilt
41+
again if their tags match tags specified by benchmarks source code.
42+
3943
>NOTE: By default `level_zero` adapter is used.
4044
4145
>NOTE: Pay attention to the `--ur` parameter. It points directly to the directory where UR is installed.
@@ -48,10 +52,6 @@ $ cmake --build ~/ur_build -j $(nproc)
4852
$ cmake --install ~/ur_build
4953
```
5054

51-
### Rebuild
52-
The scripts will try to reuse the files stored in `~/benchmarks_workdir/`, but the benchmarks will be rebuilt every time.
53-
To avoid that, use `--no-rebuild` option.
54-
5555
## Results
5656

5757
By default, the benchmark results are not stored.

devops/scripts/benchmarks/benches/benchdnn.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,13 @@ def setup(self) -> None:
6666
self.git_tag(),
6767
Path(options.workdir),
6868
"onednn",
69-
force_rebuild=True,
69+
use_installdir=False,
7070
)
7171

72+
if not self.project.needs_rebuild():
73+
log.info(f"Rebuilding {self.project.name} skipped")
74+
return
75+
7276
extra_cmake_args = [
7377
f"-DCMAKE_PREFIX_PATH={options.sycl}",
7478
"-DCMAKE_CXX_COMPILER=clang++",
@@ -80,7 +84,6 @@ def setup(self) -> None:
8084
]
8185
self.project.configure(
8286
extra_cmake_args,
83-
install_prefix=False,
8487
add_sycl=True,
8588
)
8689
self.project.build(

devops/scripts/benchmarks/benches/compute.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from git_project import GitProject
1515
from options import options
1616
from utils.result import BenchmarkMetadata, Result
17+
from utils.logger import log
1718

1819
from .base import Benchmark, Suite, TracingType
1920
from .compute_metadata import ComputeMetadataGenerator
@@ -74,9 +75,13 @@ def setup(self) -> None:
7475
self.git_hash(),
7576
Path(options.workdir),
7677
"compute-benchmarks",
77-
force_rebuild=True,
78+
use_installdir=False,
7879
)
7980

81+
if not self.project.needs_rebuild():
82+
log.info(f"Rebuilding {self.project.name} skipped")
83+
return
84+
8085
extra_args = [
8186
f"-DBUILD_SYCL=ON",
8287
f"-DSYCL_COMPILER_ROOT={options.sycl}",
@@ -96,7 +101,7 @@ def setup(self) -> None:
96101
f"-Dunified-runtime_DIR={options.ur}/lib/cmake/unified-runtime",
97102
]
98103

99-
self.project.configure(extra_args, install_prefix=False, add_sycl=True)
104+
self.project.configure(extra_args, add_sycl=True)
100105
self.project.build(add_sycl=True)
101106

102107
def additional_metadata(self) -> dict[str, BenchmarkMetadata]:
@@ -266,12 +271,13 @@ def benchmarks(self) -> list[Benchmark]:
266271

267272
# Add UR-specific benchmarks
268273
benches += [
269-
MemcpyExecute(self, RUNTIMES.UR, 400, 1, 102400, 10, 1, 1, 1, 1, 0),
270-
MemcpyExecute(self, RUNTIMES.UR, 400, 1, 102400, 10, 0, 1, 1, 1, 0),
271-
MemcpyExecute(self, RUNTIMES.UR, 100, 4, 102400, 10, 1, 1, 0, 1, 0),
272-
MemcpyExecute(self, RUNTIMES.UR, 100, 4, 102400, 10, 1, 1, 0, 0, 0),
273-
MemcpyExecute(self, RUNTIMES.UR, 4096, 4, 1024, 10, 0, 1, 0, 1, 0),
274-
MemcpyExecute(self, RUNTIMES.UR, 4096, 4, 1024, 10, 0, 1, 0, 1, 1),
274+
# TODO: multithread_benchmark_ur fails with segfault
275+
# MemcpyExecute(self, RUNTIMES.UR, 400, 1, 102400, 10, 1, 1, 1, 1, 0),
276+
# MemcpyExecute(self, RUNTIMES.UR, 400, 1, 102400, 10, 0, 1, 1, 1, 0),
277+
# MemcpyExecute(self, RUNTIMES.UR, 100, 4, 102400, 10, 1, 1, 0, 1, 0),
278+
# MemcpyExecute(self, RUNTIMES.UR, 100, 4, 102400, 10, 1, 1, 0, 0, 0),
279+
# MemcpyExecute(self, RUNTIMES.UR, 4096, 4, 1024, 10, 0, 1, 0, 1, 0),
280+
# MemcpyExecute(self, RUNTIMES.UR, 4096, 4, 1024, 10, 0, 1, 0, 1, 1),
275281
UsmMemoryAllocation(self, RUNTIMES.UR, "Device", 256, "Both"),
276282
UsmMemoryAllocation(self, RUNTIMES.UR, "Device", 256 * 1024, "Both"),
277283
UsmBatchMemoryAllocation(self, RUNTIMES.UR, "Device", 128, 256, "Both"),
@@ -342,11 +348,12 @@ def cpu_count_str(self, separator: str = "") -> str:
342348

343349
def get_iters(self, run_trace: TracingType):
344350
"""Returns the number of iterations to run for the given tracing type."""
345-
return (
346-
self.iterations_trace
347-
if run_trace != TracingType.NONE
348-
else self.iterations_regular
349-
)
351+
if options.exit_on_failure:
352+
# we are just testing that the benchmark runs successfully
353+
return 3
354+
if run_trace == TracingType.NONE:
355+
return self.iterations_regular
356+
return self.iterations_trace
350357

351358
def supported_runtimes(self) -> list[RUNTIMES]:
352359
"""Base runtimes supported by this benchmark, can be overridden."""
@@ -764,6 +771,7 @@ def bin_args(self, run_trace: TracingType = TracingType.NONE) -> list[str]:
764771
"--contents=Zeros",
765772
"--multiplier=1",
766773
"--vectorSize=1",
774+
"--lws=256",
767775
]
768776

769777

0 commit comments

Comments
 (0)