container/inf1_mx_entry.py [19:39]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if sys.argv[1] == 'serve':
    user_ncgs = os.environ.get('NEURONCORE_GROUP_SIZES')
    if user_ncgs is None:
        os.environ['NEURONCORE_GROUP_SIZES'] = "1"
    user_workers = os.environ.get('SAGEMAKER_MODEL_SERVER_WORKERS')
    if user_workers is None:
        num_host_cores = os.environ.get("NEURON_CORE_HOST_TOTAL")
        if num_host_cores is None:
            os.environ['SAGEMAKER_MODEL_SERVER_WORKERS'] = "1"
        else:
            os.environ['SAGEMAKER_MODEL_SERVER_WORKERS'] = num_host_cores
    print("NEURONCORE_GROUP_SIZES {}".format(os.environ.get('NEURONCORE_GROUP_SIZES')))
    print("SAGEMAKER_MODEL_SERVER_WORKERS {}".format(os.environ.get('SAGEMAKER_MODEL_SERVER_WORKERS')))

    from sagemaker_mxnet_serving_container import serving
    serving.main()
else:
    subprocess.check_call(shlex.split(' '.join(sys.argv[1:])))

# prevent docker exit
subprocess.call(['tail', '-f', '/dev/null'])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



container/inf1_pyt_entry.py [20:40]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
if sys.argv[1] == 'serve':
    user_ncgs = os.environ.get('NEURONCORE_GROUP_SIZES')
    if user_ncgs is None:
        os.environ['NEURONCORE_GROUP_SIZES'] = "1"
    user_workers = os.environ.get('SAGEMAKER_MODEL_SERVER_WORKERS')
    if user_workers is None:
        num_host_cores = os.environ.get("NEURON_CORE_HOST_TOTAL")
        if num_host_cores is None:
            os.environ['SAGEMAKER_MODEL_SERVER_WORKERS'] = "1"
        else:
            os.environ['SAGEMAKER_MODEL_SERVER_WORKERS'] = num_host_cores
    print("NEURONCORE_GROUP_SIZES {}".format(os.environ.get('NEURONCORE_GROUP_SIZES')))
    print("SAGEMAKER_MODEL_SERVER_WORKERS {}".format(os.environ.get('SAGEMAKER_MODEL_SERVER_WORKERS')))

    from sagemaker_pytorch_inferentia_serving_container import serving
    serving.main()
else:
    subprocess.check_call(shlex.split(' '.join(sys.argv[1:])))

# prevent docker exit
subprocess.call(['tail', '-f', '/dev/null'])
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



