Summary: Currently OpKind is stored as an object field called op_ for each IR
node, and one usage of op_ is to avoid dynamic_cast in NodeCast when we
need to downcast a base-node pointer into a concrete sub-node pointer.
As a result, we need to construct and pass in an op when downcasting
nodes, and this becomes quite anonnying when we start to implement the
trie-based IR node reusing. More importantly, the op for each subclass
should be unique for that subclass and thus making it a const static field
is a more logical design.
In this PR, we still keep the object-level op_ for easier XLA adoption. As
furture work, we can come back to remove op_, make the op() method
virtual, and get rid of OpKind in all the node constructors.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76711
Approved by: https://github.com/wconstab, https://github.com/JackCaoG
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75790
We were building it before, but now we use it in downstream
rules. This enables us to eliminate the handwritten genrule.
ghstack-source-id: 155300051
Test Plan: Verified locally and in CI.
Reviewed By: dreiss
Differential Revision: D35645390
fbshipit-source-id: 478bb37a6ec295c232f66383babf46606e83ed5e
(cherry picked from commit 2822d4c5b48c6d9282149b2d43cf72d645237196)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75800
This leads to more similarities between OSS CMake and eventually OSS
Bazel. We will be able to generate files with the same names and not
have different file lists between the builds.
ghstack-source-id: 155300043
Test Plan: Verified locally and in CI.
Reviewed By: dreiss
Differential Revision: D35648586
fbshipit-source-id: 9f1638b5665ebcc64466883f65ef24a2bfd05228
(cherry picked from commit 7f2acff1baa8dfafddefdc720714f8d39feda436)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76174
This is about to conflict with the existing Bazel codegen
outputs. Switch to it atomically.
ghstack-source-id: 155029309
Test Plan: Verify manually and rely on CI.
Reviewed By: dreiss
Differential Revision: D35815288
fbshipit-source-id: 8b35e7baeb8572aef13c07cac689ee84dc7335d5
(cherry picked from commit 6dde9831a30fcf664b73fccaa51e30a7049b3251)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75964
This is already in the shared build structure for Bazel, but we need
to implement genrule for fbcode.
There's an xplat target that can't build in fbcode yet because the
dependencies don't line up, so we have to add a tag to exclude it.
ghstack-source-id: 154696020
Test Plan: Rely on CI
Reviewed By: malfet
Differential Revision: D35443900
fbshipit-source-id: 0768b29906c8218d7aebfdc7c18d69f59a0c9384
(cherry picked from commit bff47be441bd142392a07aa177be02e18aa86f1c)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75942
This also requires changes to the target definition and the xplat translator to get it working.
ghstack-source-id: 154678046
Test Plan: Verify locally and rely on CI.
Reviewed By: malfet
Differential Revision: D35704597
fbshipit-source-id: 6b0d9f5a044609b24dda656f80233ba6186c097f
(cherry picked from commit 6de43c5ca7a973c9f8b71f4d60d4d5e85cc2ba21)
Summary: This is a first step to migrate xplat targets to shared build structure. Eventually both xplat buck and open source bazel targets will be generated from shared build.bzl.
Test Plan: Should be no-op, rely on CI.
Reviewed By: malfet
Differential Revision: D35270004
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75847
Approved by: https://github.com/linbinyu