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

Set CPU Affinity: Electric Boogaloo V2 #187

Merged
merged 6 commits into from Dec 29, 2023
Merged

Conversation

KaraKaraWitch
Copy link
Contributor

Hopefully closes #115.

We now use psutil. This method also now is more cross-platform thanks to it. There is an improvement when the requests are split across multiple cores.

The reason why it is labeled as a hack is that we are applying the said affinities afterthe workers have been initialized.
I have found that trying to set it to before (RayWorkers generated from the bundles in the code above don't get affinities applied) or clearing (Clearing affinities set them back to (0,1) in my testing) doesn't yield good results. By explicitly setting affinities, we can avoid those problems.

I've also added a hyper-threading check. Not too sure what other method I can use from psutil but eh, it works?

@KaraKaraWitch KaraKaraWitch marked this pull request as ready for review December 28, 2023 12:16
@AlpinDale
Copy link
Member

LGTM. Thanks for the fix!

@AlpinDale AlpinDale merged commit 9a0b5a1 into PygmalionAI:dev Dec 29, 2023
0 of 2 checks passed
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.

None yet

2 participants