Skip to content

Commit 71e4bcb

Browse files
committed
benchdnn: fix out-of-memory encountered on iGPU systems
Adds a new benchdnn_combined_limit for the combined device and CPU memory limit. A new combined capacity factor was introduced, as the capacity factor appears unnecessarily strict from what has been observed in practice. We likely could increase the current capacity factor, but that is avoided in this patch to limit the scope of this change.
1 parent e9e696f commit 71e4bcb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/benchdnn/dnnl_common.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1129,6 +1129,7 @@ int check_total_size(res_t *res, dnnl_primitive_t prim_ref) {
11291129
const double capacity_factor = 0.75;
11301130
const double benchdnn_device_limit = capacity_factor * device_max_capacity;
11311131
const double benchdnn_cpu_limit = capacity_factor * cpu_device_capacity;
1132+
const double benchdnn_combined_limit = 0.90 * cpu_device_capacity;
11321133
assert(benchdnn_device_limit > 0 && benchdnn_cpu_limit > 0);
11331134

11341135
auto dir_c_str = [&res]() {
@@ -1203,7 +1204,7 @@ int check_total_size(res_t *res, dnnl_primitive_t prim_ref) {
12031204
size_t cpu_and_device_size
12041205
= total_size_cpu + check_mem_size_args.total_size_device;
12051206
bool fits_cpu_ram = cpu_and_device_size
1206-
<= (is_cpu() ? benchdnn_cpu_limit : cpu_device_capacity);
1207+
<= (is_cpu() ? benchdnn_cpu_limit : benchdnn_combined_limit);
12071208

12081209
// Check combined size against CPU capacity as the simpler method to account
12091210
// for integrated devices and mapping/unmapping memory.

0 commit comments

Comments
 (0)