From 7c962eee34861f4f306410f773b2b1d4a2cb53a2 Mon Sep 17 00:00:00 2001 From: Carl Jeske Date: Wed, 5 Jul 2023 12:43:09 +0100 Subject: [PATCH] feature: enable vmargs argument for torchserve --- .../etc/default-ts.properties | 1 - src/sagemaker_pytorch_serving_container/etc/mme-ts.properties | 1 - src/sagemaker_pytorch_serving_container/torchserve.py | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/sagemaker_pytorch_serving_container/etc/default-ts.properties b/src/sagemaker_pytorch_serving_container/etc/default-ts.properties index 029f6051..bc0f996a 100644 --- a/src/sagemaker_pytorch_serving_container/etc/default-ts.properties +++ b/src/sagemaker_pytorch_serving_container/etc/default-ts.properties @@ -1,5 +1,4 @@ # Based on https://github.com/pytorch/serve/blob/master/docs/configuration.md -vmargs=-XX:-UseContainerSupport enable_envvars_config=true decode_input_request=false load_models=ALL diff --git a/src/sagemaker_pytorch_serving_container/etc/mme-ts.properties b/src/sagemaker_pytorch_serving_container/etc/mme-ts.properties index 1ef6c581..37621c1c 100644 --- a/src/sagemaker_pytorch_serving_container/etc/mme-ts.properties +++ b/src/sagemaker_pytorch_serving_container/etc/mme-ts.properties @@ -1,4 +1,3 @@ -vmargs=-XX:-UseContainerSupport enable_envvars_config=true model_store=/ default_service_handler=$$SAGEMAKER_HANDLER$$ diff --git a/src/sagemaker_pytorch_serving_container/torchserve.py b/src/sagemaker_pytorch_serving_container/torchserve.py index 2e246105..f0bcbea0 100644 --- a/src/sagemaker_pytorch_serving_container/torchserve.py +++ b/src/sagemaker_pytorch_serving_container/torchserve.py @@ -134,6 +134,7 @@ def _generate_ts_config_properties(handler_service): "inference_address": "http://0.0.0.0:{}".format(env.inference_http_port), "management_address": "http://0.0.0.0:{}".format(env.management_http_port), "default_service_handler": handler_service + ":handle", + "vmargs": env.vmargs, } ts_env = ts_environment.TorchServeEnvironment()