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

Function UpdatePinnedMemorySizeOption

catboost/cuda/train_lib/train.cpp:49–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48namespace NCatboostCuda {
49 inline void UpdatePinnedMemorySizeOption(const NCB::TTrainingDataProvider& learn,
50 const NCB::TTrainingDataProvider* test,
51 const TBinarizedFeaturesManager& featuresManager,
52 NCatboostOptions::TCatBoostOptions& catBoostOptions) {
53 const bool needFeatureCombinations = (catBoostOptions.CatFeatureParams->MaxTensorComplexity > 1) && (catBoostOptions.BoostingOptions->DataPartitionType == EDataPartitionType::FeatureParallel);
54
55 if (needFeatureCombinations) {
56 const bool storeCatFeaturesInPinnedMemory = catBoostOptions.DataProcessingOptions->GpuCatFeaturesStorage ==
57 EGpuCatFeaturesStorage::CpuPinnedMemory;
58 if (storeCatFeaturesInPinnedMemory) {
59 ui32 devCount = NCudaLib::GetEnabledDevices(catBoostOptions.SystemOptions->Devices,
60 NCudaLib::GetDevicesProvider().GetDeviceCount())
61 .size();
62 ui32 cpuFeaturesSize = 104857600 + 1.05 * EstimatePinnedMemorySizeInBytesPerDevice(learn, test,
63 featuresManager,
64 devCount);
65 ui64 currentSize = ParseMemorySizeDescription(catBoostOptions.SystemOptions->PinnedMemorySize.Get());
66 if (currentSize < cpuFeaturesSize) {
67 catBoostOptions.SystemOptions->PinnedMemorySize = ToString(cpuFeaturesSize);
68 }
69 }
70 }
71 }
72
73 inline void UpdateDataPartitionType(const TBinarizedFeaturesManager& featuresManager,
74 NCatboostOptions::TCatBoostOptions& catBoostOptions) {

Callers 1

Calls 6

GetEnabledDevicesFunction · 0.85
ToStringFunction · 0.50
sizeMethod · 0.45
GetDeviceCountMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected