Skip to content

Commit 29f7c71

Browse files
committed
fix 2 pvc machine
2 parents ec71b98 + 06f48f6 commit 29f7c71

Some content is hidden

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

65 files changed

+4546
-377
lines changed

.github/workflows/multi_device.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ jobs:
5858

5959
- name: Test adapter specific
6060
working-directory: ${{github.workspace}}/build
61-
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" -E "test-adapter-level_zero_multi_queue" --timeout 180
62-
# TODO: investigate why test-adapter-level_zero_multi_queue fails on newer driver
61+
run: ctest -C ${{matrix.build_type}} --output-on-failure -L "adapter-specific" --timeout 180
6362

6463
- name: Test adapters
6564
working-directory: ${{github.workspace}}/build

cmake/helpers.cmake

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,28 @@ function(add_ur_target_compile_options name)
120120
elseif(MSVC)
121121
target_compile_options(${name} PRIVATE
122122
$<$<CXX_COMPILER_ID:MSVC>:/MP> # clang-cl.exe does not support /MP
123-
/W3
124123
/MD$<$<CONFIG:Debug>:d>
125-
/GS
126-
/DWIN32_LEAN_AND_MEAN
127-
/DNOMINMAX
124+
125+
/W3
126+
/GS # Enable: Buffer security check
127+
/Gy # Enable: Function-level linking
128+
129+
$<$<CONFIG:Release>:/sdl> # Enable: Additional SDL checks
130+
$<$<CXX_COMPILER_ID:MSVC>:/Qspectre> # Enable: Mitigate Spectre variant 1 vulnerabilities
131+
132+
/wd4267 # Disable: 'var' : conversion from 'size_t' to 'type', possible loss of data
133+
/wd6244 # Disable: local declaration of 'variable' hides previous declaration
134+
/wd6246 # Disable: local declaration of 'variable' hides declaration of same name in outer scope
135+
)
136+
137+
target_compile_definitions(${name} PRIVATE
138+
WIN32_LEAN_AND_MEAN NOMINMAX # Cajole Windows.h to define fewer symbols
139+
_CRT_SECURE_NO_WARNINGS # Slience warnings about getenv
128140
)
129141

130142
if(UR_DEVELOPER_MODE)
131-
# _CRT_SECURE_NO_WARNINGS used mainly because of getenv
132-
# C4267: The compiler detected a conversion from size_t to a smaller type.
133143
target_compile_options(${name} PRIVATE
134-
/WX /GS /D_CRT_SECURE_NO_WARNINGS /wd4267
144+
/WX # Enable: Treat all warnings as errors
135145
)
136146
endif()
137147
endif()
@@ -155,9 +165,12 @@ function(add_ur_target_link_options name)
155165
endif()
156166
elseif(MSVC)
157167
target_link_options(${name} PRIVATE
158-
LINKER:/DYNAMICBASE
159-
LINKER:/HIGHENTROPYVA
160-
LINKER:/NXCOMPAT
168+
LINKER:/DYNAMICBASE # Enable: Modify header to indicate ASLR should be use
169+
LINKER:/HIGHENTROPYVA # Enable: High-entropy address space layout randomization (ASLR)
170+
$<$<CONFIG:Release>:
171+
LINKER:/NXCOMPAT # Enable: Data Execution Prevention
172+
LINKER:/LTCG # Enable: Link-time code generation
173+
>
161174
)
162175
endif()
163176
endfunction()

scripts/benchmarks/benches/compute.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ def extra_env_vars(self) -> dict:
104104
def setup(self):
105105
self.benchmark_bin = os.path.join(self.bench.directory, 'compute-benchmarks-build', 'bin', self.bench_name)
106106

