AMDMIGraphX icon indicating copy to clipboard operation
AMDMIGraphX copied to clipboard

Incorrect ref version for pooling with count_include_pad=True

Open pfultz2 opened this issue 3 months ago • 0 comments

The following fails verification:

p = migraphx.program()
m = p.get_main_module()
p_x = m.add_parameter("x", migraphx.shape(type="float_type", lens=[1, 1, 2]))
x_1 = m.add_instruction(migraphx.op("pooling", padding=[1,2], stride=[1], lengths=[3], dilations=[1], count_include_pad=True), [p_x]) # migraphx.shape(type="float_type", lens=[1, 1, 3])
m.add_return([x_1])

However, the gpu is correct in this case, but the ref version is not. The ref version changes the size of the window in certain cases which produces an incorrect value as count_include_pad=True should always use the same window size. These changes were made in #1823, but are wrong. There is no reason to adjust the window size as we already check for out of bounds and skip.

pfultz2 avatar Oct 05 '25 21:10 pfultz2