Skip to content

[CPU] Incorrect results depending on native_vector_size for fusion of 2 generics. #23952

@bjacob

Description

@bjacob

See attached reproduction. Unzip, cd into that directory and run ./repro.sh

repro.zip

repro.sh is just compiling, running, and print the number of NaNs. The expected result is 0 (even though NaNs occur as intermediate results, they should not occur in the final outputs). The actual value is 311. If you edit the testcase to change native_vector_size from 32 to 64, then the printed value changes from 311 to 0, which confirms that there is a bug: the outputs should not depend on the value of native_vector_size.

This testcase is already minimal in the following sense:

  1. The source has to be post Flow. If we just make the source be pure linalg, it doesn't reproduce anymore, presumably because it is essential to have one dispatch fusing the two generics here.
  2. If we try pre-evaluating the first generic (reduction) and feeding its output to just the second generic, this stops reproducing too. Again, this seems to show that the problem is specifically about the fusion.
  3. The testcase also stops reproducing if I try removing any of the remaining ops in the second generic.

Metadata

Metadata

Assignees

Labels

bug 🐞Something isn't workingcodegen/llvmLLVM code generation compiler backend

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions