De-duplicate GPU parameters. (#4454)
* Only define `gpu_id` and `n_gpus` in `LearnerTrainParam` * Pass LearnerTrainParam through XGBoost vid factory method. * Disable all GPU usage when GPU related parameters are not specified (fixes XGBoost choosing GPU over aggressively). * Test learner train param io. * Fix gpu pickling.
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
// Copyright by Contributors
|
||||
#include <xgboost/objective.h>
|
||||
|
||||
#include <xgboost/generic_parameters.h>
|
||||
#include "../helpers.h"
|
||||
|
||||
TEST(Objective, PairwiseRankingGPair) {
|
||||
xgboost::ObjFunction * obj = xgboost::ObjFunction::Create("rank:pairwise");
|
||||
std::vector<std::pair<std::string, std::string> > args;
|
||||
xgboost::LearnerTrainParam tparam;
|
||||
std::vector<std::pair<std::string, std::string>> args;
|
||||
tparam.InitAllowUnknown(args);
|
||||
|
||||
xgboost::ObjFunction * obj =
|
||||
xgboost::ObjFunction::Create("rank:pairwise", &tparam);
|
||||
obj->Configure(args);
|
||||
// Test with setting sample weight to second query group
|
||||
CheckRankingObjFunction(obj,
|
||||
|
||||
Reference in New Issue
Block a user