Commit Graph

93 Commits

Author SHA1 Message Date
John Detloff
8a7b4b8559 Turn off keychain timeout in CircleCI builds of ios/TestApp (#83162)
Fixes #82890

Default timeout is 1 hour, but our build sometimes exceeds this limit. Setting it to 0 turns the timeout off entirely. This is necessary because when our build exceeds the timeout codesign hangs indefinitely, ultimately causing the build to fail.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83162
Approved by: https://github.com/malfet, https://github.com/kit1980
2022-08-10 20:21:14 +00:00
Linbin Yu
da61ec2a4a [CI] imporve ios simulator test (#80459)
update fastlane version and parameters to improve test reliability

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80459
Approved by: https://github.com/malfet, https://github.com/seemethere
2022-06-29 21:23:56 +00:00
atalman
33fecf057f [IOS] Update Cocoapods for 1.12 release (#80472)
[IOS] Update Cocoapods for 1.12 release

Pull Request resolved: https://github.com/pytorch/pytorch/pull/80472
Approved by: https://github.com/mthrok, https://github.com/malfet
2022-06-28 23:49:50 +00:00
Linbin Yu
1d7627955b Add instructions for iOS test (#79100)
as title

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79100
Approved by: https://github.com/atalman
2022-06-10 16:31:30 +00:00
Linbin Yu
7cb4a76844 Add detailed error message for iOS test (#79140)
As title.
Tested locally.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79140
Approved by: https://github.com/kit1980
2022-06-08 21:07:08 +00:00
PyTorch MergeBot
496e294e31 Revert "add some instructions for ios test (#79097)"
This reverts commit e1534e3fe7.

Reverted https://github.com/pytorch/pytorch/pull/79097 on behalf of https://github.com/kit1980 due to ios tests failed on both PR and trunk, see e1534e3fe7
2022-06-08 07:39:20 +00:00
Linbin Yu
e1534e3fe7 add some instructions for ios test (#79097)
as title

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79097
Approved by: https://github.com/kit1980
2022-06-08 03:31:50 +00:00
Jon Janzen
03847808a0 Add all bzl files per D36874458 2022-06-06 09:40:19 -07:00
Natalia Gimelshein
04b3313379 remove unneeded overload for nansum
Per title, fixes a few OpInfo skips

Pull Request resolved: https://github.com/pytorch/pytorch/pull/76356
Approved by: https://github.com/albanD, https://github.com/mruberry
2022-04-27 16:02:54 +00:00
Linbin Yu
58d4f59e87 [mobile] enable ios tests for on-the-fly models
enable ios tests for on-the-fly generated models

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75118
Approved by: https://github.com/kit1980
2022-04-01 19:54:01 +00:00
Linbin Yu
28a4b4759a Add models test for android and iOS
See https://github.com/pytorch/pytorch/pull/74793 for more details
Redo everything in one pr. This diff added test model generation script and updated android and ios tests.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74947
Approved by: https://github.com/kit1980
2022-03-30 20:56:24 +00:00
CodemodService FBSourceClangFormatLinterBot
c9612cddb7 [AutoAccept][Codemod][FBSourceClangFormatLinter] Daily arc lint --take CLANGFORMAT
Reviewed By: zsol

Differential Revision: D35109008

fbshipit-source-id: 35d37cc1d991569c6df8e65fc789803ac881012b
(cherry picked from commit f5beda976adc343f90b8e622257b2bcac3ac0d27)
2022-03-24 09:35:26 +00:00
Linbin Yu
c24bc056c8 [mobile] add test model generation script and ios tests
- update model generation script to cover more ops (including quant ops)
- add more test cases for iOS simulator test
- Need to update GA config to run the new model test on iOS
```
Generated 703 ops and covered 356/393 (90.59%) production ops.
```
Pull Request resolved: https://github.com/pytorch/pytorch/pull/74599
Approved by: https://github.com/kit1980
2022-03-23 07:53:04 +00:00
CodemodService FBSourceClangFormatLinterBot
ef9023e93d [AutoAccept][Codemod][FBSourceClangFormatLinter] Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D34842439

fbshipit-source-id: 89fd3edc02e726e2b5da349d8ad66d99bd796b6b
(cherry picked from commit 230bd973742220b9e5c446c840d343be83597212)
2022-03-12 11:06:52 +00:00
Nikita Shulga
acd3f3705f Revert D34814800: [AutoAccept][Codemod][FBSourceClangFormatLinter] Daily arc lint --take CLANGFORMAT
Test Plan: revert-hammer

Differential Revision:
D34814800 (89d6f3e609)

Original commit changeset: 49cdae9ff3b7

Original Phabricator Diff: D34814800 (89d6f3e609)

fbshipit-source-id: 36a223785614affa4754a78c714aba0468c5e458
(cherry picked from commit bbe922380b127627940bac580a2b5c63d4941ce7)
2022-03-11 15:25:55 +00:00
CodemodService FBSourceClangFormatLinterBot
89d6f3e609 [AutoAccept][Codemod][FBSourceClangFormatLinter] Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D34814800

fbshipit-source-id: 49cdae9ff3b7b3489181f130fefb25c400abbfe8
(cherry picked from commit 205c1098405afc6841a3bbe45a6a8ba20b601e72)
2022-03-11 12:52:20 +00:00
Tao Xu
9a5c3ca23f [iOS] Fix the TestApp (#74090)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/74090

Test Plan: Imported from OSS

Reviewed By: hanton

Differential Revision: D34812215

Pulled By: xta0

fbshipit-source-id: 70beb8239d195a59c8df6588ea1ae4d7cc52026d
(cherry picked from commit fa72699b81563f89e8a54f8be4d81bb25b6438eb)
2022-03-11 06:23:30 +00:00
Tao Xu
7cd8857b8a [iOS] Update Cocoapods for 1.11 (#74089)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/74089

Test Plan: Imported from OSS

Reviewed By: hanton

Differential Revision: D34811951

Pulled By: xta0

fbshipit-source-id: b1cc4a63941f1db6372266c840c56a82205e7786
(cherry picked from commit ff5951052ecf41597795883f47b46476c8e74e04)
2022-03-11 05:41:51 +00:00
Linbin Yu
69cdcd2da2 [OSS] add script to generate test models for mobile (#73746)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/73746

Added some scripts to generate 4 models for OSS mobile test

- tensor related ops
- math ops
- neural net related ops
- random sampling ops

So far these models covered around half of root ops used in production.
Will continue to iterate for more ops.

Also updated iOS test to run these test models.

Test Plan:
all tests passed on iOS simulator

{F708807282}

Reviewed By: xta0

Differential Revision: D34616936

fbshipit-source-id: c7b7b4644f766924f0914fbfe1beec2d8e098c38
(cherry picked from commit 4b1d52b1f2bc2d7325bf2712f39b8ba0a381cae1)
2022-03-09 18:18:50 +00:00
Shashank Chaudhry
89c4e8c22b [NOOP][clangformat][codemod] Enable CLANGFORMAT for some folders in caffe2/* (#67746)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/67746

Test Plan: Visual inspection. Sandcastle.

Reviewed By: zertosh

Differential Revision: D31986646

fbshipit-source-id: 91885c20c3cead3853c49abb9fe0a94a67f33cc8
2021-11-03 12:23:14 -07:00
Hanton Yang
01ced45217 [iOS] Bump up iOS CocoaPods version to 1.10.0 (#67058)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/67058

Test Plan: Imported from OSS

Reviewed By: xta0

Differential Revision: D31846445

Pulled By: hanton

fbshipit-source-id: 7510a6c15fdeecc996fcce5c48db32e148ba7def
2021-10-21 21:30:24 -07:00
Tao Xu
34682377b9 [iOS][CI] Update dev certs (#66004)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/65988

Pull Request resolved: https://github.com/pytorch/pytorch/pull/66004

Reviewed By: xta0

Differential Revision: D31340893

Pulled By: malfet

fbshipit-source-id: 3bf0be266e9686a73d62e86c5cf0bebeb0416260
2021-10-01 09:38:49 -07:00
Tao Xu
f850d7ef2e [CoreML][OSS] Add Simulator tests (#65076)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65076

ghstack-source-id: 138869950

create a new conda environment - conda create --name coreml python=3.8
conda activate coreml
pip3 install --pre torch torchvision torchaudio -f https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
pip install coremltools==5.0b5
cd pytorch
git fetch
git checkout gh/xta0/131/head
cd ios/TestApp/benchmark
mkdir ../models
python coreml_backend.py
Test the model_coreml.ptl in the helloworld example

Test Plan:
1. CircleCI
2. Pytorch nightly builds

Reviewed By: hanton

Differential Revision: D30912268

fbshipit-source-id: 52b2ed1ad40e5949ee2755bca113119132dfc914
2021-09-23 14:57:01 -07:00
Tao Xu
0430d1da12 [iOS] Fix the TestApp (#65319)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/65319

Test Plan: Imported from OSS

Reviewed By: hanton

Differential Revision: D31049543

Pulled By: xta0

fbshipit-source-id: ff0d0baac30682c63b2a28254ee0a5d8d9b8ca6f
2021-09-20 11:28:40 -07:00
Tao Xu
f159f12fee [iOS][OSS][BE] Add Simulator tests for full JIT (#64851)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64851

ghstack-source-id: 137970229

Test Plan: CircleCI

Reviewed By: hanton, cccclai

Differential Revision: D30877963

fbshipit-source-id: 7bb8ade1959b85c3902ba9dc0660cdac8f558d64
2021-09-13 18:16:08 -07:00
Tao Xu
d13e0c9c39 [iOS][OSS][BE] Update XCode to use 12.5.1 (#64850)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64850

ghstack-source-id: 137827895

Test Plan: CircleCI

Reviewed By: hanton

Differential Revision: D30877964

fbshipit-source-id: 803f2506a755b3815024704e6177c7826bc42de8
2021-09-11 11:24:06 -07:00
Tao Xu
c9eb312ce9 [iOS][OSS][BE] Remove unused files (#64849)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64849

ghstack-source-id: 137827893

Test Plan: CircleCI

Reviewed By: hanton

Differential Revision: D30877962

fbshipit-source-id: a76f7fe888b990ba6cad650f72be7f4a1e58a2f1
2021-09-11 11:22:55 -07:00
Hanton Yang
3f43a8b9a3 [iOS] Add LibTorch-Lite-Nightly pod (#63239)
Summary:
D30090760 (e182b459d9) was reverted by D30303292 because of a lint issue in `LibTorch-Lite-Nightly.podspec.template`. Resubmit the diff after fixing the issue.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/63239

Test Plan: Imported from OSS

Reviewed By: xta0

Differential Revision: D30315690

Pulled By: hanton

fbshipit-source-id: f0fa719ffc3b8181ab28c123584ae5c1da8992c0
2021-08-13 16:21:41 -07:00
Alban Desmaison
aa665e1ab8 Revert D30090760: [iOS] Add podspec for libTorch-lite nightly build
Test Plan: revert-hammer

Differential Revision:
D30090760 (e182b459d9)

Original commit changeset: 361aa2ed24a1

fbshipit-source-id: 9c0dfee80a80eb012b142d3928204d6eb8025b0a
2021-08-13 06:45:43 -07:00
Hanton Yang
e182b459d9 [iOS] Add podspec for libTorch-lite nightly build (#62691)
Summary:
The nightly pod version will be aliased with [PyTorch nightly build version](https://l.facebook.com/l.php?u=https%3A%2F%2Fgithub.com%2Fpytorch%2Fpytorch%2Fblob%2Fmaster%2F.circleci%2Fscripts%2Fbinary_populate_env.sh%23L88&h=AT3AeTpSGcz9YVeG7Lr_bweWOv8H2-kAMevglFfMslaZwgEPptNM59WdWj2ZER806rKVLNhQGM5EQcyFC_8xOq334LBo2J6YzgPW2LELkgASlA6UxP2gaD2 (fa22f6303f)Wy5mA6_lu_YlHHbEGPIU7ewJQD1 (2d884f2263)aBSlOy) and [CocoaPods version specification](https://l.facebook.com/l.php?u=https%3A%2F%2Fguides.cocoapods.org%2Fusing%2Fthe-podfile.html%23specifying-pod-versions&h=AT3AeTpSGcz9YVeG7Lr_bweWOv8H2-kAMevglFfMslaZwgEPptNM59WdWj2ZER806rKVLNhQGM5EQcyFC_8xOq334LBo2J6YzgPW2LELkgASlA6UxP2gaD2 (fa22f6303f)Wy5mA6_lu_YlHHbEGPIU7ewJQD1 (2d884f2263)aBSlOy), the version format of the podspect is `PyTorch version + nightly build date`, like `1.10.0.20210812`.

Usage:
1. Add `pod 'LibTorch-Lite-Nightly'` to `Podfile`
2. Run `pod install` to install the nightly built lib
3. Run `pod update` to update the lib to the latest version

Pull Request resolved: https://github.com/pytorch/pytorch/pull/62691

Test Plan:
* Test on [TestApp](https://github.com/pytorch/pytorch/tree/master/ios/TestApp) and [HelloWorld](https://github.com/pytorch/ios-demo-app):
Podfile: `pod 'LibTorch-Lite-Nightly'`

* Test on Private Pod:
{F642106928}

Reviewed By: xta0

Differential Revision: D30090760

Pulled By: hanton

fbshipit-source-id: 361aa2ed24a11d6aced8374cb45f70f49bd5da52
2021-08-12 15:35:14 -07:00
Shen Li
1022443168 Revert D30279364: [codemod][lint][fbcode/c*] Enable BLACK by default
Test Plan: revert-hammer

Differential Revision:
D30279364 (b004307252)

Original commit changeset: c1ed77dfe43a

fbshipit-source-id: eab50857675c51e0088391af06ec0ecb14e2347e
2021-08-12 11:45:01 -07:00
Zsolt Dollenstein
b004307252 [codemod][lint][fbcode/c*] Enable BLACK by default
Test Plan: manual inspection & sandcastle

Reviewed By: zertosh

Differential Revision: D30279364

fbshipit-source-id: c1ed77dfe43a3bde358f92737cd5535ae5d13c9a
2021-08-12 10:58:35 -07:00
dependabot[bot]
72394aaf68 Bump addressable from 2.7.0 to 2.8.0 in /ios/TestApp (#61573)
Summary:
Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md">addressable's changelog</a>.</em></p>
<blockquote>
<h1>Addressable 2.8.0</h1>
<ul>
<li>fixes ReDoS vulnerability in Addressable::Template#match</li>
<li>no longer replaces <code>+</code> with spaces in queries for non-http(s) schemes</li>
<li>fixed encoding ipv6 literals</li>
<li>the <code>:compacted</code> flag for <code>normalized_query</code> now dedupes parameters</li>
<li>fix broken <code>escape_component</code> alias</li>
<li>dropping support for Ruby 2.0 and 2.1</li>
<li>adding Ruby 3.0 compatibility for development tasks</li>
<li>drop support for <code>rack-mount</code> and remove Addressable::Template#generate</li>
<li>performance improvements</li>
<li>switch CI/CD to GitHub Actions</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="6469a232c0"><code>6469a23</code></a> Updating gemspec again</li>
<li><a href="24336385de"><code>2433638</code></a> Merge branch 'main' of github.com:sporkmonger/addressable into main</li>
<li><a href="e9c76b8897"><code>e9c76b8</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/sporkmonger/addressable/issues/378">https://github.com/pytorch/pytorch/issues/378</a> from ashmaroli/flat-map</li>
<li><a href="56c5cf7ece"><code>56c5cf7</code></a> Update the gemspec</li>
<li><a href="c1fed1ca0a"><code>c1fed1c</code></a> Require a non-vulnerable rake</li>
<li><a href="0d8a3127e3"><code>0d8a312</code></a> Adding note about ReDoS vulnerability</li>
<li><a href="89c76130ce"><code>89c7613</code></a> Merge branch 'template-regexp' into main</li>
<li><a href="cf8884f815"><code>cf8884f</code></a> Note about alias fix</li>
<li><a href="bb03f7112e"><code>bb03f71</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/sporkmonger/addressable/issues/371">https://github.com/pytorch/pytorch/issues/371</a> from charleystran/add_missing_encode_component_doc_entry</li>
<li><a href="6d1d8094a6"><code>6d1d809</code></a> Adding note about :compacted normalization</li>
<li>Additional commits viewable in <a href="https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=addressable&package-manager=bundler&previous-version=2.7.0&new-version=2.8.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/pytorch/pytorch/network/alerts).

</details>

Pull Request resolved: https://github.com/pytorch/pytorch/pull/61573

Reviewed By: xta0

Differential Revision: D29685329

Pulled By: seemethere

fbshipit-source-id: a43008155144a358950dc3ed1934fcc470b73c02
2021-07-13 14:30:33 -07:00
Chen Lai
700df82881 [PyTorch Edge] Update iOS readme to use lite interpreter (#59841)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/59841

As lite interpreter moves to beta, it's recommended to let users start using it.
ghstack-source-id: 131766778

Test Plan: CI

Reviewed By: husthyc

Differential Revision: D29048350

fbshipit-source-id: 54d2ad09b4e9475304522c80b358647bcea79b14
2021-06-22 02:17:04 -07:00
Tao Xu
67b8e6410d [OSS] Add podspec for libtorch-lite (#59638)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/59638

ghstack-source-id: 130847775

Test Plan: .

Reviewed By: husthyc, cccclai

Differential Revision: D28966693

fbshipit-source-id: 1b82623279709d0118c0967e2ba730d5dec040cc
2021-06-08 14:46:23 -07:00
Chen Lai
b5a834a739 [Pytorch] Build lite interpreter as default for iOS
Summary:
Two changes:
1. Build lite interpreter as default for iOS
2. Switch the previous lite interpreter test to full jit build test

Test Plan: Imported from OSS

Differential Revision: D27698039

Reviewed By: xta0

Pulled By: cccclai

fbshipit-source-id: 022b554f4997ae577681f2b79a9ebe9236ca4f7d
2021-05-17 22:36:05 -07:00
Ailing Zhang
24c904951c Replace AutoNonVariableTypeMode with InferenceMode in fbcode. (#55114)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55114

Test Plan: CI

Reviewed By: ezyang, bhosmer

Differential Revision: D27472768

fbshipit-source-id: 76f17ef7de40f6e04e2968f8958027b5f93e1c0c
2021-04-02 11:45:53 -07:00
Sam Estep
5bcbbf5373 Lint trailing newlines (#54737)
Summary:
*Context:* https://github.com/pytorch/pytorch/issues/53406 added a lint for trailing whitespace at the ends of lines. However, in order to pass FB-internal lints, that PR also had to normalize the trailing newlines in four of the files it touched. This PR adds an OSS lint to normalize trailing newlines.

The changes to the following files (made in 54847d0adb9be71be4979cead3d9d4c02160e4cd) are the only manually-written parts of this PR:

- `.github/workflows/lint.yml`
- `mypy-strict.ini`
- `tools/README.md`
- `tools/test/test_trailing_newlines.py`
- `tools/trailing_newlines.py`

I would have liked to make this just a shell one-liner like the other three similar lints, but nothing I could find quite fit the bill. Specifically, all the answers I tried from the following Stack Overflow questions were far too slow (at least a minute and a half to run on this entire repository):

- [How to detect file ends in newline?](https://stackoverflow.com/q/38746)
- [How do I find files that do not end with a newline/linefeed?](https://stackoverflow.com/q/4631068)
- [How to list all files in the Git index without newline at end of file](https://stackoverflow.com/q/27624800)
- [Linux - check if there is an empty line at the end of a file [duplicate]](https://stackoverflow.com/q/34943632)
- [git ensure newline at end of each file](https://stackoverflow.com/q/57770972)

To avoid giving false positives during the few days after this PR is merged, we should probably only merge it after https://github.com/pytorch/pytorch/issues/54967.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/54737

Test Plan:
Running the shell script from the "Ensure correct trailing newlines" step in the `quick-checks` job of `.github/workflows/lint.yml` should print no output and exit in a fraction of a second with a status of 0. That was not the case prior to this PR, as shown by this failing GHA workflow run on an earlier draft of this PR:

- https://github.com/pytorch/pytorch/runs/2197446987?check_suite_focus=true

In contrast, this run (after correcting the trailing newlines in this PR) succeeded:

- https://github.com/pytorch/pytorch/pull/54737/checks?check_run_id=2197553241

To unit-test `tools/trailing_newlines.py` itself (this is run as part of our "Test tools" GitHub Actions workflow):
```
python tools/test/test_trailing_newlines.py
```

Reviewed By: malfet

Differential Revision: D27409736

Pulled By: samestep

fbshipit-source-id: 46f565227046b39f68349bbd5633105b2d2e9b19
2021-03-30 13:09:52 -07:00
Sam Estep
8c798e0622 Forbid trailing whitespace (#53406)
Summary:
Context: https://github.com/pytorch/pytorch/pull/53299#discussion_r587882857

These are the only hand-written parts of this diff:
- the addition to `.github/workflows/lint.yml`
- the file endings changed in these four files (to appease FB-internal land-blocking lints):
  - `GLOSSARY.md`
  - `aten/src/ATen/core/op_registration/README.md`
  - `scripts/README.md`
  - `torch/csrc/jit/codegen/fuser/README.md`

The rest was generated by running this command (on macOS):
```
git grep -I -l ' $' -- . ':(exclude)**/contrib/**' ':(exclude)third_party' | xargs gsed -i 's/ *$//'
```

I looked over the auto-generated changes and didn't see anything that looked problematic.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/53406

Test Plan:
This run (after adding the lint but before removing existing trailing spaces) failed:
- https://github.com/pytorch/pytorch/runs/2043032377

This run (on the tip of this PR) succeeded:
- https://github.com/pytorch/pytorch/runs/2043296348

Reviewed By: walterddr, seemethere

Differential Revision: D26856620

Pulled By: samestep

fbshipit-source-id: 3f0de7f7c2e4b0f1c089eac9b5085a58dd7e0d97
2021-03-05 17:22:55 -08:00
Yuchen Huang
842ba90739 [iOS] Bump up the Cocoapods version (#53335)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/53335

ghstack-source-id: 123166245

(Note: this ignores all push blocking failures!)

Test Plan: CI

Reviewed By: xta0

Differential Revision: D26838693

fbshipit-source-id: 0007eba40b3145c8ba77b3211759f0609e17f561
2021-03-04 20:29:23 -08:00
Yuchen Huang
edbf9263ad [iOS] Bump up the cocoapods version (#49176)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/49176

Bump up the cocoapods version
ghstack-source-id: 118305636

Test Plan: CI

Reviewed By: xta0

Differential Revision: D25466321

fbshipit-source-id: 916adc514c5edc8971445da893362a160cfc092b
2020-12-10 11:07:49 -08:00
Yuchen Huang
79a1d2bd78 [iOS] Bump up the cocoapods version (#46935)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/46935

Bump up the cocoapods version
ghstack-source-id: 115283786

(Note: this ignores all push blocking failures!)

Test Plan: CI

Reviewed By: xta0

Differential Revision: D24572715

fbshipit-source-id: 41ffcd43512dc7d4e94af887fb5dfeab703d7602
2020-10-27 14:51:33 -07:00
Yuchen Huang
c80ec91b00 [iOS] Bump up the cocoapods version (#45862)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/45862

Bump up the cocoapods version
ghstack-source-id: 113585513

(Note: this ignores all push blocking failures!)

Test Plan: CI

Reviewed By: xta0

Differential Revision: D24119158

fbshipit-source-id: e689b69628dcf802084e67c5ea627220cafcc575
2020-10-05 14:37:26 -07:00
Tao Xu
0ec7ba4088 [iOS] Bump up the cocoapods version (#41895)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41895

### Summary

The iOS binary for 1.6.0 has been uploaded to AWS. This PR bumps up the version for cocoapods.

### Test Plan

- Check CI

Test Plan: Imported from OSS

Reviewed By: husthyc

Differential Revision: D22683787

Pulled By: xta0

fbshipit-source-id: bb95b670a7945d823d55e9c65b357765753f295a
2020-07-22 22:03:40 -07:00
David Reiss
b7e044f0e5 Re-apply PyTorch pthreadpool changes
Summary:
This re-applies D21232894 (b9d3869df3) and D22162524, plus updates jni_deps in a few places
to avoid breaking host JNI tests.

Test Plan: `buck test @//fbandroid/mode/server //fbandroid/instrumentation_tests/com/facebook/caffe2:host-test`

Reviewed By: xcheng16

Differential Revision: D22199952

fbshipit-source-id: df13eef39c01738637ae8cf7f581d6ccc88d37d5
2020-06-23 19:26:21 -07:00
Kate Mormysh
92d3182c11 Revert D21232894: Unify PyTorch mobile's threadpool usage.
Test Plan: revert-hammer

Differential Revision:
D21232894 (b9d3869df3)

Original commit changeset: 8b3de86247fb

fbshipit-source-id: e6517cfec08f7dd0f4f8877dab62acf1d65afacd
2020-06-23 17:09:14 -07:00
Ashkan Aliabadi
b9d3869df3 Unify PyTorch mobile's threadpool usage. (#37243)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37243

*** Why ***

As it stands, we have two thread pool solutions concurrently in use in PyTorch mobile: (1) the open source pthreadpool library under third_party, and (2) Caffe2's implementation of pthreadpool under caffe2/utils/threadpool.  Since the primary use-case of the latter has been to act as a drop-in replacement for the third party version so as to enable integration and usage from within NNPACK and QNNPACK, Caffe2's implementation is intentionally written to the exact same interface as the third party version.

The original argument in favor of C2's implementation has been improved performance as a result of using spin locks, as opposed to relinquishing the thread's time slot and putting it to sleep - a less expensive operation up to a point.  That seems to have given C2's implementation the upper hand in performance, hence justifying the added maintenance complexity, until the third party version improved in parallel surpassing the efficiency of C2's implementation as I have verified in benchmarks.  With that advantage gone, there is no reason to continue using C2's implementation in PyTorch mobile either from the perspective of performance or code hygiene.  As a matter of fact, there is considerable performance benefit to be had as a result of using the third party version as it currently stands.

This is a tricky change though, mainly because in order to avoid potential performance regressions, of which I have witnessed none but just in abundance of caution, we have decided to continue using the internal C2's implementation whenever building for Caffe2.  Again, this is mainly to avoid potential performance regressions in production C2 use cases even if doing so results in reduced performance as far as I can tell.

So to summarize, today, and as it currently stands, we are using C2's implementation for (1) NNPACK, (2) PyTorch QNNPACK, and (3) ATen parallel_for on mobile builds, while using the third party version of pthreadpool for XNNPACK as XNNPACK does not provide any build options to link against an external implementation unlike NNPACK and QNNPACK do.

The goal of this PR then, is to unify all usage on mobile to the third party implementation both for improved performance and better code hygiene.  This applies to PyTorch's use of NNPACK, QNNPACK, XNNPACK, and mobile's implementation of ATen parallel_for, all getting routed to the
exact same third party implementation in this PR.

Considering that NNPACK, QNNPACK, and XNNPACK are not mobile specific, these benefits carry over to non-mobile builds of PyTorch (but not Caffe2) as well.  The implementation of ATen parallel_for on non-mobile builds remains unchanged.

*** How ***

This is where things get tricky.

A good deal of the build system complexity in this PR arises from our desire to maintain C2's implementation intact for C2's use.

pthreadpool is a C library with no concept of namespaces, which means two copies of the library cannot exist in the same binary or symbol collision will occur violating ODR.  This means that somehow, and based on some condition, we must decide on the choice of a pthreadpool implementation.  In practice, this has become more complicated as a result of all the possible combinations that USE_NNPACK, USE_QNNPACK, USE_PYTORCH_QNNPACK, USE_XNNPACK, USE_SYSTEM_XNNPACK, USE_SYSTEM_PTHREADPOOL and other variables can result in.  Having said that, I have done my best in this PR to surgically cut through this complexity in a way that minimizes the side effects, considering the significance of the performance we are leaving on the table, yet, as a result of this combinatorial explosion explained above I cannot guarantee that every single combination will work as expected on the first try.  I am heavily relying on CI to find any issues as local testing can only go that far.

Having said that, this PR provides a simple non mobile-specific C++ thread pool implementation on top of pthreadpool, namely caffe2::PThreadPool that automatically routes to C2's implementation or the third party version depending on the build configuration.  This simplifies the logic at the cost of pushing the complexity to the build scripts.  From there on, this thread pool is used in aten parallel_for, and NNPACK and family, again, routing all usage of threading to C2 or third party pthreadpool depending on the build configuration.

When it is all said or done, the layering will look like this:

a) aten::parallel_for, uses
b) caffe2::PThreadPool, which uses
c) pthreadpool C API, which delegates to
    c-1) third_party implementation of pthreadpool if that's what the build has requested, and the rabbit hole ends here.
    c-2) C2's implementation of pthreadpool if that's what the build has requested, which itself delegates to
    c-2-1) caffe2::ThreadPool, and the rabbit hole ends here.

NNPACK, and (PyTorch) QNNPACK directly hook into (c). They never go through (b).

Differential Revision: D21232894

Test Plan: Imported from OSS

Reviewed By: dreiss

Pulled By: AshkanAliabadi

fbshipit-source-id: 8b3de86247fbc3a327e811983e082f9d40081354
2020-06-23 16:34:51 -07:00
Tao Xu
6de6041585 [iOS] Disable NNPACK on iOS builds (#39868)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39868

### Summary

why disable NNPACK on iOS

- To stay consistency with our internal version
- It's currently blocking some external users due to its lack support of x86 architecture
    - https://github.com/pytorch/pytorch/issues/32040
    - https://discuss.pytorch.org/t/undefined-symbols-for-architecture-x86-64-for-libtorch-in-swift-unit-test/84552/6
- NNPACK uses fast convolution algorithms (FFT, winograd) to reduce the computational complexity of convolutions with large kernel size. The algorithmic speedup is limited to specific conv params which are unlikely to appear in mobile networks.
- Since XNNPACK has been enabled, it performs much better than NNPACK on depthwise-separable convolutions which is the algorithm being used by most of mobile computer vision networks.

### Test Plan

- CI Checks

Test Plan: Imported from OSS

Differential Revision: D22087365

Pulled By: xta0

fbshipit-source-id: 89a959b0736c1f8703eff10723a8fbd02357fd4a
2020-06-17 01:39:56 -07:00
Tao Xu
307920731d [iOS] Add nonVarTypeModeGuard to fix the unit test (#39743)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/39743

### Summary

Still need this RAII guard for full JIT

### Test Plan

- CI checks

Test Plan: Imported from OSS

Differential Revision: D21968256

Pulled By: xta0

fbshipit-source-id: 8ea63c699fed4e2a01390232a58f039110391844
2020-06-09 20:05:32 -07:00
Tao Xu
9b0e7ebab0 [iOS] 1.5.0 Cocoapods Release (#37039)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37039

### Summary

Cocoapods 1.5.0 release. Binary has been pushed to AWS - https://ossci-ios.s3.amazonaws.com/libtorch_ios_1.5.0.zip

### Test Plan

- ` pod spec lint --verbose --allow-warnings --no-clean --use-libraries --skip-import-validation`
- TestApp

Test Plan: Imported from OSS

Differential Revision: D21169113

Pulled By: xta0

fbshipit-source-id: d015c218ed20b168a1ef21025db8880da4e3b074
2020-04-22 10:36:18 -07:00