Closed dhanainme closed 4 years ago
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
I am not sure torchserve should be part of sagemaker-inference: aws/sagemaker-inference-toolkit#58 Shouldn't that logic be moved here instead?
Have moved the logic here.
Flake8 failed:
flake8 run-test: commands[0] | flake8
./test/unit/test_serving.py:25:1: E302 expected 2 blank lines, found 1
./test/unit/test_model_server.py:1:1: FI11 __future__ import "absolute_import" missing
./test/unit/test_model_server.py:89:34: E225 missing whitespace around operator
./test/unit/test_model_server.py:91:34: E225 missing whitespace around operator
./test/unit/test_model_server.py:93:5: E265 block comment should start with '# '
./test/unit/test_model_server.py:115:1: F811 redefinition of unused 'test_start_torchserve_default_service_handler' from line 29
./test/unit/test_model_server.py:159:1: E303 too many blank lines (4)
./test/unit/test_model_server.py:193:9: E265 block comment should start with '# '
./test/unit/test_model_server.py:292:1: E303 too many blank lines (3)
./test/unit/test_model_server.py:297:34: E225 missing whitespace around operator
./test/unit/test_model_server.py:299:34: E225 missing whitespace around operator
./test/unit/test_model_server.py:310:1: E303 too many blank lines (3)
./test/unit/test_handler_service.py:34:49: E225 missing whitespace around operator
./test/unit/test_handler_service.py:35:39: E225 missing whitespace around operator
./test/unit/test_handler_service.py:38:39: E225 missing whitespace around operator
./test/unit/test_default_inference_handler.py:18:1: F401 'mock' imported but unused
ERROR: InvocationError for command /codebuild/output/src399464208/src/github.com/aws/sagemaker-pytorch-inference-toolkit/.tox/flake8/bin/flake8 (exited with code 1)
Flake8 failed:
flake8 run-test: commands[0] | flake8 ./test/unit/test_serving.py:25:1: E302 expected 2 blank lines, found 1 ./test/unit/test_model_server.py:1:1: FI11 __future__ import "absolute_import" missing ./test/unit/test_model_server.py:89:34: E225 missing whitespace around operator ./test/unit/test_model_server.py:91:34: E225 missing whitespace around operator ./test/unit/test_model_server.py:93:5: E265 block comment should start with '# ' ./test/unit/test_model_server.py:115:1: F811 redefinition of unused 'test_start_torchserve_default_service_handler' from line 29 ./test/unit/test_model_server.py:159:1: E303 too many blank lines (4) ./test/unit/test_model_server.py:193:9: E265 block comment should start with '# ' ./test/unit/test_model_server.py:292:1: E303 too many blank lines (3) ./test/unit/test_model_server.py:297:34: E225 missing whitespace around operator ./test/unit/test_model_server.py:299:34: E225 missing whitespace around operator ./test/unit/test_model_server.py:310:1: E303 too many blank lines (3) ./test/unit/test_handler_service.py:34:49: E225 missing whitespace around operator ./test/unit/test_handler_service.py:35:39: E225 missing whitespace around operator ./test/unit/test_handler_service.py:38:39: E225 missing whitespace around operator ./test/unit/test_default_inference_handler.py:18:1: F401 'mock' imported but unused ERROR: InvocationError for command /codebuild/output/src399464208/src/github.com/aws/sagemaker-pytorch-inference-toolkit/.tox/flake8/bin/flake8 (exited with code 1)
Have fixed this.
copying src/sagemaker_pytorch_serving_container/default_pytorch_inference_handler.py -> sagemaker_pytorch_inference-1.5.2.dev0/src/sagemaker_pytorch_serving_container
copying src/sagemaker_pytorch_serving_container/handler_service.py -> sagemaker_pytorch_inference-1.5.2.dev0/src/sagemaker_pytorch_serving_container
copying src/sagemaker_pytorch_serving_container/serving.py -> sagemaker_pytorch_inference-1.5.2.dev0/src/sagemaker_pytorch_serving_container
copying src/sagemaker_pytorch_serving_container/torchserve.py -> sagemaker_pytorch_inference-1.5.2.dev0/src/sagemaker_pytorch_serving_container
copying src/sagemaker_pytorch_serving_container/etc/default-ts.properties -> sagemaker_pytorch_inference-1.5.2.dev0/src/sagemaker_pytorch_serving_container/etc
copying src/sagemaker_pytorch_serving_container/etc/log4j.properties -> sagemaker_pytorch_inference-1.5.2.dev0/src/sagemaker_pytorch_serving_container/etc
Writing sagemaker_pytorch_inference-1.5.2.dev0/setup.cfg
Creating tar archive
removing 'sagemaker_pytorch_inference-1.5.2.dev0' (and everything under it)
twine runtests: commands[1] | twine check dist/*.tar.gz
Checking dist/sagemaker_pytorch_inference-1.5.2.dev0.tar.gz: PASSED, with warnings
warning: `long_description_content_type` missing. defaulting to `text/x-rst`.
_______________________________________________________________________________________________________________________________________________________________________________ summary ________________________________________________________________________________________________________________________________________________________________________________
flake8: commands succeeded
twine: commands succeeded
congratulations :)
ubuntu@ip-172-31-65-0:~/ts/sagemaker-pytorch-inference-toolkit$
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
algo-1-doyas_1 | 2020-07-17 20:07:21,364 [INFO ] W-9001-model_1 org.pytorch.serve.wlm.WorkerThread - Backend response time: 569
algo-1-doyas_1 | 2020-07-17 20:07:21,364 [INFO ] W-9000-model_1 TS_METRICS - W-9000-model_1.ms:714|#Level:Host|#hostname:2c8a2bc735be,timestamp:1595016441
algo-1-doyas_1 | 2020-07-17 20:07:21,364 [INFO ] W-9001-model_1 TS_METRICS - W-9001-model_1.ms:712|#Level:Host|#hostname:2c8a2bc735be,timestamp:1595016441
algo-1-doyas_1 | 2020-07-17 20:07:23,333 [INFO ] pool-1-thread-3 ACCESS_LOG - /172.18.0.1:38292 "GET /ping HTTP/1.1" 200 3
algo-1-doyas_1 | 2020-07-17 20:07:23,334 [INFO ] pool-1-thread-3 TS_METRICS - Requests2XX.Count:1|#Level:Host|#hostname:2c8a2bc735be,timestamp:null
!algo-1-doyas_1 | 2020-07-17 20:07:23,357 [INFO ] W-9000-model_1 org.pytorch.serve.wlm.WorkerThread - Backend response time: 1
algo-1-doyas_1 | 2020-07-17 20:07:23,357 [INFO ] W-9000-model_1-stdout MODEL_METRICS - PredictionTime.Milliseconds:0.05|#ModelName:model,Level:Model|#hostname:2c8a2bc735be,requestID:f08bfa54-47bd-444a-a91a-b6aa56819ce7,timestamp:1595016443
algo-1-doyas_1 | 2020-07-17 20:07:23,358 [INFO ] W-9000-model_1 ACCESS_LOG - /172.18.0.1:38296 "POST /invocations HTTP/1.1" 200 5
algo-1-doyas_1 | 2020-07-17 20:07:23,358 [INFO ] W-9000-model_1 TS_METRICS - Requests2XX.Count:1|#Level:Host|#hostname:2c8a2bc735be,timestamp:null
algo-1-doyas_1 | 2020-07-17 20:07:23,365 [INFO ] W-9001-model_1 org.pytorch.serve.wlm.WorkerThread - Backend response time: 1
algo-1-doyas_1 | 2020-07-17 20:07:23,365 [INFO ] W-9001-model_1 ACCESS_LOG - /172.18.0.1:38296 "POST /invocations HTTP/1.1" 200 1
algo-1-doyas_1 | 2020-07-17 20:07:23,365 [INFO ] W-9001-model_1-stdout MODEL_METRICS - PredictionTime.Milliseconds:0.04|#ModelName:model,Level:Model|#hostname:2c8a2bc735be,requestID:bbeb14f3-c0c4-4de2-bf58-faf948458a31,timestamp:1595016443
algo-1-doyas_1 | 2020-07-17 20:07:23,365 [INFO ] W-9001-model_1 TS_METRICS - Requests2XX.Count:1|#Level:Host|#hostname:2c8a2bc735be,timestamp:null
algo-1-doyas_1 | 2020-07-17 20:07:23,371 [INFO ] W-9000-model_1 org.pytorch.serve.wlm.WorkerThread - Backend response time: 0
algo-1-doyas_1 | 2020-07-17 20:07:23,371 [INFO ] W-9000-model_1 ACCESS_LOG - /172.18.0.1:38296 "POST /invocations HTTP/1.1" 200 1
algo-1-doyas_1 | 2020-07-17 20:07:23,371 [INFO ] W-9000-model_1-stdout MODEL_METRICS - PredictionTime.Milliseconds:0.02|#ModelName:model,Level:Model|#hostname:2c8a2bc735be,requestID:407df61c-82c0-4059-b590-288551436fb6,timestamp:1595016443
algo-1-doyas_1 | 2020-07-17 20:07:23,371 [INFO ] W-9000-model_1 TS_METRICS - Requests2XX.Count:1|#Level:Host|#hostname:2c8a2bc735be,timestamp:null
Gracefully stopping... (press Ctrl+C again to force)
PASSED
=========================================================================================================================================================================== warnings summary ===========================================================================================================================================================================
test/integration/local/test_serving.py:69
/home/ubuntu/ts/sagemaker-pytorch-inference-toolkit/test/integration/local/test_serving.py:69: PytestUnknownMarkWarning: Unknown pytest.mark.skip_cpu - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
@pytest.mark.skip_cpu
-- Docs: https://docs.pytest.org/en/latest/warnings.html
=============================================================================================================================================================== 4 passed, 1 warning in 136.40s (0:02:16) ===============================================================================================================================================================
Logs from a more recent run.
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
for why mms-entrypoint.py
is named such - it contains a line to accommodate for the fact that MMS exits right away: https://github.com/aws/sagemaker-pytorch-inference-toolkit/blob/master/artifacts/mms-entrypoint.py#L26-L27
if Torchserve doesn't need that, then we should be able to remove the file altogether (rather than just renaming it)
for why
mms-entrypoint.py
is named such - it contains a line to accommodate for the fact that MMS exits right away: https://github.com/aws/sagemaker-pytorch-inference-toolkit/blob/master/artifacts/mms-entrypoint.py#L26-L27if Torchserve doesn't need that, then we should be able to remove the file altogether (rather than just renaming it)
There may not be any differences between MMS & TS for this as the behaviour would not have changed.
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Looks like 1 of the integ tests consumes DLC container for a test.
From test logs :
[Container] 2020/07/27 18:46:51 Running command test_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --build-image --push-image --dockerfile-type pytorch --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --framework-version $FRAMEWORK_VERSION --processor cpu --tag $GENERIC_TAG” ✅ - PASSING
[Container] 2020/07/27 18:54:25 Running command test_cmd="IGNORE_COVERAGE=- tox -e py36 -- test/integration/local --build-image --push-image --dockerfile-type dlc.cpu --region $AWS_DEFAULT_REGION --docker-base-name $ECR_REPO --aws-id $ACCOUNT --framework-version $FRAMEWORK_VERSION --processor cpu --tag $DLC_CPU_TAG” - ❌ NOT PASSING
This may not pass until DLC PR is merged & it inturn depends on this PR
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository
Change Model server to Torchserve for PyTorch Inference
Use TorchServe in place of MMS for Pytorch Inference.
This PR depends on PR in sagemaker-inference-toolkit #58 to be merged before this can be supported. Hence existing integ tests should likely fail because of the same.
Testing :
Tested with SageMaker local based on the buildspec.yaml file.
This would fail with the following error & create a docker image : sagemaker-pytorch-inference:1.5.0-cpu-py3
Now install chanages from PR - sagemaker-inference-toolkit (#89) manualy to this container & commit it before running the test again this time without the --build-image flag.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.