Define the environment for your algorithm script
Amazon Braket supports three environments defined by containers for your algorithm script:
-
A base container (the default, if no
image_uri
is specified) -
A container with Tensorflow and PennyLane
-
A container with PyTorch and PennyLane
The following table provides details about the containers and the libraries they include.
Type | PennyLane with TensorFlow | PennyLane with PyTorch | Pennylane |
---|---|---|---|
Base |
292282985366.dkr.ecr.us-east-1.amazonaws.com/amazon-braket-tensorflow-jobs:latest |
292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-pytorch-jobs:latest |
292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-base-jobs:latest |
Inherited Libraries |
|
|
|
Additional Libraries |
|
|
|
You can view and access the open source container definitions at aws/amazon-braket-containerscreate(…)
call in the hybrid job script. You can install additional
dependencies into the container you choose at runtime (at the cost of startup or runtime)
because the Amazon Braket containers have internet connectivity. The
following example is for the us-west-2 Region.
-
Base image image_uri="292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-base-jobs:1.0-cpu-py39-ubuntu22.04"
-
Tensorflow image image_uri="292282985366.dkr.ecr.us-east-1.amazonaws.com/amazon-braket-tensorflow-jobs:2.11.0-gpu-py39-cu112-ubuntu20.04"
-
PyTorch image image_uri="292282985366.dkr.ecr.us-west-2.amazonaws.com/amazon-braket-pytorch-jobs:1.13.1-gpu-py39-cu117-ubuntu20.04"
The image-uris
can also be retrieved using the
retrieve_image()
function in the Amazon Braket SDK. The
following example shows how to retrieve them from the us-west-2 AWS Region.
from braket.jobs.image_uris import retrieve_image, Framework image_uri_base = retrieve_image(Framework.BASE, "us-west-2") image_uri_tf = retrieve_image(Framework.PL_TENSORFLOW, "us-west-2") image_uri_pytorch = retrieve_image(Framework.PL_PYTORCH, "us-west-2")