Skip to content

Commit bb2755f

Browse files
Merge branch 'sycl' into avoid-kernel-copies
2 parents 29f60a4 + 8e7ec0f commit bb2755f

File tree

98 files changed

+1930
-1056
lines changed

Some content is hidden

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

98 files changed

+1930
-1056
lines changed

.ci/metrics/requirements.lock.txt

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -186,34 +186,38 @@ charset-normalizer==3.4.0 \
186186
--hash=sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079 \
187187
--hash=sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482
188188
# via requests
189-
cryptography==43.0.3 \
190-
--hash=sha256:0c580952eef9bf68c4747774cde7ec1d85a6e61de97281f2dba83c7d2c806362 \
191-
--hash=sha256:0f996e7268af62598f2fc1204afa98a3b5712313a55c4c9d434aef49cadc91d4 \
192-
--hash=sha256:1ec0bcf7e17c0c5669d881b1cd38c4972fade441b27bda1051665faaa89bdcaa \
193-
--hash=sha256:281c945d0e28c92ca5e5930664c1cefd85efe80e5c0d2bc58dd63383fda29f83 \
194-
--hash=sha256:2ce6fae5bdad59577b44e4dfed356944fbf1d925269114c28be377692643b4ff \
195-
--hash=sha256:315b9001266a492a6ff443b61238f956b214dbec9910a081ba5b6646a055a805 \
196-
--hash=sha256:443c4a81bb10daed9a8f334365fe52542771f25aedaf889fd323a853ce7377d6 \
197-
--hash=sha256:4a02ded6cd4f0a5562a8887df8b3bd14e822a90f97ac5e544c162899bc467664 \
198-
--hash=sha256:53a583b6637ab4c4e3591a15bc9db855b8d9dee9a669b550f311480acab6eb08 \
199-
--hash=sha256:63efa177ff54aec6e1c0aefaa1a241232dcd37413835a9b674b6e3f0ae2bfd3e \
200-
--hash=sha256:74f57f24754fe349223792466a709f8e0c093205ff0dca557af51072ff47ab18 \
201-
--hash=sha256:7e1ce50266f4f70bf41a2c6dc4358afadae90e2a1e5342d3c08883df1675374f \
202-
--hash=sha256:81ef806b1fef6b06dcebad789f988d3b37ccaee225695cf3e07648eee0fc6b73 \
203-
--hash=sha256:846da004a5804145a5f441b8530b4bf35afbf7da70f82409f151695b127213d5 \
204-
--hash=sha256:8ac43ae87929a5982f5948ceda07001ee5e83227fd69cf55b109144938d96984 \
205-
--hash=sha256:9762ea51a8fc2a88b70cf2995e5675b38d93bf36bd67d91721c309df184f49bd \
206-
--hash=sha256:a2a431ee15799d6db9fe80c82b055bae5a752bef645bba795e8e52687c69efe3 \
207-
--hash=sha256:bf7a1932ac4176486eab36a19ed4c0492da5d97123f1406cf15e41b05e787d2e \
208-
--hash=sha256:c2e6fc39c4ab499049df3bdf567f768a723a5e8464816e8f009f121a5a9f4405 \
209-
--hash=sha256:cbeb489927bd7af4aa98d4b261af9a5bc025bd87f0e3547e11584be9e9427be2 \
210-
--hash=sha256:d03b5621a135bffecad2c73e9f4deb1a0f977b9a8ffe6f8e002bf6c9d07b918c \
211-
--hash=sha256:d56e96520b1020449bbace2b78b603442e7e378a9b3bd68de65c782db1507995 \
212-
--hash=sha256:df6b6c6d742395dd77a23ea3728ab62f98379eff8fb61be2744d4679ab678f73 \
213-
--hash=sha256:e1be4655c7ef6e1bbe6b5d0403526601323420bcf414598955968c9ef3eb7d16 \
214-
--hash=sha256:f18c716be16bc1fea8e95def49edf46b82fccaa88587a45f8dc0ff6ab5d8e0a7 \
215-
--hash=sha256:f46304d6f0c6ab8e52770addfa2fc41e6629495548862279641972b6215451cd \
216-
--hash=sha256:f7b178f11ed3664fd0e995a47ed2b5ff0a12d893e41dd0494f406d1cf555cab7
189+
cryptography==44.0.1 \
190+
--hash=sha256:00918d859aa4e57db8299607086f793fa7813ae2ff5a4637e318a25ef82730f7 \
191+
--hash=sha256:1e8d181e90a777b63f3f0caa836844a1182f1f265687fac2115fcf245f5fbec3 \
192+
--hash=sha256:1f9a92144fa0c877117e9748c74501bea842f93d21ee00b0cf922846d9d0b183 \
193+
--hash=sha256:21377472ca4ada2906bc313168c9dc7b1d7ca417b63c1c3011d0c74b7de9ae69 \
194+
--hash=sha256:24979e9f2040c953a94bf3c6782e67795a4c260734e5264dceea65c8f4bae64a \
195+
--hash=sha256:2a46a89ad3e6176223b632056f321bc7de36b9f9b93b2cc1cccf935a3849dc62 \
196+
--hash=sha256:322eb03ecc62784536bc173f1483e76747aafeb69c8728df48537eb431cd1911 \
197+
--hash=sha256:436df4f203482f41aad60ed1813811ac4ab102765ecae7a2bbb1dbb66dcff5a7 \
198+
--hash=sha256:4f422e8c6a28cf8b7f883eb790695d6d45b0c385a2583073f3cec434cc705e1a \
199+
--hash=sha256:53f23339864b617a3dfc2b0ac8d5c432625c80014c25caac9082314e9de56f41 \
200+
--hash=sha256:5fed5cd6102bb4eb843e3315d2bf25fede494509bddadb81e03a859c1bc17b83 \
201+
--hash=sha256:610a83540765a8d8ce0f351ce42e26e53e1f774a6efb71eb1b41eb01d01c3d12 \
202+
--hash=sha256:6c8acf6f3d1f47acb2248ec3ea261171a671f3d9428e34ad0357148d492c7864 \
203+
--hash=sha256:6f76fdd6fd048576a04c5210d53aa04ca34d2ed63336d4abd306d0cbe298fddf \
204+
--hash=sha256:72198e2b5925155497a5a3e8c216c7fb3e64c16ccee11f0e7da272fa93b35c4c \
205+
--hash=sha256:887143b9ff6bad2b7570da75a7fe8bbf5f65276365ac259a5d2d5147a73775f2 \
206+
--hash=sha256:888fcc3fce0c888785a4876ca55f9f43787f4c5c1cc1e2e0da71ad481ff82c5b \
207+
--hash=sha256:8e6a85a93d0642bd774460a86513c5d9d80b5c002ca9693e63f6e540f1815ed0 \
208+
--hash=sha256:94f99f2b943b354a5b6307d7e8d19f5c423a794462bde2bf310c770ba052b1c4 \
209+
--hash=sha256:9b336599e2cb77b1008cb2ac264b290803ec5e8e89d618a5e978ff5eb6f715d9 \
210+
--hash=sha256:a2d8a7045e1ab9b9f803f0d9531ead85f90c5f2859e653b61497228b18452008 \
211+
--hash=sha256:b8272f257cf1cbd3f2e120f14c68bff2b6bdfcc157fafdee84a1b795efd72862 \
212+
--hash=sha256:bf688f615c29bfe9dfc44312ca470989279f0e94bb9f631f85e3459af8efc009 \
213+
--hash=sha256:d9c5b9f698a83c8bd71e0f4d3f9f839ef244798e5ffe96febfa9714717db7af7 \
214+
--hash=sha256:dd7c7e2d71d908dc0f8d2027e1604102140d84b155e658c20e8ad1304317691f \
215+
--hash=sha256:df978682c1504fc93b3209de21aeabf2375cb1571d4e61907b3e7a2540e83026 \
216+
--hash=sha256:e403f7f766ded778ecdb790da786b418a9f2394f36e8cc8b796cc056ab05f44f \
217+
--hash=sha256:eb3889330f2a4a148abead555399ec9a32b13b7c8ba969b72d8e500eb7ef84cd \
218+
--hash=sha256:f4daefc971c2d1f82f03097dc6f216744a6cd2ac0f04c68fb935ea2ba2a0d420 \
219+
--hash=sha256:f51f5705ab27898afda1aaa430f34ad90dc117421057782022edf0600bec5f14 \
220+
--hash=sha256:fd0ee90072861e276b0ff08bd627abec29e32a53b2be44e41dbcdf87cbee2b00
217221
# via pyjwt
218222
deprecated==1.2.15 \
219223
--hash=sha256:353bc4a8ac4bfc96800ddab349d89c25dec1079f65fd53acdcc1e0b975b21320 \
@@ -232,8 +236,8 @@ pygithub==2.5.0 \
232236
--hash=sha256:e1613ac508a9be710920d26eb18b1905ebd9926aa49398e88151c1b526aad3cf
233237
# via -r ./requirements.txt
234238
pyjwt[crypto]==2.10.1 \
235-
--hash=sha256:543b77207db656de204372350926bed5a86201c4cbff159f623f79c7bb487a15 \
236-
--hash=sha256:7628a7eb7938959ac1b26e819a1df0fd3259505627b575e4bad6d08f76db695c
239+
--hash=sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953 \
240+
--hash=sha256:dcdd193e30abefd5debf142f9adfcdd2b58004e644f25406ffaebd50bd98dacb
237241
# via pygithub
238242
pynacl==1.5.0 \
239243
--hash=sha256:06b8f6fa7f5de8d5d2f7573fe8c863c051225a27b61e6860fd047b1775807858 \
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Benchmarks
2+
3+
# This workflow is a WIP: this workflow file acts as a placeholder.
4+
5+
on: [ workflow_dispatch ]
6+
7+
jobs:
8+
do-nothing:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- run: echo 'This workflow is a WIP.'
12+

