Skip to content

Incorrect results in sparse_tanh.mlir and sparse_matmul.mlir #60626

Open
@banach-space

Description

@banach-space

Hi,

In https://reviews.llvm.org/D143514 I updated some SparseCompiler integration tests to use SVE code-gen path. In two cases the generated output disagrees with the expected output.

1. sparse_tanh.mlir
Expected output:

// CHECK-NEXT: {{( -0.761[0-9]*, 0.761[0-9]*, 0.96[0-9]*, 0.99[0-9]*, 0.99[0-9]*, 0.99[0-9]*, 0.99[0-9]*, 0.99[0-9]*, 1 )}}

Output generated by the SVE RUN line

( -0.761594, 0, 0, 0.761594, 0, 0, 0, 0, 0, 0, 0, 0.964028, 0, 0, 0, 0, 0, 0.995055, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 )

Note the non-zero values at the end in one case and zeros in the other.

2. sparse_matmul.mlir
Output generated by non-sve RUN lines:

[30.5,  4.2,  4.6,  7,  8,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0]

Output generated by the SVE RUN line:

[30.5,  4.2,  4.6,  7,  8,  4.32995e-304,  5.24135e-304,  8.48805e-314,  3.95253e-322,  3.95253e-322,  9.2689e-310,  9.27115e-310,  0,  2,  0,  0]

All values are effectively correct except 2 at the end. The test passes nonetheless as the CHECK lines only verifiy the first 5 values:

// CHECK: [30.5,  4.2,  4.6,  7,  8{{.*}}]

SET-UP
Tested with ToT on AWS Graviton 3 (9c7g.12xlarge).

The results with qemu-aarch64 are also incorrect, but the actual values are different.

CC @aartbik

-Andrzej

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions