Skip to content

Commit

Permalink
[jit] do the code reorg (pytorch#33851)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#33851

Rationale and context described in pytorch#33828.

Script to reproduce the move:
https://gist.github.com/suo/16cbefaaeb67ca5a7c6caffd49b7f6e9
ghstack-source-id: 99079645

Test Plan: Make sure CI passes

Reviewed By: jamesr66a

Differential Revision: D20133869

fbshipit-source-id: 390e9241a9c85366d9005c492ac31f10aa96488e
  • Loading branch information
suo authored and facebook-github-bot committed Feb 27, 2020
1 parent afbd044 commit dbe850a
Show file tree
Hide file tree
Showing 385 changed files with 999 additions and 994 deletions.
2 changes: 1 addition & 1 deletion android/pytorch_android/generate_test_asset.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <torch/jit.h>
#include <torch/script.h>
#include <torch/csrc/jit/script/module.h>
#include <torch/csrc/jit/api/module.h>

#include <iostream>
#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion android/pytorch_android/src/main/cpp/pytorch_jni_jit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <fbjni/fbjni.h>

#include <torch/csrc/autograd/record_function.h>
#include <torch/csrc/jit/print_handler.h>
#include <torch/csrc/jit/runtime/print_handler.h>
#include <torch/script.h>
#include "caffe2/serialize/read_adapter_interface.h"

Expand Down
28 changes: 14 additions & 14 deletions aten/src/ATen/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ EXCLUDE(ATen_CORE_SRCS "${ATen_CORE_SRCS}" ${ATen_CORE_TEST_SRCS})

# Add files needed from jit folders
LIST(APPEND ATen_CORE_HEADERS
${Caffe2_SOURCE_DIR}/torch/csrc/jit/source_range.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/function_schema_parser.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/lexer.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/strtod.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/parse_string_literal.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/schema_type_parser.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/error_report.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/tree.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/source_range.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/function_schema_parser.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/lexer.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/strtod.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/parse_string_literal.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/schema_type_parser.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/error_report.h
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/tree.h
)
LIST(APPEND ATen_CORE_SRCS
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/error_report.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/function_schema_parser.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/lexer.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/strtod.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/script/schema_type_parser.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/source_range.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/error_report.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/function_schema_parser.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/lexer.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/strtod.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/schema_type_parser.cpp
${Caffe2_SOURCE_DIR}/torch/csrc/jit/frontend/source_range.cpp
)

# Pass to parent
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/boxing/kernel_function_legacy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <ATen/core/boxing/test_helpers.h>
#include <ATen/core/op_registration/op_registration.h>
#include <ATen/core/Tensor.h>
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>

/**
* This file tests the legacy function-based API for registering kernels.
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/boxing/kernel_function_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <ATen/core/op_registration/op_registration.h>
#include <ATen/core/Tensor.h>
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>

using c10::RegisterOperators;
using c10::DispatchKey;
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/boxing/kernel_functor_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <ATen/core/op_registration/op_registration.h>
#include <ATen/core/Tensor.h>
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>

using c10::RegisterOperators;
using c10::OperatorKernel;
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/boxing/kernel_lambda_legacy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <ATen/core/boxing/test_helpers.h>
#include <ATen/core/op_registration/op_registration.h>
#include <ATen/core/Tensor.h>
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>

/**
* This file tests the legacy lambda-based API for registering kernels:
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/boxing/kernel_lambda_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <ATen/core/op_registration/op_registration.h>
#include <ATen/core/Tensor.h>
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>

using c10::RegisterOperators;
using c10::DispatchKey;
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/boxing/kernel_stackbased_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include <ATen/core/op_registration/op_registration.h>
#include <ATen/core/Tensor.h>
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>

using c10::RegisterOperators;
using c10::DispatchKey;
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/custom_class.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <ATen/core/jit_type.h>
#include <torch/csrc/jit/custom_class.h>
#include <torch/csrc/jit/api/custom_class.h>

#include <atomic>

Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/op_registration/op_registration.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <ATen/core/op_registration/op_registration.h>
#if !defined(CAFFE2_IS_XPLAT_BUILD)
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>
#endif

namespace c10 {
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/core/op_registration/op_registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <ATen/core/dispatch/Dispatcher.h>
#include <ATen/core/op_registration/infer_schema.h>
#if !defined(CAFFE2_IS_XPLAT_BUILD)
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>
#endif
#include <ATen/core/OpsAlreadyMovedToC10.h>

Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/quantized/Quantizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct CAFFE2_API Quantizer : public c10::intrusive_ptr_target {
explicit Quantizer(ScalarType scalar_type) : scalar_type_(scalar_type) {}
virtual ~Quantizer();

// Copied from torch/csrc/jit/scope.h
// Copied from torch/csrc/jit/ir/scope.h
QuantizerPtr intrusive_from_this() {
c10::raw::intrusive_ptr::incref(this); // we are creating a new pointer
// from a raw `this` pointer
Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/test/backend_fallback_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <ATen/ATen.h>
#include <ATen/NativeFunctions.h>
#include <ATen/core/op_registration/op_registration.h>
#include <torch/csrc/jit/operator.h>
#include <torch/csrc/jit/runtime/operator.h>

using namespace at;

Expand Down
2 changes: 1 addition & 1 deletion aten/src/ATen/test/extension_backend_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <ATen/NativeFunctions.h>
#include <ATen/core/op_registration/op_registration.h>

#include <torch/csrc/jit/operator.h>
#include <torch/csrc/jit/runtime/operator.h>

using namespace at;

Expand Down
6 changes: 3 additions & 3 deletions binaries/dump_operator_names.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

#include <torch/csrc/jit/script/module.h>
#include <torch/csrc/jit/api/module.h>
#include <torch/csrc/jit/mobile/module.h>
#include <torch/csrc/jit/import.h>
#include <torch/csrc/jit/instruction.h>
#include <torch/csrc/jit/serialization/import.h>
#include <torch/csrc/jit/runtime/instruction.h>
#include <c10/util/Flags.h>

#include <fstream>
Expand Down
2 changes: 1 addition & 1 deletion binaries/speed_benchmark_torch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "caffe2/core/timer.h"
#include "caffe2/utils/string_utils.h"
#include "torch/csrc/autograd/grad_mode.h"
#include "torch/csrc/jit/import.h"
#include "torch/csrc/jit/serialization/import.h"
#include "torch/script.h"

#include <chrono>
Expand Down
144 changes: 72 additions & 72 deletions caffe2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,34 +349,34 @@ if (NOT INTERN_BUILD_MOBILE OR NOT BUILD_CAFFE2_MOBILE)
${TORCH_SRC_DIR}/csrc/autograd/record_function_ops.cpp
${TORCH_SRC_DIR}/csrc/autograd/saved_variable.cpp
${TORCH_SRC_DIR}/csrc/autograd/variable.cpp
${TORCH_SRC_DIR}/csrc/jit/autodiff.cpp
${TORCH_SRC_DIR}/csrc/jit/attributes.cpp
${TORCH_SRC_DIR}/csrc/jit/argument_spec.cpp
${TORCH_SRC_DIR}/csrc/jit/custom_class.cpp
${TORCH_SRC_DIR}/csrc/jit/pass_manager.cpp
${TORCH_SRC_DIR}/csrc/jit/pickler.cpp
${TORCH_SRC_DIR}/csrc/jit/unpickler.cpp
${TORCH_SRC_DIR}/csrc/jit/graph_executor.cpp
${TORCH_SRC_DIR}/csrc/jit/import_source.cpp
${TORCH_SRC_DIR}/csrc/jit/import.cpp
${TORCH_SRC_DIR}/csrc/jit/pickle.cpp
${TORCH_SRC_DIR}/csrc/jit/import_export_helpers.cpp
${TORCH_SRC_DIR}/csrc/jit/instruction.cpp
${TORCH_SRC_DIR}/csrc/jit/interpreter.cpp
${TORCH_SRC_DIR}/csrc/jit/constants.cpp
${TORCH_SRC_DIR}/csrc/jit/node_hashing.cpp
${TORCH_SRC_DIR}/csrc/jit/type_hashing.cpp
${TORCH_SRC_DIR}/csrc/jit/ir.cpp
${TORCH_SRC_DIR}/csrc/jit/irparser.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/autodiff.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/attributes.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/argument_spec.cpp
${TORCH_SRC_DIR}/csrc/jit/api/custom_class.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/pass_manager.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/pickler.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/unpickler.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/graph_executor.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/import_source.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/import.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/pickle.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/import_export_helpers.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/instruction.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/interpreter.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/constants.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/node_hashing.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/type_hashing.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/ir.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/irparser.cpp
${TORCH_SRC_DIR}/csrc/jit/jit_log.cpp
${TORCH_SRC_DIR}/csrc/jit/operator.cpp
${TORCH_SRC_DIR}/csrc/jit/register_c10_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/subgraph_matcher.cpp
${TORCH_SRC_DIR}/csrc/jit/symbolic_script.cpp
${TORCH_SRC_DIR}/csrc/jit/profiling_record.cpp
${TORCH_SRC_DIR}/csrc/jit/profiling_graph_executor_impl.cpp
${TORCH_SRC_DIR}/csrc/jit/update_graph_executor_opt.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/alias_analysis.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/operator.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/register_c10_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/subgraph_matcher.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/symbolic_script.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/profiling_record.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/profiling_graph_executor_impl.cpp
${TORCH_SRC_DIR}/csrc/jit/python/update_graph_executor_opt.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/alias_analysis.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/batch_mm.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/bailout_graph.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/canonicalize.cpp
Expand Down Expand Up @@ -412,49 +412,49 @@ if (NOT INTERN_BUILD_MOBILE OR NOT BUILD_CAFFE2_MOBILE)
${TORCH_SRC_DIR}/csrc/jit/passes/specialize_autogradzero.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/subgraph_rewrite.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/tensorexpr_fuser.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/python_print.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/python_print.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/utils/subgraph_utils.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/utils/check_alias_annotation.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/utils/memory_dag.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/quantization.cpp
${TORCH_SRC_DIR}/csrc/jit/passes/fuse_linear.cpp
${TORCH_SRC_DIR}/csrc/jit/print_handler.cpp
${TORCH_SRC_DIR}/csrc/jit/fuser/interface.cpp
${TORCH_SRC_DIR}/csrc/jit/register_prim_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/register_prim_ops_c10.cpp
${TORCH_SRC_DIR}/csrc/jit/register_string_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/register_special_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/scope.cpp
${TORCH_SRC_DIR}/csrc/jit/script/ir_emitter.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/print_handler.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/interface.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/register_prim_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/register_prim_ops_c10.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/register_string_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/register_special_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/scope.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/ir_emitter.cpp
${TORCH_SRC_DIR}/csrc/jit/testing/file_check.cpp
${TORCH_SRC_DIR}/csrc/jit/script/convert_to_ssa.cpp
${TORCH_SRC_DIR}/csrc/jit/script/exit_transforms.cpp
${TORCH_SRC_DIR}/csrc/jit/script/inline_loop_condition.cpp
${TORCH_SRC_DIR}/csrc/jit/script/schema_matching.cpp
${TORCH_SRC_DIR}/csrc/jit/script/script_type_parser.cpp
${TORCH_SRC_DIR}/csrc/jit/script/sugared_value.cpp
${TORCH_SRC_DIR}/csrc/jit/script/class_type.cpp
${TORCH_SRC_DIR}/csrc/jit/script/parser.cpp
${TORCH_SRC_DIR}/csrc/jit/script/builtin_functions.cpp
${TORCH_SRC_DIR}/csrc/jit/script/canonicalize_modified_loop.cpp
${TORCH_SRC_DIR}/csrc/jit/script/edit_distance.cpp
${TORCH_SRC_DIR}/csrc/jit/script/logging.cpp
${TORCH_SRC_DIR}/csrc/jit/script/module.cpp
${TORCH_SRC_DIR}/csrc/jit/script/object.cpp
${TORCH_SRC_DIR}/csrc/jit/script/jit_exception.cpp
${TORCH_SRC_DIR}/csrc/jit/script/string_to_type.cpp
${TORCH_SRC_DIR}/csrc/jit/source_range_serialization.cpp
${TORCH_SRC_DIR}/csrc/jit/tracer.cpp
${TORCH_SRC_DIR}/csrc/jit/hooks_for_testing.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/convert_to_ssa.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/exit_transforms.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/inline_loop_condition.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/schema_matching.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/script_type_parser.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/sugared_value.cpp
${TORCH_SRC_DIR}/csrc/jit/ir/class_type.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/parser.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/builtin_functions.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/canonicalize_modified_loop.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/edit_distance.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/logging.cpp
${TORCH_SRC_DIR}/csrc/jit/api/module.cpp
${TORCH_SRC_DIR}/csrc/jit/api/object.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/jit_exception.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/string_to_type.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/source_range_serialization.cpp
${TORCH_SRC_DIR}/csrc/jit/frontend/tracer.cpp
${TORCH_SRC_DIR}/csrc/jit/testing/hooks_for_testing.cpp
${TORCH_SRC_DIR}/csrc/utils/tensor_flatten.cpp
${TORCH_SRC_DIR}/csrc/utils/variadic.cpp
${TORCH_SRC_DIR}/csrc/jit/fuser/kernel_cache.cpp
${TORCH_SRC_DIR}/csrc/jit/fuser/compiler.cpp
${TORCH_SRC_DIR}/csrc/jit/fuser/executor.cpp
${TORCH_SRC_DIR}/csrc/jit/fuser/codegen.cpp
${TORCH_SRC_DIR}/csrc/jit/fuser/fallback.cpp
${TORCH_SRC_DIR}/csrc/jit/function.cpp
${TORCH_SRC_DIR}/csrc/jit/vararg_functions.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/kernel_cache.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/compiler.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/executor.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/codegen.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/fallback.cpp
${TORCH_SRC_DIR}/csrc/jit/api/function.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/vararg_functions.cpp

${TORCH_SRC_DIR}/csrc/jit/tensorexpr/mem_arena.cpp
${TORCH_SRC_DIR}/csrc/jit/tensorexpr/codegen.cpp
Expand Down Expand Up @@ -489,12 +489,12 @@ if (NOT INTERN_BUILD_MOBILE OR NOT BUILD_CAFFE2_MOBILE)
if (NOT INTERN_BUILD_MOBILE)
list(APPEND TORCH_SRCS
${TORCH_SRC_DIR}/csrc/api/src/jit.cpp
${TORCH_SRC_DIR}/csrc/jit/export.cpp
${TORCH_SRC_DIR}/csrc/jit/export_module.cpp
${TORCH_SRC_DIR}/csrc/jit/import_legacy.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/export.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/export_module.cpp
${TORCH_SRC_DIR}/csrc/jit/serialization/import_legacy.cpp
${TORCH_SRC_DIR}/csrc/jit/netdef_converter.cpp
${TORCH_SRC_DIR}/csrc/jit/fuser/cpu/fused_kernel.cpp
${TORCH_SRC_DIR}/csrc/jit/script/module_save.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp
${TORCH_SRC_DIR}/csrc/jit/api/module_save.cpp
${TORCH_SRC_DIR}/csrc/utils/byte_order.cpp
)
if (USE_DISTRIBUTED)
Expand Down Expand Up @@ -526,14 +526,14 @@ if (NOT INTERN_BUILD_MOBILE OR NOT BUILD_CAFFE2_MOBILE)
${TORCH_SRC_DIR}/csrc/distributed/rpc/script_resp.cpp
${TORCH_SRC_DIR}/csrc/distributed/rpc/types.cpp
${TORCH_SRC_DIR}/csrc/distributed/rpc/utils.cpp
${TORCH_SRC_DIR}/csrc/jit/register_distributed_ops.cpp
${TORCH_SRC_DIR}/csrc/jit/runtime/register_distributed_ops.cpp
)
endif()
endif()

if (USE_CUDA)
list(APPEND Caffe2_GPU_SRCS
${TORCH_SRC_DIR}/csrc/jit/fuser/cuda/fused_kernel.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/cuda/fused_kernel.cpp
${TORCH_SRC_DIR}/csrc/autograd/profiler_cuda.cpp
${TORCH_SRC_DIR}/csrc/autograd/functions/comm.cpp
${TORCH_SRC_DIR}/csrc/cuda/comm.cpp
Expand All @@ -550,7 +550,7 @@ if (NOT INTERN_BUILD_MOBILE OR NOT BUILD_CAFFE2_MOBILE)

if (USE_ROCM)
list(APPEND Caffe2_HIP_SRCS
${TORCH_SRC_DIR}/csrc/jit/fuser/cuda/fused_kernel.cpp
${TORCH_SRC_DIR}/csrc/jit/codegen/fuser/cuda/fused_kernel.cpp
${TORCH_SRC_DIR}/csrc/autograd/profiler_cuda.cpp
${TORCH_SRC_DIR}/csrc/autograd/functions/comm.cpp
${TORCH_SRC_DIR}/csrc/cuda/comm.cpp
Expand Down Expand Up @@ -864,8 +864,8 @@ if(USE_ROCM)
USE_ROCM
__HIP_PLATFORM_HCC__
)
# NB: Massive hack. torch/csrc/jit/fuser/codegen.cpp includes
# torch/csrc/jit/fuser/cuda/resource_strings.h which changes the
# NB: Massive hack. torch/csrc/jit/codegen/fuser/codegen.cpp includes
# torch/csrc/jit/codegen/fuser/cuda/resource_strings.h which changes the
# strings depending on if you're __HIP_PLATFORM_HCC__ or not.
# But that file is in torch_cpu! So, against all odds, this macro
# has to be set on torch_cpu too. I also added it to torch for
Expand Down
2 changes: 1 addition & 1 deletion caffe2/core/export_caffe2_op_to_c10.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <ATen/core/function_schema.h>
#include <ATen/core/grad_mode.h>
#include <ATen/core/op_registration/op_registration.h>
#include <torch/csrc/jit/script/function_schema_parser.h>
#include <torch/csrc/jit/frontend/function_schema_parser.h>
#include <vector>

namespace caffe2 {
Expand Down
Loading

0 comments on commit dbe850a

Please sign in to comment.