· AI dev tools

AWS Lambda supports GPU inference, allowing 48 concurrent invocations per model on G-series GPUs

The process of getting a function running on a GPU instance involves simply building an OCI image and directing the function toward it, allowing Lambda to manage the provisioning, scaling, and event…


The process of getting a function running on a GPU instance involves simply building an OCI image and directing the function toward it, allowing Lambda to manage the provisioning, scaling, and event integration without needing to reconcile GPU drivers, CUDA versions, or AMIs, as noted by Daniel Abib, a senior specialist solutions architect at AWS.

AWS has extended GPU capabilities to its Lambda service, permitting Event Functions to operate on EC2 G-series instances (including G4dn, G5, G6, G6f, Gr6, Gr6f, and G6e upon initial release) via Lambda Managed Instances. These deployments function as container images and respond to the same event triggers as any other function. This capability is generally available across commercial regions where both Managed Instances and G-series hardware are accessible.

The cost structure involves the standard $0.20 per million requests, combined with the EC2 On-Demand rate for the instance itself, plus an additional 9.75 percent management charge. Previously, Managed Instances allowed functions to run on customer-selected EC2 capacity with Lambda handling maintenance and scaling, but GPUs were absent during that initial rollout.

Abib elaborated on the operator's experience with this new feature: "You 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." A capacity provider specifies the permissible instance types, the VPC, and a ceiling for vCPUs; Lambda automatically selects the most recent generation that possesses capacity, reverting to older generations if newer ones are unavailable.

The function defines its GPU memory needs through a novel AcceleratorConfig block, positioned alongside settings for memory, timeout, storage, and per-environment concurrency. For instance, a configuration might specify: "MemorySize": 16384, "Timeout": 900, "EphemeralStorage": { "Size": 32768 }, "Environment": { "Variables": { "MODEL_ID": "Qwen/Qwen2.5-1.5B-Instruct" } }, "CapacityProviderConfig": { "LambdaManagedInstancesCapacityProviderConfig": { "CapacityProviderArn": "arn:aws:lambda:us-east-2:111122223333:capacity-provider:lmi-gpu-cp", "ExecutionEnvironmentMemoryGiBPerVCpu": 4, "PerExecutionEnvironmentMaxConcurrency": 4 } }, "AcceleratorConfig": { "AcceleratorMemorySize": 16 }.

Up to 48 concurrent invocations within a single environment will utilize one model instance loaded into GPU memory, and scaling decisions are based on GPU utilization, CPU utilization, and the number of concurrent requests. When a version is published, the necessary environments are provisioned, the model weights are downloaded, and the engine is warmed up before the initial event arrives. Thanks to Seekable OCI lazy loading, the time required to start an environment can be reduced by as much as 70 percent.

AWS supplies five distinct GPU base images: ones dedicated to CUDA only, CuPy, PyTorch, vLLM, and SGLang. The two inference servers, vLLM and SGLang, require no custom handler code; instead, a MODEL_ID variable directs the system to a repository on Hugging Face or ModelScope, an S3 path, or a local file system, and switching models is achieved simply by altering the configuration and deploying a new version, as demonstrated by the command: aws lambda update-function-configuration --function-name my-gpu-function --environment 'Variables={MODEL_ID=s3://amzn-s3-demo-bucket/models/Qwen2.5-1.5B-Instruct/,VLLM_LOAD_FORMAT=runai_streamer}'.

The defined limitations for these launches include container images up to 32 GB, 32 GB of ephemeral storage, memory ranging from 2 to 32 GB, accelerator memory between 3 and 48 GB, a capacity provider limit of 15,000 vCPUs, and a maximum timeout of 90 minutes for asynchronous and event source mapping invocations.

In a concise comparison to competing solutions, Abib stated: "serverless GPU services that hide the same work 'often sit outside your AWS environment, with no native event sources, identity, or networking.'"

Early practical evaluations surfaced within a single day. Akaike from Classmethod reported that after correcting a conference presentation in December due to the initial rejection of G-type instances, he tested every available accelerated instance type in us-east-1, finding 37 out of 81 accepted, all belonging to the G-family; types like P-family, G7, Inferentia, Trainium, and the Graviton-based g5g were declined, as were zip packages. A benchmark using PyTorch showed performance roughly 66 times faster on the L4 compared to the instance's CPU. However, both Terraform and the Cloud Control provider lacked support for AcceleratorConfig at that time, and a new account's GPU vCPU quota started at zero: "if you use g6.xlarge (4 vCPU) with the default three instances, you need a quota of 12 vCPUs." A pull request addressing this Terraform provider gap, opened on November 16 by sasidhar-aws, and another from the same contributor remain open.

A subsequent test, conducted by AWS Community Builder xbill, involved running Gemma 4 E2B on a single g6.2xlarge using the vLLM image, incorporating Google's 4-bit QAT weights and a speculative-decoding drafter within a 9 GB image. This single environment successfully handled all 48 simultaneous requests, with every one of 417 calls succeeding, achieving approximately 130 tokens per second for a solitary request and between 3,400 and 3,600 when all 48 were active. The bottleneck, in this case, was the deployment pipeline rather than the GPU itself: the time from publishing to an active version took 484 seconds, and Lambda rejected the Docker image until it was submitted as a single-platform manifest, alongside a requirement for a handler that returns complete replies, preventing the measurement of time to the first token.

His conclusion regarding deployment strategy was narrowly focused: "For a model behind events, queues or other AWS services, the Lambda GPU function is the simpler road: one image, one function, and Lambda keeps the server alive and routes the requests." He advised keeping the drafter active for interactions with a small number of users, but disabling it for heavy batch processing. For scenarios demanding streamed replies or complete server control, he recommended, "run vLLM on an EC2 G6 yourself."

The pricing methodology mirrors that introduced by Managed Instances, featuring a reduced fee for GPU usage compared to the 15 percent applied to CPU instance types. Savings Plans and Reserved Instances apply to the underlying instance, and since there is no duration charge, an instance incurs billing as long as its minimum environment count remains above zero.

Yan Cui's December assessment of the service, written before the line "GPU instances are NOT supported" was removed, remains accurate for the GPU scenario: Standard Lambda functions can scale quickly by accessing a vast, shared pool of EC2 instances; conversely, Managed Instances require several tens of seconds to spin up new EC2 instances, making them unsuitable for traffic experiencing sudden, large surges. Furthermore, Managed Instances currently only support Event Functions; this GPU path has not yet extended to Web Functions, the HTTP-server capability Lambda gained this year, and AWS has not provided an update on this matter.

Earlier coverage

Related coverage

Also worth reading

  1. next.js 16.5.0-canary.62 released with switchyard updates, Turbopack fixes
  2. Gemini Preview semantic governance blocks AI agent tool calls before execution
  3. CircumVolve, LLM tool, finds Great Firewall evasion using GPT-5.1 for less than $1
  4. Next.js 16.5.0-canary.61 adds experimental image optimization support, Turbopack cache recovery
  5. Debian 13.8 bundles kernel and Chromium security fixes, 122-package bugfix list