pytorch

Форк
0
/
build_variables.bzl 
1480 строк · 67.5 Кб
1
# WARNING: the contents of this file must BOTH be valid Starlark (for Buck and
2

3
# Bazel) as well as valid Python (for our cmake build).  This means that
4
# load() directives are not allowed (as they are not recognized by Python).
5
# If you want to fix this, figure out how run this file from cmake with a proper
6
# Starlark interpreter as part of the default OSS build process.  If you need
7
# some nontrivial Starlark features, make a separate bzl file (remember that
8

9
# bzl files are not exported via ShipIt by default, so you may also need to
10
# update PyTorch's ShipIt config)
11

12
# This is duplicated in caffe2/CMakeLists.txt for now and not yet used in buck
13
GENERATED_LAZY_TS_CPP = [
14
    "lazy/generated/LazyNativeFunctions.cpp",
15
    "lazy/generated/RegisterAutogradLazy.cpp",
16
    "lazy/generated/RegisterLazy.cpp",
17
]
18

19
def libtorch_generated_sources(gencode_pattern):
20
    return [gencode_pattern.format(name) for name in [
21
        "torch/csrc/autograd/generated/Functions.cpp",
22
        "torch/csrc/autograd/generated/VariableType_0.cpp",
23
        "torch/csrc/autograd/generated/VariableType_1.cpp",
24
        "torch/csrc/autograd/generated/VariableType_2.cpp",
25
        "torch/csrc/autograd/generated/VariableType_3.cpp",
26
        "torch/csrc/autograd/generated/VariableType_4.cpp",
27
        "torch/csrc/autograd/generated/ViewFuncs.cpp",
28
        "torch/csrc/autograd/generated/TraceType_0.cpp",
29
        "torch/csrc/autograd/generated/TraceType_1.cpp",
30
        "torch/csrc/autograd/generated/TraceType_2.cpp",
31
        "torch/csrc/autograd/generated/TraceType_3.cpp",
32
        "torch/csrc/autograd/generated/TraceType_4.cpp",
33
        "torch/csrc/autograd/generated/ADInplaceOrViewType_0.cpp",
34
        "torch/csrc/autograd/generated/ADInplaceOrViewType_1.cpp",
35
    ]]
36

37
# copied from https://github.com/pytorch/pytorch/blob/f99a693cd9ff7a9b5fdc71357dac66b8192786d3/aten/src/ATen/core/CMakeLists.txt
38
jit_core_headers = [
39
    "torch/csrc/Export.h",
40
    "torch/csrc/jit/frontend/source_range.h",
41
    "torch/csrc/jit/serialization/callstack_debug_info_serialization.h",
42
    "torch/csrc/jit/serialization/source_range_serialization.h",
43
    "torch/csrc/jit/frontend/lexer.h",
44
    "torch/csrc/jit/frontend/strtod.h",
45
    "torch/csrc/jit/frontend/parser_constants.h",
46
    "torch/csrc/jit/frontend/function_schema_parser.h",
47
    "torch/csrc/jit/frontend/parse_string_literal.h",
48
    "torch/csrc/jit/frontend/schema_type_parser.h",
49
    "torch/csrc/jit/frontend/error_report.h",
50
    "torch/csrc/jit/frontend/tree.h",
51
    "torch/custom_class.h",
52
    "torch/custom_class_detail.h",
53
    "torch/library.h",
54
]
55

56
jit_core_sources = [
57
    "torch/csrc/jit/frontend/error_report.cpp",
58
    "torch/csrc/jit/frontend/function_schema_parser.cpp",
59
    "torch/csrc/jit/frontend/lexer.cpp",
60
    "torch/csrc/jit/frontend/schema_type_parser.cpp",
61
    "torch/csrc/jit/frontend/strtod.cpp",
62
    "torch/csrc/jit/frontend/source_range.cpp",
63
]
64

65
# copied from https://github.com/pytorch/pytorch/blob/0bde610c14b92d351b968a0228df29e92442b1cc/torch/CMakeLists.txt
66
# There are some common files used in both internal lite-interpreter and full-jit. Making a separate
67
# list for the shared files.
68

69
core_sources_common = [
70
    "torch/csrc/autograd/autograd_meta.cpp",
71
    "torch/csrc/autograd/forward_grad.cpp",
72
    "torch/csrc/jit/frontend/edit_distance.cpp",
73
    "torch/csrc/jit/mobile/compatibility/runtime_compatibility.cpp",
74
    "torch/csrc/jit/mobile/type_parser.cpp",
75
    "torch/csrc/jit/operator_upgraders/version_map.cpp",
76
    "torch/csrc/jit/runtime/instruction.cpp",
77
    "torch/csrc/jit/runtime/jit_exception.cpp",
78
    "torch/csrc/jit/runtime/operator.cpp",
79
    "torch/csrc/jit/mobile/register_ops_common_utils.cpp",
80
    "torch/csrc/jit/runtime/print_handler.cpp",
81
    "torch/csrc/jit/runtime/slice_indices_adjust.cpp",
82
    "torch/csrc/jit/runtime/register_ops_utils.cpp",
83
    "torch/csrc/jit/runtime/vararg_functions.cpp",
84
    "torch/csrc/jit/mobile/promoted_prim_ops.cpp",
85
    "torch/csrc/jit/mobile/prim_ops_registery.cpp",
86
    "torch/csrc/profiler/util.cpp",
87
]
88

89
torch_unpickler_common = [
90
    "torch/csrc/jit/serialization/import_read.cpp",
91
    "torch/csrc/jit/serialization/unpickler.cpp",
92
]
93

94
libtorch_sources_common = sorted(core_sources_common + torch_unpickler_common)
95

96
# The profilers are not needed in the lite interpreter build.
97
libtorch_profiler_sources = [
98
    "torch/csrc/autograd/profiler_legacy.cpp",
99
    "torch/csrc/autograd/profiler_kineto.cpp",
100
    "torch/csrc/profiler/collection.cpp",
101
    "torch/csrc/profiler/data_flow.cpp",
102
    "torch/csrc/profiler/kineto_shim.cpp",
103
    "torch/csrc/profiler/kineto_client_interface.cpp",
104
    "torch/csrc/profiler/orchestration/observer.cpp",
105
    "torch/csrc/profiler/orchestration/python_tracer.cpp",
106
    "torch/csrc/profiler/standalone/execution_trace_observer.cpp",
107
    "torch/csrc/profiler/standalone/itt_observer.cpp",
108
    "torch/csrc/profiler/standalone/nvtx_observer.cpp",
109
    "torch/csrc/profiler/stubs/base.cpp",
110
    "torch/csrc/profiler/orchestration/vulkan.cpp",
111
    "torch/csrc/profiler/perf.cpp",
112
    "torch/csrc/monitor/counters.cpp",
113
    "torch/csrc/monitor/events.cpp",
114
]
115

116
libtorch_edge_profiler_sources = libtorch_profiler_sources + [
117
    "torch/csrc/jit/mobile/profiler_edge.cpp",
118
]
119

120
core_trainer_sources = [
121
    "torch/csrc/autograd/anomaly_mode.cpp",
122
    "torch/csrc/autograd/autograd.cpp",
123
    "torch/csrc/autograd/autograd_not_implemented_fallback.cpp",
124
    "torch/csrc/autograd/cpp_hook.cpp",
125
    "torch/csrc/autograd/custom_function.cpp",
126
    "torch/csrc/autograd/variable_info.cpp",
127
    "torch/csrc/autograd/engine.cpp",
128
    "torch/csrc/autograd/function.cpp",
129
    "torch/csrc/autograd/input_metadata.cpp",
130
    "torch/csrc/autograd/functions/accumulate_grad.cpp",
131
    "torch/csrc/autograd/functions/basic_ops.cpp",
132
    "torch/csrc/autograd/functions/tensor.cpp",
133
    "torch/csrc/autograd/functions/utils.cpp",
134
    "torch/csrc/autograd/input_buffer.cpp",
135
    "torch/csrc/autograd/record_function_ops.cpp",
136
    "torch/csrc/autograd/saved_variable.cpp",
137
    "torch/csrc/autograd/variable.cpp",
138
    "torch/csrc/autograd/utils/warnings.cpp",
139
    "torch/csrc/autograd/jit_decomp_interface.cpp",
140
    "torch/csrc/jit/frontend/name_mangler.cpp",
141
    "torch/csrc/jit/ir/type_hashing.cpp",
142
    "torch/csrc/jit/serialization/pickler.cpp",
143
    "torch/csrc/jit/serialization/type_name_uniquer.cpp",
144
]
145

146
torch_mobile_core = [
147
    # backend_debug_info.cpp provides
148
    # __torch__.torch.classes.backend.BackendDebugInfo class
149
    # This should not be needed eventually.
150
    # TODO: Remove this dependency
151
    "torch/csrc/jit/backends/backend_debug_info.cpp",
152
    "torch/csrc/jit/mobile/compatibility/model_compatibility.cpp",
153
    "torch/csrc/jit/mobile/function.cpp",
154
    "torch/csrc/jit/mobile/import.cpp",
155
    "torch/csrc/jit/mobile/flatbuffer_loader.cpp",
156
    "torch/csrc/jit/mobile/interpreter.cpp",
157
    "torch/csrc/jit/mobile/module.cpp",
158
    "torch/csrc/jit/mobile/observer.cpp",
159
    "torch/csrc/jit/mobile/parse_bytecode.cpp",
160
    "torch/csrc/jit/mobile/parse_operators.cpp",
161
    "torch/csrc/jit/mobile/quantization.cpp",
162
    "torch/csrc/jit/mobile/upgrader_mobile.cpp",
163
    "torch/csrc/jit/runtime/register_prim_ops.cpp",
164
    "torch/csrc/jit/runtime/register_special_ops.cpp",
165
]
166

