GPU configuration for Modal functions and classes. You can pass a wide range ofDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/modal-labs/modal-client/llms.txt
Use this file to discover all available pages before exploring further.
str values for the gpu parameter of @app.function and @app.cls.
String shortcodes
The recommended way to specify GPUs is using string shortcodes:gpu="H100"- Attach 1 H100 GPU to each containergpu="L40S"- Attach 1 L40S GPU to each containergpu="A100"- Attach 1 A100-40GB GPU to each containergpu="A100-80GB"- Attach 1 A100-80GB GPU to each containergpu="T4:4"- Attach 4 T4 GPUs to each containergpu="A100-80GB:4"- Attach 4 A100-80GB GPUs to each container
Available GPU types
T4
NVIDIA T4 Tensor Core GPU. A low-cost data center GPU based on the Turing architecture, providing 16GB of GPU memory.L4
NVIDIA L4 Tensor Core GPU. A mid-tier data center GPU based on the Ada Lovelace architecture, providing 24GB of GPU memory. Includes RTX (ray tracing) support.A10G
NVIDIA A10G Tensor Core GPU. A mid-tier data center GPU based on the Ampere architecture, providing 24 GB of memory. A10G GPUs deliver up to 3.3x better ML training performance compared to T4 GPUs.A100
NVIDIA A100 Tensor Core GPU. The flagship data center GPU of the Ampere architecture. Available in 40GB and 80GB GPU memory configurations.H100
NVIDIA H100 Tensor Core GPU. The flagship data center GPU of the Hopper architecture. Enhanced support for FP8 precision and a Transformer Engine that provides up to 4X faster training over the prior generation for GPT-3 (175B) models.L40S
NVIDIA L40S GPU. The L40S is a data center GPU for the Ada Lovelace architecture. It has 48 GB of on-chip GDDR6 RAM and enhanced support for FP8 precision.Any
Selects any one of the GPU classes available within Modal, according to availability.Type hints
For type checking purposes, the GPU parameter type is:_GPUConfig is a deprecated class-based configuration (see deprecation note below).