-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
[AIR] Add guide on how implement a custom predictors #31392
[AIR] Add guide on how implement a custom predictors #31392
Conversation
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
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 @bveeramani! The content looks good to me, but I think we can do some restructuring to make this easier to read.
Instead of describing each method and then showing the examples at the end, I think it would be easier to follow by showing the examples directly in each method subsection.
So something like this:
We'll go through 2 examples of implementing custom predictors:
- Implementing an MXNet Predictor. MXNet is ...
- Implementing a statsmodel predictor. statsmodel is ...
Then walk through each step in the order that you would implement them
from_checkpoint
. Tab 1: MXNet. Tab 2: statsmodel__init__
. Tab 1: MXNet. Tab 2: statsmodel._predict_pandas
/_predict_numpy
. Tab 1: MXNet. Tab 2: statsmodel
Putting it all together. Tab 1: MXNet. Tab 2: statsmodel
|
||
# NOTE: This is to ensure the code runs. It shouldn't be part of the documentation. | ||
dataset = ray.data.read_images("s3://air-example-data-2/imagenet-sample-images") | ||
predictor.predict(dataset) |
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.
is it possible to test these code snippets?
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.
AFAIK they should already be tested
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.
Can you also update this to describe how to create a basic checkpoint? For example, showing Checkpoint.from_dict({"arg": 123})
at least in the examples.
New users aren't familiar with checkpoints, so we should at least guide them on how to create/consume the most basic kind of checkpoint.
Also +1 on suggestions above.
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Co-authored-by: Amog Kamsetty <amogkam@users.noreply.github.com> Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
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 @bveeramani, this looks great!
Looks like there are some errors with the doc code tests. |
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Signed-off-by: Balaji Veeramani <balaji@anyscale.com>
Custom predictors allow users to port their models to do scalable batch inference with Ray, but there's no guide for doing this. This PR adds such a guide. Signed-off-by: Balaji Veeramani <bveeramani@berkeley.edu> Co-authored-by: Amog Kamsetty <amogkam@users.noreply.github.com>
Signed-off-by: Balaji Veeramani balaji@anyscale.com
Why are these changes needed?
Custom predictors allow users to port their models to do scalable batch inference with Ray, but there's no guide for doing this. This PR adds such a guide.
Related issue number
Closes #29789
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.