167
core_sources_full_mobile_no_backend_interface_xplat = [
168
    "torch/csrc/jit/api/function_impl.cpp",
169
    "torch/csrc/jit/api/module.cpp",
170
    "torch/csrc/jit/api/object.cpp",
171
    "torch/csrc/jit/backends/backend_debug_handler.cpp",
172
    "torch/csrc/jit/backends/backend_detail.cpp",
173
    "torch/csrc/jit/backends/backend_resolver.cpp",
174
    "torch/csrc/jit/codegen/fuser/codegen.cpp",
175
    "torch/csrc/jit/codegen/fuser/compiler.cpp",
176
    "torch/csrc/jit/codegen/fuser/executor.cpp",
177
    "torch/csrc/jit/codegen/fuser/fallback.cpp",
178
    "torch/csrc/jit/codegen/fuser/interface.cpp",
179
    "torch/csrc/jit/codegen/fuser/kernel_cache.cpp",
180
    "torch/csrc/jit/frontend/builtin_functions.cpp",
181
    "torch/csrc/jit/frontend/versioned_symbols.cpp",
182
    "torch/csrc/jit/frontend/canonicalize_modified_loop.cpp",
183
    "torch/csrc/jit/frontend/convert_to_ssa.cpp",
184
    "torch/csrc/jit/frontend/exit_transforms.cpp",
185
    "torch/csrc/jit/frontend/inline_loop_condition.cpp",
186
    "torch/csrc/jit/frontend/ir_emitter.cpp",
187
    "torch/csrc/jit/frontend/parser.cpp",
188
    "torch/csrc/jit/frontend/schema_matching.cpp",
189
    "torch/csrc/jit/frontend/script_type_parser.cpp",
190
    "torch/csrc/jit/frontend/sugared_value.cpp",
191
    "torch/csrc/jit/frontend/tracer.cpp",
192
    "torch/csrc/jit/ir/alias_analysis.cpp",
193
    "torch/csrc/jit/ir/attributes.cpp",
194
    "torch/csrc/jit/ir/constants.cpp",
195
    "torch/csrc/jit/ir/ir.cpp",
196
    "torch/csrc/jit/ir/irparser.cpp",
197
    "torch/csrc/jit/ir/node_hashing.cpp",
198
    "torch/csrc/jit/ir/scope.cpp",
199
    "torch/csrc/jit/ir/subgraph_matcher.cpp",
200
    "torch/csrc/jit/ir/graph_utils.cpp",
201
    "torch/csrc/jit/jit_log.cpp",
202
    "torch/csrc/jit/jit_opt_limit.cpp",
203
    "torch/csrc/jit/mobile/nnc/aot_compiler.cpp",
204
    "torch/csrc/jit/mobile/nnc/backend.cpp",
205
    "torch/csrc/jit/mobile/nnc/context.cpp",
206
    "torch/csrc/jit/mobile/nnc/registry.cpp",
207
    "torch/csrc/jit/operator_upgraders/utils.cpp",
208
    "torch/csrc/jit/operator_upgraders/upgraders.cpp",
209
    "torch/csrc/jit/operator_upgraders/upgraders_entry.cpp",
210
    "torch/csrc/jit/passes/add_if_then_else.cpp",
211
    "torch/csrc/jit/passes/annotate_warns.cpp",
212
    "torch/csrc/jit/passes/bailout_graph.cpp",
213
    "torch/csrc/jit/passes/check_strict_fusion.cpp",
214
    "torch/csrc/jit/passes/batch_mm.cpp",
215
    "torch/csrc/jit/passes/canonicalize.cpp",
216
    "torch/csrc/jit/passes/canonicalize_graph_fuser_ops.cpp",
217
    "torch/csrc/jit/passes/clear_profiling.cpp",
218
    "torch/csrc/jit/passes/clear_undefinedness.cpp",
219
    "torch/csrc/jit/passes/common_subexpression_elimination.cpp",
220
    "torch/csrc/jit/passes/concat_opt.cpp",
221
    "torch/csrc/jit/passes/constant_pooling.cpp",
222
    "torch/csrc/jit/passes/constant_propagation.cpp",
223
    "torch/csrc/jit/passes/restore_mutation.cpp",
224
    "torch/csrc/jit/passes/create_autodiff_subgraphs.cpp",
225
    "torch/csrc/jit/passes/dead_code_elimination.cpp",
226
    "torch/csrc/jit/passes/eliminate_no_ops.cpp",
227
    "torch/csrc/jit/passes/remove_redundant_profiles.cpp",
228
    "torch/csrc/jit/passes/remove_exceptions.cpp",
229
    "torch/csrc/jit/passes/decompose_ops.cpp",
230
    "torch/csrc/jit/passes/dtype_analysis.cpp",
231
    "torch/csrc/jit/passes/device_type_analysis.cpp",
232
    "torch/csrc/jit/passes/erase_number_types.cpp",
233
    "torch/csrc/jit/passes/fixup_trace_scope_blocks.cpp",
234
    "torch/csrc/jit/passes/freeze_module.cpp",
235
    "torch/csrc/jit/passes/fuse_linear.cpp",
236
    "torch/csrc/jit/passes/fuse_relu.cpp",
237
    "torch/csrc/jit/passes/graph_fuser.cpp",
238
    "torch/csrc/jit/passes/graph_rewrite_helper.cpp",
239
    "torch/csrc/jit/passes/guard_elimination.cpp",
240
    "torch/csrc/jit/passes/hoist_conv_packed_params.cpp",
241
    "torch/csrc/jit/passes/inline_autodiff_subgraphs.cpp",
242
    "torch/csrc/jit/passes/inline_forked_closures.cpp",
243
    "torch/csrc/jit/passes/inline_fork_wait.cpp",
244
    "torch/csrc/jit/passes/inliner.cpp",
245
    "torch/csrc/jit/passes/inplace_check.cpp",
246
    "torch/csrc/jit/passes/insert_guards.cpp",
247
    "torch/csrc/jit/passes/lift_closures.cpp",
248
    "torch/csrc/jit/passes/liveness.cpp",
249
    "torch/csrc/jit/passes/loop_unrolling.cpp",
250
    "torch/csrc/jit/passes/lower_grad_of.cpp",
251
    "torch/csrc/jit/passes/lower_tuples.cpp",
252
    "torch/csrc/jit/passes/normalize_ops.cpp",
253
    "torch/csrc/jit/passes/peephole_dict_idioms.cpp",
254
    "torch/csrc/jit/passes/peephole_list_idioms.cpp",
255
    "torch/csrc/jit/passes/value_refinement_utils.cpp",
256
    "torch/csrc/jit/passes/peephole_alias_sensitive.cpp",
257
    "torch/csrc/jit/passes/pass_manager.cpp",
258
    "torch/csrc/jit/passes/peephole.cpp",
259
    "torch/csrc/jit/passes/peephole_non_tensor.cpp",
260
    "torch/csrc/jit/passes/create_functional_graphs.cpp",
261
    "torch/csrc/jit/passes/refine_tuple_types.cpp",
262
    "torch/csrc/jit/passes/remove_mutation.cpp",
263
    "torch/csrc/jit/passes/prepack_folding.cpp",
264
    "torch/csrc/jit/passes/fold_conv_bn.cpp",
265
    "torch/csrc/jit/passes/fold_linear_bn.cpp",
266
    "torch/csrc/jit/passes/dbr_quantization/remove_redundant_aliases.cpp",
267
    "torch/csrc/jit/passes/frozen_concat_linear.cpp",
268
    "torch/csrc/jit/passes/frozen_conv_add_relu_fusion.cpp",
269
    "torch/csrc/jit/passes/frozen_conv_folding.cpp",
270
    "torch/csrc/jit/passes/frozen_linear_folding.cpp",
271
    "torch/csrc/jit/passes/frozen_linear_transpose.cpp",
272
    "torch/csrc/jit/passes/frozen_ops_to_mkldnn.cpp",
273
    "torch/csrc/jit/passes/frozen_graph_optimizations.cpp",
274
    "torch/csrc/jit/passes/remove_expands.cpp",
275
    "torch/csrc/jit/passes/remove_dropout.cpp",
276
    "torch/csrc/jit/passes/requires_grad_analysis.cpp",
277
    "torch/csrc/jit/passes/shape_analysis.cpp",
278
    "torch/csrc/jit/passes/integer_value_refinement.cpp",
279
    "torch/csrc/jit/passes/replacement_of_old_operators.cpp",
280
    "torch/csrc/jit/passes/symbolic_shape_analysis.cpp",
281
    "torch/csrc/jit/passes/symbolic_shape_cache.cpp",
282
    "torch/csrc/jit/passes/symbolic_shape_runtime_fusion.cpp",
283
    "torch/csrc/jit/passes/specialize_autogradzero.cpp",
284
    "torch/csrc/jit/passes/update_differentiable_graph_requires_grad.cpp",
285
    "torch/csrc/jit/passes/variadic_ops.cpp",
286
    "torch/csrc/jit/passes/subgraph_rewrite.cpp",
287
    "torch/csrc/jit/passes/tensorexpr_fuser.cpp",
288
    "torch/csrc/jit/passes/utils/memory_dag.cpp",
289
    "torch/csrc/jit/passes/utils/subgraph_utils.cpp",
290
    "torch/csrc/jit/passes/utils/optimization_utils.cpp",
291
    "torch/csrc/jit/passes/utils/op_registry.cpp",
292
    "torch/csrc/jit/passes/mkldnn_rewrite.cpp",
293
    "torch/csrc/jit/passes/xnnpack_rewrite.cpp",
294
    "torch/csrc/jit/passes/vulkan_rewrite.cpp",
295
    "torch/csrc/jit/passes/metal_rewrite.cpp",
296
    "torch/csrc/jit/passes/quantization/helper.cpp",
297
    "torch/csrc/jit/passes/quantization/quantization_type.cpp",
298
    "torch/csrc/jit/passes/quantization/insert_observers.cpp",
299
    "torch/csrc/jit/passes/quantization/insert_quant_dequant.cpp",
300
    "torch/csrc/jit/passes/quantization/dedup_module_uses.cpp",
301
    "torch/csrc/jit/passes/quantization/finalize.cpp",
302
    "torch/csrc/jit/passes/quantization/fusion_passes.cpp",
303
    "torch/csrc/jit/passes/quantization/register_packed_params.cpp",
304
    "torch/csrc/jit/python/update_graph_executor_opt.cpp",
305
    "torch/csrc/jit/python/utf8_decoding_ignore.cpp",
306
    "torch/csrc/jit/runtime/argument_spec.cpp",
307
    "torch/csrc/jit/runtime/autodiff.cpp",
308
    "torch/csrc/jit/runtime/graph_executor.cpp",
309
    "torch/csrc/jit/runtime/interpreter/frame.cpp",
310
    "torch/csrc/jit/runtime/interpreter/preprocess_graph.cpp",
311
    "torch/csrc/jit/runtime/interpreter.cpp",
312
    "torch/csrc/jit/runtime/logging.cpp",
313
    "torch/csrc/jit/runtime/simple_graph_executor_impl.cpp",
314
    "torch/csrc/jit/runtime/profiling_graph_executor_impl.cpp",
315
    "torch/csrc/jit/runtime/profiling_record.cpp",
316
    "torch/csrc/jit/runtime/script_profile.cpp",
317
    "torch/csrc/jit/runtime/symbolic_script.cpp",
318
    "torch/csrc/jit/runtime/symbolic_shape_registry.cpp",
319
    "torch/csrc/jit/runtime/decomposition_registry.cpp",
320
    "torch/csrc/jit/runtime/decomposition_registry_util.cpp",
321
    "torch/csrc/jit/runtime/serialized_shape_function_registry.cpp",
322
    "torch/csrc/jit/runtime/symbolic_shape_registry_util.cpp",
323
    "torch/csrc/jit/runtime/jit_trace.cpp",
324
    "torch/csrc/jit/serialization/callstack_debug_info_serialization.cpp",
325
    "torch/csrc/jit/serialization/import.cpp",
326
    "torch/csrc/jit/serialization/import_export_helpers.cpp",
327
    "torch/csrc/jit/serialization/import_source.cpp",
328
    "torch/csrc/jit/serialization/pickle.cpp",
329
    "torch/csrc/jit/serialization/python_print.cpp",
330
    "torch/csrc/jit/serialization/source_range_serialization.cpp",
331
    "torch/csrc/jit/tensorexpr/block_codegen.cpp",
332
    "torch/csrc/jit/tensorexpr/bounds_inference.cpp",
333
    "torch/csrc/jit/tensorexpr/bounds_overlap.cpp",
334
    "torch/csrc/jit/tensorexpr/codegen.cpp",
335
    "torch/csrc/jit/tensorexpr/cpp_codegen.cpp",
336
    "torch/csrc/jit/tensorexpr/eval.cpp",
337
    "torch/csrc/jit/tensorexpr/expr.cpp",
338
    "torch/csrc/jit/tensorexpr/external_functions_core.cpp",
339
    "torch/csrc/jit/tensorexpr/external_functions_registry.cpp",
340
    "torch/csrc/jit/tensorexpr/graph_opt.cpp",
341
    "torch/csrc/jit/tensorexpr/hash_provider.cpp",
342
    "torch/csrc/jit/tensorexpr/intrinsic_symbols.cpp",
343
    "torch/csrc/jit/tensorexpr/ir.cpp",
344
    "torch/csrc/jit/tensorexpr/ir_cloner.cpp",
345
    "torch/csrc/jit/tensorexpr/ir_mutator.cpp",
346
    "torch/csrc/jit/tensorexpr/ir_printer.cpp",
347
    "torch/csrc/jit/tensorexpr/ir_simplifier.cpp",
348
    "torch/csrc/jit/tensorexpr/ir_verifier.cpp",
349
    "torch/csrc/jit/tensorexpr/ir_visitor.cpp",
350
    "torch/csrc/jit/tensorexpr/kernel.cpp",
351
    "torch/csrc/jit/tensorexpr/llvm_codegen.cpp",
352
    "torch/csrc/jit/tensorexpr/llvm_jit.cpp",
353
    "torch/csrc/jit/tensorexpr/loopnest.cpp",
354
    "torch/csrc/jit/tensorexpr/loopnest_randomization.cpp",
355
    "torch/csrc/jit/tensorexpr/lowerings.cpp",
356
    "torch/csrc/jit/tensorexpr/mem_dependency_checker.cpp",
357
    "torch/csrc/jit/tensorexpr/operators/conv2d.cpp",
358
    "torch/csrc/jit/tensorexpr/operators/matmul.cpp",
359
    "torch/csrc/jit/tensorexpr/operators/misc.cpp",
360
    "torch/csrc/jit/tensorexpr/operators/norm.cpp",
361
    "torch/csrc/jit/tensorexpr/operators/pointwise.cpp",
362
    "torch/csrc/jit/tensorexpr/operators/quantization.cpp",
363
    "torch/csrc/jit/tensorexpr/operators/reduction.cpp",
364
    "torch/csrc/jit/tensorexpr/operators/softmax.cpp",
365
    "torch/csrc/jit/tensorexpr/reduction.cpp",
366
    "torch/csrc/jit/tensorexpr/registerizer.cpp",
367
    "torch/csrc/jit/tensorexpr/tensor.cpp",
368
    "torch/csrc/jit/tensorexpr/types.cpp",
369
    "torch/csrc/jit/tensorexpr/unique_name_manager.cpp",
370
    "torch/csrc/jit/testing/file_check.cpp",
371
    "torch/csrc/profiler/unwind/unwind.cpp",
372
    "torch/csrc/profiler/unwind/unwind_fb.cpp",
373
    "torch/csrc/profiler/combined_traceback.cpp",
374
    "torch/csrc/jit/testing/hooks_for_testing.cpp",
375
    "torch/csrc/utils/cpp_stacktraces.cpp",
376
    "torch/csrc/utils/schema_info.cpp",
377
    "torch/csrc/utils/tensor_flatten.cpp",
378
    "torch/csrc/utils/variadic.cpp",
379
]
380

