-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support upto 4D array as REST input payload. #6
Conversation
@pvaneck Please take a look ! |
Thanks @ScrapCodes , I will test this out soon. Currently having issues with my workstation I need to resolve. I'm not entirely sure why the lint job is suddenly failing with that @njhill Would be great to have your eyes on this, too. :) |
f3d7083
to
94abb4f
Compare
Thanks @ScrapCodes. I think there should be a way we can streamline this and support arbitrary dimensions without having to deal with them as separate cases. I updated some experiments I was making before and can push that to a different branch to illustrate. W.r.t. to test cases, I think we want to just have a set of raw json request payload examples along with the expected protobuf equivalent, and a bunch of raw protobuf response payload examples along with the expected REST equivalent. Just testing more cases end-to-end would be more valuable and simpler imo for this than more granular tests. |
@ScrapCodes @pvaneck here's my proposed approach: https://github.com/kserve/rest-proxy/compare/main...njhill:dimensions?expand=1. It does not yet handle string / BYTES values though - I think there's some ambiguity in the spec around how BYTES values should/can be represented within the data array(s) so needs a bit more investigation. |
94abb4f
to
c0abece
Compare
Thanks @njhill, tests are not exactly as you had asked. Please take a look! For handling BYTES in json, are you considering base64 encoding? |
Thanks @ScrapCodes the tests are going in the right direction but I would suggest the following:
out = &gw.ModelInferRequest{}
err := CustomJsonPb{}.NewDecoder(...).Decode(out)
// verify contents of out
For BYTES as mentioned I think the spec is currently ambiguous (to me at least). For example if strings are used then how should the encoding be determined. Also it's not clear how the byte lengths should be encoded when flattening. One option is to say that they must all be the same length and add a dimension to the shape for this. If their lengths can vary however then something extra is needed, like a corresponding integer tensor to hold them. Previously I looked into how MLServer handles these kinds of inputs for some clues but do not recall the details now. Maybe you could look into that? |
@ScrapCodes @pvaneck any thoughts/update on this? We should aim to get it in for the release right? |
@njhill Yep, this should definitely be in the next release. I believe @ScrapCodes is currently finalizing the tests, then we can hopefully get this merged in. I think BYTES can be handled in a separate PR. I remember looking at some of MLServer's BYTES string tests and base64 tests before, but yea, this needs some more investigation for how we should handle it here. |
353aebe
to
f96a742
Compare
f96a742
to
70d78b7
Compare
b182d0d
to
ec54e3e
Compare
ec54e3e
to
974799b
Compare
@njhill thanks for taking a look, hope this is close to what we expect. Code looks cleaner and should perform faster thanks to you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ScrapCodes, lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @ScrapCodes
@njhill Ah, yea, they should be added. I can do that real quick. |
closes #5