ai newsMi., 25. Nov.
EilmeldungCan Claude’s storage webhooks miss an hour-long outage?

AWS Lambda startet GPU-Inferenz mit bis zu 48 parallelen Aufrufen pro Modell

AWS Lambda unterstützt Event Functions nun auf EC2-GPU-Instanzen der G-Serie, wobei bis zu 48 gleichzeitige Aufrufe ein Modell pro GPU teilen. vLLM- und SGLang-Basis-Images benötigen keinen Handler-Code, asynchrone Timeouts betragen 90 Minuten.

InfoQSonntag 07:27 · 22.11.DE4 Min. Lesezeit
Bild: InfoQ

Wie InfoQ im Dezember vergangenen Jahres berichtete, ermöglichen Managed Instances die Ausführung einer Funktion auf EC2-Kapazität, die der Kunde selbst auswählt und bezahlt, wobei Lambda Provisioning, Patching und Skalierung übernimmt und mehrere Aufrufe sich eine Ausführungsumgebung teilen. GPUs fehlten zum Startzeitpunkt noch. Daniel Abib, Senior Specialist Solutions Architect bei AWS, beschreibt die Betreibersicht der Änderung:

Sie erstellen ein OCI-Image, verweisen die Funktion darauf und überlassen Lambda Provisioning, Skalierung und Event-Integration. Es gibt keine GPU-Treiber, CUDA-Versionen oder AMIs, die abgeglichen werden müssen, und keine Cluster oder Device-Plugins zu betreiben.

Ein Capacity Provider listet die erlaubten Instance-Typen, das VPC und eine vCPU-Obergrenze auf; Lambda wählt die neueste Generation mit verfügbarer Kapazität und fällt auf ältere Generationen zurück, wenn neuere knapp sind:

"InstanceRequirements": { "AllowedInstanceTypes": ["g5.2xlarge", "g6.2xlarge", "g6e.2xlarge"] }, "CapacityProviderScalingConfig": { "ScalingMode": "Auto", "MaxVCpuCount": 96 } Die Funktion deklariert ihren GPU-Speicher über einen neuen AcceleratorConfig-Block, neben Speicher, Timeout, Storage und einer Concurrency pro Umgebung:

"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 } Gleichzeitige Aufrufe in einer Umgebung teilen sich eine einzige Kopie des Modells im GPU-Speicher, bis zu 48 pro Umgebung, und die Skalierung folgt GPU-Auslastung, CPU-Auslastung und Concurrency. Das Veröffentlichen einer Version stellt die Umgebungen bereit, lädt die Gewichte herunter und wärmt die Engine vor, bevor das erste Ereignis eintrifft; Seekable OCI Lazy Loading kann die Startzeit einer Umgebung um bis zu 70 Prozent verkürzen.

AWS liefert fünf GPU-Basisimages mit: nur CUDA, CuPy, PyTorch, vLLM und SGLang. Die beiden Inferenz-Server benötigen keinen Handler-Code; eine MODEL_ID-Variable verweist auf ein Hugging-Face- oder ModelScope-Repository, einen S3-Präfix oder einen lokalen Pfad, und ein Modellwechsel ist eine Konfigurationsänderung gefolgt von einer neuen Version:

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}' Die Limits stehen im Launch-Post: Container-Images bis 32 GB, 32 GB Ephemeral Storage, 2 bis 32 GB Speicher, 3 bis 48 GB Accelerator-Speicher, 15.000 vCPUs pro Capacity Provider und ein Timeout von bis zu 90 Minuten für asynchrone Aufrufe und Event-Source-Mapping-Invocations. Abib zieht die Grenze zur Konkurrenz in einem Satz: serverlose GPU-Dienste, die dieselbe Arbeit verbergen, "liegen oft außerhalb Ihrer AWS-Umgebung, ohne native Event-Quellen, Identität oder Networking".

Die ersten Praxisberichte erschienen innerhalb eines Tages. Akaike von Classmethod, der im Dezember einen Konferenzvortrag hatte korrigieren müssen, nachdem er festgestellt hatte, dass kein G-Typ akzeptiert wurde, testete jeden beschleunigten Instance-Typ in us-east-1 und fand 37 von 81 akzeptiert, alle aus der G-Familie; P-Familie, G7, Inferentia, Trainium und die auf Graviton basierende g5g wurden abgelehnt, ebenso Zip-Pakete. Ein PyTorch-Benchmark lief auf der L4 etwa 66-mal schneller als auf der CPU der Instanz.