.github/workflows/ur-benchmarks-reusable.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Benchmarks Reusable
22

33
# This workflow is a WIP: This workflow file acts as a placeholder.
4+
#
5+
# This workflow is set to be merged into benchmark.yml
46

57
on: [ workflow_call ]
68

.github/workflows/ur-benchmarks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Benchmarks
22

33
# This workflow is a WIP: this workflow file acts as a placeholder.
4+
#
5+
# This workflow is set to be merged into benchmark.yml
46

57
on: [ workflow_dispatch ]
68

clang/test/Driver/linker-wrapper-sycl.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@
4747
// RUN: clang-linker-wrapper -sycl-device-libraries=%t.devicelib.o -sycl-post-link-options="SYCL_POST_LINK_OPTIONS" -llvm-spirv-options="LLVM_SPIRV_OPTIONS" "--host-triple=x86_64-unknown-linux-gnu" "--triple=spir64" "--linker-path=/usr/bin/ld" -shared "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %t.o --dry-run 2>&1 | FileCheck -check-prefix=CHK-SHARED %s
4848
// CHK-SHARED: "{{.*}}clang"{{.*}} -fPIC
4949

50-
// RUN: rm %T/linker_wrapper_dump || true
51-
// RUN: clang-linker-wrapper -sycl-dump-device-code=%T/linker_wrapper_dump -sycl-device-libraries=%t.devicelib.o "--host-triple=x86_64-unknown-linux-gnu" "--triple=spir64" "--linker-path=/usr/bin/ld" -shared "--" HOST_LINKER_FLAGS "-dynamic-linker" HOST_DYN_LIB "-o" "a.out" HOST_LIB_PATH HOST_STAT_LIB %t.o --dry-run
52-
// RUN: ls %T/linker_wrapper_dump | FileCheck -check-prefix=CHK-SYCL-DUMP-DEVICE %s
53-
// CHK-SYCL-DUMP-DEVICE: {{.*}}.spv
54-
5550
/// Check for list of commands for standalone clang-linker-wrapper run for sycl (AOT for Intel GPU)
5651
// -------
5752
// Generate .o file as linker wrapper input.

clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static std::optional<llvm::module_split::IRSplitMode> SYCLModuleSplitMode;
151151

152152
static bool UseSYCLPostLinkTool;
153153

154-
static SmallString<128> SPIRVDumpDir;
154+
static SmallString<128> OffloadImageDumpDir;
155155

156156
using OffloadingImage = OffloadBinary::OffloadingImage;
157157

@@ -923,29 +923,6 @@ static Expected<StringRef> runLLVMToSPIRVTranslation(StringRef File,
923923
if (Error Err = executeCommands(*LLVMToSPIRVPath, CmdArgs))
924924
return std::move(Err);
925925

926-
if (!SPIRVDumpDir.empty()) {
927-
std::error_code EC =
928-
llvm::sys::fs::create_directory(SPIRVDumpDir, /*IgnoreExisting*/ true);
929-
if (EC)
930-
return createStringError(
931-
EC,
932-
formatv("failed to create dump directory. path: {0}, error_code: {1}",
933-
SPIRVDumpDir, EC.value()));
934-
935-
StringRef Sep = llvm::sys::path::get_separator();
936-
StringRef Path = *TempFileOrErr;
937-
StringRef Filename = Path.rsplit(Sep).second;
938-
SmallString<128> CopyPath = SPIRVDumpDir;
939-
CopyPath.append(Filename);
940-
EC = llvm::sys::fs::copy_file(Path, CopyPath);
941-
if (EC)
942-
return createStringError(
943-
EC,
944-
formatv(
945-
"failed to copy file. original: {0}, copy: {1}, error_code: {2}",
946-
Path, CopyPath, EC.value()));
947-
}
948-
949926
return *TempFileOrErr;
950927
}
951928

@@ -1103,6 +1080,18 @@ wrapSYCLBinariesFromFile(std::vector<module_split::SplitModule> &SplitModules,
11031080
RegularTarget = "spir64";
11041081

11051082
for (auto &SI : SplitModules) {
1083+
if (!OffloadImageDumpDir.empty()) {
1084+
StringRef CopyFrom = SI.ModuleFilePath;
1085+
SmallString<128> CopyTo = OffloadImageDumpDir;
1086+
StringRef Filename = sys::path::filename(CopyFrom);
1087+
CopyTo.append(Filename);
1088+
std::error_code EC = sys::fs::copy_file(CopyFrom, CopyTo);
1089+
if (EC)
1090+
return createStringError(EC, formatv("failed to copy file. From: "
1091+
"{0} to: {1}, error_code: {2}",
1092+
CopyFrom, CopyTo, EC.value()));
1093+
}
1094+
11061095
auto MBOrDesc = MemoryBuffer::getFile(SI.ModuleFilePath);
11071096
if (!MBOrDesc)
11081097
return createFileError(SI.ModuleFilePath, MBOrDesc.getError());
@@ -2618,13 +2607,11 @@ int main(int Argc, char **Argv) {
26182607

26192608
if (Args.hasArg(OPT_sycl_dump_device_code_EQ)) {
26202609
Arg *A = Args.getLastArg(OPT_sycl_dump_device_code_EQ);
2621-
SmallString<128> Dir(A->getValue());
2622-
if (Dir.empty())
2623-
llvm::sys::path::native(Dir = "./");
2610+
OffloadImageDumpDir = A->getValue();
2611+
if (OffloadImageDumpDir.empty())
2612+
sys::path::native(OffloadImageDumpDir = "./");
26242613
else
2625-
Dir.append(llvm::sys::path::get_separator());
2626-
2627-
SPIRVDumpDir = Dir;
2614+
OffloadImageDumpDir.append(sys::path::get_separator());
26282615
}
26292616

26302617
{

clang/tools/clang-linker-wrapper/LinkerWrapperOpts.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ Flags<[WrapperOnlyOption]>, HelpText<"Embed LLVM IR for runtime kernel fusion">
242242

243243
def sycl_dump_device_code_EQ : Joined<["--", "-"], "sycl-dump-device-code=">,
244244
Flags<[WrapperOnlyOption]>,
245-
HelpText<"Path to the folder where the tool dumps SPIR-V device code. Other formats aren't dumped.">;
245+
HelpText<"Directory to dump offloading images to.">;
246246

247247
// Options to enable/disable device dynamic linking.
248248
def sycl_allow_device_image_dependencies : Flag<["--", "-"], "sycl-allow-device-image-dependencies">,

devops/scripts/benchmarks/benches/base.py

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,37 @@
1-
# Copyright (C) 2024 Intel Corporation
1+
# Copyright (C) 2024-2025 Intel Corporation
22
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
33
# See LICENSE.TXT
44
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
55

6+
from dataclasses import dataclass
67
import os
78
import shutil
89
from pathlib import Path
9-
from .result import Result
10+
from utils.result import BenchmarkMetadata, BenchmarkTag, Result
1011
from options import options
1112
from utils.utils import download, run
12-
import urllib.request
13-
import tarfile
13+
14+
benchmark_tags = [
15+
BenchmarkTag("SYCL", "Benchmark uses SYCL runtime"),
16+
BenchmarkTag("UR", "Benchmark uses Unified Runtime API"),
17+
BenchmarkTag("L0", "Benchmark uses Level Zero API directly"),
18+
BenchmarkTag("UMF", "Benchmark uses Unified Memory Framework directly"),
19+
BenchmarkTag("micro", "Microbenchmark focusing on a specific functionality"),
20+
BenchmarkTag("application", "Real application-based performance test"),
21+
BenchmarkTag("proxy", "Benchmark that simulates real application use-cases"),
22+
BenchmarkTag("submit", "Tests kernel submission performance"),
23+
BenchmarkTag("math", "Tests math computation performance"),
24+
BenchmarkTag("memory", "Tests memory transfer or bandwidth performance"),
25+
BenchmarkTag("allocation", "Tests memory allocation performance"),
26+
BenchmarkTag("graph", "Tests graph-based execution performance"),
27+
BenchmarkTag("latency", "Measures operation latency"),
28+
BenchmarkTag("throughput", "Measures operation throughput"),
29+
BenchmarkTag("inference", "Tests ML/AI inference performance"),
30+
BenchmarkTag("image", "Image processing benchmark"),
31+
BenchmarkTag("simulation", "Physics or scientific simulation benchmark"),
32+
]
33+
34+
benchmark_tags_dict = {tag.name: tag for tag in benchmark_tags}
1435

1536

1637
class Benchmark:
@@ -55,19 +76,25 @@ def create_data_path(self, name, skip_data_dir=False):
5576
data_path = os.path.join(self.directory, name)
5677
else:
5778
data_path = os.path.join(self.directory, "data", name)
58-
if options.rebuild and Path(data_path).exists():
79+
if options.redownload and Path(data_path).exists():
5980
shutil.rmtree(data_path)
6081

6182
Path(data_path).mkdir(parents=True, exist_ok=True)
6283

6384
return data_path
6485

65-
def download(self, name, url, file, untar=False, unzip=False, skip_data_dir=False):
86+
def download(
87+
self,
88+
name,
89+
url,
90+
file,
91+
untar=False,
92+
unzip=False,
93+
skip_data_dir=False,
94+
checksum="",
95+
):
6696
self.data_path = self.create_data_path(name, skip_data_dir)
67-
return download(self.data_path, url, file, untar, unzip)
68-
69-
def name(self):
70-
raise NotImplementedError()
97+
return download(self.data_path, url, file, untar, unzip, checksum)
7198

7299
def lower_is_better(self):
73100
return True
@@ -87,6 +114,30 @@ def stddev_threshold(self):
87114
def get_suite_name(self) -> str:
88115
return self.suite.name()
89116

117+
def name(self):
118+
raise NotImplementedError()
119+
120+
def description(self):
121+
return ""
122+
123+
def notes(self) -> str:
124+
return None
125+
126+
def unstable(self) -> str:
127+
return None
128+
129+
def get_tags(self) -> list[str]:
130+
return []
131+
132+
def get_metadata(self) -> BenchmarkMetadata:
133+
return BenchmarkMetadata(
134+
type="benchmark",
135+
description=self.description(),
136+
notes=self.notes(),
137+
unstable=self.unstable(),
138+
tags=self.get_tags(),
139+
)
140+
90141

91142
class Suite:
92143
def benchmarks(self) -> list[Benchmark]:
@@ -97,3 +148,6 @@ def name(self) -> str:
97148

98149
def setup(self):
99150
return
151+
152+
def additionalMetadata(self) -> dict[str, BenchmarkMetadata]:
153+
return {}

0 commit comments

Comments
 (0)