We (@manupa-arm) ran into this in the graph partitioner. I think in the end we were forced to introduce logic to flatten such tuples, so if a more fundamental solution can be found that would simplify our logic.
@masahi there is code for doing this mapping inside of the VM, if you message me on Slack we can probably figure out how to update the code, might require a bit of debugging
Ok, thanks! I found the code Jared was probably referring to (transform/memory_plan.py, transform/memory_alloc.py, not sure why they are written in python). I’m going to learn about memory planning and see what I can do.
@masahi FromTupleType is the one you probably want it takes a Type representing the layout of expr and returns a sequence of expressions which correspond to the linearized view of the tuple, i.e it will handle projecting nested tuples out.