fix dupliate gpu check (#9578)

This commit is contained in:
Rong Ou 2023-09-13 14:53:46 -07:00 committed by GitHub
parent 300f9ace06
commit a343ae3b34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,9 +83,8 @@ class XGBoostTrainer(Executor):
'eval_metric': 'auc',
}
if self._use_gpus:
if self._use_gpus:
self.log_info(fl_ctx, f'Training with GPU {rank}')
param['device'] = f"cuda:{rank}"
self.log_info(fl_ctx, f'Training with GPU {rank}')
param['device'] = f"cuda:{rank}"
# specify validations set to watch performance
watchlist = [(dtest, "eval"), (dtrain, "train")]