Skip to content

Commit f7fae04

Browse files
committedAug 19, 2024
generic: sycl: pooling: buf fixes when running on Intel GPU
1 parent 3355b98 commit f7fae04

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed
 

‎src/gpu/generic/sycl/pooling_kernels.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ struct pooling_fwd_kernel_vec_t {
124124
return 0;
125125
}
126126
float data_conv() const {
127-
switch (src_md().data_type()) {
127+
switch (dst_md().data_type()) {
128128
case data_type::bf16:
129129
return (float)
130130
std::numeric_limits<xpu::sycl::bfloat16_t>::lowest();

‎tests/benchdnn/pool/pool.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,15 @@ void skip_invalid_prb(const prb_t *prb, res_t *res) {
162162
// Special function to handle Nvidia libraries issues showing up through the
163163
// timeline. Not recommended to remove instances to keep working state of any
164164
// cuda/cuDNN/cuBLAS versions.
165-
bool cuda_check_correctness(const prb_t *prb,
165+
bool gpu_check_correctness(const prb_t *prb,
166166
const compare::compare_t::driver_check_func_args_t &args) {
167-
if (!is_nvidia_gpu()) return false;
167+
if (!is_gpu()) return false;
168168

169-
if (args.dt == dnnl_f16) {
169+
if (args.dt == dnnl_f16 && is_nvidia_gpu()) {
170170
// cuDNN bug: it spits f16 min value as -inf, not -65504.
171171
return args.exp == lowest_dt(args.dt) && std::isinf(args.got)
172172
&& std::signbit(args.got);
173-
} else if (args.dt == dnnl_s8) {
173+
} else if (args.dt == dnnl_s8 && is_nvidia_gpu()) {
174174
// cuDNN bug: ... and s8 min value as -127 (-INT8_MAX?), not -128.
175175
return args.exp == lowest_dt(args.dt) && args.got == -127;
176176
} else if (prb->alg == alg_t::max && (prb->dir & FLAG_BWD)
@@ -203,7 +203,7 @@ void setup_cmp(compare::compare_t &cmp, const prb_t *prb, data_kind_t kind,
203203
// and `kind` by value to avoid using dangling references.
204204
const auto pooling_add_check =
205205
[&, prb](const compare::compare_t::driver_check_func_args_t &args) {
206-
return cuda_check_correctness(prb, args);
206+
return gpu_check_correctness(prb, args);
207207
};
208208
cmp.set_driver_check_function(pooling_add_check);
209209
}

‎tests/benchdnn/pool/ref_pool.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ void compute_ref_fwd(const prb_t *prb, const args_t &args) {
3535
const int64_t SD = prb->sd, SH = prb->sh, SW = prb->sw;
3636
const int64_t DD = prb->dd, DH = prb->dh, DW = prb->dw;
3737

38-
// XXX: this is a hack to let tests with padded area to pass for bf16
39-
// dt due to the library initialize values with -max_dt, but not -INF.
4038
float max_value = lowest_dt(prb->dst_dt());
41-
if (is_nvidia_gpu() || is_amd_gpu())
42-
max_value = lowest_dt(prb->src_dt());
4339
float avg_value = 0.;
4440
// Set initial value based on ws data type
4541
int ws_off = prb->kernel_size() <= UINT8_MAX ? UINT8_MAX : INT_MAX;

0 commit comments

Comments
 (0)