24 Commits

Author SHA1 Message Date
f557402e8d remove //c10:headers (#98420)
The c10 library is light enough that there's not really much benefit
to being very unbazel-y and providing an incomplete library that lacks
the source files.

Differential Revision: [D44713077](https://our.internmc.facebook.com/intern/diff/D44713077/)
Pull Request resolved: https://github.com/pytorch/pytorch/pull/98420
Approved by: https://github.com/ezyang
2023-04-05 19:33:10 +00:00
47efbd5719 [pytorch] [hygiene] remove legacy buck rules (#94053)
Summary:
Removes legacy buck rules specifically we do the following conversions
- ["xxx:=yyy"] -> ["xxx[yyy]"]
- "//xxx/yyy" - "//xxx/yyy:yyy"

Test Plan: CI should pass

Differential Revision: D42999413

Pull Request resolved: https://github.com/pytorch/pytorch/pull/94053
Approved by: https://github.com/osalpekar, https://github.com/malfet
2023-02-09 15:45:29 +00:00
5a6019033f [bazel] change visibility for //c10:headers (#91422)
At Cruise we are actively depending on the c10 headers, I'm not certain what is the reason to hide them to the pkg level.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/91422
Approved by: https://github.com/malfet
2023-01-04 19:04:35 +00:00
e9dfc61938 extract //c10 to common build system (#71411)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71411

This library is mostly the same now externally and internally, though
internal to Meta we never include cuda in this library, so our select
resolves internally unconditionally to false.
ghstack-source-id: 150235103

Test Plan: This ought to be a no-op, rely on CI.

Reviewed By: malfet

Differential Revision: D33635739

fbshipit-source-id: a4d3c7e30995c0e43ecd4c69ad0abb23498ee098
(cherry picked from commit c574a123615588adbe42cc51a713fccfa1b2cac0)
2022-03-02 11:33:22 +00:00
9d4d782e42 remove alwayslink/link_whole from //c10 library (#70997)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70997

This is no longer necessary because the sublibraries that need this
have it specified.
ghstack-source-id: 147786997

Test Plan: Verified manually that this works with Bazel and Buck.

Reviewed By: malfet

Differential Revision: D33477915

fbshipit-source-id: f00f8ac24747711904fe49df4fc9400beec54f3b
(cherry picked from commit 3325437d2b20c398e3edfb389d6d3d3e6ce74d93)
2022-02-04 00:07:27 +00:00
e970160c19 remove //c10:headers dependency from //c10 (#70996)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70996

This is no longer necessary and does not exist internally.
ghstack-source-id: 148159361

Test Plan: Relying on CI.

Reviewed By: malfet

Differential Revision: D33477755

fbshipit-source-id: 7d375a0770d5c6277cfdea4bb0e85a9b2b4f40cd
(cherry picked from commit 360f9a548c2e4cde1b97b5902ca62a8e43af4070)
2022-02-03 22:55:04 +00:00
286f5a51f9 move //c10:tests target to the shared //c10/test package (#70928)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70928

ghstack-source-id: 148159366

Test Plan: Ensured that the same number of tests are found and run.

Reviewed By: malfet

Differential Revision: D33455272

fbshipit-source-id: fba1e3409b14794be3e6fe4445c56dd5361cfe9d
(cherry picked from commit b45fce500aa9c3f69915bf0857144ba6d268e649)
2022-02-03 20:14:57 +00:00
6d9c0073a8 create //c10/cuda library (#70863)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70863

ghstack-source-id: 148159368

Test Plan: Ought to be a no-op: rely on CI to validate.

Reviewed By: malfet

Differential Revision: D33367290

fbshipit-source-id: cb550538b9eafaa0117f94077ebd4cb920688881
(cherry picked from commit 077d9578bcbf5e41e806c6acb7a8f7c622f66fe9)
2022-02-03 19:17:18 +00:00
de58a27769 define //c10/core:CPUAllocator target (#70862)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70862

ghstack-source-id: 147642558

Test Plan: Should be a no-op, rely on CI to validate.

Reviewed By: malfet

Differential Revision: D33330151

fbshipit-source-id: f566993f47cffa0df85105f3787bb5c6385cf5d6
(cherry picked from commit a17c3865efb6f1fa7e14adb20e5d5ed441543885)
2022-01-27 07:34:53 +00:00
41690d7804 define //c10/mobile targets (#70861)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70861

ghstack-source-id: 147642549

Test Plan: Should be a no-op. Rely on CI to validate.

Reviewed By: malfet

Differential Revision: D33329870

fbshipit-source-id: 7dbccaa994737c5fe7195d02dffd61eeceb19ceb
(cherry picked from commit 2b5264ebc49e4a5445c066e07f15bad041f42ac8)
2022-01-27 07:34:52 +00:00
844a4b47df extract out //c10/core:alloc_cpu (#70859)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70859

ghstack-source-id: 147642534

Test Plan: Extracting code unmodified to a new library: relying on CI to validate.

Reviewed By: malfet

Differential Revision: D33329688

fbshipit-source-id: f60327467d197ec1862fb3554f8b83e6c84cab5c
(cherry picked from commit f82e7c0e9beba1113defe6d55cf8a232551e913b)
2022-01-27 07:34:52 +00:00
fc6a488e9a extract out //c10/core:alignment (#70858)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70858

ghstack-source-id: 147642533

Test Plan: Extracted a constant to a new header, trusting CI build to validate.

Reviewed By: malfet

Differential Revision: D33329689

fbshipit-source-id: 8697bb81a5cc3366462ebdf1f214b62d478fa77c
(cherry picked from commit 16663847e179ea1c2a16f2bb538cfe3aca032593)
2022-01-27 07:34:52 +00:00
c6d885e489 extract out //c10/core:base library (#70857)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70857

ghstack-source-id: 147302543

Test Plan: Relying on CI

Reviewed By: malfet

Differential Revision: D33329579

fbshipit-source-id: 961abdecabb7b2c6f090e00a6a670e5b70aa5bca
(cherry picked from commit 2b8c4bb0a4f6b22e028aa4cfbf06f09fb6873fa3)
2022-01-26 16:31:26 +00:00
130ca58601 extract final two libraries out of //c10/util (#70856)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70856

ghstack-source-id: 147302541

Test Plan: Relying on CI

Reviewed By: malfet

Differential Revision: D33329555

fbshipit-source-id: 1e7884b2df1c294a8fe9e7f3664a139487d27978
(cherry picked from commit 643cc436ec416ea42a73ec2e376b1d5e747192ac)
2022-01-26 16:31:26 +00:00
bfc481cf67 extract //c10/core:ScalarType to its own library (#70855)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70855

This library is depended on by parts of util so it has to go next.
ghstack-source-id: 147170897

Test Plan: Rely on CI.

Reviewed By: malfet

Differential Revision: D33329527

fbshipit-source-id: 28a111f602ee085c1d9b0acec29790488f8c8f0b
(cherry picked from commit e3601b94ff4a89caeb0c012a0d946613934646b9)
2022-01-26 16:31:26 +00:00
40e88b75c4 extract out //c10/util:base library (#70854)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70854

We can't do the entire package since parts of it depend on //c10/core.
ghstack-source-id: 147170901

Test Plan: Rely on CI.

Reviewed By: malfet

Differential Revision: D33321821

fbshipit-source-id: 6d634da872a382a60548e2eea37a0f9f93c6f080
(cherry picked from commit 0afa808367ff92b6011b61dcbb398a2a32e5e90d)
2022-01-26 11:51:45 +00:00
d665097cad allow Bazel to build without glog and gflags (#70850)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70850

We support both, so we want to ensure both continue to work.
ghstack-source-id: 146960552

Test Plan: Tested manually. A subsequent diff adds this test configuration to CI.

Reviewed By: malfet

Differential Revision: D33297464

fbshipit-source-id: 70e1431d0907d480c576239af93ef57036d5e4d7
2022-01-18 08:08:46 -08:00
ffdc6b4994 extract //c10/macros to its own package (#70849)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70849

ghstack-source-id: 146960563

Test Plan: Bazel CI tests will protect this.

Reviewed By: malfet

Differential Revision: D33297235

fbshipit-source-id: 6504a977e82ad2f2232a74233b96cdea8bf94a20
2022-01-18 08:08:42 -08:00
8d0e354191 fix CAFFE2_BUILD_MAIN_LIB to the correct C10_BUILD_MAIN_LIB (#70848)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/70848

This is the C10 library, it that's the main lib we are building
here. While here, use `local_defines` instead of `copts` for this
definition. Both `copts` and `local_defines` only apply to the
compilation units in the library, and not transitively.
ghstack-source-id: 146998039

Test Plan: We are relying on CI to verify this doesn't cause any problems.

Reviewed By: malfet

Differential Revision: D33429420

fbshipit-source-id: b3fc84c0588bd43346e3f9f77e851d293bde9428
2022-01-18 08:05:20 -08:00
23ab6ce723 Revert D33141011: extract //c10/macros into its own package
Test Plan: revert-hammer

Differential Revision:
D33141011 (8f4c724bb6)

Original commit changeset: caa97448f922

Original Phabricator Diff: D33141011 (8f4c724bb6)

fbshipit-source-id: 79423ed51f9a43ecf1f716a739c74949b66fadb4
2021-12-22 17:48:45 -08:00
f126501d37 Revert D33141010: allow Bazel to build without glog and gflags
Test Plan: revert-hammer

Differential Revision:
D33141010 (8c41f258f4)

Original commit changeset: d951e5616459

Original Phabricator Diff: D33141010 (8c41f258f4)

fbshipit-source-id: d52ca20ddf4c5a91cb09a32fecb30a00227fc4ae
2021-12-22 17:47:23 -08:00
8c41f258f4 allow Bazel to build without glog and gflags (#69995)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69995
ghstack-source-id: 146027060

Test Plan: Imported from OSS

Reviewed By: malfet

Differential Revision: D33141010

fbshipit-source-id: d951e5616459e8aa163ae0741e245f53185580e8
2021-12-22 14:30:30 -08:00
8f4c724bb6 extract //c10/macros into its own package (#69994)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69994
ghstack-source-id: 145799968

Test Plan: Imported from OSS

Reviewed By: malfet

Differential Revision: D33141011

fbshipit-source-id: caa97448f922d7c12980bf01669c1b3ef5c1213b
2021-12-22 14:30:27 -08:00
02c63c3006 extract out c10 targets to the c10 package (#69992)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/69992

Test Plan: Imported from OSS

Reviewed By: mruberry

Differential Revision: D33141013

fbshipit-source-id: e5edd6bd5b5834ac27390ba940ebed9148512c8d
2021-12-16 13:11:49 -08:00