Local computing resource creation for performing machine learning tasks
Local computing resources may be created for machine learning tasks. A kernel of a machine learning development environment implemented as a first container at a host system may execute code to perform a machine learning task that includes a statement that causes a local execution resource to be created at the host system to perform the machine learning task. A second container may be placed as the local execution resource at the host system as a child application at the host system. A network namespace of the first container may be used as the network namespace of the second container, making the second container able to perform network communications with the first container locally on the host system. The second container may perform the machine learning task in accordance with the code.
1 . A system, comprising:
at least one processor; and
a memory, storing program instructions that when executed by the at least one processor, cause the at least one processor to implement a host system as a virtual compute instance, configured to:
execute, by a kernel of a machine learning development environment implemented as a first container at the host system, code to perform a machine learning task, wherein the code to perform the machine learning task includes a statement that causes creation of a local execution resource at the host system to perform the machine learning task, and wherein the kernel of the machine learning development environment is accessed via a separately hosted notebook server;
wherein to create the local execution resource, the statement causes:
placement of a second container as the local execution resource at the host system as a child application of the first container;
use of a network namespace of the first container as the network namespace of the second container, making the second container able to perform network communications with the first container locally on the host system, wherein the network namespace is a local, independent network stack comprising one or more routes, one or more firewall rules, and one or more network devices specific to the network namespace; and
perform, by the second container, of the machine learning task in accordance with the code.
2 . The system of claim 1 , wherein the host system is further configured to perform a clean-up process to remove the second container after an auto-termination event for the second container is detected.
3 . The system of claim 1 , wherein the host system is further configured to determine that creation of the local computing resource is authorized based on a previously received authorization request.
4 . The system of claim 1 , wherein the host system and the notebook server are implemented as part of a machine learning service offered as part of a provider network, wherein the statement is implemented according to a Software Development Kit (SDK) provided by the machine learning service, and wherein the machine learning task is an inference task or a training task that uses a machine learning model.
5 . A method, comprising:
executing, by a kernel of a machine learning development environment implemented as a first container at a host system, code to perform a machine learning task, wherein the code to perform the machine learning task includes a statement that causes creation of a local execution resource at the host system to perform the machine learning task;
wherein to create the local execution resource, the statement causes:
placement of a second container as the local execution resource at the host system as a child application of the first container;
use of a network namespace of the first container as the network namespace of the second container, making the second container able to perform network communications with the first container locally on the host system, wherein the network namespace is a local, independent network stack comprising one or more routes, one or more firewall rules, and one or more network devices specific to the network namespace; and
performing, by the second container, the machine learning task in accordance with the code.
6 . The method of claim 5 , further comprising performing a clean-up process to remove the second container after an auto-termination event for the second container is detected.
7 . The method of claim 5 , further comprising determining that creation of the local computing resource is authorized based on a previously received authorization request.
8 . The method of claim 5 , wherein the machine learning task is an inference task that uses a machine learning model to generate one or more inferences based on input data.
9 . The method of claim 5 , further comprising performing a clean-up process to remove the second container after a request to delete the local computing resource is sent by the kernel of the machine learning development environment.
10 . The method of claim 5 , wherein the second container is obtained from a container registry service, wherein the second container was provided to the container registry service via a request to register the second container for use.
11 . The method of claim 5 , further comprising:
determining that the kernel of the machine learning development environment is not healthy;
responsive to determining that the kernel of the machine learning development environment is not healthy:
performing a clean-up operation to remove the first container and the second container from the host system.
12 . The method of claim 5 , wherein a third container is placed at the at the first host system as another child application of the first container using the network namespace of the first container as the network namespace of the third container, making the third container able to perform network communications with the first container and the second container locally on the host system to provide local, distributed execution.
13 . The method of claim 5 , wherein the host system is implemented as part of a machine learning service that supports both local computing resources on a same host system as kernels for the machine learning development environment and other host systems for remote computing resources to perform other machine learning tasks.
14 . One or more non-transitory, computer-readable storage media, storing program instructions that when executed on or across one or more computing devices cause the one or more computing devices to implement:
executing, by a kernel of a machine learning development environment implemented as a first container at a host system, code to perform a machine learning task, wherein the code to perform the machine learning task includes a statement that causes creation of a local execution resource at the host system to perform the machine learning task;
wherein to create the local execution resource, the statement causes:
placement of a second container as the local execution resource at the host system as a child application of the first container;
use of a network namespace of the first container as the network namespace of the second container, making the second container able to perform network communications with the first container locally on the host system, wherein the network namespace is a local, independent network stack comprising one or more routes, one or more firewall rules, and one or more network devices specific to the network namespace; and
performance, at the second container, of the machine learning task in accordance with the code.
15 . The one or more non-transitory, computer-readable storage media of claim 14 , storing further program instructions that when executed by the at least one processor, cause the at least one processor to further implement performing a clean-up process to remove the second container after an auto-termination event for the second container is detected.
16 . The one or more non-transitory, computer-readable storage media of claim 14 , storing further program instructions that when executed by the at least one processor, cause the at least one processor to further implement determining that creation of the local computing resource is authorized based on a previously received authorization request.
17 . The one or more non-transitory, computer-readable storage media of claim 14 , wherein the machine learning task is a training task that trains a machine learning model using training data.
18 . The one or more non-transitory, computer-readable storage media of claim 14 , wherein the kernel of the machine learning development environment is accessed via a separately hosted notebook server.
19 . The one or more non-transitory, computer-readable storage media of claim 14 , storing further program instructions that when executed by the at least one processor, cause the at least one processor to further implement:
determining that the kernel of the machine learning development environment is not healthy;
responsive to determining that the kernel of the machine learning development environment is not healthy:
performing a clean-up operation to remove the first container and the second container from the host system.
20 . The one or more non-transitory, computer-readable storage media of claim 14 , wherein a third container is placed at the at the first host system as another child application of the first container using the network namespace of the first container as the network namespace of the third container, making the third container able to perform network communications with the first container and the second container locally on the host system to provide local, distributed execution.