Hi, I'm trying to use strided memory with strides of zero as shown here, however, I'm not seeing the results I expect.
In particular:
Have I gotten something wrong here, or if not how can I make sense of the above? Thank you.
Hi @alannnna ,
Thank you for your report. I reproduced behavior you described. It is an issue in optimized version of binary primitive, I tried your reproducer with manually disabled optimized implementation and the result matches expected result:
The current behavior on master:
DNNL_VERBOSE=1 ./build/examples/zero-strides-cpp
dnnl_verbose,info,cpu,runtime:OpenMP
dnnl_verbose,info,cpu,isa:Intel AVX2
dnnl_verbose,info,gpu,runtime:none
dnnl_verbose,info,prim_template:operation,engine,primitive,implementation,prop_kind,memory_descriptors,attributes,auxiliary,problem_desc,exec_time
dnnl_verbose,exec,cpu,binary,jit:uni,undef,src_f32::blocked:ab:f0 src_f32::blocked:ab:f0 dst_f32::blocked:ab:f0,,alg:binary_add,2x3:2x3,2.04419
1 2 3 4 5 6
With disabled optimized implementation:
dnnl_verbose,info,cpu,runtime:OpenMP
dnnl_verbose,info,cpu,isa:Intel AVX2
dnnl_verbose,info,gpu,runtime:none
dnnl_verbose,info,prim_template:operation,engine,primitive,implementation,prop_kind,memory_descriptors,attributes,auxiliary,problem_desc,exec_time
dnnl_verbose,exec,cpu,binary,ref:any,undef,src_f32::blocked:ab:f0 src_f32::blocked:ab:f0 dst_f32::blocked:ab:f0,,alg:binary_add,2x3:2x3,5.67798
1 1 1 4 4 4
As a short-term solution you could disable jit implementations by commenting out jit_uni_*_binary instantiations in src/cpu/cpu_binary_list.cpp, however performance will be affected for all binary operations used in your application. In long - term jit binary should either support such memory descriptors or be disabled for those cases.
We will update you once fix is promoted in master.
Regards,
Igor Safonov
Hi @alannnna ,
Could you please post the example on your side under Apache license so we can include it in oneDNN repository as a regression test?
Regards,
Igor Safonov
@igorsafo - I added a LICENSE file to the gist. Let me know if I should do something different. Thanks!
Fixed by 5906f4d003d5ac225d62afa092473107c2b3713e and backported to v2.2.