-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Use huge pages for worker data #6359
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR switches worker allocations to use huge pages for potential performance gains and adds the contributor to AUTHORS.
- Replace std::unique_ptr with LargePagePtr for Worker in Thread
- Allocate Worker via make_unique_large_page within the NUMA-bound context
- Add include of memory.h where needed and update AUTHORS
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/thread.h | Switch worker type to LargePagePtr and include memory.h to support huge page allocation. |
| src/thread.cpp | Use make_unique_large_page to allocate Worker and include memory.h. |
| AUTHORS | Add new contributor entry. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
As the worker data is quite large (28MB after #6350) we can make use of huge pages as a speedup. prior to #6350 STC passed elo gaining bounds: LLR: 2.95 (-2.94,2.94) <0.00,2.00> Total: 166272 W: 43479 L: 42993 D: 79800 Ptnml(0-2): 540, 17598, 46365, 18102, 531 https://tests.stockfishchess.org/tests/view/68e9f3c0d323fd15c04e3ba4 Tested the speedup on a large machine with speedtest: ==== master ==== Average (over 20): 288644510 ==== largePageWorker ==== Average (over 20): 292082422 Test after #6350: ==== rustam-cpp-testPR ==== Average (over 20): 291035351 ==== rustam-cpp-testPR-pages ==== Average (over 20): 291937367 #6359 No functional change
|
merged with 75edbee |
As the worker data is quite large (28MB after official-stockfish#6350) we can make use of huge pages as a speedup. prior to official-stockfish#6350 STC passed elo gaining bounds: LLR: 2.95 (-2.94,2.94) <0.00,2.00> Total: 166272 W: 43479 L: 42993 D: 79800 Ptnml(0-2): 540, 17598, 46365, 18102, 531 https://tests.stockfishchess.org/tests/view/68e9f3c0d323fd15c04e3ba4 Tested the speedup on a large machine with speedtest: ==== master ==== Average (over 20): 288644510 ==== largePageWorker ==== Average (over 20): 292082422 Test after official-stockfish#6350: ==== rustam-cpp-testPR ==== Average (over 20): 291035351 ==== rustam-cpp-testPR-pages ==== Average (over 20): 291937367 official-stockfish#6359 No functional change
As the worker data is quite large (14MB) we can make use of huge pages as a speedup.
STC passed elo gaining bounds:
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 166272 W: 43479 L: 42993 D: 79800
Ptnml(0-2): 540, 17598, 46365, 18102, 531
https://tests.stockfishchess.org/tests/view/68e9f3c0d323fd15c04e3ba4
@vondele tested the speedup on a large machine:
Which shows approximately a 1.2% speedup
It was speculated that if the worker size was increased, the speedup would become more pronounced. To test this, @vondele tested this patch on top of another (#6350) which increased the worker size to 28MB:
Which shows only a 0.3% speedup. This was not the anticipated result, but could simply be due to noise in the speed test.
Bench: 2169281