serve icon indicating copy to clipboard operation
serve copied to clipboard

Support array of parameters

Open jamesanto opened this issue 3 years ago • 2 comments

Description

Supports array of parameters. It might be useful in cases where the model might expect a list of images, instead of a single image. It could also be used to control batching manually.

Fixes #1536 (Potentially/Partially ?)

Type of change

  • [x] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update

Technically it doesn't break any API/interface. The service would behave differently if someone uses array parameters in requests.

Feature/Issue validation/testing

Added unit test validating the expected request formats.

Checklist:

  • [x] Did you have fun?
  • [x] Have you added tests that prove your fix is effective or that this feature works?
  • [ ] Has code been commented, particularly in hard-to-understand areas?
  • [ ] Have you made corresponding changes to the documentation?

jamesanto avatar Jun 09 '22 22:06 jamesanto

So I may need some more time to review and think about this one. Overall I think this makes sense to support video and time series use cases. As far as controlling the batch size though this probably isn't the right use case since we already support dynamic batching. Would you be interested in working on a video or time series example to make the case for this change?

msaroufim avatar Jun 09 '22 23:06 msaroufim

There are two scenarios:

  1. the input data of a model is an array.
  2. the input is a batch of inference requests.

Solutions: scenario 1) set batch size =1 and input multiple data scenario 2) set batch size = N and input multiple data

lxning avatar Jul 08 '22 17:07 lxning

I believe per @lxning's comment this PR is not needed but feel free to reopen if you'd like to revisit

msaroufim avatar Sep 26 '22 03:09 msaroufim