This PR replaces the original RABIT implementation with a new one, which has already been partially merged into XGBoost. The new one features: - Federated learning for both CPU and GPU. - NCCL. - More data types. - A unified interface for all the underlying implementations. - Improved timeout handling for both tracker and workers. - Exhausted tests with metrics (fixed a couple of bugs along the way). - A reusable tracker for Python and JVM packages.
27 lines
942 B
Plaintext
27 lines
942 B
Plaintext
/*!
|
|
* Copyright (c) by Contributors 2020
|
|
*/
|
|
#include <gtest/gtest.h>
|
|
#include "test_survival_metric.h"
|
|
#include "xgboost/metric.h"
|
|
|
|
/** Tests for Survival metrics that should run both on CPU and GPU **/
|
|
|
|
namespace xgboost::common {
|
|
// Test configuration of AFT metric
|
|
TEST(AFTNegLogLikMetric, DeclareUnifiedTest(Configuration)) {
|
|
auto ctx = MakeCUDACtx(GPUIDX);
|
|
std::unique_ptr<Metric> metric(Metric::Create("aft-nloglik", &ctx));
|
|
metric->Configure({{"aft_loss_distribution", "normal"}, {"aft_loss_distribution_scale", "10"}});
|
|
|
|
// Configuration round-trip test
|
|
Json j_obj{ Object() };
|
|
metric->SaveConfig(&j_obj);
|
|
auto aft_param_json = j_obj["aft_loss_param"];
|
|
EXPECT_EQ(get<String>(aft_param_json["aft_loss_distribution"]), "normal");
|
|
EXPECT_EQ(get<String>(aft_param_json["aft_loss_distribution_scale"]), "10");
|
|
|
|
CheckDeterministicMetricElementWise(StringView{"aft-nloglik"}, GPUIDX);
|
|
}
|
|
} // namespace xgboost::common
|