Repository navigation
Implement function.py return type coercion - #6832
Conversation
ecf55ee to
1b6f644
Compare
GMNGeoffrey
left a comment
There was a problem hiding this comment.
So I've done my best to review this and it looks reasonable. I'm going to approve to unblock you and because I don't think this is going to break anything, but since I lack a lot of context on the function ABI and Python bindings, I'd appreciate @stellaraccident taking a look when she gets back
| result = invoker(-1, a=1, b=2, c=3) | ||
|
|
||
| # TODO: Fill out all return types. | ||
| def testReturnTypeNdArrayBool(self): |
There was a problem hiding this comment.
You didn't create the testing deficit, but since you're here, would you mind stamping a variant of this out for all of the supported dtypes (probably except bf16 which no one knows what to do with)? Fine to say now... just trolling for test coverage :)
There was a problem hiding this comment.
Thanks for the review! @stellaraccident
I actually asked on internal chat for clarification on this comment: I was wondering if the comment meant test type coercion from other ABI types specifically to i1 (say, doing an i32 to bool test), or type coercion from any DTYPE to any type in the ABI (i32 to i8)?
Also, there are some types listed in the VM_TO_PYTHON_CONVERTERS that are missing from the ABI_TYPE_TO_DTYPE, such at f16. Not sure how to handle this (or ignore it)?
There was a problem hiding this comment.
Leaving this as a todo for now and will submit and address in followups when Stella returns.
|
when she gets back 👀 😛 |
* 30463f1 Adding #util.composite attribute. (#6854) * 7a1c579 Implement function.py return type coercion (#6832) * d90f0fc Remove PromoteTensorLoads pass, convert ExtractOp in TensorToFlow. (#6852) * 7fa8c20 Update SwiftShader to 2021-08-25 (#6859) * a328761 Rename Bazel repo iree_vulkan_headers to vulkan_headers (#6862) * 7660e49 Merge pull request #6856 from google/benvanik-shared-target-backend * ebc5eb5 Removing the pipeline caching during executable translation. (#6855) * 2fb7a8d Reapply "Update TFLite concrete function conversion codes" (#6800) * ce7b475 NFC: Merge ConvertToFlow passes into dedicated before/after passes. (#6850) * 9fce2d6 Support f32 in the VM by default in the compiler. (#6744) * b6baea9 Support global ref ops and fix passing of refs on function boundaries in the C.. * 4b5d2ed Bump flatcc version (#6853) * c8a8f5d Add e2e tests for mhlo.bitcast_convert (#6846) COPYBARA_INTEGRATE_REVIEW=#6865 from hanhanW:main-to-google 30463f1 PiperOrigin-RevId: 392952973
* 30463f1 Adding #util.composite attribute. (#6854) * 7a1c579 Implement function.py return type coercion (#6832) * d90f0fc Remove PromoteTensorLoads pass, convert ExtractOp in TensorToFlow. (#6852) * 7fa8c20 Update SwiftShader to 2021-08-25 (#6859) * a328761 Rename Bazel repo iree_vulkan_headers to vulkan_headers (#6862) * 7660e49 Merge pull request #6856 from google/benvanik-shared-target-backend * ebc5eb5 Removing the pipeline caching during executable translation. (#6855) * 2fb7a8d Reapply "Update TFLite concrete function conversion codes" (#6800) * ce7b475 NFC: Merge ConvertToFlow passes into dedicated before/after passes. (#6850) * 9fce2d6 Support f32 in the VM by default in the compiler. (#6744) * b6baea9 Support global ref ops and fix passing of refs on function boundaries in the C.. * 4b5d2ed Bump flatcc version (#6853) * c8a8f5d Add e2e tests for mhlo.bitcast_convert (#6846) PiperOrigin-RevId: 392952973
Update
function.pyto supportndarraytype coercion on return (currently supported on input values). Tested for i8 to boolean conversion since the IREE runtime doesn't support boolean values internally.