Skip to content

Incorrect ref version for pooling with count_include_pad=True #4350

@pfultz2

Description

@pfultz2

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions