Commit Graph

215 Commits

Author SHA1 Message Date
a38e43e936 [perf][1/5] Replace IValue::toString()->string() with IValue::toStringRef() (#85437)
Summary: `IValue::toString()` creates a `new c10::intrusive_ptr` (like `std::shared_ptr`) and `->string()` immediately accesses it, creating an atomic reference increment/decrement. We can skip both of these operations by calling `IValue::toStringRef()`.

Test Plan: CI

Reviewed By: jaybean-dev

Differential Revision: D39605242

Pull Request resolved: https://github.com/pytorch/pytorch/pull/85437
Approved by: https://github.com/jfix71
2022-09-23 23:36:57 +00:00
487c0e1181 [pytorch] Bump SoLoader version to 0.10.4 (#81946)
Test Plan: sandcastle CI.

Differential Revision: D38056789

Pull Request resolved: https://github.com/pytorch/pytorch/pull/81946
Approved by: https://github.com/kit1980
2022-07-27 18:16:29 +00:00
dff70a5e1a Make language std configurable. (#75519)
RocksDB 7 starts to use C++17 in header.
We should make this configurable, in case user needs higher std version.

List of files to changed is found by `git grep 'CMAKE_[^_]*_STANDARD'`.
Doc string is from CMake code.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75519
Approved by: https://github.com/malfet
2022-07-13 14:21:27 +00:00
4e27863739 [fbsync] Apply changes from D36937789 & D36937774 (#78956) 2022-06-06 12:55:32 -07:00
03847808a0 Add all bzl files per D36874458 2022-06-06 09:40:19 -07:00
a645abd5aa Update nightlies from 1.12 -> 1.13
Signed-off-by: Eli Uriegas <eliuriegasfb.com>

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

Approved by: https://github.com/atalman
2022-05-20 17:59:17 +00:00
9445609ee3 Better error message for android-tests workflow
See this link as an example how it will look in annotations:
https://github.com/pytorch/pytorch/actions/runs/2242670732
Pull Request resolved: https://github.com/pytorch/pytorch/pull/76577
Approved by: https://github.com/linbinyu
2022-05-02 16:56:29 +00:00
ac2d2e3a3d Fix some typos.
Fixes #ISSUE_NUMBER

Pull Request resolved: https://github.com/pytorch/pytorch/pull/75561
Approved by: https://github.com/albanD
2022-04-11 21:55:59 +00:00
fa241e5951 [AutoAccept][Codemod][FBSourceGoogleJavaFormatLinter] Daily arc lint --take GOOGLEJAVAFORMAT
Reviewed By: ivanmurashko

Differential Revision: D35308735

fbshipit-source-id: 64356651614ebd88f897454a1fd765b7dde6a53b
(cherry picked from commit a273d9be6b73f67a2ac3fd9c9adb29e8eabae52b)
2022-04-01 09:21:41 +00:00
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
33b9726e6b Revert "add model test for Android"
This reverts commit 91ef3c82615d6ede05d5b86f1bd5571ea95e4ef1.

Reverted https://github.com/pytorch/pytorch/pull/74793 on behalf of https://github.com/seemethere
2022-03-29 22:08:22 +00:00
91ef3c8261 add model test for Android
This pr

moved some model generation scripts to a central place (mobile net v2, android test model)
updated scripts so these models can run on Android (Java doesn't support certain scalar types as return value)
updated model generation script to take arguments (generate models for android/ios, checked-in model or on-the-fly model)
add Android instrumentation tests for these new models
After this change, the Android instrumentation test will run 35 models which covered 91% of production ops. The coverage information can be found in this file: https://github.com/pytorch/pytorch/blob/master/test/mobile/model_test/coverage.yaml

Note that these models are checked-in for back compatibility check (to ensure they can run with newer pytorch versions).

The script generates models for mobile test. For each model we have a "checked-in" version
and an "on-the-fly" version. The "on-the-fly" version will be generated during test, and
should not be committed to the repo. The "checked-in" version is used for back compatibility check.

Note that Android only support checked-in model right now. iOS can test both (in another pr).

use 'gen_test_model.py android-test' to generate on the fly models for android
use 'gen_test_model.py ios-test' to generate on the fly models for ios
use 'python gen_test_model.py android' to generate checked-in models for android
use 'python gen_test_model.py ios' to generate on-the-fly models for ios
use 'gen_test_model.py <model_name_no_suffix>' to update the given checked-in model

Pull Request resolved: https://github.com/pytorch/pytorch/pull/74793
Approved by: https://github.com/kit1980
2022-03-29 04:46:14 +00:00
1c4eb3a266 [android] improve unsupported scalar type error message for android
Summary: Android only support a few scalar types as model return value. This diff improved the error message so user can know which type is not supported.

Test Plan: verified unsupported scalar type is printed

Differential Revision: D35104788

Pull Request resolved: https://github.com/pytorch/pytorch/pull/74660
Approved by: https://github.com/kit1980
2022-03-25 23:07:46 +00:00
3b1b4875f1 [AutoAccept][Codemod][FBSourceGoogleJavaFormatLinter] Daily arc lint --take GOOGLEJAVAFORMAT
Reviewed By: zertosh

Differential Revision: D34412756

fbshipit-source-id: da7424025c1d9b82b1f56a030f6b31ba08dd7b8b
(cherry picked from commit 736159d4155b9e763da68b6ff63c3190f9d32f20)
2022-02-23 10:29:48 +00:00
99bcadced4 improve android instrumentation test and update README
Added tests for lite interpreter. By default the run_test.sh will use lite interpreter, unless manually set BUILD_LITE_INTERPRETER=0

Also fixed model generation script for android instrumentation test and README.

Verified test can pass for both full jit and lite interpreter. Also tested on emulator and real device using different abis.

Lite interpreter
```
./scripts/build_pytorch_android.sh x86
./android/run_tests.sh
```

Full JIT
```
BUILD_LITE_INTERPRETER=0 ./scripts/build_pytorch_android.sh x86
BUILD_LITE_INTERPRETER=0 ./android/run_tests.sh
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/72736
2022-02-22 08:05:33 +00:00
38d37436f2 Add all 4 android ABIs to android build script by default
The android build script (./scripts/build_pytorch_android.sh) is broken if user didn't provide the abi list.

./scripts/build_pytorch_android.sh ==> failed due to the so file for armv7 cannot be found
./scripts/build_pytorch_android.sh x86,x86_64 ==> works

This is because by default we will build 4 ABIs:
0ca0e02685/android/gradle.properties (L1)
but only one is provided in this script.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/73063
2022-02-18 17:58:37 +00:00
0ca0e02685 Bump torch version to 1.12 (#72221)
Summary:
Bump torch version to 1.12

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

Reviewed By: dagitses, atalman

Differential Revision: D33987446

Pulled By: seemethere

fbshipit-source-id: f5fc1c4954ff116baab9e4afe3955c0e7842e6cf
(cherry picked from commit 78d62aa29364d46c816f0b6941ce85246824f85d)
2022-02-04 00:02:28 +00:00
c92ff47afd Use == operator to test type equivalance in pytorch_jni_common.cpp (#71508)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/71508

"==" is the more universal way to test type equalities, and also ::get() doesn't incur any refcount overhead now, so we can swtich to == instead of relying on type kinds.
ghstack-source-id: 147353057

Test Plan:
CI
buck test xplat/caffe2/android:pytorch_jni_common_test

Differential Revision: D33672433

fbshipit-source-id: 5973fd40de48b8017b5c3ebaa55bcf5b4b391aa3
(cherry picked from commit db84a4b566d1f2f17cda8785e11bc11739e6f50c)
2022-01-20 23:46:51 +00:00
24bc3be146 [Profiler] Clean up profiler includes. (#69421)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/69421

I've hit a lot of build issues in D32671972, and I've come to realize that a lot of it boils down to header hygene. `function.h` includes `profiler.h` *solely* to transitively include `record_function.h` which winds up leaking the profiler symbols. Moreover several files are relying on transitive includes to get access to `getTime`. As long as I have to touch all the places that use `getTime`, I may as well also move them to the new namespace.

Test Plan: Unit tests and CI.

Reviewed By: aaronenyeshi, albanD

Differential Revision: D32865907

fbshipit-source-id: f87d6fd5afb784dca2146436e72c69e34623020e
2021-12-15 12:50:24 -08:00
f74779e403 [android] Lite interpreter naming for android nightly publishing (#68651)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/68651

Test Plan: Imported from OSS

Reviewed By: linbinyu

Differential Revision: D32564796

Pulled By: IvanKobzarev

fbshipit-source-id: 57847bfb2778433cfb02ad7a5a79ae30a6b438c1
2021-11-19 10:56:13 -08:00
d71092f668 [android][fbjni] Update fbjni to 0.2.2 (#68400)
Summary:
ghstack-source-id: caeb8df3a18a6fa48d591af126ac59d8e41494b5
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68400

Fixes #{issue number}

CI-all check:
https://github.com/pytorch/pytorch/pull/68497

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

Reviewed By: linbinyu

Differential Revision: D32481451

Pulled By: IvanKobzarev

fbshipit-source-id: b19ce05ff9d63b3f701d718eefbf1e9d66e11639
2021-11-17 16:54:22 -08:00
27eca2c6fd Revert D32467139: [pytorch][PR] [android][fbjni] Update fbjni to 0.2.2
Test Plan: revert-hammer

Differential Revision:
D32467139 (04056df475)

Original commit changeset: 49e155989d2d

fbshipit-source-id: ce03be3c6f209a6e9969660bd823d5343a7f0615
2021-11-16 13:50:50 -08:00
04056df475 [android][fbjni] Update fbjni to 0.2.2 (#68400)
Summary:
ghstack-source-id: caeb8df3a18a6fa48d591af126ac59d8e41494b5
Pull Request resolved: https://github.com/pytorch/pytorch/pull/68400

Fixes #{issue number}

Updates fbjni version to 0.2.2

ci-all PR: https://github.com/pytorch/pytorch/pull/68401

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

Reviewed By: linbinyu

Differential Revision: D32467139

Pulled By: IvanKobzarev

fbshipit-source-id: 49e155989d2dbafedd5b2df77e089e25e8b4f8f8
2021-11-16 11:34:46 -08:00
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
82f7f8d471 [PyTorch] Adopt IValue::toTupleRef() where obvious (#65505)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65505

Generated with

`fastmod -m 'toTuple\(\)(\s*)->' 'toTupleRef()${1}.'`

, followed by

`fastmod '(std::move\(.*)toTupleRef\(\).' '${1}toTuple()->'`

to unbreak 2 callsites.
ghstack-source-id: 142065835

Test Plan: CI

Reviewed By: gchanan

Differential Revision: D31131025

fbshipit-source-id: 54457ae5bbeb38db9c7f196d469b98521c3d3f34
2021-11-02 10:22:18 -07:00
0a07488ed2 use irange for loops 1 (#66741)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66741

Modified loops in files under fbsource/fbcode/caffe2/ from the format

`for(TYPE var=x0;var<x_max;x++)`

to the format

`for(const auto var: irange(xmax))`

This was achieved by running r-barnes's loop upgrader script (D28874212) with some modification to exclude all files under /torch/jit and a number of reversions or unused variable suppression warnings added by hand.

Test Plan: Sandcastle

Reviewed By: ngimel

Differential Revision: D31705360

fbshipit-source-id: 7115f76e381ad2d98584eb534961c3cbb957ebaa
2021-10-19 03:28:51 -07:00
2f099c7555 Revert D30652629: use irange for loops
Test Plan: revert-hammer

Differential Revision:
D30652629 (687c2267d4)

Original commit changeset: 0ae6c4bbbb55

fbshipit-source-id: 5c4f067b584a021c8c9656454d1ee60999600fb3
2021-10-15 15:23:10 -07:00
687c2267d4 use irange for loops (#66234)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66234

Modified loops in files under fbsource/fbcode/caffe2/ from the format

`for(TYPE var=x0;var<x_max;x++)`

to the format

`for(const auto var: irange(xmax))`

This was achieved by running r-barnes's loop upgrader script (D28874212) with some modification to exclude all files under /torch/jit and a number of reversions or unused variable suppression warnings added by hand.

bypass_size_limit
allow-large-files

Test Plan: Sandcastle

Reviewed By: ngimel

Differential Revision: D30652629

fbshipit-source-id: 0ae6c4bbbb554bad42e372792a6430e1acf15e3e
2021-10-15 13:50:33 -07:00
2c7df1360a Bump torch version to 1.11 (#65435)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/65435

Reviewed By: zhouzhuojie

Differential Revision: D31099045

Pulled By: malfet

fbshipit-source-id: 6ae6ca8a4b652fc51ee3138c800d067e144acbaa
2021-09-22 07:07:16 -07:00
1b5b210f2c [Android] print type name for IValues (#64602)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/64602

print type name in error message for easier debugging.

Test Plan:
Example:
java.lang.IllegalStateException: Expected IValue type Tensor, actual type TensorList

Reviewed By: beback4u

Differential Revision: D30782318

fbshipit-source-id: 60d88a659e7b4bb2b574b12c7652a28f0d5ad0d2
2021-09-09 17:06:15 -07:00
c982f13a80 [android][vulkan] Fix model loading for Vulkan backend (#63402)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/63402

Test Plan: Imported from OSS

Reviewed By: SS-JIA

Differential Revision: D30370692

Pulled By: IvanKobzarev

fbshipit-source-id: 73311b9b767fe9ed3ae390db59d6aa2c4a98f06d
2021-08-17 10:20:32 -07:00
38c185189c [Pytorch Edge] Enable kineto profiler on mobile via EdgeKinetoProfiler (#62419)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62419

This diff adds support for cpu only kineto profiler on mobile. Thus
enabling chrome trace generation on mobile. This bring cpp API for
mobile profiling on part with Torchscript.
This is done via:
1. Utilizating debug handle annotations in KinetoEvent.
2. Adding post processing capability, via callbacks, to
KinetoThreadLocalState
3. Creating new RAII stype profiler, KinetoEdgeCPUProfiler, which can be
used in surrounding scope of model execution. This will write chrome
trace to the location specified in profiler constructor.

Test Plan:
MobileProfiler.ModuleHierarchy

Imported from OSS

Reviewed By: raziel

Differential Revision: D29993660

fbshipit-source-id: 0b44f52f9e9c5f5aff81ebbd9273c254c3c03299
2021-08-13 21:40:19 -07:00
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
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
06a3b23971 [android] Lite interpreter module to load from assets (#61609)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/61609

Test Plan: Imported from OSS

Reviewed By: cccclai

Differential Revision: D29688641

Pulled By: IvanKobzarev

fbshipit-source-id: 7857bad51e91eae7c90a1218d463f3767f4fae15
2021-07-23 17:51:18 -07:00
6107cf3750 Add --jobs 0 for git submodule update (#61311)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/61311

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

Some related docs about `submodule.fetchJobs`
https://git-scm.com/docs/git-config#Documentation/git-config.txt-submodulefetchJobs

```
time git submodule update --init --recursive
________________________________________________________
Executed in  243.20 secs    fish           external
   usr time   49.64 secs  213.00 micros   49.64 secs
   sys time   29.27 secs  795.00 micros   29.27 secs
```

```
time git submodule update --init --recursive --jobs 4
________________________________________________________
Executed in  143.04 secs    fish           external
   usr time   51.06 secs  246.00 micros   51.06 secs
   sys time   30.96 secs  742.00 micros   30.96 secs
```

```
time git submodule update --init --recursive --jobs 8
________________________________________________________
Executed in  124.64 secs    fish           external
   usr time   51.76 secs  264.00 micros   51.76 secs
   sys time   30.49 secs  739.00 micros   30.49 secs

```

```
time git submodule update --init --recursive --jobs 0 # use all online cpus
 ________________________________________________________
Executed in  129.75 secs    fish           external
   usr time   51.64 secs  181.00 micros   51.64 secs
   sys time   31.49 secs  781.00 micros   31.49 secs

```

Test Plan: Imported from OSS

Reviewed By: 1ntEgr8

Differential Revision: D29560875

Pulled By: zhouzhuojie

fbshipit-source-id: 556027dffe744c66428075a8a1bf64683930aaaf
2021-07-07 16:28:18 -07:00
f1ce7f4b7f Update PyTorch version to 0.10.0a (#59345)
Summary:
Also fix `TestProducerVersion` by removing assumption that major and minor are single digit

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

Reviewed By: robieta

Differential Revision: D28853720

Pulled By: malfet

fbshipit-source-id: 4b6d03c6b0c9d652a5aef792aaa84eaa522d10e8
2021-06-03 07:55:44 -07:00
dfe85d6fd7 Revert D28840199: [pytorch][PR] Update version to 1.10
Test Plan: revert-hammer

Differential Revision:
D28840199 (3453aa44c1)

Original commit changeset: acc5a93e12a3

fbshipit-source-id: a41eb7c882fe0bf8f9a35ef180e99a7e72f6857d
2021-06-02 16:25:51 -07:00
3453aa44c1 Update version to 1.10 (#59325)
Summary:
Fixes #{issue number}

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

Reviewed By: jbschlosser, seemethere

Differential Revision: D28840199

Pulled By: malfet

fbshipit-source-id: acc5a93e12a3db47d6103ea064bec9e40320f708
2021-06-02 15:00:33 -07:00
6edd49a8e8 [Android]Removed dependency with AppCompat. (#58527)
Summary:
I build using [Bazel](https://bazel.build/).

When I use `pytorch_android` in latest Android app, I get the following error due to dependencies:

```
$ bazel build //app/src/main:app
WARNING: API level 30 specified by android_ndk_repository 'androidndk' is not available. Using latest known API level 29
INFO: Analyzed target //app/src/main:app (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: /home/H1Gdev/android-bazel-app/app/src/main/BUILD.bazel:3:15: Merging manifest for //app/src/main:app failed: (Exit 1): ResourceProcessorBusyBox failed: error executing command bazel-out/k8-opt-exec-2B5CBBC6/bin/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/ResourceProcessorBusyBox --tool MERGE_MANIFEST -- --manifest ... (remaining 11 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox ResourceProcessorBusyBox failed: error executing command bazel-out/k8-opt-exec-2B5CBBC6/bin/external/bazel_tools/src/tools/android/java/com/google/devtools/build/android/ResourceProcessorBusyBox --tool MERGE_MANIFEST -- --manifest ... (remaining 11 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Error: /home/H1Gdev/.cache/bazel/_bazel_H1Gdev/29e18157a4334967491de4cc9a879dc0/sandbox/linux-sandbox/914/execroot/__main__/app/src/main/AndroidManifest.xml:19:18-86 Error:
	Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [maven//:androidx_core_core] AndroidManifest.xml:19:18-86
	is also present at [maven//:com_android_support_support_compat] AndroidManifest.xml:19:18-91 value=(android.support.v4.app.CoreComponentFactory).
	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-19:19 to override.
May 19, 2021 10:45:03 AM com.google.devtools.build.android.ManifestMergerAction main
SEVERE: Error during merging manifests
com.google.devtools.build.android.AndroidManifestProcessor$ManifestProcessingException: Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [maven//:androidx_core_core] AndroidManifest.xml:19:18-86
	is also present at [maven//:com_android_support_support_compat] AndroidManifest.xml:19:18-91 value=(android.support.v4.app.CoreComponentFactory).
	Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-19:19 to override.
	at com.google.devtools.build.android.AndroidManifestProcessor.mergeManifest(AndroidManifestProcessor.java:186)
	at com.google.devtools.build.android.ManifestMergerAction.main(ManifestMergerAction.java:217)
	at com.google.devtools.build.android.ResourceProcessorBusyBox$Tool$5.call(ResourceProcessorBusyBox.java:93)
	at com.google.devtools.build.android.ResourceProcessorBusyBox.processRequest(ResourceProcessorBusyBox.java:233)
	at com.google.devtools.build.android.ResourceProcessorBusyBox.main(ResourceProcessorBusyBox.java:177)

Warning:
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Target //app/src/main:app failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 2.221s, Critical Path: 1.79s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
```

This is due to conflict between `AndroidX` and `Support Library` on which `pytorch_android_torch` depends.
(In the case of `Gradle`, it is avoided by `android.useAndroidX`.)

I created [Android application](https://github.com/H1Gdev/android-bazel-app) for comparison.

At first, I updated `AppCompat` from `Support Library` to `AndroidX`, but `pytorch_android` and `pytorch_android_torchvision` didn't seem to need any dependencies, so I removed dependencies.

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

Reviewed By: xta0

Differential Revision: D28585234

Pulled By: IvanKobzarev

fbshipit-source-id: 78aa6b1525543594ae951a6234dd88a3fdbfc062
2021-05-20 15:49:19 -07:00
0c3db1cb33 [Pytorch] Build lite interpreter as default for Android
Summary:
Build lite interpreter as default for android, should wait until https://github.com/pytorch/pytorch/pull/56002 lands
Mainly two changes:
1. Use lite interpreter as default for Android
2. Switch the lite interpreter build test to full jit build test

Test Plan: Imported from OSS

Differential Revision: D27695530

Reviewed By: IvanKobzarev

Pulled By: cccclai

fbshipit-source-id: e1b2c70fee6590accc22c7404b9dd52c7d7c36e2
2021-05-17 14:12:48 -07:00
16710e5d93 Add reasons in TODO for the unblocked AVNTM -> InferenceMode cases. (#56823)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/56823

Test Plan: CI

Reviewed By: bhosmer

Differential Revision: D27975596

fbshipit-source-id: 1d5681852163cd24ae245a6d90e44a34a0909145
2021-04-26 15:58:34 -07:00
0c544ebd24 Revert to ANVTM in jni_lite due to Oculus failure.
Test Plan: FanW123 verified on her Oculus device

Reviewed By: FanW123

Differential Revision: D27943428

fbshipit-source-id: ac1c1ca6b47937f8839ba23c9e3af0843ea086a3
2021-04-22 11:49:01 -07:00
f096245610 AutoNonVariableTypeMode->InferenceMode in OSS. (#56421)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/56421

Test Plan: Imported from OSS

Reviewed By: bertmaher

Differential Revision: D27866609

Pulled By: ailzhang

fbshipit-source-id: 040991a031c5511501b03cfe21a4a636586e120e
2021-04-19 18:07:41 -07:00
7eed077406 [android] Fix headers publishing in aar (#56068)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/56068

Test Plan: Imported from OSS

Reviewed By: dreiss

Differential Revision: D27776655

Pulled By: IvanKobzarev

fbshipit-source-id: 75e07b56dab8f7ff2ab501d0ddc4566ef2378fcf
2021-04-15 09:54:08 -07:00
37ac271089 [AutoAccept][Codemod][FBSourceGoogleJavaFormatLinter] Daily arc lint --take GOOGLEJAVAFORMAT
Reviewed By: zertosh

Differential Revision: D27731676

fbshipit-source-id: 9402fa9f19b9186a2f38e56c110800254a8e8d91
2021-04-13 04:15:35 -07:00
ee2de8ae3a [android] Module load extraFiles (#55644)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/55644

Testing:
Prepare the model with extra:

```
    extra_files = {}
    extra_files["model/live.spec.json"] = '{ "spec": "spec_value"}'
    torch.jit.save(script_model, "extra.pt", _extra_files=extra_files)
    script_model._save_for_lite_interpreter("extra.ptl"), _extra_files=extra_files)
```

Change android/test_app/app/src/main/java/org/pytorch/testapp/MainActivity.java
1. Full jit
```
Map<String, String> map = new HashMap<>();
map.put("model/live.spec.json", "");
mModule = Module.load(assetFilePath(this, BuildConfig.MODULE_ASSET_NAME), map, Device.CPU);
android.util.Log.i("XXX", "map:" + map);
```
`gradle -p android test_app:installMnetLocalBaseDebug -PABI_FILTERS=arm64-v8a`

2. Lite
```
Map<String, String> map = new HashMap<>();
map.put("model/live.spec.json", "");
mModule = LiteModuleLoader.load(assetFilePath(this, BuildConfig.MODULE_ASSET_NAME), map, Device.CPU);
android.util.Log.i("XXX", "map:" + map);
```
`BUILD_LITE_INTERPRETER=1 gradle -p android test_app:installMnetLocalBaseDebug -PABI_FILTERS=arm64-v8a`

Check logcat

Test Plan: Imported from OSS

Reviewed By: ljk53

Differential Revision: D27663624

Pulled By: IvanKobzarev

fbshipit-source-id: 0dcd93b2fddaacd221db0306d18afee2584fcb85
2021-04-09 14:52:21 -07:00
eb52e36460 Revert D27469727: [pytorch][PR] [android] fbjni from prefab dependency 0.2.2
Test Plan: revert-hammer

Differential Revision:
D27469727 (507b46f23e)

Original commit changeset: 2ab22879e81c

fbshipit-source-id: d656463b81a02fbf870dded5d3868bb33e016fe0
2021-03-31 17:21:30 -07:00
7f87358840 [android] bump nigtlies version to 1.9.0 (#55076)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55076

Test Plan: Imported from OSS

Reviewed By: seemethere

Differential Revision: D27474604

Pulled By: IvanKobzarev

fbshipit-source-id: b0b694333464485fd20036e9d5ef982877b1aa19
2021-03-31 14:37:59 -07:00
507b46f23e [android] fbjni from prefab dependency 0.2.2 (#55066)
Summary:
Switching pytorch android to use fbjni from prefab dependencies
Bumping version of fbjni to 0.2.2
soloader version to 0.10.1

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

Reviewed By: dreiss

Differential Revision: D27469727

Pulled By: IvanKobzarev

fbshipit-source-id: 2ab22879e81c9f2acf56807c6a133b0ca20bb40a
2021-03-31 14:12:18 -07:00