cornell-zhang / hcl-dialect

HeteroCL-MLIR dialect for accelerator design
https://cornell-zhang.github.io/heterocl/index.html
Other
40 stars 17 forks source link

[Build] Create Schedule Fails with `assert` Statement in fcompute #67

Closed zzzDavid closed 1 year ago

zzzDavid commented 2 years ago

Description

The struct test case use Python's assert to check whether field type is correct. This breaks schedule creation.

Relevant test case

mlir/test_dtype.py::test_struct

Error message

python: /home/nz264/shared/llvm-project-14.0.0/mlir/lib/Dialect/Affine/IR/AffineOps.cpp:2248: static void mlir::AffineLoadOp::buil
d(mlir::OpBuilder&, mlir::OperationState&, mlir::Value, mlir::AffineMap, mlir::ValueRange): Assertion `map.getNumInputs() == mapOp
erands.size() && "inconsistent index info"' failed.

Seems like assert's operand value was built but there is no operation to consume them, not exactly sure if this is the issue. This is low priority and probably not easy to fix? This thread is just to keep a note and we can fix it later.

Ref commit

zzzDavid commented 1 year ago

After adding HCL AST, using assert during input python function tracing works