aws / sagemaker-pytorch-inference-toolkit

Toolkit for allowing inference and serving with PyTorch on SageMaker. Dockerfiles used for building SageMaker Pytorch Containers are at https://github.com/aws/deep-learning-containers.
Apache License 2.0
131 stars 70 forks source link

Add new unit and integration tests #155

Closed sachanub closed 10 months ago

sachanub commented 10 months ago

Issue #, if available:

Description of changes:

The objective of this PR is to add new unit and integration tests. Specifically, we include the following:

UPDATE:

Added the following local integration tests:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

chen3933 commented 10 months ago

I notice we don't have local integration test. Is there any use case we want to cover in local integration test?

chen3933 commented 10 months ago

I didn't see user script overwrites input_fn or output_fn. Do we want to add those tests?

sachanub commented 10 months ago

I notice we don't have local integration test. Is there any use case we want to cover in local integration test?

Added the following local integration tests:

sachanub commented 10 months ago

I didn't see user script overwrites input_fn or output_fn. Do we want to add those tests?

We define custom input_fn and output_fn for this test: https://github.com/aws/sagemaker-pytorch-inference-toolkit/blob/master/test/integration/local/test_serving.py#L87. This script defines custom input_fn and output_fn functions: https://github.com/aws/sagemaker-pytorch-inference-toolkit/blob/master/test/resources/mnist/model_cpu/code/call_model_fn_once.py