MCPcopy Create free account
hub / github.com/dmlc/xgboost / GetExternalMemoryDMatrixFromData

Function GetExternalMemoryDMatrixFromData

tests/cpp/helpers.cc:640–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640[[nodiscard]] std::shared_ptr<DMatrix> GetExternalMemoryDMatrixFromData(
641 HostDeviceVector<float> const& x, bst_idx_t n_samples, bst_feature_t n_features,
642 const common::TemporaryDirectory& tempdir, bst_idx_t n_batches) {
643 Context ctx;
644 auto iter = NumpyArrayIterForTest{&ctx, x, n_samples / n_batches, n_features, n_batches};
645
646 auto prefix = tempdir.Path() / "temp";
647 auto config = ExtMemConfig{
648 prefix.string(),
649 false,
650 ::xgboost::cuda_impl::AutoHostRatio(),
651 ::xgboost::cuda_impl::AutoCachePageBytes(),
652 std::numeric_limits<float>::quiet_NaN(),
653 Context{}.Threads(),
654 };
655 std::shared_ptr<DMatrix> p_fmat{
656 DMatrix::Create(static_cast<DataIterHandle>(&iter), iter.Proxy(), Reset, Next, config)};
657 return p_fmat;
658}
659
660std::unique_ptr<GradientBooster> CreateTrainedGBM(std::string name, Args kwargs, size_t kRows,
661 size_t kCols,

Callers 2

TESTFunction · 0.85
TESTFunction · 0.85

Calls 4

AutoHostRatioFunction · 0.85
AutoCachePageBytesFunction · 0.85
ThreadsMethod · 0.80
ProxyMethod · 0.45

Tested by 2

TESTFunction · 0.68
TESTFunction · 0.68