Refactor check
dialect to support multiple devices via hal.tensor.device
.
#17738
Labels
cleanup 🧹
compiler/dialects
Relating to the IREE compiler dialects (flow, hal, vm)
infrastructure
Relating to build systems, CI, or testing
Currently the dialect predates external modules and does some weird stuff to support conversion through flow/stream/hal down to the point it becomes VM calls. Of particular issue is that the calls require a
!hal.device
but that's only introduced during HAL conversion at which point we've already discarded the affinities that would make it possible to infer. As a workaround #17482 forces check tests to use device 0 when lowering into HAL.Instead we should probably think of the check dialect as an input dialect and convert it to an extern util.func/util.call with HAL ops early on. The extern call would take HAL buffer views and a HAL device that we resolve via
hal.tensor.export
and some newhal.tensor.device
(?) op that allows for retrieving the device at input time. This would also allow custom modules to get device handles as required.The
hal.tensor.device
op could take one or more tensors and let us fail if any of the tensors end up with differing affinities. In ConvertToStream the affinity analysis would allow it to be turned into astream.context.resolve
.TODO:
hal.tensor.device
ophal.tensor.device
tostream.context.resolve
The text was updated successfully, but these errors were encountered: