Skip to content

TileAndFuse configuration gives numeric error #19343

@nirvedhmeshram

Description

@nirvedhmeshram

For this pre-configured aligned matmul

compile with

iree-compile small_matmul_aligned_withconfig.mlir   -o output_tileandfuse_aligned.vmfb 

and run

iree-run-module --device=hip --module=output_tileandfuse_aligned.vmfb --input=64x64xf32=1 --input=64x16xf32=1

the expected answer is all 64s but we get

EXEC @matmul
result[0]: hal.buffer_view
64x16xf32=[16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16][16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]
[16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16][16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16][16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]
[16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16][16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16][16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]
[16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16][16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16][16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]
[16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16][16 16 16 16 16 16 16 16 16 16 16 16 16 16 16 16]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0][0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]

The heuristics will not automatically choose this configuration for aligned shape but they do for unaligned shape where this bug was originally discovered.

Note that this is using c promotion which is new for tile and fuse pipeline. However even for aligned case this configuration is yet to be supported without c promotion. The missing patterns are being added for that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐞Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions