Skip to content

Commit

Permalink
execute removeGpuReservation first to release GPUs properly (#3941)
Browse files Browse the repository at this point in the history
  • Loading branch information
hzhua committed Jul 16, 2021
1 parent 30df69b commit bccfa9f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ts/nni_manager/training_service/reusable/trialDispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!`);
Expand All @@ -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> {
Expand Down

0 comments on commit bccfa9f

Please sign in to comment.