bkim125
February 14, 2021, 8:26pm
1
I am able to use the type memref<1x1x1x1xquant.uniform<u8<1:255>:f16, 6.17568E-5:128>> without any problems.
But when I try using type aliases like this:
!qtype = type !quant.uniform<u8<1:255>:f16, 6.17568E-5:128>
memref<1x1x1x1x!qtype>
I get an “invalid memref element type”. Does anyone know how to properly use type aliases in this scenario?
ftynse
February 15, 2021, 9:04am
2
bkim125
February 19, 2021, 6:36pm
3
I think the version that I’m using is from about 2 weeks ago: 5eec9a380a24
ftynse
February 22, 2021, 8:36am
4
It’s the same check - llvm-project/BuiltinTypes.h at 5eec9a380a24bf0611c676b5da4933949c787a6b · llvm/llvm-project · GitHub - types other than integers, floats, complex and vectors of integers or floats are not allowed as memref elements. At the commit in question, I get
$ cat foo.mlir
func private @foo() -> memref<1x1x1x1x!quant.uniform<u8<1:255>:f16, 6.17568E-5:128>>
$ ./bin/mlir-opt foo.mlir
foo.mlir:1:39: error: invalid memref element type
func private @foo() -> memref<1x1x1x1x!quant.uniform<u8<1:255>:f16, 6.17568E-5:128>>
^
so it’s not an alias problem. If you can use such types, you seem to either have a patched version of MLIR that diverges from upstream or not running verification.