Move c10 dispatcher back to ATen/core (#16050)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/16050

The c10 dispatcher will (soon) depend on IValue and IValue can't be moved to c10 yet because it depends on at::Tensor, which depends on legacy Type dispatch and we don't want the legacy dispatch in c10.

So instead, we move the c10 dispatcher back to ATen/core until we can actually move at::Tensor to c10.

Reviewed By: ezyang

Differential Revision: D13684517

fbshipit-source-id: 1125f4254223907c52f96ff73034f6d4ae9fd0a7
This commit is contained in:
Sebastian Messmer
2019-01-17 15:47:16 -08:00
committed by Facebook Github Bot
parent a9438ba62f
commit 3e85a2bcbf
70 changed files with 68 additions and 68 deletions

View File

@ -1,9 +1,9 @@
# This file solely exists to let Caffe2 Android build get at the list
# of core files without having to trundle through all of ATen's CMakeLists.txt
FILE(GLOB ATen_CORE_HEADERS "*.h")
FILE(GLOB ATen_CORE_SRCS "*.cpp")
FILE(GLOB ATen_CORE_TEST_SRCS "*_test.cpp")
FILE(GLOB_RECURSE ATen_CORE_HEADERS "*.h")
FILE(GLOB_RECURSE ATen_CORE_SRCS "*.cpp")
FILE(GLOB_RECURSE ATen_CORE_TEST_SRCS "*_test.cpp")
EXCLUDE(ATen_CORE_SRCS "${ATen_CORE_SRCS}" ${ATen_CORE_TEST_SRCS})
# Pass to parent

View File

@ -0,0 +1 @@
#include <ATen/core/dispatch/DeviceId.h>

View File

@ -0,0 +1 @@
#include <ATen/core/dispatch/DispatchKey.h>

View File

@ -1,7 +1,7 @@
#pragma once
#include <c10/core/dispatch/DeviceId.h>
#include <c10/core/dispatch/LayoutId.h>
#include <ATen/core/dispatch/DeviceId.h>
#include <ATen/core/dispatch/LayoutId.h>
#include <c10/util/typeid.h>
#include <vector>

View File

@ -0,0 +1 @@
#include <ATen/core/dispatch/DispatchTable.h>

View File

@ -1,6 +1,6 @@
#pragma once
#include <c10/core/dispatch/OpSchema.h>
#include <ATen/core/dispatch/OpSchema.h>
#include <c10/util/LeftRight.h>
#include <c10/util/Metaprogramming.h>
#include <c10/util/flat_hash_map.h>

View File

@ -0,0 +1 @@
#include <ATen/core/dispatch/Dispatcher.h>

View File

@ -1,6 +1,6 @@
#pragma once
#include <c10/core/dispatch/DispatchTable.h>
#include <ATen/core/dispatch/DispatchTable.h>
namespace c10 {

View File

@ -0,0 +1 @@
#include <ATen/core/dispatch/KernelRegistration.h>

View File

@ -1,8 +1,8 @@
#pragma once
#include <c10/util/Optional.h>
#include <c10/core/dispatch/Dispatcher.h>
#include <c10/core/dispatch/OpSchema.h>
#include <ATen/core/dispatch/Dispatcher.h>
#include <ATen/core/dispatch/OpSchema.h>
/**
* To register your own kernel for an operator, do in one (!) cpp file:

View File

@ -0,0 +1 @@
#include <ATen/core/dispatch/LayoutId.h>

View File

@ -0,0 +1 @@
#include <ATen/core/dispatch/OpSchema.h>

View File

@ -1,6 +1,6 @@
#pragma once
#include <c10/core/dispatch/DispatchKey.h>
#include <ATen/core/dispatch/DispatchKey.h>
#include <c10/util/Array.h>
#include <c10/util/Metaprogramming.h>
#include <c10/core/DeviceType.h>

View File

@ -0,0 +1 @@
#include <ATen/core/dispatch/OpSchemaRegistration.h>

View File

@ -1,6 +1,6 @@
#pragma once
#include <c10/core/dispatch/Dispatcher.h>
#include <ATen/core/dispatch/Dispatcher.h>
// TODO Better error message when this definition is missing

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/OpSchema.h>
#include <ATen/core/dispatch/OpSchema.h>
#include <c10/util/Array.h>
using namespace c10;

View File

@ -0,0 +1,4 @@
#include <ATen/core/opschema/layer_norm.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
C10_DEFINE_OP_SCHEMA(c10::core::opschema::LayerNorm);

View File

@ -1 +0,0 @@
#include <c10/core/dispatch/DeviceId.h>

View File

@ -1 +0,0 @@
#include <c10/core/dispatch/DispatchKey.h>

View File

@ -1 +0,0 @@
#include <c10/core/dispatch/DispatchTable.h>

View File

@ -1 +0,0 @@
#include <c10/core/dispatch/Dispatcher.h>

View File

@ -1 +0,0 @@
#include <c10/core/dispatch/KernelRegistration.h>

View File

@ -1 +0,0 @@
#include <c10/core/dispatch/LayoutId.h>

View File

@ -1 +0,0 @@
#include <c10/core/dispatch/OpSchema.h>

View File

@ -1 +0,0 @@
#include <c10/core/dispatch/OpSchemaRegistration.h>

View File

@ -1,4 +0,0 @@
#include <c10/core/opschema/layer_norm.h>
#include <c10/core/dispatch/OpSchemaRegistration.h>
C10_DEFINE_OP_SCHEMA(c10::core::opschema::LayerNorm);

View File

@ -1,6 +1,6 @@
#pragma once
#include <c10/core/dispatch/Dispatcher.h>
#include <ATen/core/dispatch/Dispatcher.h>
#include "caffe2/core/operator.h"
#include <c10/util/ArrayRef.h>
#include <c10/util/Metaprogramming.h>

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/elementwise_ops_utils.h"
#include "caffe2/operators/experimental/c10/schemas/add.h"
#include "caffe2/utils/math.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/averaged_loss.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/batch_gather.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/batch_matmul.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/cast.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/concat.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/enforce_finite.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/expand_dims.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,5 +1,5 @@
#include "caffe2/core/context.h"
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/core/operator.h"
#include "caffe2/operators/experimental/c10/schemas/fc.h"
#include "caffe2/utils/conversions.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/filler.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/flatten.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/elementwise_ops_utils.h"
#include "caffe2/operators/experimental/c10/schemas/mul.h"
#include "caffe2/utils/math.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/relu.h"
#include "caffe2/utils/eigen_utils.h"
#include "caffe2/utils/math.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/sigmoid.h"
#include "caffe2/utils/eigen_utils.h"
#include "caffe2/utils/math.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/sigmoid_cross_entropy_with_logits.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/sparse_lengths_sum.h"
#include "caffe2/perfkernels/embedding_lookup.h"
#include "caffe2/utils/math.h"

View File

@ -1,4 +1,4 @@
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/dispatch/KernelRegistration.h>
#include "caffe2/operators/experimental/c10/schemas/stop_gradient.h"
#include "caffe2/utils/math.h"
#include "caffe2/core/tensor.h"

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/add.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/averaged_loss.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/batch_gather.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/batch_matmul.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/cast.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
#include "caffe2/utils/cast.h"

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/concat.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,6 +1,6 @@
#pragma once
#include <c10/core/dispatch/DeviceId.h>
#include <ATen/core/dispatch/DeviceId.h>
#include <c10/core/Tensor.h>
#include <c10/util/Array.h>
#include <c10/util/ArrayRef.h>

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/enforce_finite.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/expand_dims.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/fc.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/filler.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
#include "caffe2/utils/cast.h"

View File

@ -1,6 +1,6 @@
#pragma once
#include <c10/core/dispatch/DeviceId.h>
#include <ATen/core/dispatch/DeviceId.h>
#include <c10/core/Tensor.h>
#include <c10/util/Array.h>
#include <c10/util/ArrayRef.h>

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/flatten.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,4 +1,4 @@
#include <c10/core/opschema/layer_norm.h>
#include <ATen/core/opschema/layer_norm.h>
#include "caffe2/core/operator_c10wrapper.h"
namespace {

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/mul.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/relu.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/sigmoid.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/sigmoid_cross_entropy_with_logits.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/sparse_lengths_sum.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,5 +1,5 @@
#include "caffe2/operators/experimental/c10/schemas/stop_gradient.h"
#include <c10/core/dispatch/OpSchemaRegistration.h>
#include <ATen/core/dispatch/OpSchemaRegistration.h>
#include "caffe2/core/operator_c10wrapper.h"
using caffe2::CPUContext;

View File

@ -1,7 +1,7 @@
#include "caffe2/operators/layer_norm_op.h"
#include "caffe2/utils/eigen_utils.h"
#include <c10/core/opschema/layer_norm.h>
#include <c10/core/dispatch/KernelRegistration.h>
#include <ATen/core/opschema/layer_norm.h>
#include <ATen/core/dispatch/KernelRegistration.h>
namespace caffe2 {

View File

@ -860,9 +860,9 @@ if __name__ == '__main__':
'lib/include/c10/*.h',
'lib/include/c10/macros/*.h',
'lib/include/c10/core/*.h',
'lib/include/c10/core/dispatch/*.h',
'lib/include/ATen/core/dispatch/*.h',
'lib/include/c10/core/impl/*.h',
'lib/include/c10/core/opschema/*.h',
'lib/include/ATen/core/opschema/*.h',
'lib/include/c10/util/*.h',
'lib/include/c10/cuda/*.h',
'lib/include/c10/cuda/impl/*.h',

View File

@ -1,5 +1,5 @@
#include <c10/core/dispatch/Dispatcher.h>
#include <c10/core/opschema/layer_norm.h>
#include <ATen/core/dispatch/Dispatcher.h>
#include <ATen/core/opschema/layer_norm.h>
#include <torch/csrc/jit/custom_operator.h>
#include <torch/csrc/autograd/variable.h>