Complex matrix inversion?

Just a general question if you don’t mind.

We are considering extending TVM for computational physics tasks involving quite a bit complex matrix multiplication and inversions stages. Up until now, we are still in the planning stage, but would like to know if this sounds like a valid application target for TVM.

Really appreciate any comments or suggestions. Cheers.

As far as I know matrix inversion (no matter complex or real) is an induction based algorithm, but TVM so far has no primitive to depict induction.

The current alternative solution is to compile n different modules for each step of induction.

Also, current interface makes it hard to do complex computation. I tried both array of struct and struct of array implementation before, which showed none of them can be done easily.

To sum up, I think we should discuss some reasonable (but not aggressive) extension to TVM to make it easier for both complex and induction-based algorithms.

Thanks for the reply.

In Halide, complex operations are extended from a tuple by defining the specific operations (https://github.com/halide/Halide/blob/master/apps/fft/complex.h), I envision this to be fairly doable in TVM, but not sure if it’s worth the effort to be included as a feature. However, if TVM is to be used for general algorithm scheduling in heterogenous platform aside from DL, it does sound justified.

Matrix inversion could be partially parallelized with numerical tricks, but that indeed require significant efforts, guess I will have to dig deeper to provide meaningful ideas.

It seems Complex is not a feature of Halide but an extended package.
I think package also works for a Complex extension.

I mean these days I am also working on some matrix factorization algorithms, and I find it is hard to deploy them on TVM too. Could you look at my RFC and give me some comments?