-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
pytorch: renamed from libtorch #111889
pytorch: renamed from libtorch #111889
Conversation
344ca50
to
a126fca
Compare
Formula/pytorch.rb
Outdated
depends_on "pyyaml" | ||
|
||
on_macos do | ||
depends_on arch: :arm64 |
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.
I'm fine with the rename, but I'm not fine with making this depend on ARM.
If it fails to build on Intel, then we need to understand why and fix it. Or, at least, report the problem upstream so that it can be fixed there.
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.
I just reported the problem upstream: pytorch/pytorch#85956
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.
Thanks!
f187218
to
ef62fa5
Compare
ef62fa5
to
7838297
Compare
@singingwolfboy when #110116 is merged could you rebase this? It should now work on Intel macOS so you won't need to have the ARM requirement any more. That was the only blocker we seemed to have over this. I added some of your changes in that PR as well so you shouldn't have to do much other than the rename itself and tweaks you made to the build parameters and test. |
e26560c
to
b0965ed
Compare
Ugh, still failing! 😩 This is the new error message, still only on Intel Macs:
Does anyone know what might be causing this, or how to fix it? |
That's odd because we literally just built this with no issues and #112520 seems to have gotten past building |
b0965ed
to
d077c18
Compare
inreplace "cmake/Dependencies.cmake", | ||
'if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0.0)', | ||
'if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")' | ||
|
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.
I think instead we need to backport the part of pytorch/pytorch@d7e6aaa that changes
target_compile_options(asmjit -Wno-unused-but-set-variable)
to
target_compile_options_if_supported(asmjit -Wno-unused-but-set-variable)
That will make sure that flag is only added if the compile supports the flag, where as in the current release it uses the flag unconditionally.
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.
I thought about doing that, but unfortunately the target_compile_options_if_supported
macro is not present in the 1.12.1 release! It's a custom macro that was committed after the release was created. So we would have to patch that function back in as well, which seems like a bigger change than necessary.
I think maybe we can just delete these lines entirely? That's what I'm trying now in my latest commit.
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.
Nope, patches aren't allowed in new formulae, and brew-test-bot sees this as a new formula (even though it's a rename, which is different). So I'm going to try patching it to if(FALSE)
instead for the same effect.
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.
It looks like this worked now and just timed out, though we should only do the inreplace
if the macOS version is less than or equal to Catalina.
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.
Why less than or equal to Catalina? Also, could you please add the "long build" label to this pull request, so that it doesn't time out for the next CI build?
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.
Actually let's do a CI run to see if all platforms can build with the if(FALSE)
fix used. We'll be able to drop it in the next release anyway.
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.
CI worked at last! Great job hunting down that fix, and thanks for your patience. This PR was beset by multiple unrelated problems that were non-trivial to fix but I think we're ready to go. I will merge this tomorrow if there has been no other maintainer feedback as the other changes here are pretty straight forward.
1dc991b
to
e02b660
Compare
e02b660
to
c1bdd38
Compare
|
||
inreplace "torch/utils/cpp_extension.py", "_TORCH_PATH = os.path.dirname(os.path.dirname(_HERE))", | ||
"_TORCH_PATH = \"#{opt_prefix}\"" | ||
|
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.
I don't think it should block this PR, but I think we should report upstream that there should be a way to set the paths to torch_shm_manager
and _TORCH_PATH
as CMake options. Hardcoding them like this reduces the portability of this package and these types of paths are usually pretty easy to pass in as options.
Thank you @singingwolfboy for this pull request! |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?This renames
libtorch
topytorch
, and installs the Python module as well as the C++ libraries. This was originally #110199, but I opened a new pull request to get more attention on this change.