381
core_sources_full_mobile_no_backend_interface = core_sources_full_mobile_no_backend_interface_xplat + [
382
    # backend_debug_info.cpp provides
383
    # __torch__.torch.classes.backend.BackendDebugInfo class
384
    # This should not be needed eventually.
385
    # TODO: Remove this dependency
386
    "torch/csrc/jit/backends/backend_debug_info.cpp",
387
    "torch/csrc/jit/mobile/compatibility/model_compatibility.cpp",
388
    "torch/csrc/jit/mobile/function.cpp",
389
    "torch/csrc/jit/mobile/import.cpp",
390
    "torch/csrc/jit/mobile/flatbuffer_loader.cpp",
391
    "torch/csrc/jit/mobile/interpreter.cpp",
392
    "torch/csrc/jit/mobile/module.cpp",
393
    "torch/csrc/jit/mobile/observer.cpp",
394
    "torch/csrc/jit/mobile/parse_bytecode.cpp",
395
    "torch/csrc/jit/mobile/parse_operators.cpp",
396
    "torch/csrc/jit/mobile/quantization.cpp",
397
    "torch/csrc/jit/mobile/upgrader_mobile.cpp",
398
]
399

400

401
core_sources_full_mobile = core_sources_full_mobile_no_backend_interface + [
402
    "torch/csrc/jit/backends/backend_debug_info.cpp",
403
    "torch/csrc/jit/backends/backend_interface.cpp",
404
]
405

406
core_sources_full = core_sources_full_mobile + [
407
    "torch/csrc/jit/runtime/static/fusion.cpp",
408
    "torch/csrc/jit/runtime/static/generated_ops.cpp",
409
    "torch/csrc/jit/runtime/static/impl.cpp",
410
    "torch/csrc/jit/runtime/static/memory_planner.cpp",
411
    "torch/csrc/jit/runtime/static/native_ops.cpp",
412
    "torch/csrc/jit/runtime/static/ops.cpp",
413
    "torch/csrc/jit/runtime/static/passes.cpp",
414
    "torch/csrc/jit/runtime/static/te_wrapper.cpp",
415
    "torch/csrc/jit/tensorexpr/external_functions.cpp",
416
    "torch/csrc/jit/tensorexpr/external_functions_codegen.cpp",
417
]
418

419
lazy_tensor_core_sources = [
420
    "torch/csrc/lazy/backend/backend_device.cpp",
421
    "torch/csrc/lazy/backend/backend_interface.cpp",
422
    "torch/csrc/lazy/backend/lowering_context.cpp",
423
    "torch/csrc/lazy/core/config.cpp",
424
    "torch/csrc/lazy/core/debug_util.cpp",
425
    "torch/csrc/lazy/core/hash.cpp",
426
    "torch/csrc/lazy/core/helpers.cpp",
427
    "torch/csrc/lazy/core/ir.cpp",
428
    "torch/csrc/lazy/core/ir_dump_util.cpp",
429
    "torch/csrc/lazy/core/ir_metadata.cpp",
430
    "torch/csrc/lazy/core/ir_util.cpp",
431
    "torch/csrc/lazy/core/lazy_graph_executor.cpp",
432
    "torch/csrc/lazy/core/metrics.cpp",
433
    "torch/csrc/lazy/core/multi_wait.cpp",
434
    "torch/csrc/lazy/core/ops/arithmetic_ir_ops.cpp",
435
    "torch/csrc/lazy/core/ops/utils.cpp",
436
    "torch/csrc/lazy/core/permutation_util.cpp",
437
    "torch/csrc/lazy/core/shape.cpp",
438
    "torch/csrc/lazy/core/shape_inference.cpp",
439
    "torch/csrc/lazy/core/tensor.cpp",
440
    "torch/csrc/lazy/core/tensor_impl.cpp",
441
    "torch/csrc/lazy/core/tensor_util.cpp",
442
    "torch/csrc/lazy/core/thread_pool.cpp",
443
    "torch/csrc/lazy/core/trie.cpp",
444
]
445

446
# We can't build all of the ts backend under certain build configurations, e.g. mobile,
447
# since it depends on things like autograd, meta functions, which may be disabled
448
lazy_tensor_ts_sources = [
449
    "torch/csrc/lazy/ts_backend/dynamic_ir.cpp",
450
    "torch/csrc/lazy/ts_backend/config.cpp",
451
    "torch/csrc/lazy/ts_backend/ops/device_data.cpp",
452
    "torch/csrc/lazy/ts_backend/ops/generic.cpp",
453
    "torch/csrc/lazy/ts_backend/tensor_aten_ops.cpp",
454
    "torch/csrc/lazy/ts_backend/ts_autograd_functions.cpp",
455
    "torch/csrc/lazy/ts_backend/ts_backend_impl.cpp",
456
    "torch/csrc/lazy/ts_backend/ts_eager_fallback.cpp",
457
    "torch/csrc/lazy/ts_backend/ts_lowering_context.cpp",
458
    "torch/csrc/lazy/ts_backend/ts_native_functions.cpp",
459
    "torch/csrc/lazy/ts_backend/ts_node.cpp",
460
    "torch/csrc/lazy/ts_backend/ts_node_lowering.cpp",
461
]
462

463
lazy_tensor_core_python_sources = [
464
    "torch/csrc/lazy/python/init.cpp",
465
    "torch/csrc/lazy/python/python_util.cpp",
466
]
467

468
inductor_core_resources = [
469
    "torch/csrc/inductor/aoti_runner/model_container_runner.cpp",
470
    "torch/csrc/inductor/aoti_runner/model_container_runner_cpu.cpp",
471
    "torch/csrc/inductor/aoti_torch/shim_common.cpp",
472
    "torch/csrc/inductor/aoti_torch/tensor_converter.cpp",
473
    "torch/csrc/inductor/inductor_ops.cpp",
474
]
475

476
libtorch_core_sources = sorted(
477
    core_sources_common +
478
    torch_unpickler_common +
479
    core_sources_full +
480
    core_trainer_sources +
481
    inductor_core_resources +
482
    libtorch_profiler_sources +
483
    lazy_tensor_core_sources,
484
)
485

486
# These files are the only ones that are supported on Windows.
487
libtorch_distributed_base_sources = [
488
    "torch/csrc/distributed/c10d/Backend.cpp",
489
    "torch/csrc/distributed/c10d/FileStore.cpp",
490
    "torch/csrc/distributed/c10d/Functional.cpp",
491
    "torch/csrc/distributed/c10d/GlooDeviceFactory.cpp",
492
    "torch/csrc/distributed/c10d/GroupRegistry.cpp",
493
    "torch/csrc/distributed/c10d/Ops.cpp",
494
    "torch/csrc/distributed/c10d/ParamCommsUtils.cpp",
495
    "torch/csrc/distributed/c10d/PrefixStore.cpp",
496
    "torch/csrc/distributed/c10d/ProcessGroup.cpp",
497
    "torch/csrc/distributed/c10d/ProcessGroupGloo.cpp",
498
    "torch/csrc/distributed/c10d/ProcessGroupMPI.cpp",
499
    "torch/csrc/distributed/c10d/ProcessGroupWrapper.cpp",
500
    "torch/csrc/distributed/c10d/Store.cpp",
501
    "torch/csrc/distributed/c10d/TCPStore.cpp",
502
    "torch/csrc/distributed/c10d/TCPStoreBackend.cpp",
503
    "torch/csrc/distributed/c10d/TCPStoreLibUvBackend.cpp",
504
    "torch/csrc/distributed/c10d/Utils.cpp",
505
    "torch/csrc/distributed/c10d/comm.cpp",
506
    "torch/csrc/distributed/c10d/debug.cpp",
507
    "torch/csrc/distributed/c10d/default_comm_hooks.cpp",
508
    "torch/csrc/distributed/c10d/logger.cpp",
509
    "torch/csrc/distributed/c10d/logging.cpp",
510
    "torch/csrc/distributed/c10d/quantization/quantization.cpp",
511
    "torch/csrc/distributed/c10d/reducer.cpp",
512
    "torch/csrc/distributed/c10d/sequence_num.cpp",
513
    "torch/csrc/distributed/c10d/socket.cpp",
514
    "torch/csrc/distributed/c10d/Work.cpp",
515
]
516

517
# These files are only supported on Linux (and others) but not on Windows.
518
libtorch_distributed_extra_sources = [
519
    "torch/csrc/distributed/autograd/autograd.cpp",
520
    "torch/csrc/distributed/autograd/utils.cpp",
521
    "torch/csrc/distributed/autograd/context/container.cpp",
522
    "torch/csrc/distributed/autograd/context/context.cpp",
523
    "torch/csrc/distributed/autograd/engine/dist_engine.cpp",
524
    "torch/csrc/distributed/autograd/functions/recvrpc_backward.cpp",
525
    "torch/csrc/distributed/autograd/functions/sendrpc_backward.cpp",
526
    "torch/csrc/distributed/autograd/rpc_messages/autograd_metadata.cpp",
527
    "torch/csrc/distributed/autograd/rpc_messages/propagate_gradients_req.cpp",
528
    "torch/csrc/distributed/autograd/rpc_messages/propagate_gradients_resp.cpp",
529
    "torch/csrc/distributed/autograd/rpc_messages/cleanup_autograd_context_req.cpp",
530
    "torch/csrc/distributed/autograd/rpc_messages/cleanup_autograd_context_resp.cpp",
531
    "torch/csrc/distributed/autograd/rpc_messages/rpc_with_autograd.cpp",
532
    "torch/csrc/distributed/autograd/rpc_messages/rpc_with_profiling_req.cpp",
533
    "torch/csrc/distributed/autograd/rpc_messages/rpc_with_profiling_resp.cpp",
534
    "torch/csrc/distributed/autograd/rpc_messages/rref_backward_req.cpp",
535
    "torch/csrc/distributed/autograd/rpc_messages/rref_backward_resp.cpp",
536
    "torch/csrc/distributed/c10d/HashStore.cpp",
537
    "torch/csrc/distributed/c10d/ProcessGroupRoundRobin.cpp",
538
    "torch/csrc/distributed/rpc/agent_utils.cpp",
539
    "torch/csrc/distributed/rpc/message.cpp",
540
    "torch/csrc/distributed/rpc/profiler/remote_profiler_manager.cpp",
541
    "torch/csrc/distributed/rpc/profiler/server_process_global_profiler.cpp",
542
    "torch/csrc/distributed/rpc/python_call.cpp",
543
    "torch/csrc/distributed/rpc/python_remote_call.cpp",
544
    "torch/csrc/distributed/rpc/python_resp.cpp",
545
    "torch/csrc/distributed/rpc/request_callback.cpp",
546
    "torch/csrc/distributed/rpc/request_callback_no_python.cpp",
547
    "torch/csrc/distributed/rpc/rpc_agent.cpp",
548
    "torch/csrc/distributed/rpc/rref_context.cpp",
549
    "torch/csrc/distributed/rpc/rref_impl.cpp",
550
    "torch/csrc/distributed/rpc/rref_proto.cpp",
551
    "torch/csrc/distributed/rpc/script_call.cpp",
552
    "torch/csrc/distributed/rpc/script_remote_call.cpp",
553
    "torch/csrc/distributed/rpc/script_resp.cpp",
554
    "torch/csrc/distributed/rpc/tensorpipe_agent.cpp",
555
    "torch/csrc/distributed/rpc/tensorpipe_utils.cpp",
556
    "torch/csrc/distributed/rpc/testing/faulty_tensorpipe_agent.cpp",
557
    "torch/csrc/distributed/rpc/torchscript_functions.cpp",
558
    "torch/csrc/distributed/rpc/types.cpp",
559
    "torch/csrc/distributed/rpc/utils.cpp",
560
]
561

562
libtorch_distributed_sources = libtorch_distributed_base_sources + libtorch_distributed_extra_sources
563

564
jit_sources_full = [
565
    "torch/csrc/jit/codegen/cuda/interface.cpp",
566
    "torch/csrc/jit/passes/lower_graph.cpp",
567
    "torch/csrc/jit/runtime/register_c10_ops.cpp",
568
    "torch/csrc/jit/runtime/register_prim_ops.cpp",
569
    "torch/csrc/jit/runtime/register_prim_ops_fulljit.cpp",
570
    "torch/csrc/jit/runtime/register_special_ops.cpp",
571
    "torch/csrc/jit/passes/remove_inplace_ops.cpp",
572
    "torch/csrc/jit/passes/utils/check_alias_annotation.cpp",
573
    "torch/csrc/jit/passes/autocast.cpp",
574
]
575

576
libtorch_core_jit_sources = sorted(jit_sources_full)
577

578
torch_mobile_tracer_sources = [
579
    "torch/csrc/jit/mobile/model_tracer/tracer.cpp",
580
    "torch/csrc/jit/mobile/model_tracer/TensorUtils.cpp",
581
    "torch/csrc/jit/mobile/model_tracer/TracerRunner.cpp",
582
    "torch/csrc/jit/mobile/model_tracer/MobileModelRunner.cpp",
583
    "torch/csrc/jit/mobile/model_tracer/OperatorCallTracer.cpp",
584
    "torch/csrc/jit/mobile/model_tracer/KernelDTypeTracer.cpp",
585
    "torch/csrc/jit/mobile/model_tracer/CustomClassTracer.cpp",
586
    "torch/csrc/jit/mobile/model_tracer/BuildFeatureTracer.cpp",
587
]
588

589
libtorch_lite_eager_symbolication = [
590
    "torch/csrc/jit/frontend/source_range.cpp",
591
    "torch/csrc/jit/ir/scope.cpp",
592
    "torch/csrc/jit/mobile/debug_info.cpp",
593
    "torch/csrc/jit/serialization/callstack_debug_info_serialization.cpp",
594
    "torch/csrc/jit/serialization/source_range_serialization.cpp",
595
    # Later we can split serialization and deserialization logic
596
    # to have better separation within build and only build relevant parts.
597
    "torch/csrc/jit/serialization/pickle.cpp",
598
    "torch/csrc/jit/serialization/pickler.cpp",
599
    "torch/csrc/jit/serialization/unpickler.cpp",
600
]
601

602
# TODO: core_trainer_sources is not necessary for libtorch lite
603
libtorch_lite_cmake_sources = sorted(
604
    core_trainer_sources +
605
    core_sources_common +
606
    torch_unpickler_common +
607
    torch_mobile_core,
608
)
609

610
libtorch_cmake_sources = libtorch_core_sources + libtorch_core_jit_sources
611

612
libtorch_extra_sources = libtorch_core_jit_sources + [
613
    "torch/csrc/autograd/TraceTypeManual.cpp",
614
    "torch/csrc/autograd/VariableTypeManual.cpp",
615
    "torch/csrc/autograd/FunctionsManual.cpp",
616
    "torch/csrc/jit/api/module_save.cpp",
617
    "torch/csrc/jit/codegen/fuser/cpu/fused_kernel.cpp",
618
    "torch/csrc/jit/mobile/compatibility/backport.cpp",
619
    "torch/csrc/jit/mobile/compatibility/backport_manager.cpp",
620
    "torch/csrc/jit/mobile/compatibility/model_compatibility.cpp",
621
    # To be included for eager symbolication in lite interpreter
622
    # when it is built in libtorch
623
    "torch/csrc/jit/mobile/debug_info.cpp",
624
    "torch/csrc/jit/mobile/function.cpp",
625
    "torch/csrc/jit/mobile/flatbuffer_loader.cpp",
626
    "torch/csrc/jit/mobile/import.cpp",
627
    "torch/csrc/jit/mobile/import_data.cpp",
628
    "torch/csrc/jit/mobile/interpreter.cpp",
629
    "torch/csrc/jit/mobile/module.cpp",
630
    "torch/csrc/jit/mobile/observer.cpp",
631
    "torch/csrc/jit/mobile/parse_bytecode.cpp",
632
    "torch/csrc/jit/mobile/parse_operators.cpp",
633
    "torch/csrc/jit/mobile/quantization.cpp",
634
    "torch/csrc/jit/mobile/train/export_data.cpp",
635
    "torch/csrc/jit/mobile/train/optim/sgd.cpp",
636
    "torch/csrc/jit/mobile/train/random.cpp",
637
    "torch/csrc/jit/mobile/train/sequential.cpp",
638
    "torch/csrc/jit/mobile/upgrader_mobile.cpp",
639
    "torch/csrc/jit/serialization/onnx.cpp",
640
    "torch/csrc/jit/serialization/export.cpp",
641
    "torch/csrc/jit/serialization/export_bytecode.cpp",
642
    "torch/csrc/jit/serialization/export_module.cpp",
643
    "torch/csrc/jit/serialization/flatbuffer_serializer.cpp",
644
    "torch/csrc/jit/serialization/import_legacy.cpp",
645
    "torch/csrc/utils/byte_order.cpp",
646
    "torch/csrc/utils/out_types.cpp",
647
]
648

649
def libtorch_sources(gencode_pattern = ":generate-code[{}]"):
650
    return (
651
        libtorch_generated_sources(gencode_pattern) + libtorch_core_sources + libtorch_distributed_sources + libtorch_extra_sources
652
    )
653

654
libtorch_cuda_core_sources = [
655
    "torch/csrc/CudaIPCTypes.cpp",
656
    "torch/csrc/cuda/comm.cpp",
657
    "torch/csrc/cuda/memory_snapshot.cpp",
658
    "torch/csrc/inductor/aoti_runner/model_container_runner_cuda.cpp",
659
    "torch/csrc/inductor/aoti_torch/shim_cuda.cpp",
660
    "torch/csrc/jit/codegen/fuser/cuda/fused_kernel.cpp",
661
    "torch/csrc/profiler/stubs/cuda.cpp",
662
    "torch/csrc/autograd/functions/comm.cpp",
663
    "torch/csrc/jit/passes/frozen_conv_add_relu_fusion_cuda.cpp",
664
    "torch/csrc/jit/tensorexpr/cuda_codegen.cpp",
665
    "torch/csrc/jit/runtime/register_cuda_ops.cpp",
666
]
667

668
# These files are the only ones that are supported on Windows.
669
libtorch_cuda_distributed_base_sources = [
670
    "torch/csrc/distributed/c10d/reducer_cuda.cpp",
671
]
672

673
# These files are only supported on Linux (and others) but not on Windows.
674
libtorch_cuda_distributed_extra_sources = [
675
    "torch/csrc/distributed/c10d/NCCLUtils.cpp",
676
    "torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp",
677
    "torch/csrc/distributed/c10d/ProcessGroupUCC.cpp",
678
    "torch/csrc/distributed/c10d/UCCTracing.cpp",
679
    "torch/csrc/distributed/c10d/UCCUtils.cpp",
680
    "torch/csrc/distributed/c10d/intra_node_comm.cpp",
681
    "torch/csrc/distributed/c10d/intra_node_comm.cu",
682
    "torch/csrc/distributed/rpc/tensorpipe_cuda.cpp",
683
    "torch/csrc/distributed/c10d/quantization/quantization_gpu.cu",
684
]
685

686
libtorch_cuda_distributed_sources = libtorch_cuda_distributed_base_sources + libtorch_cuda_distributed_extra_sources
687

688
libtorch_cuda_sources = libtorch_cuda_core_sources + libtorch_cuda_distributed_sources + [
689
    "torch/csrc/cuda/nccl.cpp",
690
]
691

692
torch_cpp_srcs = [
693
    "torch/csrc/api/src/cuda.cpp",  # this just forwards stuff, no real CUDA
694
    "torch/csrc/api/src/data/datasets/mnist.cpp",
695
    "torch/csrc/api/src/data/samplers/distributed.cpp",
696
    "torch/csrc/api/src/data/samplers/random.cpp",
697
    "torch/csrc/api/src/data/samplers/sequential.cpp",
698
    "torch/csrc/api/src/data/samplers/stream.cpp",
699
    "torch/csrc/api/src/enum.cpp",
700
    "torch/csrc/api/src/imethod.cpp",
701
    "torch/csrc/api/src/jit.cpp",
702
    "torch/csrc/api/src/mps.cpp",
703
    "torch/csrc/api/src/serialize.cpp",
704
    "torch/csrc/api/src/nn/init.cpp",
705
    "torch/csrc/api/src/nn/module.cpp",
706
    "torch/csrc/api/src/nn/modules/_functions.cpp",
707
    "torch/csrc/api/src/nn/modules/activation.cpp",
708
    "torch/csrc/api/src/nn/modules/adaptive.cpp",
709
    "torch/csrc/api/src/nn/modules/batchnorm.cpp",
710
    "torch/csrc/api/src/nn/modules/normalization.cpp",
711
    "torch/csrc/api/src/nn/modules/instancenorm.cpp",
712
    "torch/csrc/api/src/nn/modules/conv.cpp",
713
    "torch/csrc/api/src/nn/modules/dropout.cpp",
714
    "torch/csrc/api/src/nn/modules/distance.cpp",
715
    "torch/csrc/api/src/nn/modules/embedding.cpp",
716
    "torch/csrc/api/src/nn/modules/fold.cpp",
717
    "torch/csrc/api/src/nn/modules/linear.cpp",
718
    "torch/csrc/api/src/nn/modules/loss.cpp",
719
    "torch/csrc/api/src/nn/modules/padding.cpp",
720
    "torch/csrc/api/src/nn/modules/pixelshuffle.cpp",
721
    "torch/csrc/api/src/nn/modules/pooling.cpp",
722
    "torch/csrc/api/src/nn/modules/rnn.cpp",
723
    "torch/csrc/api/src/nn/modules/upsampling.cpp",
724
    "torch/csrc/api/src/nn/modules/transformer.cpp",
725
    "torch/csrc/api/src/nn/modules/container/functional.cpp",
726
    "torch/csrc/api/src/nn/options/activation.cpp",
727
    "torch/csrc/api/src/nn/options/adaptive.cpp",
728
    "torch/csrc/api/src/nn/options/batchnorm.cpp",
729
    "torch/csrc/api/src/nn/options/conv.cpp",
730
    "torch/csrc/api/src/nn/options/dropout.cpp",
731
    "torch/csrc/api/src/nn/options/instancenorm.cpp",
732
    "torch/csrc/api/src/nn/options/linear.cpp",
733
    "torch/csrc/api/src/nn/options/normalization.cpp",
734
    "torch/csrc/api/src/nn/options/embedding.cpp",
735
    "torch/csrc/api/src/nn/options/padding.cpp",
736
    "torch/csrc/api/src/nn/options/pooling.cpp",
737
    "torch/csrc/api/src/nn/options/rnn.cpp",
738
    "torch/csrc/api/src/nn/options/vision.cpp",
739
    "torch/csrc/api/src/nn/options/transformer.cpp",
740
    "torch/csrc/api/src/optim/adagrad.cpp",
741
    "torch/csrc/api/src/optim/adam.cpp",
742
    "torch/csrc/api/src/optim/adamw.cpp",
743
    "torch/csrc/api/src/optim/lbfgs.cpp",
744
    "torch/csrc/api/src/optim/optimizer.cpp",
745
    "torch/csrc/api/src/optim/rmsprop.cpp",
746
    "torch/csrc/api/src/optim/serialize.cpp",
747
    "torch/csrc/api/src/optim/sgd.cpp",
748
    "torch/csrc/api/src/optim/schedulers/lr_scheduler.cpp",
749
    "torch/csrc/api/src/optim/schedulers/step_lr.cpp",
750
    "torch/csrc/api/src/serialize/input-archive.cpp",
751
    "torch/csrc/api/src/serialize/output-archive.cpp",
752
    "torch/csrc/api/src/xpu.cpp",
753
]
754

755
libtorch_python_cuda_core_sources = [
756
    "torch/csrc/cuda/Event.cpp",
757
    "torch/csrc/cuda/Module.cpp",
758
    "torch/csrc/cuda/python_comm.cpp",
759
    "torch/csrc/cuda/Stream.cpp",
760
    "torch/csrc/cuda/Graph.cpp",
761
    "torch/csrc/cuda/shared/cudart.cpp",
762
    "torch/csrc/cuda/shared/nvtx.cpp",
763
    "torch/csrc/cuda/utils.cpp",
764
    "torch/csrc/cuda/CUDAPluggableAllocator.cpp",
765
]
766

767
libtorch_python_cuda_sources = libtorch_python_cuda_core_sources + [
768
    "torch/csrc/cuda/python_nccl.cpp",
769
    "torch/csrc/cuda/shared/cudnn.cpp",
770
    "torch/csrc/cuda/Tensor.cpp",
771
]
772

