Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Stream] Do not specialize encodings that is either unrecognized or a…
…lready serialized (#20054) A recognized encoding indicates an attribute that implements SerializableEncodingAttrInterface. If an encoding does not implement the interface, it is an unknown/unrecognized encoding. The revision makes the SpecializeEncoding pass more robust. It filters all the ops that need the specialization. I.e., it filters out the ops that do not have any recognized encoding. For DispatchTensorOp, it also checks if the corresponding executables/functions match the assumptions or not. In the pass, the specializable cases must match: - The corresponding executable is a stream.executable op. - The function arguments, where the types are !stream.binding_type, are only used by stream.binding.subspan ops. Furthermore, the result type of subspan ops have to implement IREE::Encoding::EncodingTypeInterface. If one of the requirements does not meet, the op won't be updated. If the encoding is unrecognized, the pass does nothing. If the encoding is recognized and it is already serialized, the pass updates the bindings with the serialized encodings. To test unrecognized encoding, the revision introduces `UnknownEncodingAttr` and uses it for testing. --------- Signed-off-by: hanhanW <hanhan0912@gmail.com>
- Loading branch information