Skip to content

Bazel build of pytorch#35220

Closed
werkt wants to merge 5 commits intopytorch:masterfrom
werkt:bazel
Closed

Bazel build of pytorch#35220
werkt wants to merge 5 commits intopytorch:masterfrom
werkt:bazel

Conversation

@werkt
Copy link
Copy Markdown

@werkt werkt commented Mar 23, 2020

No description provided.

@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Mar 23, 2020

💊 CircleCI build failures summary and remediations

As of commit 1e84fb8 (more details on the Dr. CI page):


None of the build failures appear to be your fault 💚


  • 2/2 broken upstream at merge base 2b068d1 on Apr 01 from 9:47am to 12:34pm PDT (9 commits; a736b99 - 990b541)

    Please rebase on the viable/strict branch (expand for instructions)

    If your commit is newer than viable/strict, you can try basing on an older, stable commit:

    git fetch https://github.com/pytorch/pytorch viable/strict
    git rebase --onto FETCH_HEAD $(git merge-base origin/master HEAD)
    

    If your commit is older than viable/strict:

    git fetch https://github.com/pytorch/pytorch viable/strict
    git rebase FETCH_HEAD
    

    Check out the recency history of this "viable master" tracking branch.


🚧 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.

See how this bot performed.

This comment has been revised 118 times.

@albanD albanD requested review from kostmo and malfet March 24, 2020 17:43
@albanD albanD added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Mar 24, 2020
@albanD
Copy link
Copy Markdown
Collaborator

albanD commented Mar 24, 2020

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.

@albanD albanD removed the request for review from kostmo March 24, 2020 17:51
Comment thread tools/setup_helpers/generate_code.py Outdated
Comment thread tools/setup_helpers/generate_code.py Outdated
Comment thread tools/setup_helpers/generate_code.py Outdated
Comment thread third_party/fbgemm.BUILD Outdated
Comment thread third_party/fbgemm.BUILD Outdated
Comment thread third_party/fbgemm.BUILD Outdated
Comment on lines 91 to 125
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can the list of srcs be generated by glob?

Suggested change
"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",
],

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

They can, but I was seeking to emulate what fbgemm does as a part of its build.

Comment thread third_party/cpuinfo.BUILD Outdated
Comment thread WORKSPACE Outdated
Comment thread tools/setup_helpers/generate_code.py Outdated
Comment thread .circleci/config.yml Outdated
@nicolov
Copy link
Copy Markdown
Contributor

nicolov commented Mar 29, 2020

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?

@werkt
Copy link
Copy Markdown
Author

werkt commented Mar 29, 2020

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.

@nicolov
Copy link
Copy Markdown
Contributor

nicolov commented Mar 29, 2020

Merge a working copy that prevents breakages.

Perfect, makes sense. Are you planning to include CUDA support in the first round?

@werkt
Copy link
Copy Markdown
Author

werkt commented Mar 29, 2020

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

@nicolov
Copy link
Copy Markdown
Contributor

nicolov commented Mar 29, 2020

No, cuda is coming later.

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?

@werkt
Copy link
Copy Markdown
Author

werkt commented Mar 30, 2020

No, cuda is coming later.

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.

@nicolov
Copy link
Copy Markdown
Contributor

nicolov commented Mar 30, 2020

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).

@werkt
Copy link
Copy Markdown
Author

werkt commented Mar 30, 2020

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.

"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?

@nicolov
Copy link
Copy Markdown
Contributor

nicolov commented Mar 30, 2020

"have it working" can you elaborate?

We don't use nvcc at all, just the clang PTX backend directly. IIRC there's a TensorFlow configuration that does the same.

@werkt
Copy link
Copy Markdown
Author

werkt commented Mar 30, 2020

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.

@nicolov
Copy link
Copy Markdown
Contributor

nicolov commented Mar 31, 2020

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 gen script). https://gist.github.com/nicolov/09af3c1a8c7dcf971822daf8f2dc9caf

Comment thread BUILD.bazel
"c10/cuda/impl/cuda_cmake_macros.h",
],
deps = [
"@com_github_gflags_gflags//:gflags",
Copy link
Copy Markdown
Contributor

@nicolov nicolov Mar 31, 2020

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@seemethere
Copy link
Copy Markdown
Member

@werkt sorry to do this to you but it appears as though we need a rebase.

@werkt
Copy link
Copy Markdown
Author

werkt commented Apr 1, 2020

@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 :(

Copy link
Copy Markdown
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

@malfet has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

malfet added a commit to malfet/pytorch that referenced this pull request Apr 3, 2020
facebook-github-bot pushed a commit that referenced this pull request Apr 3, 2020
Summary:
Preliminary step to merge #35220
Pull Request resolved: #35924

Test Plan: CI

Differential Revision: D20832159

Pulled By: malfet

fbshipit-source-id: 29ff2e3c04c08c39c49f35414f94b76f0651859a
malfet added a commit to malfet/pytorch that referenced this pull request Apr 3, 2020
…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
facebook-github-bot pushed a commit that referenced this pull request Apr 3, 2020
…#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
@facebook-github-bot
Copy link
Copy Markdown
Contributor

@malfet merged this pull request in 585f153.

ashishfarmer pushed a commit to ashishfarmer/pytorch that referenced this pull request Apr 13, 2020
Summary: Pull Request resolved: pytorch#35220

Reviewed By: seemethere

Differential Revision: D20783179

Pulled By: malfet

fbshipit-source-id: b160908a3e107790fa06057a77de9d6d23493bbc
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
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
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
…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
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary: Pull Request resolved: pytorch#35220

Reviewed By: seemethere

Differential Revision: D20783179

Pulled By: malfet

fbshipit-source-id: b160908a3e107790fa06057a77de9d6d23493bbc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants