onnx-mlir icon indicating copy to clipboard operation
onnx-mlir copied to clipboard

issues with mlir2FileCheck.py

Open chentong319 opened this issue 2 years ago • 1 comments

This is a very useful tool for lit test. But there are several issues with the tool:

  1. Arguments in block. They should be definition of a symbol, not a reference.
  2. name for negative constant. VAR_cvalue is used for constant Value. When the value is negative, VAR_c-* is not a legal name.
  3. name attribute for constant. We added a name attribute for constant, which contains the value of a global counter. As a result, we cannot use the mlir2FileCheck.py on one test case. My solution is to manually change name={{.*}}.

Another issue, not rooted from mlir2FileCheck.py, is the handling of DAG. The check tool is not power enough enough to handle the DAG with different order. We have to put the IR creation code in a linear sequence. For example, instead of c = (create a) + (create b), we have to write v1 = create a, v2 = create b, c = a+b

chentong319 avatar Jul 08 '22 02:07 chentong319

Can you give me a small example for 1, 2, and 3 (the mlir file), then I can try to address these suggestions.

AlexandreEichenberger avatar Jul 15 '22 17:07 AlexandreEichenberger