You need to enable JavaScript to run this app.
E-MapReduce

E-MapReduce

Copy page
Download PDF
mGPU jobs
EMR Serverless uses mGPU resources
Copy page
Download PDF
EMR Serverless uses mGPU resources

EMR Serverless queue supports mGPU, enabling resource sharing on a single GPU card, flexible allocation of compute cores and GPU memory resources, and strict isolation. This article introduces how to enable and use mGPU resources.

Limits
  • mGPU can only be enabled when creating a queue. If enabled, the compute engine uses mGPU resources; if not enabled, the compute engine uses the entire GPU instance resources.
  • A maximum of 16 mGPU Executors/Workers can be created on a single GPU card. Compute performance decreases as the number of mGPUs increases. It is recommended to plan the number of engine Executors/Workers according to business requirements.
  • The minimum GPU memory setting for mGPU is 256 MiB, and the minimum core is 5.

context
  • mGPU is VolcanoEnginea container-based shared GPU solution based on kernel virtualization isolation and an in-house scheduling framework. Through kernel virtualization technology, it enables resource sharing on a single GPU card, flexible allocation of compute cores and GPU memory resources, and strict isolation.
  • After enabling mGPU, jobs in the queue can directly specify the use of part of the cores and GPU memory of a single GPU card. In small model scenarios, this can significantly reduce usage costs and improve resource utilization.
  • On EMR Serverless GPU queue, both Ray and CustomJob engines support mGPU. You can use mGPU to share GPU resources among multiple jobs/Pods without modifying engine code.

tip

For detailed information about mGPU, refer to: mGPU Overview.

procedure

Enable mGPU

On the EMR Serverless Create queue interface, after selecting GPU Resource allocation, you can choose to enable mGPU. Once created queue, mGPU resources will be used.

tip

  • mGPU and GPU are mutually exclusive; a single queue can only use GPU or mGPU.
  • mGPU virtualization itself occupies a small portion of video memory, so the actual available video memory is slightly less than the native memory of the full card.

Image

Engine usage of mGPU resources

See the table below for mGPU-related parameters. For detailed GPU parameters, refer to EMR Serverless GPU parameter description.

Job types

Parameter key

Parameter meaning

Parameter example

CustomJob

emr.serverless.mgpu.core

Set the computing power used by a single Pod.
When the setting does not exceed the computing power of a single GPU card: the range is 5–100. The minimum GPU computing power is 5% with a step size of 5. For example, setting 30 means using 30% of the computing power. Setting 99 means using 99% of the full GPU card's computing power.

warning

When the value is set to 100 or greater, it indicates the use of the full computing power of a GPU card. Only integer multiples of 100 can be set. For example, 200 indicates that two full GPU cards are mounted.

30

emr.serverless.mgpu.memory

Set the video memory used by a single Pod. The unit is MiB. For example, 4096 means GPU video memory of 4 GiB.

warning

When Mgpu Core is set to 100 or greater, full card resources are used by default. After this parameter is set, the mgpu memory parameter cannot be set.

4096

serverless.custom.job.task.gpus

The number of GPU cards per CustomJob Task. In the mGPU scenario, the quantity is automatically converted to the use of full GPU cards. For example, 2 means using 2 full GPU cards.

warning

The priority of emr.serverless.mgpu.core is higher than that of serverless.custom.job.task.gpus.

1

Ray

serverless.ray.head.mgpu.core

Ray Head dedicated configuration. Set the mgpu core used by ray head separately. Usage aligns with emr.serverless.mgpu.core.

30

serverless.ray.head.mgpu.memory

Ray Head dedicated configuration. Set the mgpu memory used by ray head. Usage aligns with emr.serverless.mgpu.memory.

4096

serverless.ray.worker.mgpu.core

Ray Worker dedicated configuration. Set the mgpu core used by ray worker separately. Usage aligns with emr.serverless.mgpu.core.

30

serverless.ray.worker.mgpu.memory

Ray Worker dedicated configuration. Set the mgpu memory used by ray worker. Usage aligns with emr.serverless.mgpu.memery.

4096

serverless.ray.worker.gpu.amount

The number of GPU cards per Ray Worker. In the mgpu scenario, the quantity is automatically converted to the use of full GPU cards. For example, 2 means using 2 full GPU cards.

warning

The priority of serverless.ray.worker.mgpu.core is higher than that of serverless.ray.worker.gpu.amount.

1

warning

From the engine's perspective, it still sees a complete GPU card, but the memory and computing power of this "card" are restricted. Therefore, the upper-layer engine business code can still treat it as a single card.

CustomJob

In the default compute group, you can additionally set the following parameters:

-- Set mgu-related parameters
emr.serverless.mgpu.core=30;
emr.serverless.mgpu.memory=1000;

-- Set historical GPU parameters. When the mgpu queue is enabled, full GPU cards are used by default.
-- Equivalent to emr.serverless.mgpu.core=100
serverless.custom.job.task.gpus=1; 

After setting, each CustomJob Task will mount a GPU card and use only 30% of its compute power and 1000 MiB of GPU memory.

RayJob

In the default compute group, you can additionally set the following parameters:

-- mgpu-related parameters
serverless.ray.worker.mgpu.core=30;
serverless.ray.worker.mgpu.memory=4096;

-- Set historical GPU parameters. When the mgpu queue is enabled, full GPU cards are used by default.
-- Equivalent to serverless.ray.worker.mgpu.core;
serverless.ray.worker.gpu.amount=1;

After setting, each Ray Worker will mount a GPU card, but each Worker will only use 30% of the GPU card's compute power and 4096 MiB of GPU memory. You can also see that each Worker has one GPU card resource in the Ray dashboard:
Image

RayCluster / RayServe

In Ray Cluster/Ray Serve, you can set the required mGPU core and GPU memory for Worker/Head through the interface.
Image
When the setting is greater than or equal to 100, it indicates the use of the full card's computing power. Only integer multiples of 100 can be set. For example, 200 means using the computing power of two full GPU cards.
Image

Resource monitoring

In EMR Console > Queue Details > Queue Monitoring > GPU Resources , you can view the current queue's mGPU Core and Memory usage.
Image

FAQs

If the job fails to start after setting mGPU parameters, check whether the values of mGPU core and mGPU memory meet the requirements:

  • When mGPU core is set to not exceed the computing power of a single GPU card: the range is 5–100.
  • When mGPU core is set to greater than or equal to 100, only integer multiples of 100 can be set.
  • When mGPU core is set to greater than or equal to 100, mGPU memory cannot be set.
Last updated: 2026.07.01 16:54:28