Dennoch kannten weder Terraform noch der Cloud-Control-Provider AcceleratorConfig bisher, und die GPU-vCPU-Quote in einem frischen Konto liegt bei null: "Wenn Sie g6.xlarge (4 vCPU) mit den standardmäßigen drei Instanzen verwenden, benötigen Sie eine Quote von 12 vCPUs." Ein Terraform-Provider-Issue und Pull Request, eröffnet am 16. November von einem Nutzer namens sasidhar-aws, sowie ein weiterer Pull Request desselben Nutzers sind weiterhin offen.

Ein zweiter Test, von einem AWS Community Builder unter dem Namen xbill, setzte Gemma 4 E2B über das vLLM-Image auf einer einzelnen g6.2xlarge ein, mit Googles 4-Bit-QAT-Gewichten und einem Speculative-Decoding-Drafter in einem 9-GB-Image. Eine Umgebung bediente alle 48 gleichzeitigen Anfragen, und jeder der 417 Aufrufe war erfolgreich, mit rund 130 Tokens pro Sekunde bei einer einzelnen Anfrage und 3.400 bis 3.600 bei 48. Die Reibung lag eher in der Pipeline als auf der GPU: 484 Sekunden vom Veröffentlichen bis zu einer aktiven Version, ein Docker-Image-Index, den Lambda ablehnte, bis er als Single-Platform-Manifest gepusht wurde, und ein Handler, der vollständige Antworten zurückgibt, sodass die Time to First Token nicht gemessen werden konnte. Sein Fazit bleibt in diesem Rahmen:

Für ein Modell hinter Events, Queues oder anderen AWS-Diensten ist die Lambda-GPU-Funktion der einfachere Weg: ein Image, eine Funktion, und Lambda hält den Server am Leben und routet die Anfragen. Lassen Sie den Drafter für einen Chat mit einigen wenigen Nutzern gleichzeitig aktiviert und veröffentlichen Sie ihn für hohe Batch-Lasten ohne ihn.

Wenn gestreamte Antworten oder volle Kontrolle über den Server benötigt werden, schreibt er, "betreiben Sie vLLM selbst auf einer EC2 G6".

Das Preismodell ist dasjenige, das Managed Instances eingeführt haben, mit einer niedrigeren Gebühr für GPUs als die 15 Prozent, die auf CPU-Instance-Typen erhoben werden. Savings Plans und Reserved Instances gelten für die Instanz, und es gibt keine Laufzeitgebühr, sodass eine Instanz abrechnet, solange die minimale Umgebungszahl über null liegt. Yan Cuis Dezember-Analyse des Modells, verfasst, als sie noch die Zeile "GPU instances are NOT supported" enthielt, gilt für den GPU-Fall unverändert:

Reguläre Lambda-Funktionen können schnell skalieren, indem sie auf einen großen, gemeinsam genutzten Pool von EC2-Instanzen zurückgreifen. Bei Managed Instances dauert das Starten neuer EC2-Instanzen Zehnersekunden. Daher eignen sie sich nicht, wenn Sie große, unvorhersehbare Verkehrsspitzen haben.

Managed Instances unterstützen weiterhin nur Event Functions, sodass der GPU-Pfad noch nicht die Web Functions erreicht, die HTTP-Server-Form, die Lambda in diesem Jahr erhalten hat, und AWS hat nicht gesagt, ob das kommen wird.

15. bis 16. Dezember 2026. Erleben Sie, wie erfahrene Praktiker Agents, Evals, Model Serving und KI-gestützte Entwicklung im Produktivbetrieb einsetzen, einschließlich dessen, was gescheitert ist und was sich geändert hat. Jetzt registrieren.

Automatisch übersetzt. Das Original auf Englisch ist unten aufklappbar.

Original (Englisch) anzeigen

As InfoQ reported last December, Managed Instances let a function run on EC2 capacity the customer selects and pays for, with Lambda handling provisioning, patching and scaling and several invocations sharing one execution environment. GPUs were missing at that launch. Daniel Abib, senior specialist solutions architect at AWS, describes the operator's side of the change:

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 lists the allowed instance types, the VPC and a vCPU ceiling; Lambda picks the newest generation with capacity and falls back to older generations when newer ones are short:

