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

Fix: Account for requests that have already been decoded by model server #4987

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

gwang111
Copy link
Collaborator

@gwang111 gwang111 commented Jan 6, 2025

Issue #, if available:
#4959

Description of changes:
Some model servers (MMS in specific) decode the request from bytes ahead of time if the content type of the request is in a known format.

In these scenarios, we should honor that logic. If the request by the time it gets to our decoder is no longer in a bytes / bytestream format then propagate it as is.

We should not get into the business of re-encoding it back into a bytes or bytestream format

In the first iteration: #4960 a regression was introduced. Fixed that here

Testing done:

tests/integ/sagemaker/serve/test_serve_mlflow_pytorch_flavor_happy.py::test_happy_pytorch_sagemaker_endpoint_with_torch_serve PASSED

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

  • I have read the CONTRIBUTING doc
  • I certify that the changes I am introducing will be backward compatible, and I have discussed concerns about this, if any, with the Python SDK team
  • I used the commit message format described in CONTRIBUTING
  • I have passed the region in to all S3 and STS clients that I've initialized as part of this change.
  • I have updated any necessary documentation, including READMEs and API docs (if appropriate)

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have added unit and/or integration tests as appropriate to ensure backward compatibility of the changes
  • I have checked that my tests are not configured for a specific region or account (if appropriate)
  • I have used unique_name_from_base to create resource names in integ tests (if appropriate)
  • If adding any dependency in requirements.txt files, I have spell checked and ensured they exist in PyPi

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@gwang111 gwang111 requested a review from a team as a code owner January 6, 2025 22:59
@gwang111 gwang111 requested a review from akrishna1995 January 6, 2025 22:59
@gwang111 gwang111 requested review from Aditi2424 and removed request for akrishna1995 January 6, 2025 22:59
@gwang111
Copy link
Collaborator Author

gwang111 commented Jan 6, 2025

@andjsmi please review this when u have the chance. Can't add you as a reviewer for some reason

Spoke offline. he is good with the change:
image

…ot decoding the request again if it is not already bytes or bytestream
@Aditi2424 Aditi2424 changed the title [Fix] Account for requests that have already been decoded by model server Fix: Account for requests that have already been decoded by model server Jan 7, 2025
@Aditi2424 Aditi2424 merged commit daa5518 into aws:master Jan 7, 2025
14 checks passed
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

Successfully merging this pull request may close these issues.

2 participants