Skip to content

Commit f0c9da5

Browse files
committed
Merge branch 'sycl' into no_handler_scheduler_bypass
2 parents 956d27a + d13a577 commit f0c9da5

File tree

70 files changed

+920
-631
lines changed

Some content is hidden

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

70 files changed

+920
-631
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,13 @@ on:
9393
type: choice
9494
options:
9595
- "[]"
96+
- '[sycl]'
9697
- '[llvm, clang, sycl, llvm_spirv, xptifw, libclc]'
9798
build_image:
9899
type: choice
99100
options:
100101
- 'ghcr.io/intel/llvm/sycl_ubuntu2404_nightly:latest'
102+
- 'ghcr.io/intel/llvm/ubuntu2204_build:latest'
101103
cc:
102104
type: choice
103105
options:

clang/lib/Driver/ToolChains/SYCL.cpp

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,7 @@ void SYCLToolChain::AddImpliedTargetArgs(const llvm::Triple &Triple,
18151815
// Default device AOT: -g -cl-opt-disable
18161816
// Default device JIT: -g (-O0 is handled by the runtime)
18171817
// GEN: -options "-g -O0"
1818-
// CPU: "--bo=-g -cl-opt-disable"
1818+
// CPU: "--bo=-g" "-bo=-cl-opt-disable"
18191819
llvm::opt::ArgStringList BeArgs;
18201820
// Per-device argument vector storing the device name and the backend argument
18211821
// string
@@ -1969,17 +1969,23 @@ void SYCLToolChain::AddImpliedTargetArgs(const llvm::Triple &Triple,
19691969
CmdArgs.push_back(Args.MakeArgString(A));
19701970
return;
19711971
}
1972-
SmallString<128> BeOpt;
1973-
if (IsGen)
1972+
if (IsGen) {
1973+
SmallString<128> BeOpt;
19741974
CmdArgs.push_back("-options");
1975-
else
1976-
BeOpt = "--bo=";
1977-
for (unsigned I = 0; I < BeArgs.size(); ++I) {
1978-
if (I)
1979-
BeOpt += ' ';
1980-
BeOpt += BeArgs[I];
1975+
for (unsigned I = 0; I < BeArgs.size(); ++I) {
1976+
if (I)
1977+
BeOpt += ' ';
1978+
BeOpt += BeArgs[I];
1979+
}
1980+
CmdArgs.push_back(Args.MakeArgString(BeOpt));
1981+
} else {
1982+
for (unsigned I = 0; I < BeArgs.size(); ++I) {
1983+
SmallString<128> BeOpt;
1984+
BeOpt += "--bo=";
1985+
BeOpt += BeArgs[I];
1986+
CmdArgs.push_back(Args.MakeArgString(BeOpt));
1987+
}
19811988
}
1982-
CmdArgs.push_back(Args.MakeArgString(BeOpt));
19831989
}
19841990

19851991
void SYCLToolChain::TranslateBackendTargetArgs(

clang/test/Driver/sycl-offload-aot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-CPU %s
146146
// RUN: %clang_cl -### -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown -Zi -Od -Xsycl-target-backend "-DFOO1 -DFOO2" -- %s 2>&1 \
147147
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-CPU %s
148-
// CHK-TOOLS-IMPLIED-OPTS-CPU: opencl-aot{{.*}} "--bo=-g -cl-opt-disable" "-DFOO1" "-DFOO2"
148+
// CHK-TOOLS-IMPLIED-OPTS-CPU: opencl-aot{{.*}} "--bo=-g" "--bo=-cl-opt-disable" "-DFOO1" "-DFOO2"
149149

150150
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_gen-unknown-unknown -g -O0 -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
151151
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-GEN %s

devops/containers/ubuntu2204_intel_drivers.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ USER root
99

1010
RUN apt update && apt install -yqq wget
1111

12-
COPY scripts/get_release.py /
1312
COPY scripts/install_drivers.sh /
1413
COPY dependencies.json /
1514

devops/containers/ubuntu2404_intel_drivers.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ USER root
99

1010
RUN apt update && apt install -yqq wget
1111

12-
COPY scripts/get_release.py /
1312
COPY scripts/install_drivers.sh /
1413
COPY dependencies.json /
1514

devops/containers/ubuntu2404_intel_drivers_igc_dev.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ USER root
99

1010
RUN apt update && apt install -yqq libllvm14 libllvm15 libz3-4
1111

12-
COPY scripts/get_release.py /
1312
COPY scripts/install_drivers.sh /
1413
COPY dependencies.json /
1514
COPY dependencies-igc-dev.json /

devops/dependencies-igc-dev.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"linux": {
33
"igc_dev": {
4-
"github_tag": "igc-dev-6d3f69e",
5-
"version": "6d3f69e",
6-
"updated_at": "2025-09-20T11:44:56Z",
7-
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/4062749149/zip",
4+
"github_tag": "igc-dev-5572ee3",
5+
"version": "5572ee3",
6+
"updated_at": "2025-09-28T11:41:20Z",
7+
"url": "https://api.github.com/repos/intel/intel-graphics-compiler/actions/artifacts/4125423999/zip",
88
"root": "{DEPS_ROOT}/opencl/runtime/linux/oclgpu"
99
}
1010
}

devops/scripts/benchmarks/CONTRIB.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,17 @@ The benchmark suite generates an interactive HTML dashboard that visualizes `Res
191191

192192
## Utilities
193193

194+
* **`git_project.GitProject`:** Manages git repository cloning, building, and installation for benchmark suites:
195+
* Automatically clones repositories to a specified directory and checks out specific commits/refs.
196+
* Provides standardized directory structure with `src_dir`, `build_dir`, and `install_dir` properties.
197+
* Handles incremental updates - only re-clones if the target commit has changed.
198+
* Supports force rebuilds and custom directory naming via constructor options.
199+
* Provides `configure()`, `build()`, and `install()` methods for CMake-based projects.
200+
* Use this for benchmark suites that need to build from external git repositories (e.g., `ComputeBench`, `VelocityBench`).
194201
* **`utils.utils`:** Provides common helper functions:
195202
* `run()`: Executes shell commands with environment setup (SYCL paths, LD_LIBRARY_PATH).
196-
* `git_clone()`: Clones/updates Git repositories.
197203
* `download()`: Downloads files via HTTP, checks checksums, optionally extracts tar/gz archives.
198204
* `prepare_workdir()`: Sets up the main working directory.
199-
* `create_build_path()`: Creates a clean build directory.
200205
* **`utils.oneapi`:** Provides the `OneAPI` singleton class (`get_oneapi()`). Downloads and installs specified oneAPI components (oneDNN, oneMKL) into the working directory if needed, providing access to their paths (libs, includes, CMake configs). Use this if your benchmark depends on these components instead of requiring a system-wide install.
201206
* **`options.py`:** Defines and holds global configuration options, populated by `argparse` in `main.py`. Use options instead of defining your own global variables.
202207
* **`presets.py`:** Defines named sets of suites (`enabled_suites()`) used by the `--preset` argument.

devops/scripts/benchmarks/benches/base.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ class TracingType(Enum):
4949

5050

5151
class Benchmark(ABC):
52-
def __init__(self, directory, suite):
53-
self.directory = directory
52+
def __init__(self, suite):
5453
self.suite = suite
5554

5655
@abstractmethod
@@ -84,8 +83,8 @@ def tracing_enabled(self, run_trace, force_trace, tr_type: TracingType):
8483
"""Returns whether tracing is enabled for the given type."""
8584
return (self.traceable(tr_type) or force_trace) and run_trace == tr_type
8685

87-
@abstractmethod
8886
def setup(self):
87+
"""Extra setup steps to be performed before running the benchmark."""
8988
pass
9089

9190
@abstractmethod
@@ -205,9 +204,9 @@ def run_bench(
205204

206205
def create_data_path(self, name, skip_data_dir=False):
207206
if skip_data_dir:
208-
data_path = os.path.join(self.directory, name)
207+
data_path = os.path.join(options.workdir, name)
209208
else:
210-
data_path = os.path.join(self.directory, "data", name)
209+
data_path = os.path.join(options.workdir, "data", name)
211210
if options.redownload and Path(data_path).exists():
212211
shutil.rmtree(data_path)
213212

devops/scripts/benchmarks/benches/benchdnn.py

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@
88

99
from .base import Suite, Benchmark, TracingType
1010
from options import options
11-
from utils.utils import git_clone, run, create_build_path
1211
from utils.result import Result
1312
from utils.oneapi import get_oneapi
1413
from utils.logger import log
1514
from .benchdnn_list import get_bench_dnn_list
15+
from git_project import GitProject
1616

1717

1818
class OneDnnBench(Suite):
19-
def __init__(self, directory):
20-
self.directory = Path(directory).resolve()
21-
build_path = create_build_path(self.directory, "onednn-build")
22-
self.build_dir = Path(build_path)
23-
self.src_dir = self.directory / "onednn-repo"
19+
def __init__(self):
20+
self.project = None
2421

2522
def git_url(self):
2623
return "https://github.com/uxlfoundation/oneDNN.git"
@@ -62,36 +59,35 @@ def setup(self) -> None:
6259
if options.sycl is None:
6360
return
6461

65-
self.src_dir = git_clone(
66-
self.directory,
67-
"onednn-repo",
68-
self.git_url(),
69-
self.git_tag(),
70-
)
71-
7262
self.oneapi = get_oneapi()
73-
cmake_args = [
74-
"cmake",
75-
f"-S {self.src_dir}",
76-
f"-B {self.build_dir}",
63+
if self.project is None:
64+
self.project = GitProject(
65+
self.git_url(),
66+
self.git_tag(),
67+
Path(options.workdir),
68+
"onednn",
69+
force_rebuild=True,
70+
)
71+
72+
extra_cmake_args = [
7773
f"-DCMAKE_PREFIX_PATH={options.sycl}",
7874
"-DCMAKE_CXX_COMPILER=clang++",
7975
"-DCMAKE_C_COMPILER=clang",
80-
"-DCMAKE_BUILD_TYPE=Release",
8176
"-DDNNL_BUILD_TESTS=ON",
8277
"-DDNNL_BUILD_EXAMPLES=OFF",
8378
"-DDNNL_CPU_RUNTIME=NONE", # Disable SYCL CPU support
8479
"-DDNNL_GPU_RUNTIME=SYCL", # Enable SYCL GPU support
8580
]
86-
run(
87-
cmake_args,
81+
self.project.configure(
82+
extra_cmake_args,
83+
install_prefix=False,
8884
add_sycl=True,
8985
)
90-
91-
run(
92-
f"cmake --build {self.build_dir} --target benchdnn -j {options.build_jobs}",
86+
self.project.build(
87+
target="benchdnn",
9388
add_sycl=True,
94-
ld_library=[str(self.build_dir) + "/src"] + self.oneapi.ld_libraries(),
89+
ld_library=[str(self.project.build_dir / "src")]
90+
+ self.oneapi.ld_libraries(),
9591
timeout=60 * 20,
9692
)
9793

@@ -113,7 +109,10 @@ def __init__(self, suite, bench_driver, bench_name, bench_args, syclgraph=True):
113109
self.bench_args += " --execution-mode=direct"
114110
self.bench_name += "-eager"
115111
self.bench_args += f" {bench_args}"
116-
self.bench_bin = suite.build_dir / "tests" / "benchdnn" / "benchdnn"
112+
113+
@property
114+
def benchmark_bin(self) -> Path:
115+
return self.suite.project.build_dir / "tests" / "benchdnn" / "benchdnn"
117116

118117
def enabled(self):
119118
if options.sycl is None:
@@ -129,8 +128,8 @@ def explicit_group(self) -> str:
129128
return self.exp_group
130129

131130
def setup(self):
132-
if not self.bench_bin.exists():
133-
raise FileNotFoundError(f"Benchmark binary not found: {self.bench_bin}")
131+
if not self.benchmark_bin.exists():
132+
raise FileNotFoundError(f"Benchmark binary not found: {self.benchmark_bin}")
134133

135134
def run(
136135
self,
@@ -145,12 +144,12 @@ def run(
145144
extra_trace_opt = None
146145

147146
command = [
148-
str(self.bench_bin),
147+
str(self.benchmark_bin),
149148
*self.bench_args.split(),
150149
]
151150

152151
ld_library = self.suite.oneapi.ld_libraries() + [
153-
str(self.suite.build_dir / "src")
152+
str(self.suite.project.build_dir / "src")
154153
]
155154

156155
env_vars = dict(env_vars) if env_vars else {}

0 commit comments

Comments
 (0)