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

aarch64 OpenBLAS: set NUM_THREADS=64 to support aarch64 instances upto 64 cores #818

Merged
merged 1 commit into from
Aug 10, 2021

Conversation

snadampal
Copy link
Contributor

This patch sets the max thread count allowed on any instance is 64.
However, the actual openblas threads used are controlled by application runtime
settings.

 instances upto 64 cores

This patch sets the max thread count allowed on any instance is 64.
However, the actual openblas threads used are controlled by application runtime
settings.
@facebook-github-bot
Copy link
Contributor

Hi @snadampal!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

Copy link
Contributor

@malfet malfet left a comment

Choose a reason for hiding this comment

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

Change looks good to me, but please sign CLA first

@snadampal
Copy link
Contributor Author

Thanks, @malfet. I'm working on the CLA signing process.

@nSircombe
Copy link

Hi @snadampal, @malfet,

Just as an additional check, I've been trying this out with various combinations of machine and NUM_THREADS and it all checks out, I can reproduce the original issue on c6g builds and get builds from 8-core t4g that work over the full 64 threads of a c6g.16xlarge.

@malfet
Copy link
Contributor

malfet commented Aug 3, 2021

@nSircombe and how did you solve the TLS cannot be allocated issue?

@nSircombe
Copy link

I've not been using the script from builder for these checks - I've been using these builds from Arm's 'Tool Solutions' repo: https://github.com/ARM-software/Tool-Solutions/tree/master/docker/pytorch-aarch64

I don't get the TLS error on these, the only time I've seen it is this recent attempt to use the script from the builder repo.

The Tool Solutions builds are, of course, not portable manylinux whls though.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@nSircombe
Copy link

It's probably worth noting that hardwiring to 64 cores (while better than getting a build that tops out at 8) isn't ideal for silicon with >64 cores, as some N1 SoCs have.

@snadampal
Copy link
Contributor Author

snadampal commented Aug 10, 2021

I agree with you @nSircombe, as the number of cores become > 64, this parameters needs change.
Unfortunately there is no runtime solution possible because OpenBLAS defines its internal buffer allocations based on the num_threads (more details here: https://fossies.org/linux/OpenBLAS/USAGE.md).
One thing I was thinking earlier was to make the num_threads arbitrarily large (eg:256) to cover next few generation SoCs, but refrained from it due to unnecessary memory overhead that might come with it.
btw, I think 64 number of threads should be more than enough for most of the applications, and hence this might cover higher core SoCs as well. We can revisit it once we benchmark nextgen SoCs.

@malfet malfet merged commit 1ddb2bf into pytorch:master Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants