Skip to content

[Integrate] RISC-V 64 has numerical issues for dynamic_pack_simple_pad_mode test #20929

Closed

Description

@hanhanW

It is identified in #20924, I haven't got the root cause yet.

See https://github.com/iree-org/iree/actions/runs/15315366130/job/43088371934?pr=20924

iree/runtime/src/iree/modules/check/module.cc:493: Failure
Failed
Expected equality of these values. Contents does not match.
  lhs:
    2x2x3x3xi32=[[[0 1 2][4 5 6][8 9 10]][[3 1 2][7 0 1][11 9 10]]][[[12 13 14][0 0 1][8 9 10]][[15 13 14][0 0 1][8 9 10]]]
  rhs:
    2x2x3x3xi32=[[[0 1 2][4 5 6][8 9 10]][[3 0 0][7 0 0][11 0 0]]][[[12 13 14][0 0 0][0 0 0]][[15 0 0][0 0 0][0 0 0]]]

[  FAILED  ] module.static_pack_simple_pad_mode, where GetParam() = 2 (15 ms)
[ RUN      ] module.dynamic_pack_simple_pad_mode
iree/runtime/src/iree/modules/check/module.cc:493: Failure
Failed
Expected equality of these values. Contents does not match.
  lhs:
    2x2x3x3xi32=[[[0 1 2][4 5 6][8 9 10]][[3 1 2][7 5 6][11 9 10]]][[[12 13 14][0 5 6][0 9 10]][[15 13 14][0 5 6][0 9 10]]]
  rhs:
    2x2x3x3xi32=[[[0 1 2][4 5 6][8 9 10]][[3 0 0][7 0 0][11 0 0]]][[[12 13 14][0 0 0][0 0 0]][[15 0 0][0 0 0][0 0 0]]]

[  FAILED  ] module.dynamic_pack_simple_pad_mode, where GetParam() = 3 (9 ms)

func.func @dynamic_pack_simple_pad_mode() {
%iree_input = flow.tensor.dynamic_constant dense<[
[0, 1, 2, 3],
[4, 5, 6, 7],
[8, 9, 10, 11],
[12, 13, 14, 15]]> : tensor<4x4xi32> -> tensor<?x?xi32>
%pad = arith.constant 0 : i32
%c0 = arith.constant 0 : index
%c1 = arith.constant 1 : index
%c3 = arith.constant 3 : index
%in_d0 = tensor.dim %iree_input, %c0 : tensor<?x?xi32>
%in_d1 = tensor.dim %iree_input, %c1 : tensor<?x?xi32>
%out_d0 = arith.ceildivui %in_d0, %c3 : index
%out_d1 = arith.ceildivui %in_d1, %c3 : index
%init = tensor.empty(%out_d0, %out_d1) : tensor<?x?x3x3xi32>
%pack = linalg.pack %iree_input padding_value(%pad : i32) inner_dims_pos = [0, 1] inner_tiles = [3, 3] into %init
: tensor<?x?xi32> -> tensor<?x?x3x3xi32>
%cast = tensor.cast %pack : tensor<?x?x3x3xi32> to tensor<2x2x3x3xi32>
check.expect_eq_const(%cast, dense<[[[[0, 1, 2], [4, 5, 6], [8, 9, 10]],
[[3, 0, 0], [7, 0, 0], [11, 0, 0]]],
[[[12, 13, 14], [0, 0, 0], [0, 0, 0]],
[[15, 0, 0], [0, 0, 0], [0, 0, 0]]]]> : tensor<2x2x3x3xi32>) : tensor<2x2x3x3xi32>
return
}

Activity

  1. added
    codegen/riscv
    on May 29, 2025
  2. hanhanW commented on May 29, 2025

    @hanhanW
    ContributorAuthor
  3. added
    bug 🐞
    on May 30, 2025
  4. mshockwave commented on Jun 13, 2025

    @mshockwave
    Contributor
  5. mshockwave commented on Jun 17, 2025

    @mshockwave
    Contributor

    Candidate PR: llvm/llvm-project#144170

    The fix was merged and I confirmed that it fixes the pack.mlir test case. I'll send another PR to re-enable this test for RISC-V once this (LLVM) patch is integrated in the next sync

  6. hanhanW commented on Jun 17, 2025

    @hanhanW
    ContributorAuthor

    Thanks @mshockwave, I'll help re-enable the test after the fix is propagated to IREE!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug 🐞codegen/riscv

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions