Skip to content

Commit

Permalink
Update on "[ONNX] Fix bug in unfold symbolic (#50504)"
Browse files Browse the repository at this point in the history
Fix bug in unfold symbolic

Differential Revision: [D26203113](https://our.internmc.facebook.com/intern/diff/D26203113)

[ghstack-poisoned]
  • Loading branch information
BowenBao committed Feb 3, 2021
2 parents 525e28a + 26f37e1 commit 5959531
Show file tree
Hide file tree
Showing 175 changed files with 7,668 additions and 1,620 deletions.
2 changes: 1 addition & 1 deletion .circleci/cimodel/data/dimensions.py
Expand Up @@ -8,7 +8,7 @@

ROCM_VERSIONS = [
"3.10",
"4.0",
"4.0.1",
]

ROCM_VERSION_LABELS = ["rocm" + v for v in ROCM_VERSIONS]
Expand Down
104 changes: 52 additions & 52 deletions .circleci/config.yml
Expand Up @@ -2165,49 +2165,49 @@ workflows:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:3.10"
- binary_linux_build:
name: binary_linux_manywheel_3_6m_rocm4_0_devtoolset7_nightly_build
build_environment: "manywheel 3.6m rocm4.0 devtoolset7"
name: binary_linux_manywheel_3_6m_rocm4_0_1_devtoolset7_nightly_build
build_environment: "manywheel 3.6m rocm4.0.1 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:4.0"
docker_image: "pytorch/manylinux-rocm:4.0.1"
- binary_linux_build:
name: binary_linux_manywheel_3_7m_rocm4_0_devtoolset7_nightly_build
build_environment: "manywheel 3.7m rocm4.0 devtoolset7"
name: binary_linux_manywheel_3_7m_rocm4_0_1_devtoolset7_nightly_build
build_environment: "manywheel 3.7m rocm4.0.1 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:4.0"
docker_image: "pytorch/manylinux-rocm:4.0.1"
- binary_linux_build:
name: binary_linux_manywheel_3_8m_rocm4_0_devtoolset7_nightly_build
build_environment: "manywheel 3.8m rocm4.0 devtoolset7"
name: binary_linux_manywheel_3_8m_rocm4_0_1_devtoolset7_nightly_build
build_environment: "manywheel 3.8m rocm4.0.1 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:4.0"
docker_image: "pytorch/manylinux-rocm:4.0.1"
- binary_linux_build:
name: binary_linux_manywheel_3_9m_rocm4_0_devtoolset7_nightly_build
build_environment: "manywheel 3.9m rocm4.0 devtoolset7"
name: binary_linux_manywheel_3_9m_rocm4_0_1_devtoolset7_nightly_build
build_environment: "manywheel 3.9m rocm4.0.1 devtoolset7"
filters:
branches:
only:
- /.*/
tags:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
docker_image: "pytorch/manylinux-rocm:4.0"
docker_image: "pytorch/manylinux-rocm:4.0.1"
- binary_linux_build:
name: binary_linux_conda_3_6_cpu_devtoolset7_nightly_build
build_environment: "conda 3.6 cpu devtoolset7"
Expand Down Expand Up @@ -3551,8 +3551,8 @@ workflows:
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
name: binary_linux_manywheel_3_6m_rocm4_0_devtoolset7_nightly_test
build_environment: "manywheel 3.6m rocm4.0 devtoolset7"
name: binary_linux_manywheel_3_6m_rocm4_0_1_devtoolset7_nightly_test
build_environment: "manywheel 3.6m rocm4.0.1 devtoolset7"
filters:
branches:
only:
Expand All @@ -3561,13 +3561,13 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
requires:
- binary_linux_manywheel_3_6m_rocm4_0_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:4.0"
- binary_linux_manywheel_3_6m_rocm4_0_1_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:4.0.1"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
name: binary_linux_manywheel_3_7m_rocm4_0_devtoolset7_nightly_test
build_environment: "manywheel 3.7m rocm4.0 devtoolset7"
name: binary_linux_manywheel_3_7m_rocm4_0_1_devtoolset7_nightly_test
build_environment: "manywheel 3.7m rocm4.0.1 devtoolset7"
filters:
branches:
only:
Expand All @@ -3576,13 +3576,13 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
requires:
- binary_linux_manywheel_3_7m_rocm4_0_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:4.0"
- binary_linux_manywheel_3_7m_rocm4_0_1_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:4.0.1"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
name: binary_linux_manywheel_3_8m_rocm4_0_devtoolset7_nightly_test
build_environment: "manywheel 3.8m rocm4.0 devtoolset7"
name: binary_linux_manywheel_3_8m_rocm4_0_1_devtoolset7_nightly_test
build_environment: "manywheel 3.8m rocm4.0.1 devtoolset7"
filters:
branches:
only:
Expand All @@ -3591,13 +3591,13 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
requires:
- binary_linux_manywheel_3_8m_rocm4_0_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:4.0"
- binary_linux_manywheel_3_8m_rocm4_0_1_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:4.0.1"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
name: binary_linux_manywheel_3_9m_rocm4_0_devtoolset7_nightly_test
build_environment: "manywheel 3.9m rocm4.0 devtoolset7"
name: binary_linux_manywheel_3_9m_rocm4_0_1_devtoolset7_nightly_test
build_environment: "manywheel 3.9m rocm4.0.1 devtoolset7"
filters:
branches:
only:
Expand All @@ -3606,8 +3606,8 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
requires:
- binary_linux_manywheel_3_9m_rocm4_0_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:4.0"
- binary_linux_manywheel_3_9m_rocm4_0_1_devtoolset7_nightly_build
docker_image: "pytorch/manylinux-rocm:4.0.1"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- binary_linux_test:
Expand Down Expand Up @@ -5129,10 +5129,10 @@ workflows:
package_type: manywheel
upload_subfolder: rocm3.10
- binary_upload:
name: binary_linux_manywheel_3_6m_rocm4_0_devtoolset7_nightly_upload
name: binary_linux_manywheel_3_6m_rocm4_0_1_devtoolset7_nightly_upload
context: org-member
requires:
- binary_linux_manywheel_3_6m_rocm4_0_devtoolset7_nightly_test
- binary_linux_manywheel_3_6m_rocm4_0_1_devtoolset7_nightly_test
filters:
branches:
only:
Expand All @@ -5141,12 +5141,12 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
package_type: manywheel
upload_subfolder: rocm4.0
upload_subfolder: rocm4.0.1
- binary_upload:
name: binary_linux_manywheel_3_7m_rocm4_0_devtoolset7_nightly_upload
name: binary_linux_manywheel_3_7m_rocm4_0_1_devtoolset7_nightly_upload
context: org-member
requires:
- binary_linux_manywheel_3_7m_rocm4_0_devtoolset7_nightly_test
- binary_linux_manywheel_3_7m_rocm4_0_1_devtoolset7_nightly_test
filters:
branches:
only:
Expand All @@ -5155,12 +5155,12 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
package_type: manywheel
upload_subfolder: rocm4.0
upload_subfolder: rocm4.0.1
- binary_upload:
name: binary_linux_manywheel_3_8m_rocm4_0_devtoolset7_nightly_upload
name: binary_linux_manywheel_3_8m_rocm4_0_1_devtoolset7_nightly_upload
context: org-member
requires:
- binary_linux_manywheel_3_8m_rocm4_0_devtoolset7_nightly_test
- binary_linux_manywheel_3_8m_rocm4_0_1_devtoolset7_nightly_test
filters:
branches:
only:
Expand All @@ -5169,12 +5169,12 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
package_type: manywheel
upload_subfolder: rocm4.0
upload_subfolder: rocm4.0.1
- binary_upload:
name: binary_linux_manywheel_3_9m_rocm4_0_devtoolset7_nightly_upload
name: binary_linux_manywheel_3_9m_rocm4_0_1_devtoolset7_nightly_upload
context: org-member
requires:
- binary_linux_manywheel_3_9m_rocm4_0_devtoolset7_nightly_test
- binary_linux_manywheel_3_9m_rocm4_0_1_devtoolset7_nightly_test
filters:
branches:
only:
Expand All @@ -5183,7 +5183,7 @@ workflows:
only:
- /v[0-9]+(\.[0-9]+)*-rc[0-9]+/
package_type: manywheel
upload_subfolder: rocm4.0
upload_subfolder: rocm4.0.1
- binary_upload:
name: binary_linux_conda_3_6_cpu_devtoolset7_nightly_upload
context: org-member
Expand Down Expand Up @@ -7801,51 +7801,51 @@ workflows:
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
name: smoke_linux_manywheel_3_6m_rocm4_0_devtoolset7_nightly
build_environment: "manywheel 3.6m rocm4.0 devtoolset7"
name: smoke_linux_manywheel_3_6m_rocm4_0_1_devtoolset7_nightly
build_environment: "manywheel 3.6m rocm4.0.1 devtoolset7"
requires:
- update_s3_htmls
filters:
branches:
only:
- postnightly
docker_image: "pytorch/manylinux-rocm:4.0"
docker_image: "pytorch/manylinux-rocm:4.0.1"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
name: smoke_linux_manywheel_3_7m_rocm4_0_devtoolset7_nightly
build_environment: "manywheel 3.7m rocm4.0 devtoolset7"
name: smoke_linux_manywheel_3_7m_rocm4_0_1_devtoolset7_nightly
build_environment: "manywheel 3.7m rocm4.0.1 devtoolset7"
requires:
- update_s3_htmls
filters:
branches:
only:
- postnightly
docker_image: "pytorch/manylinux-rocm:4.0"
docker_image: "pytorch/manylinux-rocm:4.0.1"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
name: smoke_linux_manywheel_3_8m_rocm4_0_devtoolset7_nightly
build_environment: "manywheel 3.8m rocm4.0 devtoolset7"
name: smoke_linux_manywheel_3_8m_rocm4_0_1_devtoolset7_nightly
build_environment: "manywheel 3.8m rocm4.0.1 devtoolset7"
requires:
- update_s3_htmls
filters:
branches:
only:
- postnightly
docker_image: "pytorch/manylinux-rocm:4.0"
docker_image: "pytorch/manylinux-rocm:4.0.1"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
name: smoke_linux_manywheel_3_9m_rocm4_0_devtoolset7_nightly
build_environment: "manywheel 3.9m rocm4.0 devtoolset7"
name: smoke_linux_manywheel_3_9m_rocm4_0_1_devtoolset7_nightly
build_environment: "manywheel 3.9m rocm4.0.1 devtoolset7"
requires:
- update_s3_htmls
filters:
branches:
only:
- postnightly
docker_image: "pytorch/manylinux-rocm:4.0"
docker_image: "pytorch/manylinux-rocm:4.0.1"
use_cuda_docker_runtime: "1"
resource_class: gpu.medium
- smoke_linux_test:
Expand Down
3 changes: 2 additions & 1 deletion .jenkins/caffe2/test.sh
Expand Up @@ -84,7 +84,8 @@ fi
# CircleCI docker images could install conda as jenkins user, or use the OS's python package.
PIP=$(which pip)
PIP_USER=$(stat --format '%U' $PIP)
if [[ "$PIP_USER" = root ]]; then
CURRENT_USER=$(id -u -n)
if [[ "$PIP_USER" = root && "$CURRENT_USER" != root ]]; then
MAYBE_SUDO=sudo
fi

Expand Down
3 changes: 1 addition & 2 deletions aten/src/ATen/Utils.cpp
Expand Up @@ -27,9 +27,8 @@ Tensor empty_cpu(
c10::optional<Device> device_opt,
c10::optional<bool> pin_memory_opt,
c10::optional<c10::MemoryFormat> memory_format_opt) {
Device device = device_or_default(device_opt);
TORCH_INTERNAL_ASSERT_DEBUG_ONLY(device_or_default(device_opt).type() == DeviceType::CPU);

TORCH_CHECK(device.type() == DeviceType::CPU);
check_size_nonnegative(size);

bool pin_memory = pinned_memory_or_default(pin_memory_opt);
Expand Down
1 change: 1 addition & 0 deletions aten/src/ATen/core/aten_interned_strings.h
Expand Up @@ -289,6 +289,7 @@ _(aten, diag_embed) \
_(aten, diagflat) \
_(aten, diagonal) \
_(aten, fill_diagonal_) \
_(aten, diff) \
_(aten, digamma) \
_(aten, dim) \
_(aten, dist) \
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/ivalue.cpp
Expand Up @@ -81,7 +81,7 @@ TypePtr IValue::type() const {
case Tag::Double:
return FloatType::get();
case Tag::ComplexDouble:
return ComplexDoubleType::get();
return ComplexType::get();
case Tag::Int:
return IntType::get();
case Tag::Bool:
Expand Down
24 changes: 12 additions & 12 deletions aten/src/ATen/core/jit_type.h
Expand Up @@ -738,7 +738,7 @@ struct TORCH_API DictType : public Type {
case TypeKind::IntType:
case TypeKind::BoolType:
case TypeKind::FloatType:
case TypeKind::ComplexDoubleType:
case TypeKind::ComplexType:
case TypeKind::StringType:
case TypeKind::TensorType:
return DictTypePtr(new DictType(key, value));
Expand Down Expand Up @@ -1107,7 +1107,7 @@ using NumberTypePtr = std::shared_ptr<NumberType>;
// Subtype hierarchy for Number Types (NumberType as the base type):
// IntType <: NumberType
// FloatType <: NumberType
// ComplexDoubleType <:NumberType
// ComplexType <:NumberType
struct TORCH_API NumberType : public Type {
static NumberTypePtr create() {
return NumberTypePtr(new NumberType()); // NOLINT(modernize-make-shared)
Expand Down Expand Up @@ -1159,12 +1159,12 @@ struct TORCH_API FloatType : public NumberType {
}
};

struct ComplexDoubleType;
using ComplexDoubleTypePtr = std::shared_ptr<ComplexDoubleType>;
struct ComplexType;
using ComplexTypePtr = std::shared_ptr<ComplexType>;
// This type represents a Python float number
struct TORCH_API ComplexDoubleType : public NumberType {
static ComplexDoubleTypePtr create() {
return ComplexDoubleTypePtr(new ComplexDoubleType()); // NOLINT(modernize-make-shared)
struct TORCH_API ComplexType : public NumberType {
static ComplexTypePtr create() {
return ComplexTypePtr(new ComplexType()); // NOLINT(modernize-make-shared)
}
bool operator==(const Type& rhs) const override {
return rhs.kind() == kind();
Expand All @@ -1175,12 +1175,12 @@ struct TORCH_API ComplexDoubleType : public NumberType {
bool isSubtypeOfExt(const TypePtr& rhs, std::ostream* why_not) const override {
return rhs->kind() == TypeKind::NumberType || NumberType::isSubtypeOfExt(rhs, why_not);
}
static const TypeKind Kind = TypeKind::ComplexDoubleType;
static const TypeKind Kind = TypeKind::ComplexType;
// global singleton
static ComplexDoubleTypePtr get();
static ComplexTypePtr get();

private:
ComplexDoubleType() : NumberType(TypeKind::ComplexDoubleType) {}
ComplexType() : NumberType(TypeKind::ComplexType) {}
std::string annotation_str_impl(TypePrinter printer = nullptr) const override {
return "complex";
}
Expand Down Expand Up @@ -1652,7 +1652,7 @@ struct getTypePtr_<double> final {
template <>
struct getTypePtr_<c10::complex<double>> final {
static TypePtr call() {
return ComplexDoubleType::get();
return ComplexType::get();
}
};
template <>
Expand Down Expand Up @@ -2440,7 +2440,7 @@ inline bool IValue::isDoubleList() const {

inline bool IValue::isComplexDoubleList() const {
// note: avoids calling type() to avoid extra referencing counting for the returned type.
return isList() && static_cast<detail::ListImpl*>(payload.u.as_intrusive_ptr)->elementType->kind() == ComplexDoubleType::Kind;
return isList() && static_cast<detail::ListImpl*>(payload.u.as_intrusive_ptr)->elementType->kind() == ComplexType::Kind;
}

inline bool IValue::isTensorList() const {
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/jit_type_base.h
Expand Up @@ -21,7 +21,7 @@ namespace c10 {
_(DictType) \
_(NumberType) \
_(FloatType) \
_(ComplexDoubleType) \
_(ComplexType) \
_(FutureType) \
_(RRefType) \
_(IntType) \
Expand Down

0 comments on commit 5959531

Please sign in to comment.