773
libtorch_python_xpu_sources = [
774
    "torch/csrc/xpu/Event.cpp",
775
    "torch/csrc/xpu/Module.cpp",
776
    "torch/csrc/xpu/Stream.cpp",
777
]
778

779
libtorch_python_core_sources = [
780
    "torch/csrc/DataLoader.cpp",
781
    "torch/csrc/Device.cpp",
782
    "torch/csrc/Dtype.cpp",
783
    "torch/csrc/DynamicTypes.cpp",
784
    "torch/csrc/Exceptions.cpp",
785
    "torch/csrc/Generator.cpp",
786
    "torch/csrc/Layout.cpp",
787
    "torch/csrc/MemoryFormat.cpp",
788
    "torch/csrc/QScheme.cpp",
789
    "torch/csrc/Module.cpp",
790
    "torch/csrc/PyInterpreter.cpp",
791
    "torch/csrc/python_dimname.cpp",
792
    "torch/csrc/Size.cpp",
793
    "torch/csrc/Storage.cpp",
794
    "torch/csrc/StorageMethods.cpp",
795
    "torch/csrc/StorageSharing.cpp",
796
    "torch/csrc/Stream.cpp",
797
    "torch/csrc/TypeInfo.cpp",
798
    "torch/csrc/api/src/python/init.cpp",
799
    "torch/csrc/autograd/functions/init.cpp",
800
    "torch/csrc/autograd/init.cpp",
801
    "torch/csrc/autograd/profiler_python.cpp",
802
    "torch/csrc/autograd/python_anomaly_mode.cpp",
803
    "torch/csrc/autograd/python_saved_variable_hooks.cpp",
804
    "torch/csrc/autograd/python_cpp_function.cpp",
805
    "torch/csrc/autograd/python_engine.cpp",
806
    "torch/csrc/autograd/python_function.cpp",
807
    "torch/csrc/autograd/python_hook.cpp",
808
    "torch/csrc/autograd/python_legacy_variable.cpp",
809
    "torch/csrc/autograd/python_nested_functions_manual.cpp",
810
    "torch/csrc/autograd/python_torch_functions_manual.cpp",
811
    "torch/csrc/autograd/python_variable.cpp",
812
    "torch/csrc/autograd/python_variable_indexing.cpp",
813
    "torch/csrc/dynamo/python_compiled_autograd.cpp",
814
    "torch/csrc/dynamo/cache_entry.cpp",
815
    "torch/csrc/dynamo/cpp_shim.cpp",
816
    "torch/csrc/dynamo/cpython_defs.c",
817
    "torch/csrc/dynamo/eval_frame.c",
818
    "torch/csrc/dynamo/extra_state.cpp",
819
    "torch/csrc/dynamo/guards.cpp",
820
    "torch/csrc/dynamo/init.cpp",
821
    "torch/csrc/functorch/init.cpp",
822
    "torch/csrc/mps/Module.cpp",
823
    "torch/csrc/inductor/aoti_runner/pybind.cpp",
824
    "torch/csrc/jit/backends/backend_init.cpp",
825
    "torch/csrc/jit/python/init.cpp",
826
    "torch/csrc/jit/passes/onnx.cpp",
827
    "torch/csrc/jit/passes/onnx/cast_all_constant_to_floating.cpp",
828
    "torch/csrc/jit/passes/onnx/deduplicate_initializers.cpp",
829
    "torch/csrc/jit/passes/onnx/eval_peephole.cpp",
830
    "torch/csrc/jit/passes/onnx/constant_fold.cpp",
831
    "torch/csrc/jit/passes/onnx/constant_map.cpp",
832
    "torch/csrc/jit/passes/onnx/eliminate_unused_items.cpp",
833
    "torch/csrc/jit/passes/onnx/fixup_onnx_controlflow.cpp",
834
    "torch/csrc/jit/passes/onnx/list_model_parameters.cpp",
835
    "torch/csrc/jit/passes/onnx/function_substitution.cpp",
836
    "torch/csrc/jit/passes/onnx/helper.cpp",
837
    "torch/csrc/jit/passes/onnx/peephole.cpp",
838
    "torch/csrc/jit/passes/onnx/preprocess_for_onnx.cpp",
839
    "torch/csrc/jit/passes/onnx/prepare_division_for_onnx.cpp",
840
    "torch/csrc/jit/passes/onnx/scalar_type_analysis.cpp",
841
    "torch/csrc/jit/passes/onnx/unpack_quantized_weights.cpp",
842
    "torch/csrc/jit/passes/onnx/remove_inplace_ops_for_onnx.cpp",
843
    "torch/csrc/jit/passes/onnx/shape_type_inference.cpp",
844
    "torch/csrc/jit/passes/onnx/function_extraction.cpp",
845
    "torch/csrc/jit/passes/onnx/onnx_log.cpp",
846
    "torch/csrc/jit/passes/onnx/naming.cpp",
847
    "torch/csrc/jit/python/pybind_utils.cpp",
848
    "torch/csrc/jit/passes/onnx/pattern_conversion/autograd_function_process.cpp",
849
    "torch/csrc/jit/passes/onnx/pattern_conversion/common.cpp",
850
    "torch/csrc/jit/passes/onnx/pattern_conversion/pattern_encapsulation.cpp",
851
    "torch/csrc/jit/passes/onnx/pattern_conversion/pattern_conversion.cpp",
852
    "torch/csrc/jit/python/python_arg_flatten.cpp",
853
    "torch/csrc/jit/python/python_custom_class.cpp",
854
    "torch/csrc/jit/python/python_dict.cpp",
855
    "torch/csrc/jit/python/python_interpreter.cpp",
856
    "torch/csrc/jit/python/python_ir.cpp",
857
    "torch/csrc/jit/python/python_list.cpp",
858
    "torch/csrc/jit/python/python_tracer.cpp",
859
    "torch/csrc/jit/python/script_init.cpp",
860
    "torch/csrc/jit/frontend/concrete_module_type.cpp",
861
    "torch/csrc/jit/frontend/tree_views.cpp",
862
    "torch/csrc/jit/python/python_sugared_value.cpp",
863
    "torch/csrc/jit/python/python_tree_views.cpp",
864
    "torch/csrc/jit/runtime/static/init.cpp",
865
    "torch/csrc/jit/tensorexpr/tensorexpr_init.cpp",
866
    "torch/csrc/monitor/python_init.cpp",
867
    "torch/csrc/multiprocessing/init.cpp",
868
    "torch/csrc/onnx/init.cpp",
869
    "torch/csrc/profiler/python/init.cpp",
870
    "torch/csrc/profiler/python/combined_traceback.cpp",
871
    "torch/csrc/serialization.cpp",
872
    "torch/csrc/tensor/python_tensor.cpp",
873
    "torch/csrc/utils/init.cpp",
874
    "torch/csrc/utils/throughput_benchmark.cpp",
875
    "torch/csrc/utils.cpp",
876
    "torch/csrc/utils/device_lazy_init.cpp",
877
    "torch/csrc/utils/invalid_arguments.cpp",
878
    "torch/csrc/utils/nested.cpp",
879
    "torch/csrc/utils/object_ptr.cpp",
880
    "torch/csrc/utils/python_arg_parser.cpp",
881
    "torch/csrc/utils/python_dispatch.cpp",
882
    "torch/csrc/utils/python_symnode.cpp",
883
    "torch/csrc/utils/pybind.cpp",
884
    "torch/csrc/utils/pyobject_preservation.cpp",
885
    "torch/csrc/utils/structseq.cpp",
886
    "torch/csrc/utils/tensor_apply.cpp",
887
    "torch/csrc/utils/tensor_dtypes.cpp",
888
    "torch/csrc/utils/tensor_layouts.cpp",
889
    "torch/csrc/utils/tensor_memoryformats.cpp",
890
    "torch/csrc/utils/tensor_qschemes.cpp",
891
    "torch/csrc/utils/tensor_list.cpp",
892
    "torch/csrc/utils/tensor_new.cpp",
893
    "torch/csrc/utils/tensor_numpy.cpp",
894
    "torch/csrc/utils/tensor_types.cpp",
895
    "torch/csrc/utils/disable_torch_function.cpp",
896
    "torch/csrc/utils/verbose.cpp",
897
    "torch/csrc/cpu/Module.cpp",
898
] + lazy_tensor_core_python_sources
899

900
libtorch_python_distributed_core_sources = [
901
    "torch/csrc/distributed/c10d/init.cpp",
902
    "torch/csrc/distributed/c10d/python_comm_hook.cpp",
903
]
904

905
libtorch_python_distributed_sources = libtorch_python_distributed_core_sources + [
906
    "torch/csrc/distributed/autograd/init.cpp",
907
    "torch/csrc/distributed/rpc/init.cpp",
908
    "torch/csrc/distributed/rpc/py_rref.cpp",
909
    "torch/csrc/distributed/rpc/python_functions.cpp",
910
    "torch/csrc/distributed/rpc/python_rpc_handler.cpp",
911
    "torch/csrc/distributed/rpc/request_callback_impl.cpp",
912
    "torch/csrc/distributed/rpc/testing/init.cpp",
913
    "torch/csrc/distributed/rpc/unpickled_python_call.cpp",
914
    "torch/csrc/distributed/rpc/unpickled_python_remote_call.cpp",
915
    "torch/csrc/jit/runtime/register_distributed_ops.cpp",
916
]
917

918
def glob_libtorch_python_sources(gencode_pattern = ":generate-code[{}]"):
919
    _libtorch_python_sources = [gencode_pattern.format(name) for name in [
920
        "torch/csrc/autograd/generated/python_functions_0.cpp",
921
        "torch/csrc/autograd/generated/python_functions_1.cpp",
922
        "torch/csrc/autograd/generated/python_functions_2.cpp",
923
        "torch/csrc/autograd/generated/python_functions_3.cpp",
924
        "torch/csrc/autograd/generated/python_functions_4.cpp",
925
        "torch/csrc/autograd/generated/python_nested_functions.cpp",
926
        "torch/csrc/autograd/generated/python_nn_functions.cpp",
927
        "torch/csrc/autograd/generated/python_fft_functions.cpp",
928
        "torch/csrc/autograd/generated/python_linalg_functions.cpp",
929
        "torch/csrc/autograd/generated/python_enum_tag.cpp",
930
        "torch/csrc/autograd/generated/python_return_types.cpp",
931
        "torch/csrc/autograd/generated/python_sparse_functions.cpp",
932
        "torch/csrc/autograd/generated/python_special_functions.cpp",
933
        "torch/csrc/autograd/generated/python_torch_functions_0.cpp",
934
        "torch/csrc/autograd/generated/python_torch_functions_1.cpp",
935
        "torch/csrc/autograd/generated/python_torch_functions_2.cpp",
936
        "torch/csrc/autograd/generated/python_variable_methods.cpp",
937
    ]]
938

939
    _libtorch_python_sources.extend(libtorch_python_core_sources)
940
    _libtorch_python_sources.extend(libtorch_python_distributed_sources)
941

942
    return _libtorch_python_sources
943

944
# List of non-globed source used to build ATen core internally
945
aten_cpu_non_globed_sources = [
946
    "aten/src/ATen/detail/CUDAHooksInterface.cpp",
947
    "aten/src/ATen/detail/HIPHooksInterface.cpp",
948
    "aten/src/ATen/detail/MPSHooksInterface.cpp",
949
    "aten/src/ATen/detail/ORTHooksInterface.cpp",
950
    "aten/src/ATen/detail/PrivateUse1HooksInterface.cpp",
951
    "aten/src/ATen/detail/XPUHooksInterface.cpp",
952
    "aten/src/ATen/detail/MTIAHooksInterface.cpp",
953
    "aten/src/ATen/detail/IPUHooksInterface.cpp",
954
    "aten/src/ATen/record_function.cpp",
955
    "aten/src/ATen/Dispatch.cpp",
956
    "aten/src/ATen/SequenceNumber.cpp",
957
]
958

959
aten_cpu_non_globed_headers = [
960
    "aten/src/ATen/CPUGeneratorImpl.h",
961
    "aten/src/ATen/NumericUtils.h",
962
    "aten/src/ATen/detail/AcceleratorHooksInterface.h",
963
    "aten/src/ATen/detail/CUDAHooksInterface.h",
964
    "aten/src/ATen/detail/MPSHooksInterface.h",
965
    "aten/src/ATen/detail/HIPHooksInterface.h",
966
    "aten/src/ATen/detail/ORTHooksInterface.h",
967
    "aten/src/ATen/detail/PrivateUse1HooksInterface.h",
968
    "aten/src/ATen/detail/XPUHooksInterface.h",
969
    "aten/src/ATen/detail/MTIAHooksInterface.h",
970
    "aten/src/ATen/detail/IPUHooksInterface.h",
971
]
972

973
aten_cpu_source_non_codegen_list = [
974
    "aten/src/ATen/AccumulateType.cpp",
975
    "aten/src/ATen/LegacyBatchedTensorImpl.cpp",
976
    "aten/src/ATen/CPUGeneratorImpl.cpp",
977
    "aten/src/ATen/DeviceAccelerator.cpp",
978
    "aten/src/ATen/Context.cpp",
979
    "aten/src/ATen/DLConvertor.cpp",
980
    "aten/src/ATen/EmptyTensor.cpp",
981
    "aten/src/ATen/ExpandUtils.cpp",
982
    "aten/src/ATen/CachedTensorUtils.cpp",
983
    "aten/src/ATen/FunctionalInverses.cpp",
984
    "aten/src/ATen/FunctionalStorageImpl.cpp",
985
    "aten/src/ATen/FunctionalTensorWrapper.cpp",
986
    "aten/src/ATen/FunctionalizeFallbackKernel.cpp",
987
    "aten/src/ATen/MemoryOverlap.cpp",
988
    "aten/src/ATen/MapAllocator.cpp",
989
    "aten/src/ATen/NamedTensorUtils.cpp",
990
    "aten/src/ATen/NestedTensorImpl.cpp",
991
    "aten/src/ATen/ParallelCommon.cpp",
992
    "aten/src/ATen/ParallelNative.cpp",
993
    "aten/src/ATen/ParallelNativeTBB.cpp",
994
    "aten/src/ATen/ParallelOpenMP.cpp",
995
    "aten/src/ATen/ParallelThreadPoolNative.cpp",
996
    "aten/src/ATen/PythonTorchFunctionTLS.cpp",
997
    "aten/src/ATen/ThreadLocalPythonObjects.cpp",
998
    "aten/src/ATen/ScalarOps.cpp",
999
    "aten/src/ATen/SparseTensorImpl.cpp",
1000
    "aten/src/ATen/SparseCsrTensorImpl.cpp",
1001
    "aten/src/ATen/TensorGeometry.cpp",
1002
    "aten/src/ATen/TensorIndexing.cpp",
1003
    "aten/src/ATen/TensorMeta.cpp",
1004
    "aten/src/ATen/TensorNames.cpp",
1005
    "aten/src/ATen/TensorUtils.cpp",
1006
    "aten/src/ATen/ThreadLocalState.cpp",
1007
    "aten/src/ATen/FuncTorchTLS.cpp",
1008
    "aten/src/ATen/Utils.cpp",
1009
    "aten/src/ATen/Version.cpp",
1010
    "aten/src/ATen/LegacyVmapMode.cpp",
1011
    "aten/src/ATen/LegacyVmapTransforms.cpp",
1012
    "aten/src/ATen/core/BackendSelectFallbackKernel.cpp",
1013
    "aten/src/ATen/core/DeprecatedTypeProperties.cpp",
1014
    "aten/src/ATen/core/DeprecatedTypePropertiesRegistry.cpp",
1015
    "aten/src/ATen/core/Dict.cpp",
1016
    "aten/src/ATen/core/Dimname.cpp",
1017
    "aten/src/ATen/core/Formatting.cpp",
1018
    "aten/src/ATen/core/function_schema.cpp",
1019
    "aten/src/ATen/core/Generator.cpp",
1020
    "aten/src/ATen/core/PythonOpRegistrationTrampoline.cpp",
1021
    "aten/src/ATen/core/List.cpp",
1022
    "aten/src/ATen/core/NamedTensor.cpp",
1023
    "aten/src/ATen/core/Tensor.cpp",
1024
    "aten/src/ATen/core/VariableFallbackKernel.cpp",
1025
    "aten/src/ATen/core/VariableHooksInterface.cpp",
1026
    "aten/src/ATen/core/Vitals.cpp",
1027
    "aten/src/ATen/core/boxing/KernelFunction.cpp",
1028
    "aten/src/ATen/core/custom_class.cpp",
1029
    "aten/src/ATen/core/dispatch/DispatchKeyExtractor.cpp",
1030
    "aten/src/ATen/core/dispatch/Dispatcher.cpp",
1031
    "aten/src/ATen/core/dispatch/ObservedOperators.cpp",
1032
    "aten/src/ATen/core/dispatch/OperatorEntry.cpp",
1033
    "aten/src/ATen/core/interned_strings.cpp",
1034
    "aten/src/ATen/core/ivalue.cpp",
1035
    "aten/src/ATen/core/library.cpp",
1036
    "aten/src/ATen/core/op_registration/infer_schema.cpp",
1037
    "aten/src/ATen/core/op_registration/op_registration.cpp",
1038
    "aten/src/ATen/core/operator_name.cpp",
1039
    "aten/src/ATen/core/TorchDispatchUtils.cpp",
1040
    "aten/src/ATen/core/register_symbols.cpp",
1041
    "aten/src/ATen/core/NestedIntSymNodeImpl.cpp",
1042
    "aten/src/ATen/core/class_type.cpp",
1043
    "aten/src/ATen/core/type.cpp",
1044
    "aten/src/ATen/core/type_factory.cpp",
1045
    "aten/src/ATen/core/dynamic_type.cpp",
1046
    "aten/src/ATen/core/tensor_type.cpp",
1047
    "aten/src/ATen/core/union_type.cpp",
1048
    "aten/src/ATen/cpu/FlushDenormal.cpp",
1049
    "aten/src/ATen/detail/CPUGuardImpl.cpp",
1050
    "aten/src/ATen/metal/Context.cpp",
1051
    "aten/src/ATen/native/AutogradComposite.cpp",
1052
    "aten/src/ATen/native/ComparisonUtils.cpp",
1053
    "aten/src/ATen/native/DispatchStub.cpp",
1054
    "aten/src/ATen/native/UpSample.cpp",
1055
    "aten/src/ATen/native/mkldnn/BinaryOps.cpp",
1056
    "aten/src/ATen/native/mkldnn/Conv.cpp",
1057
    "aten/src/ATen/native/mkldnn/ConvPrepack.cpp",
1058
    "aten/src/ATen/native/mkldnn/Copy.cpp",
1059
    "aten/src/ATen/native/mkldnn/Gelu.cpp",
1060
    "aten/src/ATen/native/mkldnn/IDeepRegistration.cpp",
1061
    "aten/src/ATen/native/mkldnn/Linear.cpp",
1062
    "aten/src/ATen/native/mkldnn/MKLDNNCommon.cpp",
1063
    "aten/src/ATen/native/mkldnn/MKLDNNConversions.cpp",
1064
    "aten/src/ATen/native/mkldnn/MkldnnTensorMath.cpp",
1065
    "aten/src/ATen/native/mkldnn/Normalization.cpp",
1066
    "aten/src/ATen/native/mkldnn/OpContext.cpp",
1067
    "aten/src/ATen/native/mkldnn/Pooling.cpp",
1068
    "aten/src/ATen/native/mkldnn/Prelu.cpp",
1069
    "aten/src/ATen/native/mkldnn/RegisterMkldnnOpContextClass.cpp",
1070
    "aten/src/ATen/native/mkldnn/Relu.cpp",
1071
    "aten/src/ATen/native/mkldnn/RNN.cpp",
1072
    "aten/src/ATen/native/mkldnn/SoftMax.cpp",
1073
    "aten/src/ATen/native/mkldnn/TensorFactories.cpp",
1074
    "aten/src/ATen/native/mkldnn/TensorShape.cpp",
1075
    "aten/src/ATen/native/mkldnn/UnaryOps.cpp",
1076
    "aten/src/ATen/native/mkldnn/Utils.cpp",
1077
    "aten/src/ATen/native/mkldnn/Matmul.cpp",
1078
    "aten/src/ATen/native/quantized/cpu/init_qnnpack.cpp",
1079
    # This is moved to aten_cpu because some of the custom ops use empty_with_tail_padding
1080
    # which was available only within aten_native_cpu. Ideally the right fix is to make
1081
    # empty_with_tail_padding into an op and use dispatcher with it. But exposing it as an op
1082
    # has limited use and hence does not seem to really make sense.
1083
    "aten/src/ATen/native/utils/Factory.cpp",
1084
    "aten/src/ATen/SavedTensorHooks.cpp",
1085
    "aten/src/ATen/vulkan/Context.cpp",
1086
    "aten/src/ATen/native/prim_native_functions.cpp",
1087
    "aten/src/ATen/native/verbose_wrapper.cpp",
1088
    "aten/src/ATen/cpu/Utils.cpp",
1089
] + aten_cpu_non_globed_sources
1090

1091
aten_cpu_source_codegen_list = [
1092
    "aten/src/ATen/native/cpu/AdaptiveAvgPoolKernel.cpp",
1093
    "aten/src/ATen/native/cpu/AdaptiveMaxPoolKernel.cpp",
1094
]
1095

1096
aten_ufunc_headers = [
1097
    "aten/src/ATen/native/ufunc/add.h",
1098
]
1099

1100
# When building lite interpreter in OSS, "aten/src/ATen/native/cpu/AdaptiveAvgPoolKernel.cpp" will go through
1101
# codegen process. The codegen version of this file, like Activation.cpp.DEFAULT.cpp, will be included
1102
# in ${cpu_kernel_cpp} in aten/src/ATen/CMakeLists.txt. As a result, in aten/src/ATen/CMakeLists.txt,
1103
# only aten_cpu_source_non_codegen_list need to be added to ${all_cpu_cpp}.
1104
aten_cpu_source_list = sorted(aten_cpu_source_non_codegen_list + aten_cpu_source_codegen_list)
1105

1106
# Same as ${aten_cpu_source_codegen_list}, this list will go through aten codegen, and be included in
1107
# ${cpu_kernel_cpp} in aten/src/ATen/CMakeLists.txt.
1108
aten_native_source_codegen_list = [
1109
    "aten/src/ATen/native/cpu/Activation.cpp",
1110
    "aten/src/ATen/native/cpu/AvgPoolKernel.cpp",
1111
    "aten/src/ATen/native/cpu/BinaryOpsKernel.cpp",
1112
    "aten/src/ATen/native/cpu/BlasKernel.cpp",
1113
    "aten/src/ATen/native/cpu/CatKernel.cpp",
1114
    "aten/src/ATen/native/cpu/ChannelShuffleKernel.cpp",
1115
    "aten/src/ATen/native/cpu/ComplexKernel.cpp",
1116
    "aten/src/ATen/native/cpu/CopyKernel.cpp",
1117
    "aten/src/ATen/native/cpu/CrossKernel.cpp",
1118
    "aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp",
1119
    "aten/src/ATen/native/cpu/DistanceOpsKernel.cpp",
1120
    "aten/src/ATen/native/cpu/DistributionKernels.cpp",
1121
    "aten/src/ATen/native/cpu/FlashAttentionKernel.cpp",
1122
    "aten/src/ATen/native/cpu/FillKernel.cpp",
1123
    "aten/src/ATen/native/cpu/FunctionOfAMatrixUtilsKernel.cpp",
1124
    "aten/src/ATen/native/cpu/GridSamplerKernel.cpp",
1125
    "aten/src/ATen/native/cpu/HistogramKernel.cpp",
1126
    "aten/src/ATen/native/cpu/IndexKernel.cpp",
1127
    "aten/src/ATen/native/cpu/LerpKernel.cpp",
1128
    "aten/src/ATen/native/cpu/LinearAlgebraKernel.cpp",
1129
    "aten/src/ATen/native/cpu/MaxPoolKernel.cpp",
1130
    "aten/src/ATen/native/cpu/MaxPooling.cpp",
1131
    "aten/src/ATen/native/cpu/MaxUnpoolKernel.cpp",
1132
    "aten/src/ATen/native/cpu/MultinomialKernel.cpp",
1133
    "aten/src/ATen/native/cpu/NativeMultiheadAttnKernel.cpp",
1134
    "aten/src/ATen/native/cpu/PaddingKernel.cpp",
1135
    "aten/src/ATen/native/cpu/PixelShuffleKernel.cpp",
1136
    "aten/src/ATen/native/cpu/PointwiseOpsKernel.cpp",
1137
    "aten/src/ATen/native/cpu/PowKernel.cpp",
1138
    "aten/src/ATen/native/cpu/RangeFactoriesKernel.cpp",
1139
    "aten/src/ATen/native/cpu/ReduceAllOpsKernel.cpp",
1140
    "aten/src/ATen/native/cpu/ReduceOpsKernel.cpp",
1141
    "aten/src/ATen/native/cpu/RenormKernel.cpp",
1142
    "aten/src/ATen/native/cpu/ScatterGatherKernel.cpp",
1143
    "aten/src/ATen/native/cpu/SoftMaxKernel.cpp",
1144
    "aten/src/ATen/native/cpu/SortingKernel.cpp",
1145
    "aten/src/ATen/native/cpu/StackKernel.cpp",
1146
    "aten/src/ATen/native/cpu/SumKernel.cpp",
1147
    "aten/src/ATen/native/cpu/TensorCompareKernel.cpp",
1148
    "aten/src/ATen/native/cpu/UnaryOpsKernel.cpp",
1149
    "aten/src/ATen/native/cpu/Unfold2d.cpp",
1150
    "aten/src/ATen/native/cpu/UnfoldBackwardKernel.cpp",
1151
    "aten/src/ATen/native/cpu/UpSampleKernel.cpp",
1152
    "aten/src/ATen/native/cpu/UpSampleMoreKernel.cpp",
1153
    "aten/src/ATen/native/cpu/WeightNormKernel.cpp",
1154
    "aten/src/ATen/native/cpu/airy_ai.cpp",
1155
    "aten/src/ATen/native/cpu/batch_norm_kernel.cpp",
1156
    "aten/src/ATen/native/cpu/group_norm_kernel.cpp",
1157
    "aten/src/ATen/native/cpu/int4mm_kernel.cpp",
1158
    "aten/src/ATen/native/cpu/layer_norm_kernel.cpp",
1159
    "aten/src/ATen/native/cpu/AmpGradScalerKernels.cpp",
1160
    "aten/src/ATen/native/cpu/scaled_modified_bessel_k0.cpp",
1161
    "aten/src/ATen/native/cpu/scaled_modified_bessel_k1.cpp",
1162
    "aten/src/ATen/native/cpu/spherical_bessel_j0.cpp",
1163
    "aten/src/ATen/native/cpu/SampledAddmmKernel.cpp",
1164
    "aten/src/ATen/native/cpu/SpmmReduceKernel.cpp",
1165
    "aten/src/ATen/native/cpu/SparseFactories.cpp",
1166
    "aten/src/ATen/native/quantized/cpu/kernels/QuantizedOpKernels.cpp",
1167
]
1168

