"docs/vscode:/vscode.git/clone" did not exist on "2c5d89a7b8fea0abece913131fb830ff6ea51ebb"
Unverified Commit bccfa9ff authored by Zhenhua Han's avatar Zhenhua Han Committed by GitHub
Browse files

execute removeGpuReservation first to release GPUs properly (#3941)

parent 30df69bf
......@@ -732,6 +732,9 @@ class TrialDispatcher implements TrainingService {
* @param trial
*/
private releaseEnvironment(trial: TrialDetail): void {
if (true === this.enableGpuScheduler) {
this.gpuScheduler.removeGpuReservation(trial);
}
if (trial.environment !== undefined) {
if (trial.environment.runningTrialCount <= 0) {
throw new Error(`TrialDispatcher: environment ${trial.environment.id} has no counted running trial!`);
......@@ -740,9 +743,6 @@ class TrialDispatcher implements TrainingService {
trial.environment.latestTrialReleasedTime = Date.now();
trial.environment = undefined;
}
if (true === this.enableGpuScheduler) {
this.gpuScheduler.removeGpuReservation(trial);
}
}
private async handleMetricData(trialId: string, data: any): Promise<void> {
......
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