MaxFrame runs GPU-based tasks on MaxCompute through GU (GPU Unit) Quota—enabling distributed multi-modal data processing and model inference at scale with Python.
Prerequisites
Before you begin, make sure you have:
-
A MaxCompute project with a GU Quota assigned
-
MaxFrame installed and configured
For information on purchasing GU resources, see MaxCompute AI compute resources.
Set the engine priority
The Distributed Python Engine (DPE) is the compute engine that handles GPU workloads in MaxFrame. GUs are suitable for scenarios such as deep learning inference, image and audio processing, and offline inference for Large Language Models (LLMs).
To route GPU tasks to the DPE, place "DPE" first in engine_order:
from maxframe.config import options
options.dag.settings = {
"engine_order": ["DPE", "MCSQL"]
}
Configure GU resources
Two methods are available. Choose based on your use case:
| Method 1: Session-level quota | Method 2: UDF-level parameters | |
|---|---|---|
| Scope | Applies automatically to MaxFrame AI Functions | Applies to a specific UDF |
| UDF support | Requires manual override for regular UDFs | Fully supported |
| Use when | Running MaxFrame AI Functions | Running custom UDFs that need GPU resources |
Method 1: Set a session-level GU Quota
options.session.gu_quota_name = "xxxxxx" # GU Quota name
The session-level GU Quota takes effect automatically only for MaxFrame AI Functions. For regular UDFs, set GU parameters at the UDF level (Method 2).
Method 2: Set GU parameters at the UDF level
@with_running_options(engine="dpe", gu=8, gu_quota="xxxxx")
def vad_call(batch, config_path: str):
...
| Parameter | Description |
|---|---|
engine="dpe" |
Routes the UDF to the DPE for GPU execution |
gu=8 |
Allocates 8 GUs (8 cards) to each instance |
gu_quota="os_xxxx" |
Specifies the GU Quota group to use |