107+
def explicit_group(self):
108+
return ""
109+
107110
def run(self, env_vars) -> list[Result]:
108111
command = [
109112
f"{self.benchmark_bin}",
@@ -120,7 +123,8 @@ def run(self, env_vars) -> list[Result]:
120123
ret = []
121124
for label, median, stddev, unit in parsed_results:
122125
extra_label = " CPU count" if parse_unit_type(unit) == "instr" else ""
123-
ret.append(Result(label=self.name() + extra_label, value=median, stddev=stddev, command=command, env=env_vars, stdout=result, unit=parse_unit_type(unit)))
126+
explicit_group = self.explicit_group() + extra_label if self.explicit_group() != "" else ""
127+
ret.append(Result(label=self.name() + extra_label, explicit_group=explicit_group, value=median, stddev=stddev, command=command, env=env_vars, stdout=result, unit=parse_unit_type(unit)))
124128
return ret
125129

126130
def parse_output(self, output):
@@ -158,6 +162,9 @@ def name(self):
158162
order = "in order" if self.ioq else "out of order"
159163
return f"api_overhead_benchmark_sycl SubmitKernel {order}"
160164

165+
def explicit_group(self):
166+
return "SubmitKernel"
167+
161168
def bin_args(self) -> list[str]:
162169
return [
163170
f"--Ioq={self.ioq}",
@@ -178,6 +185,9 @@ def name(self):
178185
order = "in order" if self.ioq else "out of order"
179186
return f"api_overhead_benchmark_ur SubmitKernel {order}"
180187

188+
def explicit_group(self):
189+
return "SubmitKernel"
190+
181191
def bin_args(self) -> list[str]:
182192
return [
183193
f"--Ioq={self.ioq}",
@@ -198,6 +208,9 @@ def name(self):
198208
order = "in order" if self.ioq else "out of order"
199209
return f"api_overhead_benchmark_l0 SubmitKernel {order}"
200210

211+
def explicit_group(self):
212+
return "SubmitKernel"
213+
201214
def bin_args(self) -> list[str]:
202215
return [
203216
f"--Ioq={self.ioq}",

scripts/benchmarks/benches/result.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Result:
1818
stdout: str
1919
passed: bool = True
2020
unit: str = ""
21+
explicit_group: str = ""
2122
# stddev can be optionally set by the benchmark,
2223
# if not set, it will be calculated automatically.
2324
stddev: float = 0.0

scripts/benchmarks/benches/test.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,30 +20,31 @@ def setup(self):
2020

2121
def benchmarks(self) -> list[Benchmark]:
2222
bench_configs = [
23-
("Memory Bandwidth", 2000, 200),
24-
("Latency", 100, 20),
25-
("Throughput", 1500, 150),
26-
("FLOPS", 3000, 300),
27-
("Cache Miss Rate", 250, 25),
23+
("Memory Bandwidth", 2000, 200, "Foo Group"),
24+
("Latency", 100, 20, "Bar Group"),
25+
("Throughput", 1500, 150, "Foo Group"),
26+
("FLOPS", 3000, 300, "Foo Group"),
27+
("Cache Miss Rate", 250, 25, "Bar Group"),
2828
]
2929

3030
result = []
31-
for base_name, base_value, base_diff in bench_configs:
31+
for base_name, base_value, base_diff, group in bench_configs:
3232
for variant in range(6):
3333
value_multiplier = 1.0 + (variant * 0.2)
3434
name = f"{base_name} {variant+1}"
3535
value = base_value * value_multiplier
3636
diff = base_diff * value_multiplier
3737

38-
result.append(TestBench(name, value, diff))
38+
result.append(TestBench(name, value, diff, group))
3939

4040
return result
4141

4242
class TestBench(Benchmark):
43-
def __init__(self, name, value, diff):
43+
def __init__(self, name, value, diff, group = ''):
4444
self.bname = name
4545
self.value = value
4646
self.diff = diff
47+
self.group = group
4748
super().__init__("")
4849

4950
def name(self):
@@ -58,7 +59,7 @@ def setup(self):
5859
def run(self, env_vars) -> list[Result]:
5960
random_value = self.value + random.uniform(-1 * (self.diff), self.diff)
6061
return [
61-
Result(label=self.name(), value=random_value, command="", env={"A": "B"}, stdout="no output", unit="ms")
62+
Result(label=self.name(), explicit_group=self.group, value=random_value, command="", env={"A": "B"}, stdout="no output", unit="ms")
6263
]
6364

6465
def teardown(self):

scripts/benchmarks/main.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,9 @@ def main(directory, additional_env_vars, save_name, compare_names, filter):
183183
# should this be configurable?
184184
history.load(1000)
185185

186+
# remove duplicates. this can happen if e.g., --compare baseline is specified manually.
187+
compare_names = list(dict.fromkeys(compare_names))
188+
186189
for name in compare_names:
187190
compare_result = history.get_compare(name)
188191
if compare_result:
@@ -203,7 +206,8 @@ def main(directory, additional_env_vars, save_name, compare_names, filter):
203206
# Otherwise we might be comparing the results to themselves.
204207
if not options.dry_run:
205208
history.save(saved_name, results, save_name is not None)
206-
compare_names.append(saved_name)
209+
if saved_name not in compare_names:
210+
compare_names.append(saved_name)
207211

208212
if options.output_html:
209213
html_content = generate_html(history.runs, 'oneapi-src/unified-runtime', compare_names)

0 commit comments

Comments
 (0)