"InstanceRequirements": { "AllowedInstanceTypes": ["g5.2xlarge", "g6.2xlarge", "g6e.2xlarge"] }, "CapacityProviderScalingConfig": { "ScalingMode": "Auto", "MaxVCpuCount": 96 } The function declares its GPU memory through a new AcceleratorConfig block, next to memory, timeout, storage, and a per-environment concurrency:

"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 } Concurrent invocations in one environment share a single copy of the model in GPU memory, up to 48 per environment, and scaling follows GPU utilization, CPU utilization, and concurrency. Publishing a version provisions the environments, downloads the weights, and warms the engine before the first event arrives; Seekable OCI lazy loading can cut environment start time by up to 70 percent.

AWS ships five GPU base images: CUDA only, CuPy, PyTorch, vLLM, and SGLang. The two inference servers need no handler code; a MODEL_ID variable points to a Hugging Face or ModelScope repository, an S3 prefix, or a local path, and a model swap is a configuration change followed by a new version:

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 limits are in the launch post: container images up to 32 GB, 32 GB of ephemeral storage, 2 to 32 GB of memory, 3 to 48 GB of accelerator memory, 15,000 vCPUs per capacity provider, and a timeout of up to 90 minutes for asynchronous and event source mapping invocations. Abib draws the line against the competition in one sentence: serverless GPU services that hide the same work "often sit outside your AWS environment, with no native event sources, identity, or networking."

The first hands-on reports came within a day. Classmethod's Akaike, who had corrected a conference talk in December after finding that no G-type was accepted, tried every accelerated instance type in us-east-1 and found 37 of 81 accepted, all G-family; P-family, G7, Inferentia, Trainium, and the Graviton-based g5g were refused, as were zip packages. A PyTorch benchmark ran about 66 times faster on the L4 than on the instance's CPU.

Still, neither Terraform nor the Cloud Control provider knew AcceleratorConfig yet, and the GPU vCPU quota in a fresh account is zero: "if you use g6.xlarge (4 vCPU) with the default three instances, you need a quota of 12 vCPUs." A Terraform provider issue and pull request, opened on 16 November by a user named sasidhar-aws, and a pull request from the same user remain open.

A second test, by an AWS Community Builder writing as xbill, put Gemma 4 E2B on a single g6.2xlarge through the vLLM image, with Google's 4-bit QAT weights and a speculative-decoding drafter baked into a 9 GB image. One environment served all 48 simultaneous requests and every one of 417 calls succeeded, at roughly 130 tokens a second for a single request and 3,400 to 3,600 at 48. The friction was in the pipeline rather than the GPU: 484 seconds from publish to an active version, a Docker image index that Lambda rejected until it was pushed as a single-platform manifest, and a handler that returns complete replies, so time to first token could not be measured. His verdict keeps to that scope:

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. Keep the drafter on for a chat with a few users at a time, and publish without it for heavy batch load.

When streamed replies or full control of the server are needed, he writes, "run vLLM on an EC2 G6 yourself."

The pricing model is the one Managed Instances introduced, with a lower fee for GPUs than the 15 percent charged on CPU instance types. Savings Plans and Reserved Instances apply to the instance, and there is no duration charge, so an instance bills for as long as the minimum environment count is above zero. Yan Cui's December analysis of the model, written when it still carried the line "GPU instances are NOT supported," applies to the GPU case unchanged:

Regular Lambda functions can scale rapidly by tapping into a large, shared pool of EC2 instances. With managed instances, it takes tens of seconds to launch new EC2 instances. As such, it's not a good fit when you have large, unpredictable spikes in traffic.

Managed Instances still support only Event Functions, so the GPU path does not yet reach Web Functions, the HTTP-server shape Lambda gained this year, and AWS has not said whether it will.

December 15–16, 2026. Examine how senior practitioners run agents, evals, model serving, and AI-assisted engineering in production, including what failed and what changed. Register Now.

Originaltitel: AWS Lambda Now Runs GPU Inference with 48 Concurrent Invocations Sharing One Model per GPUQuelle: InfoQ (InfoQ). Original öffnen