-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
A change from February allowed callers of OneShotBufferize to set the default memory space from the TensorType of a value. See PR here: #78484. According to the PR, this is used to allow implementing a mapping from tensor encoding attribute to memref memory space.
This change is a nice feature, however it is quite broken outside of limited use. In particular, it doesn't play nicely with bufferization.alloc_tensor|materialize_in_destination|to_tensor|to_memref and produces unexpected/wrong results.
I will post a range of example IR where using this feature produces unexpected/non-sense results when running one-shot-bufferize, but the crux of the issue is that there is limited support with dealing situations like the following:
bufferization.materialize_in_destinationwhere the encoding on the source and destination tensors map to different memory spacesbufferization.alloc_tensorexpects thecopyandresulttypes to match, but this is at odds with using the tensor type encoding to set the memory space. It can also fail if the tensor type encoding and thememory_spaceattribute on the op are different.
I took a shot at fixing this and believe that I have corrected all issues satisfactory (#91524).