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

Switch off NNPACK on osx? #56

Open
h-vetinari opened this issue Jul 30, 2021 · 12 comments
Open

Switch off NNPACK on osx? #56

h-vetinari opened this issue Jul 30, 2021 · 12 comments

Comments

@h-vetinari
Copy link
Member

I'm getting a test failure in conda-forge/torchvision-feedstock#28 for osx that:

[W NNPACK.cpp:79] Could not initialize NNPACK! Reason: Unsupported hardware.

Upstream sets USE_NNPACK=OFF for the osx jenkins build, but seems to have it enabled by default in CMakeLists.txt

@hmaarrfk
Copy link
Contributor

is that a warning or a failure?

@hmaarrfk
Copy link
Contributor

Could you make the PR for this? providing the same links you just did in the appropriate build file for reference

@isuruf
Copy link
Member

isuruf commented Jul 30, 2021

pytorch's own conda builds don't turn off NNPACK.

@h-vetinari
Copy link
Member Author

h-vetinari commented Jul 30, 2021

Then how to avoid the hard fail of a torchvision test? Something in the CF builds is not working with nnpack+osx...

@isuruf
Copy link
Member

isuruf commented Jul 30, 2021

That's a question for upstream devs.

@h-vetinari
Copy link
Member Author

Do we know if the error Could not initialize NNPACK! Reason: Unsupported hardware. also happens with pytorch osx packages? If not, then it would seem to be an issue with the CF builds to me...

@hmaarrfk
Copy link
Contributor

i do not know.

i don't have access to a Mac laptop.

@h-vetinari
Copy link
Member Author

I looked at the upstream recipes, and - as Isuru said - USE_NNPACK is set on OSX, but I don't see immediately where/how it's being pulled in (there's a recipe for an old version of nnpack that does seem used anymore).

However, the bigger issue is that nnpack on OSX requires AVX2, which I don't think we should impose (and which the azure osx CI agents don't support), at least not until the archspec stuff is ready.

@isuruf
Copy link
Member

isuruf commented Jul 31, 2021

However, the bigger issue is that nnpack on OSX requires AVX2, which I don't think we should impose

Isn't this a runtime requirement? NNPACK is built, but is not used if the cpu doesn't support it, right?

@h-vetinari
Copy link
Member Author

Well, that might be the intention, but it ends up being called even if the arch doesn't support it, which is why that torchvision test failed

@isuruf
Copy link
Member

isuruf commented Jul 31, 2021

Seems to me like that's just a warning and the test should ignore it.

@isuruf
Copy link
Member

isuruf commented Jul 31, 2021

The way they check if nnpack is available is by trying to initialize it https://github.com/pytorch/pytorch/blob/a9b0a921d592b328e7e80a436ef065dadda5f01b/aten/src/ATen/native/NNPACK.cpp#L115-L117 which gives a warning.

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

No branches or pull requests

3 participants