Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aws/sagemaker-pytorch-inference-toolkit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.19
Choose a base ref
...
head repository: aws/sagemaker-pytorch-inference-toolkit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 19 commits
  • 88 files changed
  • 5 contributors

Commits on Oct 17, 2023

  1. update development version to v2.0.20.dev0

    ci committed Oct 17, 2023
    Copy the full SHA
    8a7bf16 View commit details

Commits on Oct 19, 2023

  1. Migrate base inference toolkit scripts and unit tests (#157)

    * Merge base inference toolkit scripts and unit tests
    
    * Remove methods from environment.py
    sachanub authored Oct 19, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1e8e043 View commit details
  2. prepare release v2.0.20

    ci committed Oct 19, 2023
    Copy the full SHA
    ed68d92 View commit details
  3. update development version to v2.0.21.dev0

    ci committed Oct 19, 2023
    Copy the full SHA
    2704905 View commit details

Commits on Oct 20, 2023

  1. Cleanup to remove EIA integration tests and other unused files/code (#…

    …158)
    
    * Cleanup to remove EIA integration tests and other unused files/code
    
    * Modify README.rst file
    
    ---------
    
    Co-authored-by: Naman Nandan <[email protected]>
    sachanub and namannandan authored Oct 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0c3efe7 View commit details

Commits on Oct 23, 2023

  1. prepare release v2.0.21

    ci committed Oct 23, 2023
    Copy the full SHA
    2f6909d View commit details
  2. update development version to v2.0.22.dev0

    ci committed Oct 23, 2023
    Copy the full SHA
    2b0156c View commit details

Commits on Dec 16, 2023

  1. Fix dependency versions (#162)

    * Fix dependency versions
    
    * Update test dependencies
    
    * Retrigger tests
    
    * Retrigger tests
    
    * Pin test dependency versions
    
    * Pin test dependency versions
    
    * Pin tox.ini dependencies
    
    * Pause CPU integration tests
    
    * Enable CPU test
    
    ---------
    
    Co-authored-by: Ubuntu <[email protected]>
    sachanub and Ubuntu authored Dec 16, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    dd3144c View commit details

Commits on Dec 18, 2023

  1. prepare release v2.0.22

    ci committed Dec 18, 2023
    Copy the full SHA
    448d7ee View commit details
  2. update development version to v2.0.23.dev0

    ci committed Dec 18, 2023
    Copy the full SHA
    c7365b9 View commit details

Commits on Mar 15, 2024

  1. Improve error logging when invoking custom handler methods (#164)

    * Improve error logging when invoking custom handler methods
    
    * Update format for error logging
    
    * Print traceback on a single line
    
    * Refactor error logging
    
    * Fix flake8 errors
    namannandan authored Mar 15, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d49082e View commit details
  2. prepare release v2.0.23

    ci committed Mar 15, 2024
    Copy the full SHA
    e04590c View commit details
  3. update development version to v2.0.24.dev0

    ci committed Mar 15, 2024
    Copy the full SHA
    36a842e View commit details

Commits on May 31, 2024

  1. Ignore zombie processes when detecting TorchServe status (#166)

    * Ignore processes that are not running when detecting TorchServe status
    
    * Detect zombie processes and ignore them before calling cmdline API
    
    * Update PT DLC framework version to 2.1.0 and 2.2.0
    
    * Update instance type to ensure newer CUDA driver version
    
    * upgrade DLAMI version for tests
    
    * Revert "Update instance type to ensure newer CUDA driver version"
    
    This reverts commit bba00bd.
    namannandan authored May 31, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9a24052 View commit details
  2. prepare release v2.0.24

    ci committed May 31, 2024
    Copy the full SHA
    6743cbb View commit details
  3. update development version to v2.0.25.dev0

    ci committed May 31, 2024
    Copy the full SHA
    d1bd6f5 View commit details

Commits on Oct 7, 2024

  1. Disabling token auth and enabling model API by default (#167)

    * adding disable token and enabling model api
    
    * updating mme properties
    udaij12 authored Oct 7, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f8843fb View commit details
  2. prepare release v2.0.25

    ci committed Oct 7, 2024
    Copy the full SHA
    f7dd61e View commit details
  3. Copy the full SHA
    cc8bf99 View commit details
Showing with 2,843 additions and 2,653 deletions.
  1. +1 −1 .flake8
  2. +36 −0 CHANGELOG.md
  3. +1 −0 MANIFEST.in
  4. +1 −2 README.rst
  5. +1 −1 VERSION
  6. +0 −18 artifacts/changehostname.c
  7. +0 −26 artifacts/config.properties
  8. +0 −15 artifacts/start_with_right_hostname.sh
  9. +0 −27 artifacts/ts-entrypoint.py
  10. +0 −13 buildspec-container-pr.yml
  11. +5 −16 buildspec.yml
  12. +0 −40 docker/1.1.0/base/Dockerfile.cpu
  13. +0 −35 docker/1.1.0/base/Dockerfile.gpu
  14. +0 −18 docker/1.1.0/final/Dockerfile.cpu
  15. +0 −18 docker/1.1.0/final/Dockerfile.gpu
  16. +0 −77 docker/1.2.0/py2/Dockerfile.cpu
  17. +0 −98 docker/1.2.0/py2/Dockerfile.gpu
  18. +0 −26 docker/1.2.0/py2/config.properties
  19. +0 −28 docker/1.2.0/py2/mms-entrypoint.py
  20. +0 −78 docker/1.2.0/py3/Dockerfile.cpu
  21. +0 −90 docker/1.2.0/py3/Dockerfile.gpu
  22. +0 −26 docker/1.2.0/py3/config.properties
  23. +0 −28 docker/1.2.0/py3/mms-entrypoint.py
  24. +0 −88 docker/1.3.1/py2/Dockerfile.cpu
  25. +0 −113 docker/1.3.1/py2/Dockerfile.gpu
  26. +0 −87 docker/1.3.1/py3/Dockerfile.cpu
  27. +0 −105 docker/1.3.1/py3/Dockerfile.gpu
  28. +0 −88 docker/1.4.0/py2/Dockerfile.cpu
  29. +0 −112 docker/1.4.0/py2/Dockerfile.gpu
  30. +0 −87 docker/1.4.0/py3/Dockerfile.cpu
  31. +0 −104 docker/1.4.0/py3/Dockerfile.gpu
  32. +0 −88 docker/1.5.0/py3/Dockerfile.cpu
  33. +0 −103 docker/1.5.0/py3/Dockerfile.gpu
  34. +0 −18 docker/build_artifacts/changehostname.c
  35. +0 −26 docker/build_artifacts/config.properties
  36. +0 −27 docker/build_artifacts/mms-entrypoint.py
  37. +0 −15 docker/build_artifacts/start_with_right_hostname.sh
  38. +5 −4 setup.py
  39. 0 src/sagemaker_inference/__init__.py
  40. +22 −0 src/sagemaker_inference/content_types.py
  41. +109 −0 src/sagemaker_inference/decoder.py
  42. +66 −0 src/sagemaker_inference/default_handler_service.py
  43. +97 −0 src/sagemaker_inference/default_inference_handler.py
  44. +110 −0 src/sagemaker_inference/encoder.py
  45. +133 −0 src/sagemaker_inference/environment.py
  46. +71 −0 src/sagemaker_inference/errors.py
  47. +36 −0 src/sagemaker_inference/logging.py
  48. +94 −0 src/sagemaker_inference/model_server.py
  49. +25 −0 src/sagemaker_inference/parameters.py
  50. +292 −0 src/sagemaker_inference/transformer.py
  51. +102 −0 src/sagemaker_inference/utils.py
  52. +2 −0 src/sagemaker_pytorch_serving_container/etc/default-ts.properties
  53. +2 −0 src/sagemaker_pytorch_serving_container/etc/mme-ts.properties
  54. +3 −0 src/sagemaker_pytorch_serving_container/torchserve.py
  55. +2 −19 test/conftest.py
  56. +0 −9 test/container/1.10.2/Dockerfile.dlc.cpu
  57. +0 −9 test/container/1.10.2/Dockerfile.dlc.gpu
  58. +0 −46 test/container/1.10.2/Dockerfile.pytorch
  59. +0 −6 test/container/1.3.1/Dockerfile.dlc.eia
  60. +0 −18 test/container/1.5.0/Dockerfile.dlc.cpu
  61. +0 −18 test/container/1.5.0/Dockerfile.dlc.gpu
  62. +0 −45 test/container/1.5.0/Dockerfile.pytorch
  63. +0 −8 test/container/1.6.0/Dockerfile.dlc.cpu
  64. +0 −8 test/container/1.6.0/Dockerfile.dlc.gpu
  65. +0 −46 test/container/1.6.0/Dockerfile.pytorch
  66. +2 −2 test/container/{2.0.1 → 2.1.0}/Dockerfile.dlc.cpu
  67. +2 −2 test/container/{2.0.0 → 2.1.0}/Dockerfile.dlc.gpu
  68. +2 −2 test/container/{2.0.0 → 2.2.0}/Dockerfile.dlc.cpu
  69. +2 −2 test/container/{2.0.1 → 2.2.0}/Dockerfile.dlc.gpu
  70. +0 −11 test/integration/__init__.py
  71. +0 −13 test/integration/all_models_info.json
  72. +17 −45 test/integration/sagemaker/test_default_inference.py
  73. +4 −20 test/integration/sagemaker/test_mnist.py
  74. +0 −35 test/resources/mnist/default_model_eia/code/mnist.py
  75. BIN test/resources/mnist/default_model_eia/model.pt
  76. +0 −48 test/resources/mnist/model_eia/mnist.py
  77. BIN test/resources/mnist/model_eia/torch_model.pth
  78. +100 −0 test/unit/test_decoder.py
  79. +62 −0 test/unit/test_default_handler_service.py
  80. +30 −248 test/unit/test_default_inference_handler.py
  81. +271 −0 test/unit/test_default_pytorch_inference_handler.py
  82. +88 −0 test/unit/test_encoder.py
  83. +58 −0 test/unit/test_environment.py
  84. +52 −229 test/unit/test_model_server.py
  85. +267 −0 test/unit/test_torchserve.py
  86. +540 −0 test/unit/test_transfomer.py
  87. +104 −0 test/unit/test_utils.py
  88. +26 −18 tox.ini
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
application_import_names = image_utils, integration, local_mode_utils, sagemaker_pytorch_container, test, timeout, utils
application_import_names = image_utils, integration, local_mode_utils, sagemaker_inference, sagemaker_pytorch_serving_container, test, timeout, utils
import-order-style = google
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
# Changelog

## v2.0.25 (2024-10-07)

### Bug Fixes and Other Changes

* Disabling token auth and enabling model API by default

## v2.0.24 (2024-05-31)

### Bug Fixes and Other Changes

* Ignore zombie processes when detecting TorchServe status

## v2.0.23 (2024-03-15)

### Bug Fixes and Other Changes

* Improve error logging when invoking custom handler methods

## v2.0.22 (2023-12-18)

### Bug Fixes and Other Changes

* Fix dependency versions

## v2.0.21 (2023-10-23)

### Bug Fixes and Other Changes

* Cleanup to remove EIA integration tests and other unused files/code

## v2.0.20 (2023-10-19)

### Bug Fixes and Other Changes

* Migrate base inference toolkit scripts and unit tests

## v2.0.19 (2023-10-17)

### Bug Fixes and Other Changes
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
recursive-include src/sagemaker_pytorch_serving_container *
recursive-include src/sagemaker_inference *

include VERSION
include LICENSE
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -4,8 +4,7 @@ SageMaker PyTorch Inference Toolkit

SageMaker PyTorch Inference Toolkit is an open-source library for serving PyTorch models on Amazon SageMaker.
This library provides default pre-processing, predict and postprocessing for certain PyTorch model types and
utilizes the `SageMaker Inference Toolkit <https://github.com/aws/sagemaker-inference-toolkit>`__
for starting up the model server, which is responsible for handling inference requests.
is responsible for starting up the TorchServe model server on SageMaker, which is responsible for handling inference requests.

For training, see `SageMaker PyTorch Training Toolkit <https://github.com/aws/sagemaker-pytorch-training-toolkit>`__.

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.19
2.0.26.dev0
18 changes: 0 additions & 18 deletions artifacts/changehostname.c

This file was deleted.

26 changes: 0 additions & 26 deletions artifacts/config.properties

This file was deleted.

15 changes: 0 additions & 15 deletions artifacts/start_with_right_hostname.sh

This file was deleted.

27 changes: 0 additions & 27 deletions artifacts/ts-entrypoint.py

This file was deleted.

13 changes: 0 additions & 13 deletions buildspec-container-pr.yml

This file was deleted.

21 changes: 5 additions & 16 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -2,11 +2,9 @@ version: 0.2

env:
variables:
FRAMEWORK_VERSIONS: '2.0.0 2.0.1'
# EIA_FRAMEWORK_VERSION: '1.3.1'
FRAMEWORK_VERSIONS: '2.1.0 2.2.0'
CPU_INSTANCE_TYPE: 'ml.c4.xlarge'
GPU_INSTANCE_TYPE: 'ml.g4dn.12xlarge'
# EIA_ACCELERATOR_TYPE: 'ml.eia2.medium'
ECR_REPO: 'sagemaker-test'
GITHUB_REPO: 'sagemaker-pytorch-serving-container'
DLC_ACCOUNT: '763104351884'
@@ -35,9 +33,6 @@ phases:
# run unit tests
- tox -e py38,py39,py310 test/unit

# define EIA tag
# - DLC_EIA_TAG="$EIA_FRAMEWORK_VERSION-dlc-eia-$BUILD_ID"

# run local CPU integration tests (build and push the image to ECR repo)
- |
for FRAMEWORK_VERSION in $FRAMEWORK_VERSIONS;
@@ -48,18 +43,18 @@ phases:
docker system prune --all --force;
done
# launch remote GPU instance with Deep Learning AMI GPU PyTorch 1.9 (Ubuntu 20.04)
- prefix='ml.'
- instance_type=${GPU_INSTANCE_TYPE#"$prefix"}

# build DLC GPU image because the base DLC image is too big and takes too long to build as part of the test
- python3 setup.py sdist
- $(aws ecr get-login --registry-ids $DLC_ACCOUNT --no-include-email --region $AWS_DEFAULT_REGION)
- create-key-pair

# launch remote GPU instance with Deep Learning AMI GPU PyTorch 2.2 (Ubuntu 20.04)
# build DLC GPU image because the base DLC image is too big and takes too long to build as part of the test
- |
for FRAMEWORK_VERSION in $FRAMEWORK_VERSIONS;
do
launch-ec2-instance --instance-type $instance_type --ami-name ami-03e3ef8c92fdb39ad;
launch-ec2-instance --instance-type $instance_type --ami-name ami-081c4092fbff425f0;
DLC_GPU_TAG="$FRAMEWORK_VERSION-dlc-gpu-$BUILD_ID";
build_dir="test/container/$FRAMEWORK_VERSION";
docker build -f "$build_dir/Dockerfile.dlc.gpu" -t $PREPROD_IMAGE:$DLC_GPU_TAG --build-arg region=$AWS_DEFAULT_REGION .;
@@ -96,10 +91,6 @@ phases:
docker system prune --all --force;
done
# run EIA sagemaker integration tests
# - test_cmd="IGNORE_COVERAGE=- tox -e py38 -- test/integration/sagemaker --build-image --push-image --dockerfile-type dlc.eia --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --framework-version $EIA_FRAMEWORK_VERSION --processor cpu --instance-type $CPU_INSTANCE_TYPE --accelerator-type $EIA_ACCELERATOR_TYPE --tag $DLC_EIA_TAG"
# - execute-command-if-has-matching-changes "$test_cmd" "test/" "src/*.py" "setup.py" "setup.cfg"

finally:

# remove ECR image
@@ -111,5 +102,3 @@ phases:
aws ecr batch-delete-image --repository-name $ECR_REPO --region $AWS_DEFAULT_REGION --image-ids imageTag=$DLC_CPU_TAG;
aws ecr batch-delete-image --repository-name $ECR_REPO --region $AWS_DEFAULT_REGION --image-ids imageTag=$DLC_GPU_TAG;
done
# - aws ecr batch-delete-image --repository-name $ECR_REPO --region $AWS_DEFAULT_REGION --image-ids imageTag=$DLC_EIA_TAG
40 changes: 0 additions & 40 deletions docker/1.1.0/base/Dockerfile.cpu

This file was deleted.

35 changes: 0 additions & 35 deletions docker/1.1.0/base/Dockerfile.gpu

This file was deleted.

18 changes: 0 additions & 18 deletions docker/1.1.0/final/Dockerfile.cpu

This file was deleted.

18 changes: 0 additions & 18 deletions docker/1.1.0/final/Dockerfile.gpu

This file was deleted.

Loading