MCPcopy Create free account
hub / github.com/catboost/catboost / TTreeCtrDataSetsHelper

Method TTreeCtrDataSetsHelper

catboost/cuda/methods/tree_ctrs.cpp:97–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97NCatboostCuda::TTreeCtrDataSetsHelper::TTreeCtrDataSetsHelper(const NCatboostCuda::TFeatureParallelDataSet& dataSet,
98 const NCatboostCuda::TBinarizedFeaturesManager& featuresManager,
99 ui32 maxDepth, ui32 foldCount,
100 NCatboostCuda::TFeatureTensorTracker& emptyTracker)
101 : DataSet(dataSet)
102 , FeaturesManager(featuresManager)
103 , EmptyTracker(emptyTracker.Copy())
104 , PureTreeCtrTensorTracker(emptyTracker.Copy())
105 , MaxDepth(maxDepth)
106 , FoldCount(foldCount)
107{
108 DepthPermutations.resize(1);
109 if (LevelBasedCompressedIndex) {
110 DepthPermutations[0] = dataSet.GetIndices().ConstCopyView();
111 } else {
112 auto tmp = TMirrorBuffer<ui32>::CopyMapping(dataSet.GetIndices());
113 MakeSequence(tmp, 0u);
114 DepthPermutations[0] = tmp.ConstCopyView();
115 }
116 const auto& manager = NCudaLib::GetCudaManager();
117 const ui32 devCount = manager.GetDeviceCount();
118 DataSets.resize(devCount);
119 PureTreeCtrDataSets.resize(devCount);
120 PackSizeEstimators.resize(devCount);
121 NCudaLib::GetCudaManager().WaitComplete();
122 for (ui32 dev = 0; dev < devCount; ++dev) {
123 auto freeMemory = manager.FreeMemoryMb(dev, false);
124 PackSizeEstimators[dev] = (MakeHolder<TTreeCtrDataSetMemoryUsageEstimator>(featuresManager,
125 freeMemory,
126 dataSet.GetCatFeatures().GetFeatureCount(dev),
127 FoldCount,
128 MaxDepth,
129 static_cast<const ui32>(dataSet.GetDataProvider().GetObjectCount()),
130 dataSet.GetCatFeatures().GetStorageType() == EGpuCatFeaturesStorage::GpuRam
131 ? NCudaLib::EPtrType::CudaDevice
132 : NCudaLib::EPtrType::CudaHost));
133 }
134}
135
136void NCatboostCuda::TTreeCtrDataSetsHelper::AddSplit(const NCatboostCuda::TBinarySplit& split,
137 const TMirrorBuffer<ui32>& docBins) {

Callers

nothing calls this directly

Calls 10

ConstCopyViewMethod · 0.80
FreeMemoryMbMethod · 0.80
GetCatFeaturesMethod · 0.80
GetStorageTypeMethod · 0.80
CopyMethod · 0.45
resizeMethod · 0.45
GetDeviceCountMethod · 0.45
WaitCompleteMethod · 0.45
GetFeatureCountMethod · 0.45
GetObjectCountMethod · 0.45

Tested by

no test coverage detected