Skip to content
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

Documentation for inference.py transform_fn #142

Open
david-waterworth opened this issue Mar 22, 2023 · 0 comments
Open

Documentation for inference.py transform_fn #142

david-waterworth opened this issue Mar 22, 2023 · 0 comments

Comments

@david-waterworth
Copy link

david-waterworth commented Mar 22, 2023

What did you find confusing? Please describe.
Huggingface have documented how to use the sagemaker pytorch inference API in order to host their models. They make it quite clear that you must supply model_fn and then either transform_fn or (input_fn, predict_fn and output_fn). By using transform_fn you can have fine control of batch size for example, allowing you to handle large requests (in particular I have an issue where my batch transform jobs continuously die because the minimum payload of 1MB is way to large for my model - due to the large intermediate matrices I..e probabilities = batch_szie x num_labels)

I cannot find any mention of transform_fn in the documentation - https://sagemaker.readthedocs.io/en/stable/frameworks/pytorch/using_pytorch.html

It is mentioned in passing in one of the examples - https://sagemaker-examples.readthedocs.io/en/latest/frameworks/pytorch/get_started_mnist_deploy.html

Describe how documentation can be improved
Document the use of transform_fn as an alternative to input_fn, predict_fn and output_fn

Additional context
[Add any other context or screenshots about the documentation request here.]

This is how I was aware of transform_fn:

https://aws.amazon.com/blogs/machine-learning/run-computer-vision-inference-on-large-videos-with-amazon-sagemaker-asynchronous-endpoints/

The I found this:

(https://huggingface.co/docs/sagemaker/inference)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant