Back to technology news
Cloud Computing

AWS Lambda Adds GPU Instance Support for Event Functions on Lambda Managed Instances

GPU support is now available for EC2 G-series GPU instances for Event Functions running on AWS Lambda Managed Instances. Customers can run GPU-accelerated workloads, including machine learning inference, media processing, rendering, and scientific computing, on GPU instances with serverless simplicity. GPU-accelerated functions are deployed as Open Container Initiative container images. Users build an OCI image, point the function at it, and let Lambda handle provisioning, scaling, and event integration. There are no GPU drivers, CUDA versions, or AMIs to reconcile, and no clusters or device plugins to operate.

Customers have asked to run GPU workloads with the simplicity of serverless. Building on self-managed GPU infrastructure means selecting instances, installing and reconciling GPU drivers and CUDA libraries, planning capacity, writing scaling logic, and hand-building event integrations. Serverless GPU services that hide that work often sit outside the AWS environment, with no native event sources, identity, or networking. Cost is the second problem because GPUs are expensive and utilization is usually low since a single workload rarely saturates a GPU. A small inference task can leave most of a provisioned GPU idle while the customer pays for the whole thing.

This feature closes both gaps. Customers bring a function, and Lambda runs it on a GPU in minutes, triggered by the same AWS events as any other Lambda Event Function, billed and secured the same way. It maximizes utilization of every GPU by consolidating functions onto instances and keeping GPUs busy across concurrent requests. The capability is optimized for inference rather than training, and custom models rather than large foundation models already available on services like Amazon Bedrock. Common workloads include custom model inference, agentic and event-driven AI, media processing and transcoding, 3D rendering and generative media, and scientific computing and financial modeling.

GPU-accelerated functions compose with the rest of Lambda. Lambda durable functions orchestrate multi-step, long-running workflows around the GPU step, with checkpointing and automatic recovery. Lambda MicroVMs run untrusted or model-generated code in isolated, stateful sandboxes. In an agentic workload, a MicroVM executes tool-use logic on CPU, then calls a GPU-accelerated function running on Lambda Managed Instances for inference. GPU-accelerated functions support the extended function timeout on Lambda Managed Instances, up to 90 minutes for asynchronous and event source mapping invocations. They support container images up to 32 GB, up to 32 GB of ephemeral storage, 2,048 to 32,768 MB of memory, 3 to 48 GB of accelerator memory, up to 48 concurrent requests per execution environment, and up to 15,000 vCPUs per capacity provider.

In a practical example, an open-source large language model from Hugging Face was deployed as a Lambda function using the vLLM base image from Lambda. The Hugging Face model ID was set in the MODEL_ID environment variable without writing inference code. Qwen/Qwen2.5-1.5B-Instruct was used, a small instruction-tuned model suited to summarization, classification, and extraction. The flow has four steps: create a capacity provider, build and push the container image, create a function from that image, then publish and invoke. New accounts might start with a quota of 0 for Running On-Demand G and VT instances, so a quota increase may be required before beginning.

The capacity provider specifies the GPU instance types Lambda can use and lets it auto-scale. Listing several instance types lets Lambda pick the most cost-effective available one and fall back across generations when capacity is tight. After pushing the image to Amazon ECR, the function was created with the model chosen through the MODEL_ID environment variable, which accepts a Hugging Face or ModelScope repository, an Amazon S3 location, or a local path. Lambda downloads the model, manages GPU memory, and serves requests. GPU-accelerated functions use AcceleratorConfig to request accelerator memory, and Lambda places the execution environment on the smallest available GPU that meets it. Four concurrent invocations finished in about the same time as a single one, on one execution environment that shares one copy of the model in GPU memory. From a Hugging Face model ID to a live, OpenAI-compatible GPU endpoint took about 10 minutes, most of it unattended while Lambda provisioned capacity and warmed up the model.

Source credits

By Daniel Abib from AWS News Blog. Edited by SetuGeo.

More technology news

Browse all technology news