1169
# This aten native source file list will not go through aten codegen process
1170
aten_native_source_non_codegen_list = [
1171
    "aten/src/ATen/native/ao_sparse/library.cpp",
1172
    "aten/src/ATen/native/ao_sparse/quantized/cpu/fbgemm_utils.cpp",
1173
    "aten/src/ATen/native/ao_sparse/quantized/cpu/qlinear.cpp",
1174
    "aten/src/ATen/native/ao_sparse/quantized/cpu/qlinear_deserialize.cpp",
1175
    "aten/src/ATen/native/ao_sparse/quantized/cpu/qlinear_dynamic.cpp",
1176
    "aten/src/ATen/native/ao_sparse/quantized/cpu/qlinear_prepack.cpp",
1177
    "aten/src/ATen/native/ao_sparse/quantized/cpu/qlinear_serialize.cpp",
1178
    "aten/src/ATen/native/ao_sparse/quantized/cpu/qlinear_unpack.cpp",
1179
    "aten/src/ATen/native/quantized/cpu/fbgemm_utils.cpp",
1180
    "aten/src/ATen/native/quantized/cpu/fused_obs_fake_quant.cpp",
1181
    "aten/src/ATen/native/quantized/cpu/IntReprQuant.cpp",
1182
    "aten/src/ATen/native/quantized/cpu/MakePerTensorQuantizedTensor.cpp",
1183
    "aten/src/ATen/native/quantized/cpu/AdaptiveAveragePooling.cpp",
1184
    "aten/src/ATen/native/quantized/cpu/AveragePool2d.cpp",
1185
    "aten/src/ATen/native/quantized/cpu/AveragePool3d.cpp",
1186
    "aten/src/ATen/native/quantized/cpu/BinaryOps.cpp",
1187
    "aten/src/ATen/native/quantized/cpu/Normalization.cpp",
1188
    "aten/src/ATen/native/quantized/cpu/ChannelShuffle.cpp",
1189
    "aten/src/ATen/native/quantized/cpu/qclamp.cpp",
1190
    "aten/src/ATen/native/quantized/cpu/TensorShape.cpp",
1191
    "aten/src/ATen/native/quantized/cpu/qconv.cpp",
1192
    "aten/src/ATen/native/quantized/cpu/qconv_prepack.cpp",
1193
    "aten/src/ATen/native/quantized/cpu/qconv_unpack_impl.cpp",
1194
    "aten/src/ATen/native/quantized/cpu/qelu.cpp",
1195
    "aten/src/ATen/native/quantized/cpu/qembeddingbag.cpp",
1196
    "aten/src/ATen/native/quantized/cpu/qembeddingbag_prepack.cpp",
1197
    "aten/src/ATen/native/quantized/cpu/qembeddingbag_unpack.cpp",
1198
    "aten/src/ATen/native/quantized/cpu/qgelu.cpp",
1199
    "aten/src/ATen/native/quantized/cpu/qhardsigmoid.cpp",
1200
    "aten/src/ATen/native/quantized/cpu/qhardswish.cpp",
1201
    "aten/src/ATen/native/quantized/cpu/qlinear.cpp",
1202
    "aten/src/ATen/native/quantized/cpu/qlinear_dynamic.cpp",
1203
    "aten/src/ATen/native/quantized/cpu/qconv_dynamic.cpp",
1204
    "aten/src/ATen/native/quantized/cpu/qlinear_prepack.cpp",
1205
    "aten/src/ATen/native/quantized/cpu/LinearUnpackImpl.cpp",
1206
    "aten/src/ATen/native/quantized/cpu/qmatmul.cpp",
1207
    "aten/src/ATen/native/quantized/cpu/qmul.cpp",
1208
    "aten/src/ATen/native/quantized/cpu/qnormalization.cpp",
1209
    "aten/src/ATen/native/quantized/cpu/Pooling.cpp",
1210
    "aten/src/ATen/native/quantized/cpu/ReduceOps.cpp",
1211
    "aten/src/ATen/native/quantized/cpu/qrelu.cpp",
1212
    "aten/src/ATen/native/quantized/cpu/qsigmoid.cpp",
1213
    "aten/src/ATen/native/quantized/cpu/qsoftmax.cpp",
1214
    "aten/src/ATen/native/quantized/cpu/Sorting.cpp",
1215
    "aten/src/ATen/native/quantized/cpu/qtanh.cpp",
1216
    "aten/src/ATen/native/quantized/cpu/qthreshold.cpp",
1217
    "aten/src/ATen/native/quantized/cpu/UpSampleBilinear2d.cpp",
1218
    "aten/src/ATen/native/quantized/cpu/UpSampleNearest2d.cpp",
1219
    "aten/src/ATen/native/quantized/cpu/UpSampleNearest3d.cpp",
1220
    "aten/src/ATen/native/quantized/cpu/TensorOperators.cpp",
1221
    "aten/src/ATen/native/quantized/Copy.cpp",
1222
    "aten/src/ATen/native/quantized/QTensor.cpp",
1223
    "aten/src/ATen/native/quantized/TensorCompare.cpp",
1224
    "aten/src/ATen/native/quantized/TensorFactories.cpp",
1225
    "aten/src/ATen/native/quantized/AffineQuantizer.cpp",
1226
    "aten/src/ATen/native/quantized/AffineQuantizerBase.cpp",
1227
    "aten/src/ATen/native/quantized/FakeQuantPerChannelAffine.cpp",
1228
    "aten/src/ATen/native/quantized/FakeQuantPerTensorAffine.cpp",
1229
    "aten/src/ATen/native/quantized/library.cpp",
1230
    "aten/src/ATen/native/quantized/TensorAdvancedIndexing.cpp",
1231
    "aten/src/ATen/native/quantized/cpu/RuyUtils.cpp",
1232
    "aten/src/ATen/native/quantized/cpu/XnnpackUtils.cpp",
1233
    "aten/src/ATen/native/quantized/qlinear_unpack.cpp",
1234
    "aten/src/ATen/quantized/QTensorImpl.cpp",
1235
    "aten/src/ATen/quantized/Quantizer.cpp",
1236
    "aten/src/ATen/native/Activation.cpp",
1237
    "aten/src/ATen/native/AdaptiveAveragePooling.cpp",
1238
    "aten/src/ATen/native/AdaptiveAveragePooling3d.cpp",
1239
    "aten/src/ATen/native/AdaptiveMaxPooling2d.cpp",
1240
    "aten/src/ATen/native/AdaptiveMaxPooling3d.cpp",
1241
    "aten/src/ATen/native/AffineGridGenerator.cpp",
1242
    "aten/src/ATen/native/AveragePool2d.cpp",
1243
    "aten/src/ATen/native/AveragePool3d.cpp",
1244
    "aten/src/ATen/native/BatchLinearAlgebra.cpp",
1245
    "aten/src/ATen/native/BatchLinearAlgebraKernel.cpp",
1246
    "aten/src/ATen/native/LegacyBatching.cpp",
1247
    "aten/src/ATen/native/BinaryOps.cpp",
1248
    "aten/src/ATen/native/Blas.cpp",
1249
    "aten/src/ATen/native/BlasKernel.cpp",
1250
    "aten/src/ATen/native/Bucketization.cpp",
1251
    "aten/src/ATen/native/CPUBlas.cpp",
1252
    "aten/src/ATen/native/ChanelShuffle.cpp",
1253
    "aten/src/ATen/native/Col2Im.cpp",
1254
    "aten/src/ATen/native/PadNd.cpp",
1255
    "aten/src/ATen/native/Constraints.cpp",
1256
    "aten/src/ATen/native/Convolution.cpp",
1257
    "aten/src/ATen/native/ConvolutionMM2d.cpp",
1258
    "aten/src/ATen/native/ConvolutionMM3d.cpp",
1259
    "aten/src/ATen/native/ConvolutionTBC.cpp",
1260
    "aten/src/ATen/native/Copy.cpp",
1261
    "aten/src/ATen/native/Correlation.cpp",
1262
    "aten/src/ATen/native/CPUFallback.cpp",
1263
    "aten/src/ATen/native/Cross.cpp",
1264
    "aten/src/ATen/native/DilatedMaxPool2d.cpp",
1265
    "aten/src/ATen/native/DilatedMaxPool3d.cpp",
1266
    # Referenced by both native and ATen/Version.cpp. Does not reference to other native symbols
1267
    # "aten/src/ATen/native/DispatchStub.cpp",
1268
    # "aten/src/ATen/native/quantized/cpu/init_qnnpack.cpp",
1269
    "aten/src/ATen/native/Distance.cpp",
1270
    "aten/src/ATen/native/Distributions.cpp",
1271
    "aten/src/ATen/native/Dropout.cpp",
1272
    "aten/src/ATen/native/Embedding.cpp",
1273
    "aten/src/ATen/native/EmbeddingBag.cpp",
1274
    "aten/src/ATen/native/Fill.cpp",
1275
    "aten/src/ATen/native/ForeachOpsKernels.cpp",
1276
    "aten/src/ATen/native/FractionalMaxPool2d.cpp",
1277
    "aten/src/ATen/native/FractionalMaxPool3d.cpp",
1278
    "aten/src/ATen/native/FunctionOfAMatrixUtils.cpp",
1279
    "aten/src/ATen/native/GatedLinearUnit.cpp",
1280
    "aten/src/ATen/native/GridSampler.cpp",
1281
    "aten/src/ATen/native/Histogram.cpp",
1282
    "aten/src/ATen/native/Im2Col.cpp",
1283
    "aten/src/ATen/native/IndexingUtils.cpp",
1284
    "aten/src/ATen/native/Integration.cpp",
1285
    "aten/src/ATen/native/Itertools.cpp",
1286
    "aten/src/ATen/native/LegacyBridge.cpp",
1287
    "aten/src/ATen/native/Lerp.cpp",
1288
    "aten/src/ATen/native/Linear.cpp",
1289
    "aten/src/ATen/native/LinearAlgebra.cpp",
1290
    "aten/src/ATen/native/Loss.cpp",
1291
    "aten/src/ATen/native/LossCTC.cpp",
1292
    "aten/src/ATen/native/LossMultiLabelMargin.cpp",
1293
    "aten/src/ATen/native/LossMultiMargin.cpp",
1294
    "aten/src/ATen/native/LossNLL.cpp",
1295
    "aten/src/ATen/native/LossNLL2d.cpp",
1296
    "aten/src/ATen/native/MaxPooling.cpp",
1297
    "aten/src/ATen/native/MaxUnpooling.cpp",
1298
    "aten/src/ATen/native/Memory.cpp",
1299
    "aten/src/ATen/native/MetaTensor.cpp",
1300
    "aten/src/ATen/native/NNPACK.cpp",
1301
    "aten/src/ATen/native/NaiveConvolutionTranspose2d.cpp",
1302
    "aten/src/ATen/native/NaiveConvolutionTranspose3d.cpp",
1303
    "aten/src/ATen/native/NaiveDilatedConvolution.cpp",
1304
    "aten/src/ATen/native/NamedTensor.cpp",
1305
    "aten/src/ATen/native/Normalization.cpp",
1306
    "aten/src/ATen/native/Onehot.cpp",
1307
    "aten/src/ATen/native/PackedSequence.cpp",
1308
    "aten/src/ATen/native/PixelShuffle.cpp",
1309
    "aten/src/ATen/native/PointwiseOps.cpp",
1310
    "aten/src/ATen/native/Pooling.cpp",
1311
    "aten/src/ATen/native/Pow.cpp",
1312
    "aten/src/ATen/native/QuantizedLinear.cpp",
1313
    "aten/src/ATen/native/RNN.cpp",
1314
    "aten/src/ATen/native/RangeFactories.cpp",
1315
    "aten/src/ATen/native/ReduceAllOps.cpp",
1316
    "aten/src/ATen/native/ReduceOps.cpp",
1317
    "aten/src/ATen/native/ReflectionPad.cpp",
1318
    "aten/src/ATen/native/Repeat.cpp",
1319
    "aten/src/ATen/native/ReplicationPadding.cpp",
1320
    "aten/src/ATen/native/Resize.cpp",
1321
    "aten/src/ATen/native/RowwisePrune.cpp",
1322
    "aten/src/ATen/native/SegmentReduce.cpp",
1323
    "aten/src/ATen/native/Scalar.cpp",
1324
    "aten/src/ATen/native/SobolEngineOps.cpp",
1325
    "aten/src/ATen/native/SobolEngineOpsUtils.cpp",
1326
    "aten/src/ATen/native/SoftMax.cpp",
1327
    "aten/src/ATen/native/Sorting.cpp",
1328
    "aten/src/ATen/native/SparseTensorUtils.cpp",
1329
    "aten/src/ATen/native/SpectralOps.cpp",
1330
    "aten/src/ATen/native/SummaryOps.cpp",
1331
    "aten/src/ATen/native/TensorAdvancedIndexing.cpp",
1332
    "aten/src/ATen/native/TensorCompare.cpp",
1333
    "aten/src/ATen/native/TensorConversions.cpp",
1334
    "aten/src/ATen/native/TensorFactories.cpp",
1335
    "aten/src/ATen/native/TensorIteratorReduce.cpp",
1336
    "aten/src/ATen/native/TensorProperties.cpp",
1337
    "aten/src/ATen/native/TensorShape.cpp",
1338
    "aten/src/ATen/native/TensorTransformations.cpp",
1339
    "aten/src/ATen/native/TestOps.cpp",
1340
    "aten/src/ATen/native/TriangularOps.cpp",
1341
    "aten/src/ATen/native/TypeProperties.cpp",
1342
    "aten/src/ATen/native/UnaryOps.cpp",
1343
    "aten/src/ATen/native/Unfold2d.cpp",
1344
    "aten/src/ATen/native/Unfold3d.cpp",
1345
    "aten/src/ATen/native/UnfoldBackward.cpp",
1346
    "aten/src/ATen/native/Unique.cpp",
1347
    # Low-level functions that can be directly referenced
1348
    # "aten/src/ATen/native/UpSample.cpp",
1349
    "aten/src/ATen/native/UpSampleBicubic2d.cpp",
1350
    "aten/src/ATen/native/UpSampleBilinear2d.cpp",
1351
    "aten/src/ATen/native/UpSampleLinear1d.cpp",
1352
    "aten/src/ATen/native/UpSampleNearest1d.cpp",
1353
    "aten/src/ATen/native/UpSampleNearest2d.cpp",
1354
    "aten/src/ATen/native/UpSampleNearest3d.cpp",
1355
    "aten/src/ATen/native/UpSampleTrilinear3d.cpp",
1356
    "aten/src/ATen/native/VariableMethodStubs.cpp",
1357
    "aten/src/ATen/native/WeightNorm.cpp",
1358
    "aten/src/ATen/native/group_norm.cpp",
1359
    "aten/src/ATen/native/layer_norm.cpp",
1360
    "aten/src/ATen/native/AmpKernels.cpp",
1361
    "aten/src/ATen/native/mkl/LinearAlgebra.cpp",
1362
    "aten/src/ATen/native/mkl/SparseBlasImpl.cpp",
1363
    "aten/src/ATen/native/mkl/SparseCsrLinearAlgebra.cpp",
1364
    "aten/src/ATen/native/mkl/SpectralOps.cpp",
1365
    "aten/src/ATen/native/nested/NestedTensorAliases.cpp",
1366
    "aten/src/ATen/native/nested/NestedTensorBackward.cpp",
1367
    "aten/src/ATen/native/nested/NestedTensorBinaryOps.cpp",
1368
    "aten/src/ATen/native/nested/NestedTensorFactories.cpp",
1369
    "aten/src/ATen/native/nested/NestedTensorMath.cpp",
1370
    "aten/src/ATen/native/nested/NestedTensorMatmul.cpp",
1371
    "aten/src/ATen/native/nested/NestedTensorTransformerFunctions.cpp",
1372
    "aten/src/ATen/native/nested/NestedTensorUnaryOps.cpp",
1373
    "aten/src/ATen/native/nested/NestedTensorUtils.cpp",
1374
    "aten/src/ATen/native/sparse/ParamUtils.cpp",
1375
    "aten/src/ATen/native/sparse/SoftMax.cpp",
1376
    "aten/src/ATen/native/sparse/SparseBlas.cpp",
1377
    "aten/src/ATen/native/sparse/SparseBlasImpl.cpp",
1378
    "aten/src/ATen/native/sparse/SparseMatMul.cpp",
1379
    "aten/src/ATen/native/sparse/SparseTensor.cpp",
1380
    "aten/src/ATen/native/sparse/SparseCsrTensor.cpp",
1381
    "aten/src/ATen/native/sparse/SparseTensorMath.cpp",
1382
    "aten/src/ATen/native/sparse/SparseUnaryOps.cpp",
1383
    "aten/src/ATen/native/sparse/SparseCsrTensorMath.cpp",
1384
    "aten/src/ATen/native/sparse/SparseFactories.cpp",
1385
    "aten/src/ATen/native/sparse/ValidateCompressedIndicesKernel.cpp",
1386
    "aten/src/ATen/native/sparse/SparseBinaryOpIntersectionKernel.cpp",
1387
    "aten/src/ATen/native/sparse/FlattenIndicesKernel.cpp",
1388
    "aten/src/ATen/native/transformers/attention.cpp",
1389
    "aten/src/ATen/native/transformers/sdp_utils_cpp.cpp",
1390
    "aten/src/ATen/native/transformers/transformer.cpp",
1391
    "aten/src/ATen/native/xnnpack/Activation.cpp",
1392
    "aten/src/ATen/native/xnnpack/ChannelShuffle.cpp",
1393
    "aten/src/ATen/native/xnnpack/Convolution.cpp",
1394
    "aten/src/ATen/native/xnnpack/AveragePooling.cpp",
1395
    "aten/src/ATen/native/xnnpack/Init.cpp",
1396
    "aten/src/ATen/native/xnnpack/Linear.cpp",
1397
    "aten/src/ATen/native/xnnpack/MaxPooling.cpp",
1398
    "aten/src/ATen/native/xnnpack/OpContext.cpp",
1399
    "aten/src/ATen/native/xnnpack/RegisterOpContextClass.cpp",
1400
    "aten/src/ATen/native/xnnpack/Shim.cpp",
1401
    # Files not in native, but depends on native symbols
1402
    # "aten/src/ATen/TensorIndexing.cpp",
1403
    "aten/src/ATen/TensorIterator.cpp",
1404
]
1405

