Unverified Commit a05db21b authored by chicm-ms's avatar chicm-ms Committed by GitHub
Browse files

Check gpuIndices range for remote machine training service

parent b1a65978
...@@ -134,6 +134,13 @@ export class GPUScheduler { ...@@ -134,6 +134,13 @@ export class GPUScheduler {
rmMeta.gpuReservation = new Map<number, string>(); rmMeta.gpuReservation = new Map<number, string>();
} }
const designatedGpuIndices: Set<number> | undefined = parseGpuIndices(rmMeta.gpuIndices); const designatedGpuIndices: Set<number> | undefined = parseGpuIndices(rmMeta.gpuIndices);
if (designatedGpuIndices !== undefined) {
for (const gpuIndex of designatedGpuIndices) {
if (gpuIndex >= rmMeta.gpuSummary.gpuCount) {
throw new Error(`Specified GPU index not found: ${gpuIndex}`);
}
}
}
this.log.debug(`designated gpu indices: ${designatedGpuIndices}`); this.log.debug(`designated gpu indices: ${designatedGpuIndices}`);
rmMeta.gpuSummary.gpuInfos.forEach((gpuInfo: GPUInfo) => { rmMeta.gpuSummary.gpuInfos.forEach((gpuInfo: GPUInfo) => {
// if the GPU has active process, OR be reserved by a job, // if the GPU has active process, OR be reserved by a job,
...@@ -179,5 +186,4 @@ export class GPUScheduler { ...@@ -179,5 +186,4 @@ export class GPUScheduler {
} }
}; };
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment