### **** Motivation
With new sparse operators being added to TVM on a weekly basis, we would like
to propose a change that would address the lack of expressiveness in sparse
tensors of the current relay type system.
Currently, we represent a CSR matrix with `namedtuple("CSR", ["data",
"indices", "index pointer"])`. The problem is that this representation is not
only unnatural but also missing shape information of the matrix, as only the
first dimension can be inferred from the above tuple.
### **** Proposed Design
A `TensorTypeNode` has two fields: `shape` and `dtype`. We would like to add a
new field called `format` to represent the format of Tensor. The `format` here
represents the sparse format the tensor is using, and it works like `dtype`, so
it's effectively just a tag here. We don't have to explicitly handle or define
each data format. Instead, we pass the `format` to tvm codegen and let codegen
handle it. This would help us unify expression of sparse model/tensors at relay
level and would allow us to do shape inference easily.
### **** Note
I am trying to push the TVM support on Graph Neural Networks and other sparse
models. This is a huge design decision, but I don't have much background in
Programming Languages, so you might just ignore my proposal and propose your
design. We would very much appraciate community's idea or feedback.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3731