Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
9f890a9
make sure clang-tidy is diffing against the right thing (#28788)
suo Oct 28, 2019
02d3184
Temporarily disable test_numerical_consistency_per_channel due to fai…
jianyuh Oct 28, 2019
9e64c54
Add the warning message for API with linear modules (#28766)
jianyuh Oct 28, 2019
f33813d
Return NotImplemented from all binary math ops (#27423)
peterbell10 Oct 28, 2019
688a9db
Move type casting to c10/util/TypeCast.h (#28426)
zasdfgbnm Oct 28, 2019
b9f099e
Make TensorIterator stop promoting types by copying (#28427)
zasdfgbnm Oct 28, 2019
5c5b2c6
Simplify copy kernel (#28428)
zasdfgbnm Oct 28, 2019
f63cf96
Update C++ parity table for torch::nn::Linear (#28804)
Oct 28, 2019
949678b
Small fixes for torchbind (#28800)
Oct 28, 2019
6f90567
Add the unittest import for test_fake_quant.py (#28815)
jianyuh Oct 29, 2019
c6ad68c
Updating submodules
Oct 29, 2019
1e3e1f5
Fix build error in VariableTypeManual
linbinyu Oct 29, 2019
52dd587
C++ API parity: Upsample (#28413)
jon-tow Oct 29, 2019
097da55
Fix BC check CI (#28816)
houseroad Oct 29, 2019
a0339c8
`bootstrap.sh` refactor (#28809)
xta0 Oct 29, 2019
295401f
Updating submodules
Oct 29, 2019
f669214
Add Conv3dInt8 (#28768)
xiaomengy Oct 29, 2019
dff1598
Revert D18170995: Simplify copy kernel
ezyang Oct 29, 2019
0301f5f
Revert D18170997: Make TensorIterator stop promoting types by copying
ezyang Oct 29, 2019
5fbec1f
Revert D18170996: Move type casting to c10/util/TypeCast.h
ezyang Oct 29, 2019
eb55104
Updating submodules
Oct 29, 2019
47faee2
Switching tests to ProfilingExecutor (rebased)
Krovatkin Oct 29, 2019
ef5a6b2
Avoid the misleading zero_point and scale [2/2] (#28827)
jianyuh Oct 29, 2019
4703854
change softmax input shape (#28836)
mingzhe09088 Oct 29, 2019
f42768f
Add scripts to run cuda-memcheck (#28127)
zasdfgbnm Oct 29, 2019
ac4c72d
add DNNLOWP static qparam choosing to pybind
amylittleyang Oct 29, 2019
0a68e8b
fix op bench runtime error when use_jit is enabled (#28837)
mingzhe09088 Oct 29, 2019
607defa
print per block avg time when running on AI-PEP machines (#28838)
mingzhe09088 Oct 29, 2019
efbaa8a
added a check for zero stride
Oct 29, 2019
b7d472a
Some fixes for jit overview doc (#28112)
jerryzh168 Oct 29, 2019
83331bf
don't overspecify required python version (#28842)
suo Oct 29, 2019
e57a119
Remove autograd copy_ specific isFloatingPoint (#28279)
t-vi Oct 29, 2019
7e8c48b
argmax for half datatype fix (#28787)
pbelevich Oct 29, 2019
6b5bfd4
Make inserted child module names unique (#27237)
jerryzh168 Oct 29, 2019
22d70bc
Add OfflineTensor
Oct 29, 2019
d8c368b
CPU-strided-complex support for compare and pointwise ops (#28735)
dylanbespalko Oct 29, 2019
e33b4b6
Use c10::variant-based enums for Reduction
Oct 29, 2019
4045d6c
Revert D18187208: Add OfflineTensor
suo Oct 29, 2019
aa949b1
InsertObservers (#27238)
jerryzh168 Oct 29, 2019
793e291
Support full id interations (#28769)
huayuli00 Oct 29, 2019
c9423c3
Add host build for pytorch_android (#27662)
dreiss Oct 29, 2019
34455c6
Remove unnecessary BUILD_DIR variable in Android CMake build (#27663)
dreiss Oct 29, 2019
80e270a
Add support for host build to pytorch_android native code (#27664)
dreiss Oct 29, 2019
d201ff8
Factor out insertPrepackUnpackForLinear (#27239)
jerryzh168 Oct 29, 2019
f1f8699
Fix implementation of F::kl_div / F::mse_loss / F::binary_cross_entropy
Oct 29, 2019
4e56455
whitelist autogradanynonzero (#28852)
Krovatkin Oct 29, 2019
b1ea19c
Update the misleading comments for zero_points and scale in dynamic q…
jianyuh Oct 30, 2019
8f1564b
Add enum type to rpc registry for consolidating RPC initialization co…
xush6528 Oct 30, 2019
cbc234b
C++ API: torch::nn::BatchNorm1d (#28176)
nuka137 Oct 30, 2019
57c9b1c
Enabling inplace relu
Oct 30, 2019
dfe7b25
Add nn::Flatten to C++ Frontend (#28072)
Oct 30, 2019
1c436de
Remove `test_quantizer.py` and reuse one of its test in `test_quantiz…
jerryzh168 Oct 30, 2019
ec81cd5
Migrate implementations of triu and tril to a separate file (#28750)
vishwakftw Oct 30, 2019
400293f
Support remote for builtin operators in distributed autograd (#28630)
mrshenli Oct 30, 2019
043530a
Support remote for Python UDF in distributed autograd
mrshenli Oct 30, 2019
a8b63ca
Updating submodules
Oct 30, 2019
790563b
Add OfflineTensor (#28855)
Oct 30, 2019
eb00af3
insert_prepack_unpack for conv (#27346)
jerryzh168 Oct 30, 2019
496f740
Connect with clip range gather operator (#28866)
Oct 30, 2019
726f0ce
Increase verbosity of Hypothesis on CI. (#28799)
ezyang Oct 30, 2019
2526f97
Include hierarchy information in C++ API loading error messages (#28499)
t-vi Oct 30, 2019
0a5c573
specialize undefinedness
Krovatkin Oct 28, 2019
91c3cdc
investigating test failures
Krovatkin Oct 30, 2019
6195436
static graph_executor
Krovatkin Oct 31, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7.4
python-version: 3.x
architecture: x64
- name: Checkout PyTorch
uses: actions/checkout@master
Expand All @@ -28,7 +28,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7.4
python-version: 3.x
architecture: x64
- name: Checkout PyTorch
uses: actions/checkout@master
Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7.4
python-version: 3.x
architecture: x64
- name: Checkout PyTorch
uses: actions/checkout@master
Expand All @@ -84,7 +84,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7.4
python-version: 3.x
architecture: x64
- name: Checkout PyTorch
uses: actions/checkout@master
Expand All @@ -99,7 +99,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7.4
python-version: 3.x
architecture: x64
- name: Fetch PyTorch
uses: actions/checkout@master
Expand Down Expand Up @@ -174,7 +174,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: 3.7.4
python-version: 3.x
architecture: x64
- name: Checkout PyTorch
uses: actions/checkout@master
Expand Down Expand Up @@ -209,7 +209,10 @@ jobs:
run: |
set -eux
git remote add upstream https://github.com/pytorch/pytorch
git fetch upstream "${{ github.base_ref}}"
git fetch upstream "$GITHUB_BASE_REF"
BASE_SHA=${{ github.event.pull_request.base.sha }}
HEAD_SHA=${{ github.event.pull_request.head.sha }}
MERGE_BASE=$(git merge-base $BASE_SHA $HEAD_SHA)

if [[ ! -d build ]]; then
git submodule update --init --recursive
Expand Down Expand Up @@ -238,8 +241,9 @@ jobs:
# The negative filters below are to exclude files that include onnx_pb.h or
# caffe2_pb.h, otherwise we'd have to build protos as part of this CI job.
python tools/clang_tidy.py \
--verbose \
--paths torch/csrc/ \
--diff "${{ github.event.pull_request.base.sha}}" \
--diff "$MERGE_BASE" \
-g"-torch/csrc/jit/export.cpp" \
-g"-torch/csrc/jit/import.cpp" \
-g"-torch/csrc/jit/netdef_converter.cpp" \
Expand All @@ -252,6 +256,6 @@ jobs:
check_name: 'clang-tidy'
linter_output_path: 'clang-tidy-output.txt'
commit_sha: ${{ steps.get_pr_tip.outputs.commit_sha }}
regex: '^(?<filename>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+): (?<errorDesc>.*?) (?<errorCode>\[.*\])'
regex: '^(?<filename>.*?):(?<lineNumber>\d+):(?<columnNumber>\d+): (?<errorDesc>.*?) \[(?<errorCode>.*)\]'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .jenkins/pytorch/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ test_python_nn() {
}

test_python_all_except_nn() {
time python test/run_test.py --exclude nn --verbose --bring-to-front quantization quantized quantized_tensor quantized_nn_mods quantizer
time python test/run_test.py --exclude nn --verbose --bring-to-front quantization quantized quantized_tensor quantized_nn_mods
assert_git_not_dirty
}

Expand Down
54 changes: 29 additions & 25 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
buildscript {
ext {
minSdkVersion = 21
targetSdkVersion = 28
compileSdkVersion = 28
buildToolsVersion = '28.0.3'

coreVersion = "1.2.0"
extJUnitVersion = "1.1.1"
runnerVersion = "1.2.0"
rulesVersion = "1.2.0"
junitVersion = "4.12"
allprojects {
if (name == "pytorch_host") {
return
}

repositories {
google()
mavenLocal()
mavenCentral()
jcenter()
}
buildscript {
ext {
minSdkVersion = 21
targetSdkVersion = 28
compileSdkVersion = 28
buildToolsVersion = '28.0.3'

coreVersion = "1.2.0"
extJUnitVersion = "1.1.1"
runnerVersion = "1.2.0"
rulesVersion = "1.2.0"
junitVersion = "4.12"
}

repositories {
google()
mavenLocal()
mavenCentral()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${GRADLE_BINTRAY_PLUGIN_VERSION}"
classpath "com.github.dcendents:android-maven-gradle-plugin:${ANDROID_MAVEN_GRADLE_PLUGIN_VERSION}"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.8"
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:${GRADLE_BINTRAY_PLUGIN_VERSION}"
classpath "com.github.dcendents:android-maven-gradle-plugin:${ANDROID_MAVEN_GRADLE_PLUGIN_VERSION}"
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.9.8"
}
}
}

allprojects {
repositories {
google()
jcenter()
Expand Down
98 changes: 64 additions & 34 deletions android/pytorch_android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,19 @@ set(CMAKE_CXX_STANDARD 11)
set(CMAKE_VERBOSE_MAKEFILE ON)

set(pytorch_android_DIR ${CMAKE_CURRENT_LIST_DIR}/src/main/cpp)
set(libtorch_include_DIR ${pytorch_android_DIR}/libtorch_include/${ANDROID_ABI})

if (ANDROID_ABI)
set(libtorch_include_DIR ${pytorch_android_DIR}/libtorch_include/${ANDROID_ABI})
set(BUILD_SUBDIR ${ANDROID_ABI})
else()
if (NOT LIBTORCH_HOME)
message(FATAL_ERROR
"pytorch_android requires LIBTORCH_HOME to be defined for non-Android builds.")
endif()
set(libtorch_include_DIR ${LIBTORCH_HOME}/include)
link_directories(${LIBTORCH_HOME}/lib)
set(BUILD_SUBDIR host)
endif()

message(STATUS "libtorch dir:${libtorch_DIR}")

Expand All @@ -24,40 +36,58 @@ target_include_directories(pytorch PUBLIC
${libtorch_include_DIR}
)

set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
file(MAKE_DIRECTORY ${BUILD_DIR})

set(fbjni_DIR ${CMAKE_CURRENT_LIST_DIR}/../libs/fbjni/)
set(fbjni_BUILD_DIR ${BUILD_DIR}/fbjni/${ANDROID_ABI})
set(fbjni_BUILD_DIR ${CMAKE_BINARY_DIR}/fbjni/${BUILD_SUBDIR})

add_subdirectory(${fbjni_DIR} ${fbjni_BUILD_DIR})

function(import_static_lib name)
add_library(${name} STATIC IMPORTED)
set_property(
TARGET ${name}
PROPERTY IMPORTED_LOCATION
${CMAKE_CURRENT_LIST_DIR}/src/main/jniLibs/${ANDROID_ABI}/${name}.a)
endfunction(import_static_lib)

import_static_lib(libtorch)
import_static_lib(libc10)
import_static_lib(libnnpack)
import_static_lib(libpytorch_qnnpack)
import_static_lib(libeigen_blas)
import_static_lib(libcpuinfo)
import_static_lib(libclog)

target_link_libraries(pytorch
fbjni
-Wl,--gc-sections
-Wl,--whole-archive
libtorch
-Wl,--no-whole-archive
libc10
libnnpack
libpytorch_qnnpack
libeigen_blas
libcpuinfo
libclog
)
if (ANDROID_ABI)

function(import_static_lib name)
add_library(${name} STATIC IMPORTED)
set_property(
TARGET ${name}
PROPERTY IMPORTED_LOCATION
${CMAKE_CURRENT_LIST_DIR}/src/main/jniLibs/${ANDROID_ABI}/${name}.a)
endfunction(import_static_lib)

import_static_lib(libtorch)
import_static_lib(libc10)
import_static_lib(libnnpack)
import_static_lib(libpytorch_qnnpack)
import_static_lib(libeigen_blas)
import_static_lib(libcpuinfo)
import_static_lib(libclog)

# Link most things statically on Android.
target_link_libraries(pytorch
fbjni
-Wl,--gc-sections
-Wl,--whole-archive
libtorch
-Wl,--no-whole-archive
libc10
libnnpack
libpytorch_qnnpack
libeigen_blas
libcpuinfo
libclog
)

else()

# Prefer dynamic linking on the host
target_link_libraries(pytorch
fbjni
-Wl,--gc-sections
-Wl,--whole-archive
torch
-Wl,--no-whole-archive
c10
nnpack
pytorch_qnnpack
cpuinfo
clog
)

endif()
33 changes: 33 additions & 0 deletions android/pytorch_android/host/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the Apache-2 license found in the
// LICENSE file in the root directory of this source tree.

plugins {
id 'java-library'
}

repositories {
mavenLocal()
jcenter()
}

sourceSets {
main {
java.srcDir '../src/main/java'
}
test {
java {
srcDir '../src/androidTest/java'
exclude '**/PytorchInstrumented*'
}
resources.srcDirs = ["../src/androidTest/assets"]
}
}

dependencies {
compileOnly 'com.google.code.findbugs:jsr305:3.0.1'
implementation 'com.facebook.soloader:nativeloader:0.8.0'
implementation 'com.facebook.fbjni:fbjni:0.0.3-SNAPSHOT'
testImplementation 'junit:junit:4.12'
}
4 changes: 3 additions & 1 deletion android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include ':app', ':pytorch_android', ':fbjni', ':pytorch_android_torchvision'
include ':app', ':pytorch_android', ':fbjni', ':pytorch_android_torchvision', ':pytorch_host'

project(':fbjni').projectDir = file('libs/fbjni_local')
project(':pytorch_android_torchvision').projectDir = file('pytorch_android_torchvision')

project(':pytorch_host').projectDir = file('pytorch_android/host')
60 changes: 37 additions & 23 deletions aten/src/ATen/core/jit_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,36 +556,50 @@ struct CAFFE2_API TensorType : public Type {
return r;
}

TensorTypePtr withPossiblyUndefined() {
auto r = clone();
r->undefined_ = c10::nullopt;
return r;
}

c10::optional<bool> undefined() const { return undefined_; }

static TensorTypePtr get();

static const TypeKind Kind = TypeKind::TensorType;

private:
TensorType(const at::Tensor &tensor)
: Type(TypeKind::TensorType), scalar_type_(tensor.scalar_type()),
device_(tensor.device()), sizes_(tensor.sizes().size()),
strides_(tensor.sizes().size()),
requires_grad_(tensor.requires_grad()), undefined_(false) {
if (!tensor.is_mkldnn() && !tensor.is_sparse()) {
sizes_ = tensor.sizes().vec();
strides_ = tensor.strides().vec();
}
}
TensorType(c10::optional<at::ScalarType> scalar_type,
c10::optional<Device> device, const VaryingShape &sizes,
const VaryingStrides &strides,
c10::optional<bool> requires_grad,
c10::optional<bool> undefined = false)
: Type(TypeKind::TensorType), scalar_type_(scalar_type),
device_(device), sizes_(sizes), strides_(strides),
requires_grad_(requires_grad), undefined_(undefined) {}

TensorTypePtr clone() const {
return TensorTypePtr(new TensorType(scalar_type_, device_, sizes_,
strides_, requires_grad_,
undefined_));
TensorType(const at::Tensor& tensor)
: Type(TypeKind::TensorType),
scalar_type_(tensor.scalar_type()),
device_(tensor.device()),
sizes_(tensor.sizes().size()),
strides_(tensor.sizes().size()),
requires_grad_(tensor.requires_grad()),
undefined_(!tensor.defined()) {
if (!tensor.is_mkldnn() && !tensor.is_sparse()) {
sizes_ = tensor.sizes().vec();
strides_ = tensor.strides().vec();
}
}
TensorType(
c10::optional<at::ScalarType> scalar_type,
c10::optional<Device> device,
const VaryingShape& sizes,
const VaryingStrides& strides,
c10::optional<bool> requires_grad,
c10::optional<bool> undefined = false)
: Type(TypeKind::TensorType),
scalar_type_(scalar_type),
device_(device),
sizes_(sizes),
strides_(strides),
requires_grad_(requires_grad),
undefined_(undefined) {}

TensorTypePtr clone() const {
return TensorTypePtr(new TensorType(
scalar_type_, device_, sizes_, strides_, requires_grad_, undefined_));
}

static std::vector<int64_t> contiguousStridesOf(at::IntArrayRef sizes) {
Expand Down
Loading