Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement parallel logical algorithms. #8845

Closed
wants to merge 3 commits into from

Conversation

trivialfis
Copy link
Member

Extracted from #8822 .

Copy link
Member

@RAMitchell RAMitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this faster at all?

@trivialfis
Copy link
Member Author

@RAMitchell Good point.

For simple conditions like v > 0.0f, the difference is negligible. For more complicated checks like whether the input is an integer and larger than 0 (NDCG label), the difference is somewhat visible but still not an issue.

std::vector<float> data(100000000);

parallel none_of:      0.059212s
std::none_of:  0.140824s

I simply implemented it as these two functions when used for data validation, it has to walk through the entire dataset. Seems not necessary.

@RAMitchell
Copy link
Member

Feel free to merge if you want. My experience in the past is that simple operations on data don't benefit much. Multithreading then adds a bit of complexity and makes debugging harder.

@trivialfis
Copy link
Member Author

Make sense, thank you for the review. Will remove the code from the LTR branch.

@trivialfis trivialfis closed this Mar 15, 2023
@trivialfis trivialfis deleted the parallel-logical branch March 15, 2023 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants