public class GpuResourceAllocator extends Object
| Constructor and Description |
|---|
GpuResourceAllocator(Context ctx) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGpu(GpuDevice gpuDevice)
Add GPU to the allowed list of GPUs.
|
org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.gpu.GpuResourceAllocator.GpuAllocation |
assignGpus(Container container)
Assign GPU to the specified container.
|
List<GpuDevice> |
getAllowedGpus() |
List<AssignedGpuDevice> |
getAssignedGpus() |
int |
getAvailableGpus() |
Map<GpuDevice,org.apache.hadoop.yarn.api.records.ContainerId> |
getDeviceAllocationMapping() |
static int |
getRequestedGpus(org.apache.hadoop.yarn.api.records.Resource requestedResource)
Get number of requested GPUs from resource.
|
void |
recoverAssignedGpus(org.apache.hadoop.yarn.api.records.ContainerId containerId) |
String |
toString() |
void |
unassignGpus(org.apache.hadoop.yarn.api.records.ContainerId containerId)
Clean up all GPUs assigned to containerId.
|
public GpuResourceAllocator(Context ctx)
public void addGpu(GpuDevice gpuDevice)
gpuDevice - gpu devicepublic int getAvailableGpus()
public void recoverAssignedGpus(org.apache.hadoop.yarn.api.records.ContainerId containerId)
throws ResourceHandlerException
ResourceHandlerExceptionpublic static int getRequestedGpus(org.apache.hadoop.yarn.api.records.Resource requestedResource)
requestedResource - requested resourcepublic org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.gpu.GpuResourceAllocator.GpuAllocation assignGpus(Container container) throws ResourceHandlerException
container - container to allocateResourceHandlerException - When failed to assign GPUs.public void unassignGpus(org.apache.hadoop.yarn.api.records.ContainerId containerId)
containerId - containerIdpublic Map<GpuDevice,org.apache.hadoop.yarn.api.records.ContainerId> getDeviceAllocationMapping()
public List<AssignedGpuDevice> getAssignedGpus()
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.