Bazel build of pytorch#35220
Conversation
💊 CircleCI build failures summary and remediationsAs of commit 1e84fb8 (more details on the Dr. CI page): ✅ None of the build failures appear to be your fault 💚
🚧 2 upstream failures:These were probably caused by upstream breakages:
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker. This comment has been revised 118 times. |
|
Just adding reviewers to make sure it is looked at by someone. Feel free to remove yourself if someone else is already looking into it. |
There was a problem hiding this comment.
Can the list of srcs be generated by glob?
| "src/FbgemmFP16UKernelsAvx2.cc", | |
| "src/FbgemmFloat16ConvertAvx2.cc", | |
| "src/FbgemmI8Depthwise3DAvx2.cc", | |
| "src/FbgemmI8Depthwise3x3Avx2.cc", | |
| "src/FbgemmI8DepthwiseAvx2.cc", | |
| "src/FbgemmI8DepthwisePerChannelQuantAvx2.cc", | |
| "src/OptimizedKernelsAvx2.cc", | |
| "src/PackDepthwiseConvMatrixAvx2.cc", | |
| "src/QuantUtilsAvx2.cc", | |
| "src/UtilsAvx2.cc", | |
| # Private headers | |
| "src/FbgemmFP16Common.h", | |
| "src/FbgemmFP16UKernelsAvx2.h", | |
| "src/FbgemmI8Depthwise2DAvx2-inl.h", | |
| "src/FbgemmI8DepthwiseAvx2-inl.h", | |
| "src/MaskAvx2.h", | |
| "src/OptimizedKernelsAvx2.h", | |
| "src/TransposeUtils.h", | |
| "src/TransposeUtilsAvx2.h", | |
| glob("src/*Avx2.*") + [ | |
| "src/TransposeUtils.h", | |
| ], |
There was a problem hiding this comment.
They can, but I was seeking to emulate what fbgemm does as a part of its build.
|
Thanks a lot for your efforts upstreaming this. Are you interested in patches/feedback in the case where pytorch is included as a third-party repository, or are you planning to first merge a working standalone build, and then make changes? |
Merge a working copy that prevents breakages. We (Uber) are doing this because we have the same use case, and will be working towards novel third party inclusion utilities after it has landed. This is just to get a foot in the door. |
Perfect, makes sense. Are you planning to include CUDA support in the first round? |
|
No, cuda is coming later. We use this internally for it, but the FB torch team was onboard for cpu first. Hermetic cuda (the goal) requires a toolchain, which we haven't formalized for release. You can see some snippets of our cuda definitions in these BUILD files for now |
Cool, thanks. I'm migrating our internal BUILD files for pytorch to this, and was wondering whether to wait or not. I'm guessing you can import the CUDA-on-clang toolchain from TensorFlow? |
Negative. The clang-primary cuda compilation does not work, nvcc must be used as a frontend for cuda compilations with pytorch. We investigated that early on and could not make it work. |
What types of errors were you getting? I do have it working with clang 9 and CUDA 10 (modulo a few hacks required to get rid of compilation errors due to the different host/device compilation model). |
"have it working" can you elaborate? You are currently building all pytorch cuda sources with a device target with clang as the exec'd compiler frontend, not with clang as the host cc and nvcc as the frontend? |
We don't use nvcc at all, just the clang PTX backend directly. IIRC there's a TensorFlow configuration that does the same. |
Taking this conversation offline. |
|
For reference, these are the (small) changes needed to make this work as an external repo (also supports remote execution - that's why I had to add a bunch of Python files to the |
| "c10/cuda/impl/cuda_cmake_macros.h", | ||
| ], | ||
| deps = [ | ||
| "@com_github_gflags_gflags//:gflags", |
There was a problem hiding this comment.
I wonder how you can get by with adding the complete gflags and glog libraries here. c10_headers in linked in one of the .sos that have linkstatic, and my build complains about duplicate flags definitions.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@werkt sorry to do this to you but it appears as though we need a rebase. |
Not a problem. The end of that test clause changed twice in the last hour :( |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Preliminary step to merge pytorch#35220 Test Plan: CI
…pytorch#35951) Summary: Pull Request resolved: pytorch#35951 Change generate_code to keep folder structure the same regardless of whether install path is provide Amend build_variables.bzl accordingly Another preliminary step to merge pytorch#35220 Test Plan: CI Differential Revision: D20839410 fbshipit-source-id: 923ce994f2847421c23ded59ac315deadd708b4e
…#35951) Summary: Pull Request resolved: #35951 Change generate_code to keep folder structure the same regardless of whether install path is provide Amend build_variables.bzl accordingly Another preliminary step to merge #35220 Test Plan: CI Reviewed By: EscapeZero, seemethere Differential Revision: D20839410 fbshipit-source-id: 02297560a7e48aa7c6271f7a8517fc4a1ab35271
Summary: Pull Request resolved: pytorch#35220 Reviewed By: seemethere Differential Revision: D20783179 Pulled By: malfet fbshipit-source-id: b160908a3e107790fa06057a77de9d6d23493bbc
Summary: Preliminary step to merge pytorch#35220 Pull Request resolved: pytorch#35924 Test Plan: CI Differential Revision: D20832159 Pulled By: malfet fbshipit-source-id: 29ff2e3c04c08c39c49f35414f94b76f0651859a
…pytorch#35951) Summary: Pull Request resolved: pytorch#35951 Change generate_code to keep folder structure the same regardless of whether install path is provide Amend build_variables.bzl accordingly Another preliminary step to merge pytorch#35220 Test Plan: CI Reviewed By: EscapeZero, seemethere Differential Revision: D20839410 fbshipit-source-id: 02297560a7e48aa7c6271f7a8517fc4a1ab35271
Summary: Pull Request resolved: pytorch#35220 Reviewed By: seemethere Differential Revision: D20783179 Pulled By: malfet fbshipit-source-id: b160908a3e107790fa06057a77de9d6d23493bbc
No description provided.