1406
# 1. Files in ATen/native with a few exceptions
1407
# TODO: move the exceptions to proper locations
1408
# 2. The whole aten native source list includes the list with and without aten codegen process.
1409
aten_native_source_list = sorted(aten_native_source_non_codegen_list + aten_native_source_codegen_list)
1410

1411
# These are cpp files which need to go in the torch_cuda_cu library
1412
# .cu files can be found via glob
1413
aten_cuda_cu_source_list = [
1414
    "aten/src/ATen/cuda/CUDABlas.cpp",
1415
    "aten/src/ATen/cuda/CUDASparseBlas.cpp",
1416
    "aten/src/ATen/cuda/CublasHandlePool.cpp",
1417
    "aten/src/ATen/cuda/tunable/StreamTimer.cpp",
1418
    "aten/src/ATen/cuda/tunable/Tunable.cpp",
1419
    "aten/src/ATen/native/cuda/Activation.cpp",
1420
    "aten/src/ATen/native/cuda/LinearAlgebraStubs.cpp",
1421
    "aten/src/ATen/native/cuda/Blas.cpp",
1422
    "aten/src/ATen/native/cuda/Distributions.cpp",
1423
    "aten/src/ATen/native/cuda/Equal.cpp",
1424
    "aten/src/ATen/native/cuda/GridSampler.cpp",
1425
    "aten/src/ATen/native/cuda/IndexKernel.cpp",
1426
    "aten/src/ATen/native/cuda/ReduceOps.cpp",
1427
    "aten/src/ATen/native/cuda/ScanKernels.cpp",
1428
    "aten/src/ATen/native/cuda/Sort.cpp",
1429
    "aten/src/ATen/native/cuda/Sorting.cpp",
1430
    "aten/src/ATen/native/cuda/TensorModeKernel.cpp",
1431
    "aten/src/ATen/native/cuda/TensorShapeCUDA.cpp",
1432
    "aten/src/ATen/native/cuda/TensorTopK.cpp",
1433
    "aten/src/ATen/native/cuda/jit_utils.cpp",
1434
    "aten/src/ATen/native/nested/cuda/NestedTensorTransformerFunctions.cpp",
1435
    "aten/src/ATen/native/sparse/cuda/SparseBlas.cpp",
1436
    "aten/src/ATen/native/sparse/cuda/SparseBlasImpl.cpp",
1437
    "aten/src/ATen/native/sparse/cuda/SparseBlasLegacy.cpp",
1438
    "aten/src/ATen/native/sparse/cuda/SparseCUDABlas.cpp",
1439
    "aten/src/ATen/native/transformers/cuda/flash_attn/flash_api.cpp",
1440
]
1441

1442
# Files using thrust::sort_by_key need to be linked last
1443
aten_cuda_with_sort_by_key_source_list = [
1444
    # empty_cuda is needed by torch_cuda_cpp
1445
    "aten/src/ATen/native/cuda/TensorFactories.cu",
1446
]
1447

1448
aten_cuda_cu_with_sort_by_key_source_list = [
1449
    "aten/src/ATen/native/cuda/Unique.cu",
1450
]
1451

1452
# Followings are source code for xnnpack delegate
1453

1454
xnnpack_delegate_serializer_header = [
1455
    "torch/csrc/jit/backends/xnnpack/serialization/serializer.h",
1456
]
1457

1458
xnnpack_delegate_serializer_source_list = [
1459
    "torch/csrc/jit/backends/xnnpack/serialization/serializer.cpp",
1460
]
1461

1462
xnnpack_delegate_core_source_list = [
1463
    "torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.cpp",
1464
]
1465

1466
xnnpack_delegate_core_header = [
1467
    "torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.h",
1468
    "torch/csrc/jit/backends/xnnpack/executor/xnn_executor.h",
1469
]
1470

1471
xnnpack_backend_header = [
1472
    "torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.h",
1473
] + xnnpack_delegate_core_header
1474

1475
xnnpack_backend_source_list = [
1476
    "torch/csrc/jit/backends/xnnpack/compiler/xnn_compiler.cpp",
1477
    "torch/csrc/jit/backends/xnnpack/xnnpack_backend_lib.cpp",
1478
    "torch/csrc/jit/backends/xnnpack/xnnpack_backend_preprocess.cpp",
1479
    "torch/csrc/jit/backends/xnnpack/xnnpack_graph_builder.cpp",
1480
] + xnnpack_delegate_core_source_list
1481

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.