Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Lambda on Arm CPUs #1051

Open
nickovs opened this issue Oct 1, 2021 · 7 comments
Open

Support for Lambda on Arm CPUs #1051

nickovs opened this issue Oct 1, 2021 · 7 comments
Assignees
Labels
feature-request Request/idea regarding new and/or improved functionality planned Work is planned priority | P2 Priority: Medium
Milestone

Comments

@nickovs
Copy link

nickovs commented Oct 1, 2021

Context

Amazon recently announced that they are now offering Lambda running on their custom Graviton2 CPUs. These are built around the Arm CPU architecture instead of Intel, apparently offering up to 19 percent better performance at 20 percent lower cost.

Zappa does not currently have a way to indicate which CPU architecture it should use for deployment. Furthermore, for Python packages that have binary components Zappa currently always fetches the wheel files for the x86_64 architecture.

It would be valuable if Zappa supported deployment on the Arm platform by means of a configuration setting.

Expected Behavior

n/a

Actual Behavior

n/a

Possible Fix

The code that implements core.create_lambda_function() calls the CreateFunction AWS API endpoint to create the Lambda function. Amazon has updated the API to add a new Architectures argument that can be set to either x86_64 or arm64 (with the former as the default). A new architecture configuration setting should set this argument.

The regular expressions that find the suitable wheel files and check for cached wheels will need to be updated to find the wheels for the correct architecture.

@NinitoAS
Copy link

NinitoAS commented Oct 8, 2021

Any PRs for this issue?

@turingbeing
Copy link

Any PRs for this issue?

I will work on this issue

@dickermoshe
Copy link

dickermoshe commented Feb 21, 2022

Zappa will upload to ARM if your system is running ARM.
You could use mlupin/docker-lambda:python3.9-build-arm and use QEMU to emulate it on x86.
Other than that there no other solution.

@nickovs
Copy link
Author

nickovs commented Feb 21, 2022

@dickermoshe I'm not sure that you are correct when you say: "Zappa will upload to ARM if your system is running ARM." Firstly, Zappa tries to upload whole .whl wheel files and it explicitly looks for x86_64 wheels, so if use a package that has a binary component and you you have something different on your local machine it will go and fetch the Intel versions. Secondly, the existing code never sets the architecture type for the requested Lambda instance and so this will always default to an Intel instance. As a result even when I deploy from ARM machines (either Raspberry Pi with 64bit OS or M1 Mac) it runs Zappa on an Intel Lambda instance.

As for needing emulation, I don't think that is the case either. Zappa requires either pure Python modules or pre-built wheels; if there are existing ARM architecture wheel files then nothing needs to get built.

@dickermoshe
Copy link

My mistake. You're 100% right.
It always looks for x86.
I'll shut up now 😳

@van4oza
Copy link

van4oza commented Sep 26, 2023

Hi! Any news?
I'm so waiting for this feature!)

@sebatyler
Copy link

Many people are waiting for this feature. I hope it will be released soon!

@javulticat javulticat added this to the Zappa 0.60 milestone Apr 4, 2024
@javulticat javulticat added planned Work is planned priority | P2 Priority: Medium feature-request Request/idea regarding new and/or improved functionality and removed has-pr next-release-candidate labels Apr 4, 2024
@javulticat javulticat self-assigned this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request/idea regarding new and/or improved functionality planned Work is planned priority | P2 Priority: Medium
Projects
None yet
8 participants