| 47 | |
| 48 | namespace 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) { |
no test coverage detected