Parallelization of reducing the size of embedded features#2818
Open
Maslyanko wants to merge 8 commits into
Open
Parallelization of reducing the size of embedded features#2818Maslyanko wants to merge 8 commits into
Maslyanko wants to merge 8 commits into
Conversation
| localExecutor->ExecRange([&](int id) { | ||
| int linesPerThread = samplesCount / numThreads; | ||
|
|
||
| for (int i = id; i < samplesCount; i += numThreads) { |
Contributor
There was a problem hiding this comment.
/home/espetrov/arcadia/catboost/private/libs/feature_estimator/base_embedding_feature_estimator.h:300:36: error: comparison of integers of different signs: 'int' and 'const ui64' (aka 'const unsigned long') [-Werror,-Wsign-compare]
300 | for (int i = id; i < samplesCount; i += numThreads) {
| NPar::ILocalExecutor* localExecutor | ||
| ) const { | ||
| int numThreads = localExecutor->GetThreadCount(); | ||
| TVector<TKNNCalcer> featureCalcers(numThreads);; |
Contributor
There was a problem hiding this comment.
extra ;
| TConstArrayRef<TCalculatedFeatureVisitor> testVisitors, | ||
| NPar::ILocalExecutor* localExecutor | ||
| ) const { | ||
| int numThreads = localExecutor->GetThreadCount(); |
Contributor
There was a problem hiding this comment.
should be GetThreadCount() + 1 to include main thread
| TConstArrayRef<TCalculatedFeatureVisitor> visitors, | ||
| NPar::ILocalExecutor* localExecutor) const { | ||
|
|
||
| const ui32 numThreads = localExecutor->GetThreadCount(); |
Comment on lines
+281
to
+295
| localExecutor->ExecRange([&](int id) { | ||
| int linesPerThread = samplesCount / numThreads; | ||
| int begin = id * linesPerThread; | ||
| int end = (id + 1) * linesPerThread; | ||
| if (id == numThreads - 1) { | ||
| end = samplesCount; | ||
| } | ||
|
|
||
| for (int i = begin; i < end; ++i) { | ||
| auto line = learnPermutation[i]; | ||
| const TEmbeddingsArray& vector = learnDataset.GetVector(line); | ||
| vectorsNeighbors[line] = featureCalcers[id].GetNearestNeighborsAndDistances(vector); | ||
| calcerVisitors[id].Update(target[line], vector, &featureCalcers[id]); | ||
| } | ||
| }, params, NPar::TLocalExecutor::WAIT_COMPLETE); |
Contributor
There was a problem hiding this comment.
please reformat all similar code as follows
localExecutor->ExecRange(
[&](int id) {
// ...
},
params,
NPar::TLocalExecutor::WAIT_COMPLETE);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #2743.
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en