repo
stringlengths
1
152
file
stringlengths
14
221
code
stringlengths
501
25k
file_length
int64
501
25k
avg_line_length
float64
20
99.5
max_line_length
int64
21
134
extension_type
stringclasses
2 values
null
pytorch-main/torch/csrc/api/include/torch/serialize/output-archive.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/jit/api/module.h> #include <iosfwd> #include <memory> #include <string> #include <utility> namespace at { class Tensor; } // namespace at namespace torch { using at::Tensor; namespace jit { struct Module; } // namespace jit } // namespace torch names...
2,315
26.903614
79
h
null
pytorch-main/torch/csrc/autograd/VariableTypeUtils.h
#pragma once #include <c10/util/irange.h> #include <ATen/core/boxing/KernelFunction.h> #include <ATen/core/dispatch/Dispatcher.h> #include <torch/csrc/autograd/edge.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/functions/basic_ops.h> #include <torch/csrc/autograd/functions/tensor.h> #inc...
18,647
34.052632
123
h
null
pytorch-main/torch/csrc/autograd/anomaly_mode.h
#pragma once #include <torch/csrc/Export.h> #include <memory> #include <string> namespace torch { namespace autograd { // forward declaration of Node from function.h struct Node; struct TORCH_API AnomalyMode { static bool is_enabled() { return _enabled; } static bool should_check_nan() { return _check...
1,749
22.648649
71
h
null
pytorch-main/torch/csrc/autograd/autograd.h
#pragma once #include <torch/csrc/autograd/variable.h> namespace torch { namespace autograd { /// Computes the sum of gradients of given tensors with respect to graph leaves. /// /// The graph is differentiated using the chain rule. If any of ``tensors`` /// are non-scalar (i.e. their data has more than one element)...
5,334
48.859813
80
h
null
pytorch-main/torch/csrc/autograd/autograd_not_implemented_fallback.h
#pragma once #include <torch/library.h> namespace torch { namespace autograd { // Default DispatchKey::Autograd fallback for built-in operators. // Can be registered for custom operators. TORCH_API torch::CppFunction autogradNotImplementedFallback(); // Default DispatchKey::AdInplaceOrView fallback for built-in ope...
1,167
32.371429
78
h
null
pytorch-main/torch/csrc/autograd/cpp_hook.h
#pragma once #include <torch/csrc/autograd/function_hook.h> #include <functional> #include <memory> namespace torch { namespace autograd { using hooks_list = std::vector<std::function<at::TensorBase(const at::TensorBase&)>>; struct CppFunctionTensorPreHook : public FunctionPreHook { CppFunctionTensorPreHook(st...
878
26.46875
77
h
null
pytorch-main/torch/csrc/autograd/custom_function.h
#pragma once #include <ATen/core/ivalue.h> #include <c10/core/SymInt.h> #include <c10/util/flat_hash_map.h> #include <c10/util/irange.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/variable.h> #include <vector> namespace torch { namespace autograd { using optional_variable_list = std::vec...
15,411
34.675926
80
h
null
pytorch-main/torch/csrc/autograd/edge.h
#pragma once #include <cstdint> #include <functional> #include <memory> #include <c10/util/hash.h> namespace torch { namespace autograd { struct Node; /// Represents a particular input of a function. struct Edge { Edge() noexcept : function(nullptr), input_nr(0) {} Edge(std::shared_ptr<Node> function_, uint32...
1,640
26.813559
80
h
null
pytorch-main/torch/csrc/autograd/engine.h
#pragma once // Engine implements backpropagation from output variables and their gradients // to "root" variables (variables created by the user with requires_grad=True). #include <ATen/Tensor.h> #include <ATen/ThreadLocalState.h> #include <ATen/core/ivalue.h> #include <torch/csrc/Export.h> #include <torch/csrc/auto...
10,400
35.367133
82
h
null
pytorch-main/torch/csrc/autograd/forward_grad.h
#pragma once #include <ATen/core/Tensor.h> #include <unordered_set> namespace torch { namespace autograd { // [ Using ForwardGrad ] // ForwardGrad needs to be a shared_ptr to satisfy constraints of its inner // design. But this shared_ptr must be uniquely associated with the object that // stores it (as of writing, ...
8,963
41.084507
80
h
null
pytorch-main/torch/csrc/autograd/function_hook.h
#pragma once #include <ATen/Tensor.h> #include <torch/csrc/Export.h> #include <vector> // A hook that's called on gradients namespace torch { namespace autograd { using Variable = at::Tensor; using variable_list = std::vector<Variable>; struct TORCH_API FunctionPreHook { virtual ~FunctionPreHook() = default; v...
664
21.931034
67
h
null
pytorch-main/torch/csrc/autograd/graph_task.h
#pragma once #include <ATen/ThreadLocalState.h> #include <ATen/core/Tensor.h> #include <c10/util/ThreadLocal.h> #include <torch/csrc/autograd/input_buffer.h> #include <torch/csrc/autograd/utils/warnings.h> #include <vector> namespace torch { namespace autograd { using edge_list = std::vector<Edge>; struct ReadyQueue;...
9,715
38.983539
80
h
null
pytorch-main/torch/csrc/autograd/input_buffer.h
#pragma once // The InputBuffer class accumulates a list of Variables for use by a // function. It implements logic to avoid modifying the passed // values in-place (adding an input twice will accumulate the result). // This behaviour is needed and used only in backward graphs. #include <memory> #include <utility> #i...
1,461
28.836735
77
h
null
pytorch-main/torch/csrc/autograd/input_metadata.h
#pragma once #include <ATen/ExpandUtils.h> #include <ATen/NestedTensorImpl.h> #include <ATen/core/Tensor.h> #include <c10/core/Device.h> #include <c10/core/DeviceType.h> #include <c10/core/Stream.h> #include <c10/core/SymIntArrayRef.h> #include <c10/core/TensorImpl.h> #include <c10/core/impl/DeviceGuardImplInterface.h...
5,261
28.561798
86
h
null
pytorch-main/torch/csrc/autograd/jit_decomp_interface.h
#pragma once #include <ATen/core/Tensor.h> #include <ATen/core/function_schema.h> #include <c10/macros/Export.h> // NOTE: [Jit Decomposition Interface] // // For some context of why we need this at all, see NOTE: [forward-mode AD // decompositions mechanism] // // Introducing that mechanism from the NOTE is problemat...
1,848
32.618182
80
h
null
pytorch-main/torch/csrc/autograd/profiler_kineto.h
#pragma once #include <string> #include <vector> #include <torch/csrc/profiler/api.h> #include <torch/csrc/profiler/events.h> #include <torch/csrc/profiler/stubs/base.h> #include <torch/csrc/profiler/util.h> namespace torch { namespace profiler { namespace impl { struct Result; namespace kineto { struct ActivityTrac...
6,803
34.623037
80
h
null
pytorch-main/torch/csrc/autograd/profiler_legacy.h
#pragma once #include <cstdint> #include <forward_list> #include <iostream> #include <memory> #include <mutex> #include <sstream> #include <string> #include <tuple> #include <vector> #include <torch/csrc/Export.h> #include <torch/csrc/profiler/api.h> #include <torch/csrc/profiler/stubs/base.h> #include <torch/csrc/pr...
11,161
25.703349
131
h
null
pytorch-main/torch/csrc/autograd/python_anomaly_mode.h
#pragma once #include <pybind11/pybind11.h> #include <torch/csrc/autograd/anomaly_mode.h> #include <torch/csrc/python_headers.h> #include <torch/csrc/utils/auto_gil.h> #include <torch/csrc/utils/pybind.h> namespace torch { namespace autograd { struct PyAnomalyMetadata : public AnomalyMetadata { static constexpr co...
1,127
24.066667
72
h
null
pytorch-main/torch/csrc/autograd/python_cpp_function.h
#pragma once #include <torch/csrc/python_headers.h> #include <memory> #include <typeinfo> #include <torch/csrc/Exceptions.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/utils/object_ptr.h> namespace torch { namespace autograd { struct THPCppFunction { PyObject_HEAD std::shared_ptr<Node> cdata; ...
4,076
38.970588
80
h
null
pytorch-main/torch/csrc/autograd/python_engine.h
#pragma once #include <torch/csrc/python_headers.h> #include <torch/csrc/autograd/engine.h> #include <torch/csrc/autograd/function.h> bool THPEngine_initModule(PyObject* module); namespace torch { namespace autograd { namespace python { struct PythonEngine : public Engine { static Engine& get_python_engine(); ...
1,299
25.530612
72
h
null
pytorch-main/torch/csrc/autograd/python_function.h
#pragma once #include <torch/csrc/python_headers.h> #include <torch/csrc/Exceptions.h> #include <torch/csrc/autograd/custom_function.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/saved_variable.h> #include <torch/csrc/autograd/variable.h> #include <torch/csrc/utils/object_ptr.h> #include...
4,428
32.55303
79
h
null
pytorch-main/torch/csrc/autograd/python_hook.h
#pragma once #include <torch/csrc/autograd/function_hook.h> #include <torch/csrc/python_headers.h> #include <torch/csrc/utils/object_ptr.h> namespace torch { namespace autograd { struct PyFunctionTensorPreHook : public FunctionPreHook { PyFunctionTensorPreHook(PyObject* dict, int value_idx); ~PyFunctionTensorPre...
954
25.527778
65
h
null
pytorch-main/torch/csrc/autograd/python_saved_variable_hooks.h
#pragma once #include <ATen/ATen.h> #include <pybind11/pybind11.h> #include <torch/csrc/Export.h> #include <torch/csrc/autograd/python_variable.h> #include <torch/csrc/autograd/saved_variable_hooks.h> #include <torch/csrc/python_headers.h> #include <torch/csrc/utils/pybind.h> namespace py = pybind11; namespace torch...
958
25.638889
77
h
null
pytorch-main/torch/csrc/autograd/python_torch_functions.h
#include <Python.h> #include <vector> namespace torch { namespace autograd { extern PyObject* THPVariableFunctionsModule; // Wrapper converts a raised TypeError into returning NotImplemented // Used to implement binary arithmetic operators template <PyObject* (*Func)(PyObject*, PyObject*, PyObject*)> inline PyObjec...
694
22.166667
68
h
null
pytorch-main/torch/csrc/autograd/python_variable.h
#pragma once #include <ATen/core/Tensor.h> #include <torch/csrc/python_headers.h> #include <memory> #include <ATen/core/function_schema.h> #include <pybind11/pybind11.h> #include <torch/csrc/Exceptions.h> #include <torch/csrc/Export.h> #include <torch/csrc/autograd/variable.h> #include <torch/csrc/utils/pybind.h> na...
3,031
27.87619
75
h
null
pytorch-main/torch/csrc/autograd/python_variable_indexing.h
#pragma once #include <c10/core/SymInt.h> #include <torch/csrc/autograd/python_variable.h> #include <torch/csrc/python_headers.h> #include <torch/csrc/utils/pybind.h> #include <torch/csrc/utils/python_symnode.h> namespace torch { namespace autograd { struct UnpackedSlice { c10::SymInt start; c10::SymInt stop; ...
2,947
27.07619
78
h
null
pytorch-main/torch/csrc/autograd/record_function_ops.h
#pragma once #include <ATen/record_function.h> #include <c10/util/Optional.h> #include <torch/custom_class.h> namespace torch { namespace autograd { namespace profiler { struct PythonRecordFunction : public torch::CustomClassHolder { at::RecordFunction record; explicit PythonRecordFunction( at::RecordScope...
996
30.15625
81
h
null
pytorch-main/torch/csrc/autograd/saved_variable.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/autograd/forward_grad.h> #include <torch/csrc/autograd/saved_variable_hooks.h> #include <ATen/core/Tensor.h> #include <cstdint> #include <memory> namespace torch { namespace autograd { using Variable = at::Tensor; struct Node; TORCH_API extern const...
4,709
36.983871
80
h
null
pytorch-main/torch/csrc/autograd/functions/accumulate_grad.h
#pragma once #include <ATen/CachedTensorUtils.h> #include <ATen/LegacyBatchedTensorImpl.h> #include <ATen/TensorOperators.h> #include <torch/csrc/Export.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/utils/grad_layout_contract.h> #include <torch/csrc/autograd/variable.h> #ifndef AT_PER_OPE...
13,105
48.643939
88
h
null
pytorch-main/torch/csrc/autograd/functions/basic_ops.h
#pragma once #include <c10/util/irange.h> #include <torch/csrc/Export.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/variable.h> #include <memory> #include <string> #include <vector> namespace torch { namespace autograd { struct TORCH_API Error : public Node { Error(std::string msg, ed...
2,701
27.442105
80
h
null
pytorch-main/torch/csrc/autograd/functions/comm.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/variable.h> #include <ATen/ATen.h> #include <ATen/cuda/ATenCUDAGeneral.h> #include <ATen/cuda/CUDAContext.h> #include <cstddef> #include <vector> namespace torch { namespace autograd { struct TORCH_C...
1,243
24.916667
79
h
null
pytorch-main/torch/csrc/autograd/functions/tensor.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/variable.h> #include <ATen/TensorGeometry.h> #include <ATen/core/DeprecatedTypeProperties.h> #include <c10/util/Optional.h> #include <cstdint> #include <memory> namespace torch { namespace autograd { ...
6,834
38.057143
82
h
null
pytorch-main/torch/csrc/autograd/functions/utils.h
#pragma once #include <torch/csrc/Export.h> #include <torch/csrc/autograd/InferenceMode.h> #include <torch/csrc/autograd/autograd.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/variable.h> #include <torch/csrc/utils/variadic.h> #include <ATen/core/Tensor.h> #include <functional> #include ...
3,374
26.439024
80
h
null
pytorch-main/torch/csrc/autograd/utils/error_messages.h
#pragma once #include <sstream> namespace torch { namespace autograd { namespace utils { inline std::string requires_grad_leaf_error(bool requires_grad) { std::ostringstream oss; oss << "you can only change requires_grad flags of leaf variables."; if (requires_grad == false) { oss << " If you want to use a...
545
22.73913
70
h
null
pytorch-main/torch/csrc/autograd/utils/grad_layout_contract.h
#pragma once #include <ATen/Tensor.h> namespace torch { namespace autograd { namespace utils { // Helper functions to enforce the "Gradient Layout Contract" described in // torch/csrc/autograd/functions/accumulate_grad.h. // Checks if grad obeys the contract with variable. inline bool obeys_layout_contract( con...
2,829
34.375
77
h
null
pytorch-main/torch/csrc/autograd/utils/lambda_post_hook.h
#pragma once #include <torch/csrc/autograd/function_hook.h> namespace torch { namespace autograd { namespace utils { // Turns lambda into a torch::autograd::FunctionPostHook. class LambdaPostHook : public torch::autograd::FunctionPostHook { using variable_list = std::vector<torch::autograd::Variable>; public: ...
976
26.914286
79
h
null
pytorch-main/torch/csrc/autograd/utils/python_arg_parsing.h
#pragma once #include <ATen/core/Tensor.h> #include <torch/csrc/python_headers.h> #include <torch/csrc/utils/python_arg_parser.h> namespace torch { namespace autograd { namespace utils { // The parameter allow_copy is to accept copy for Tensor.to (and by proxy // PackedSequences.to) but not nn.Module.to. inline std...
1,473
26.296296
73
h
null
pytorch-main/torch/csrc/autograd/utils/warnings.h
#pragma once #include <c10/util/Exception.h> #include <mutex> #include <vector> namespace torch { namespace autograd { namespace utils { // Warning handler for multi-threaded contexts. Gather warnings from // all threads into a single queue, then process together at the end // in the main thread. class DelayWarningH...
633
20.862069
68
h
null
pytorch-main/torch/csrc/autograd/utils/wrap_outputs.h
#pragma once // Wrap tensor operation outputs as PyObject* #include <ATen/ScalarOps.h> #include <ATen/core/Tensor.h> #include <c10/util/irange.h> #include <torch/csrc/python_headers.h> #include <initializer_list> #include <tuple> #include <torch/csrc/Dtype.h> #include <torch/csrc/DynamicTypes.h> #include <torch/csrc...
3,723
23.5
72
h
null
pytorch-main/torch/csrc/cuda/CUDAPluggableAllocator.h
#pragma once #include <c10/core/Allocator.h> #include <c10/cuda/CUDAGraphsC10Utils.h> #include <c10/cuda/CUDAMacros.h> #include <c10/cuda/CUDAStream.h> #include <c10/cuda/CUDACachingAllocator.h> #include <array> #include <mutex> namespace torch { namespace cuda { namespace CUDAPluggableAllocator { #if defined(TO...
5,443
35.293333
79
h
null
pytorch-main/torch/csrc/cuda/comm.h
#pragma once #include <ATen/ATen.h> #include <ATen/cuda/ATenCUDAGeneral.h> #include <ATen/cuda/CUDAContext.h> #include <c10/util/Optional.h> #include <torch/csrc/Export.h> #include <cstddef> #include <vector> namespace torch { namespace cuda { using tensor_list2d = std::vector<std::vector<at::Tensor>>; TORCH_CUDA_...
1,549
27.703704
74
h
null
pytorch-main/torch/csrc/cuda/memory_snapshot.h
#pragma once #include <torch/csrc/Export.h> #include <string> namespace torch { namespace cuda { // C++-only versions of these, for python use // those defined in cuda/Module.cpp which also record python state. TORCH_CUDA_CU_API void _record_memory_history( bool enabled, bool record_context = true, int64...
536
23.409091
67
h
null
pytorch-main/torch/csrc/cuda/nccl.h
#pragma once #include <ATen/ATen.h> #include <ATen/cuda/CUDAContext.h> #include <c10/util/Optional.h> #include <cstddef> #include <vector> // NCCL BFloat16 is enabled only for CUDA 11+ and NCCL versions 2.10+, or for // HIP 3.1+ #if defined(__CUDA_BF16_TYPES_EXIST__) #define HAS_NCCL_BF16_DATATYPE \ ((NCCL_MAJOR >...
5,917
25.657658
80
h
null
pytorch-main/torch/csrc/cuda/python_nccl.h
#pragma once #include <torch/csrc/python_headers.h> PyObject* THCPModule_nccl_version(PyObject* self, PyObject* args); PyObject* THCPModule_nccl_unique_id(PyObject* self, PyObject* args); PyObject* THCPModule_nccl_init_rank(PyObject* self, PyObject* args); PyObject* THCPModule_nccl_reduce(PyObject* self, PyObject* ar...
608
45.846154
73
h
null
pytorch-main/torch/csrc/distributed/autograd/autograd.h
#pragma once #include <torch/csrc/distributed/autograd/context/container.h> #include <torch/csrc/distributed/autograd/engine/dist_engine.h> namespace torch { namespace distributed { namespace autograd { using torch::autograd::variable_list; /// C++ API of Distributed Autograd that kicks off the distributed backward...
1,686
40.146341
80
h
null
pytorch-main/torch/csrc/distributed/autograd/utils.h
#pragma once #include <torch/csrc/distributed/autograd/context/context.h> #include <torch/csrc/distributed/autograd/rpc_messages/rpc_with_autograd.h> #include <torch/csrc/distributed/autograd/rpc_messages/rpc_with_profiling_req.h> #include <torch/csrc/distributed/autograd/rpc_messages/rpc_with_profiling_resp.h> names...
2,697
43.229508
81
h
null
pytorch-main/torch/csrc/distributed/autograd/context/container.h
#pragma once #include <mutex> #include <unordered_map> #include <torch/csrc/distributed/autograd/context/context.h> namespace torch { namespace distributed { namespace autograd { // Singleton class per worker which is responsible for storing the distributed // autograd context for each autograd pass and also cleans...
6,435
37.309524
80
h
null
pytorch-main/torch/csrc/distributed/autograd/context/context.h
#pragma once #include <cstdint> #include <functional> #include <ATen/core/Dict.h> #include <torch/csrc/autograd/engine.h> #include <torch/csrc/distributed/autograd/functions/recvrpc_backward.h> #include <torch/csrc/distributed/autograd/functions/sendrpc_backward.h> #include <torch/csrc/distributed/rpc/rpc_agent.h> n...
6,623
36.851429
80
h
null
pytorch-main/torch/csrc/distributed/autograd/engine/dist_engine.h
#pragma once #include <mutex> #include <unordered_set> #include <torch/csrc/autograd/engine.h> #include <torch/csrc/autograd/function.h> #include <torch/csrc/autograd/functions/basic_ops.h> #include <torch/csrc/distributed/autograd/context/context.h> namespace torch { namespace distributed { namespace autograd { //...
7,465
41.180791
80
h
null
pytorch-main/torch/csrc/distributed/autograd/functions/recvrpc_backward.h
#pragma once #include <torch/csrc/autograd/function.h> #include <torch/csrc/distributed/autograd/context/context.h> #include <torch/csrc/distributed/autograd/rpc_messages/autograd_metadata.h> #include <torch/csrc/distributed/rpc/rpc_agent.h> namespace torch { namespace distributed { namespace autograd { // Forward d...
1,705
33.12
80
h
null
pytorch-main/torch/csrc/distributed/autograd/functions/sendrpc_backward.h
#pragma once #include <torch/csrc/autograd/function.h> namespace torch { namespace distributed { namespace autograd { // As part of our distributed autograd implementation, whenever we send an RPC // from one node to another, we add a 'SendRpcBackward' autograd function to the // autograd graph. This is more or less...
1,373
35.157895
80
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/autograd_metadata.h
#pragma once #include <torch/csrc/Export.h> #include <cstdint> namespace torch { namespace distributed { namespace autograd { // This structure represents autograd metadata that we need to pass across // different nodes when we call an RPC which needs autograd computation. struct TORCH_API AutogradMetadata { Autog...
750
27.884615
75
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/cleanup_autograd_context_req.h
#pragma once #include <torch/csrc/distributed/autograd/rpc_messages/autograd_metadata.h> #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> namespace torch { namespace distributed { namespace autograd { // Used to request other workers to clean up their autograd ...
886
28.566667
75
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/cleanup_autograd_context_resp.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> namespace torch { namespace distributed { namespace autograd { // Empty response for CleanupAutogradContextReq. Send to acknowledge receipt of // a CleanupAutogradContextReq. class TORCH_API CleanupA...
711
28.666667
79
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/propagate_gradients_req.h
#pragma once #include <torch/csrc/distributed/autograd/rpc_messages/autograd_metadata.h> #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <vector> namespace torch { namespace distributed { namespace autograd { // Used to propagate gradients from one no...
1,298
29.209302
76
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/propagate_gradients_resp.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> namespace torch { namespace distributed { namespace autograd { // Response for the PropagateGradients call. Currently, this class is mostly // just a placeholder and sends an empty message over the w...
804
31.2
80
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/rpc_with_autograd.h
#pragma once #include <torch/csrc/distributed/autograd/rpc_messages/autograd_metadata.h> #include <torch/csrc/distributed/rpc/rpc_agent.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> namespace torch { namespace distributed { namespace autograd { // Represents an RPC that includes autograd information. T...
3,556
34.929293
80
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/rpc_with_profiling_req.h
#pragma once #include <torch/csrc/autograd/profiler.h> #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_agent.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> namespace torch { namespace distributed { namespace autograd {...
2,347
36.269841
77
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/rpc_with_profiling_resp.h
#pragma once #include <torch/csrc/autograd/profiler.h> #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_agent.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> namespace torch { namespace distributed { namespace autograd {...
2,307
37.466667
80
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/rref_backward_req.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> namespace torch { namespace distributed { namespace autograd { // Internal system RPC to invoke distributed backward pass on remote nodes when // 'rref.b...
1,027
24.7
79
h
null
pytorch-main/torch/csrc/distributed/autograd/rpc_messages/rref_backward_resp.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> namespace torch { namespace distributed { namespace autograd { // Response for the RRefBackwardReq. class TORCH_API RRefBackwardResp : public rpc::RpcCommandBase { public: RRefBackwardResp() = def...
558
24.409091
63
h
null
pytorch-main/torch/csrc/distributed/c10d/TraceUtils.h
#pragma once #include <c10/util/irange.h> #include <torch/csrc/distributed/c10d/Store.hpp> #include <torch/csrc/distributed/c10d/Types.hpp> #include <sys/types.h> #include <cstdlib> #include <string> #include <system_error> #include <vector> namespace c10d { inline std::string getTraceStartKey(const std::string& pg...
6,944
25.711538
80
h
null
pytorch-main/torch/csrc/distributed/c10d/debug.h
// Copyright (c) Meta Platforms, Inc. and its affiliates. // All rights reserved. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #pragma once #include <c10/macros/Macros.h> namespace c10d { enum class DebugLevel { Off = 0, Info ...
604
24.208333
75
h
null
pytorch-main/torch/csrc/distributed/c10d/error.h
// Copyright (c) Facebook, Inc. and its affiliates. // All rights reserved. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #pragma once #include <cstring> #include <system_error> #include <fmt/format.h> namespace fmt { template...
1,361
22.894737
80
h
null
pytorch-main/torch/csrc/distributed/c10d/logging.h
// Copyright (c) Meta Platforms, Inc. and its affiliates. // All rights reserved. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #pragma once #include <string> #include <c10/macros/Macros.h> #include <c10/util/Logging.h> #include...
2,059
38.615385
80
h
null
pytorch-main/torch/csrc/distributed/c10d/python_comm_hook.h
#pragma once #include <torch/csrc/distributed/c10d/comm.hpp> #include <ATen/ATen.h> #include <ATen/core/ivalue.h> #include <torch/csrc/distributed/c10d/ProcessGroup.hpp> #include <torch/csrc/utils/pybind.h> namespace c10d { class TORCH_PYTHON_API PythonCommHook : public CommHookInterface { public: // Takes a sta...
1,072
29.657143
80
h
null
pytorch-main/torch/csrc/distributed/c10d/quantization/quantization.h
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #pragma once #include <ATen/ATen.h> #include <vector> namespace torch { namespace distributed { namespace c10d { namespace quant...
548
22.869565
72
h
null
pytorch-main/torch/csrc/distributed/c10d/quantization/quantization_gpu.h
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #pragma once #include <ATen/ATen.h> #include <vector> namespace torch { namespace distributed { namespace c10d { namespace quant...
550
22.956522
72
h
null
pytorch-main/torch/csrc/distributed/c10d/quantization/quantization_utils.h
// Copyright (c) Meta Platforms, Inc. and affiliates. // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. #pragma once #include <ATen/ATen.h> #include <typeinfo> inline std::string torch_tensor_device_name(const at::Tensor& ten) { ...
1,256
34.914286
72
h
null
pytorch-main/torch/csrc/distributed/rpc/agent_utils.h
#pragma once #include <torch/csrc/distributed/c10d/PrefixStore.hpp> #include <torch/csrc/distributed/rpc/utils.h> namespace torch { namespace distributed { namespace rpc { // All RPC peers should call into this function at the same time. Each peer // provides its own id and name, and this function uses the given Sto...
1,639
33.893617
79
h
null
pytorch-main/torch/csrc/distributed/rpc/message.h
#pragma once #include <torch/types.h> #include <vector> namespace torch { namespace distributed { namespace rpc { // An enum denoting common RPC errors to allow specific error handling for them. enum RPCErrorType { UNKNOWN_ERROR = 0, /* Indicates that error type could not be parsed */ TIMEOUT = 1, /* Indicates t...
7,527
37.804124
80
h
null
pytorch-main/torch/csrc/distributed/rpc/py_rref.h
#pragma once #include <torch/csrc/distributed/rpc/rref_impl.h> #include <torch/csrc/python_headers.h> #include <torch/csrc/utils/pybind.h> namespace torch { namespace distributed { namespace rpc { enum RRefProxyType { RPC_SYNC, RPC_ASYNC, REMOTE }; // Python wrapper of an RRef shared_ptr that supports Python // pic...
2,939
34
80
h
null
pytorch-main/torch/csrc/distributed/rpc/python_call.h
#pragma once #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> namespace torch { namespace distributed { namespace rpc { // RPC call representing calling a Python function over RPC. class TORCH_API PythonCall final : public RpcCommandBase { public: PythonCall(S...
790
22.969697
73
h
null
pytorch-main/torch/csrc/distributed/rpc/python_functions.h
#pragma once #include <torch/csrc/distributed/rpc/py_rref.h> #include <torch/csrc/distributed/rpc/rpc_agent.h> #include <torch/csrc/jit/python/pybind_utils.h> #include <torch/csrc/utils/pybind.h> namespace torch { namespace distributed { namespace rpc { // Converts an internal ivalue::Future of Message into a user-f...
2,307
31.507042
80
h
null
pytorch-main/torch/csrc/distributed/rpc/python_remote_call.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> #include <torch/csrc/jit/serialization/pickler.h> #include <vector> namespace torch { namespace distributed { namespace rpc { class TORCH_API PythonRemot...
1,184
22.7
79
h
null
pytorch-main/torch/csrc/distributed/rpc/python_resp.h
#pragma once #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> namespace torch { namespace distributed { namespace rpc { // RPC call representing the response of a Python UDF over RPC. class TORCH_API PythonResp final : public RpcCommandBase { public: explicit ...
671
23
73
h
null
pytorch-main/torch/csrc/distributed/rpc/python_rpc_handler.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/types.h> #include <torch/csrc/jit/frontend/script_type_parser.h> #include <torch/csrc/utils/pybind.h> namespace torch { namespace distributed { namespace rpc { // Singleton class provides interface to execute python UDF...
5,004
36.350746
79
h
null
pytorch-main/torch/csrc/distributed/rpc/request_callback.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> namespace torch { namespace distributed { namespace rpc { // Functor which is invoked to process an RPC message. This is an abstract class // with some common functionality across all request handlers. Users need to // implement this interface to perform t...
1,276
33.513514
80
h
null
pytorch-main/torch/csrc/distributed/rpc/request_callback_impl.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/request_callback_no_python.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/jit/python/pybind.h> namespace torch { namespace distributed { namespace rpc { class TORCH_API RequestCallbackI...
2,083
30.575758
77
h
null
pytorch-main/torch/csrc/distributed/rpc/request_callback_no_python.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/request_callback.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/rref_impl.h> #include <torch/csrc/distributed/rpc/script_call.h> #include <torch/csrc/distributed/rpc/scrip...
3,884
31.375
80
h
null
pytorch-main/torch/csrc/distributed/rpc/rpc_agent.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/request_callback.h> #include <torch/csrc/distributed/rpc/types.h> #include <algorithm> #include <cctype> #include <chrono> #include <condition_variable> #include <mutex> #include <thread> namespace torch { namespace dis...
13,445
38.315789
85
h
null
pytorch-main/torch/csrc/distributed/rpc/rpc_command_base.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/types.h> namespace torch { namespace distributed { namespace rpc { // Base class for all RPC request and responses. class RpcCommandBase { public: // Need to override this to serialize the RPC. This should destructiv...
728
25.035714
74
h
null
pytorch-main/torch/csrc/distributed/rpc/rref_context.h
#pragma once #include <c10/util/Optional.h> #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_agent.h> #include <torch/csrc/distributed/rpc/rref_impl.h> #include <torch/csrc/distributed/rpc/types.h> #include <torch/csrc/distributed/rpc/utils.h> #include <atomic> namespace torch...
15,829
45.558824
80
h
null
pytorch-main/torch/csrc/distributed/rpc/rref_impl.h
#pragma once #include <ATen/core/jit_type.h> #include <ATen/core/rref_interface.h> #include <c10/core/Event.h> #include <c10/util/Optional.h> #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_agent.h> #include <torch/csrc/distributed/rpc/types.h> #include <atomic> namespace tor...
16,159
37.384798
115
h
null
pytorch-main/torch/csrc/distributed/rpc/rref_proto.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> #include <torch/csrc/jit/runtime/operator.h> #include <torch/csrc/jit/serialization/pickler.h> #include <vector> namespace torch { namespace distributed {...
5,332
30.934132
79
h
null
pytorch-main/torch/csrc/distributed/rpc/script_call.h
#pragma once #include <c10/util/Optional.h> #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/jit/runtime/operator.h> #include <torch/csrc/jit/serialization/pickler.h> #include <vector> namespace torch { namespace distributed { namespace rpc ...
2,527
34.111111
80
h
null
pytorch-main/torch/csrc/distributed/rpc/script_remote_call.h
#pragma once #include <torch/csrc/distributed/rpc/script_call.h> #include <torch/csrc/distributed/rpc/types.h> #include <torch/csrc/jit/runtime/operator.h> #include <torch/csrc/jit/serialization/pickler.h> #include <vector> namespace torch { namespace distributed { namespace rpc { using torch::jit::Operator; // A S...
1,652
27.5
80
h
null
pytorch-main/torch/csrc/distributed/rpc/script_resp.h
#pragma once #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/jit/serialization/pickler.h> namespace torch { namespace distributed { namespace rpc { // Return value of a builtin operator or a TorchScript function. class TORCH_API ScriptResp...
678
24.148148
73
h
null
pytorch-main/torch/csrc/distributed/rpc/tensorpipe_agent.h
#pragma once #ifdef USE_TENSORPIPE #include <atomic> #include <thread> #include <c10/core/thread_pool.h> #include <torch/csrc/distributed/c10d/PrefixStore.hpp> #include <torch/csrc/distributed/c10d/Store.hpp> #include <torch/csrc/distributed/rpc/rpc_agent.h> // Forward-declare the TensorPipe classes we need, to avo...
17,423
34.129032
80
h
null
pytorch-main/torch/csrc/distributed/rpc/tensorpipe_utils.h
#pragma once #ifdef USE_TENSORPIPE #include <torch/csrc/distributed/rpc/utils.h> namespace tensorpipe { class Message; class Allocation; class Descriptor; } // namespace tensorpipe namespace torch { namespace distributed { namespace rpc { TORCH_API const c10::Stream& getStreamForDevice( const std::vector<c10::...
4,748
37.298387
80
h
null
pytorch-main/torch/csrc/distributed/rpc/torchscript_functions.h
#pragma once #include <ATen/core/ivalue.h> #include <torch/csrc/autograd/profiler.h> #include <torch/csrc/distributed/autograd/utils.h> #include <torch/csrc/distributed/rpc/rref_context.h> #include <torch/csrc/distributed/rpc/script_remote_call.h> namespace torch { namespace distributed { namespace rpc { // This fun...
1,707
39.666667
78
h
null
pytorch-main/torch/csrc/distributed/rpc/types.h
#pragma once #include <ATen/core/ivalue.h> #include <atomic> namespace torch { namespace distributed { namespace rpc { using worker_id_t = int16_t; using local_id_t = int64_t; bool getAllowJitRRefPickle(); TORCH_API void enableJitRRefPickle(); TORCH_API void disableJitRRefPickle(); struct TORCH_API JitRRefPickleGu...
1,720
24.686567
75
h
null
pytorch-main/torch/csrc/distributed/rpc/unpickled_python_call.h
#pragma once #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> #include <torch/csrc/utils/pybind.h> namespace torch { namespace distributed { namespace rpc { // This class converts the content in a PythonCall into py::object. This is a // helper class to make sure...
1,367
31.571429
80
h
null
pytorch-main/torch/csrc/distributed/rpc/unpickled_python_remote_call.h
#pragma once #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/distributed/rpc/types.h> #include <torch/csrc/distributed/rpc/unpickled_python_call.h> #include <torch/csrc/utils/pybind.h> namespace torch { namespace distributed { namespace rpc { // This class converts the content in a Pyth...
1,257
32.105263
79
h
null
pytorch-main/torch/csrc/distributed/rpc/utils.h
#pragma once #include <c10/core/Device.h> #include <c10/core/Event.h> #include <c10/core/Stream.h> #include <torch/csrc/autograd/profiler.h> #include <torch/csrc/distributed/rpc/rpc_command_base.h> #include <torch/csrc/jit/serialization/pickle.h> #include <torch/csrc/utils/byte_order.h> namespace tensorpipe { class M...
3,905
40.115789
80
h
null
pytorch-main/torch/csrc/distributed/rpc/metrics/RpcMetricsHandler.h
#pragma once #include <c10/util/Registry.h> #include <string> namespace torch { namespace distributed { namespace rpc { // All metrics are prefixed with the following key. // NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays) constexpr char kRpcMetricsKeyPrefix[] = "torch.distributed.rpc."; // ...
1,617
34.955556
80
h
null
pytorch-main/torch/csrc/distributed/rpc/profiler/remote_profiler_manager.h
#pragma once #include <c10/util/Optional.h> #include <torch/csrc/Export.h> #include <torch/csrc/distributed/rpc/types.h> #include <mutex> #include <unordered_map> namespace torch { namespace distributed { namespace rpc { extern const std::string REMOTE_PROFILING_KEY_PREFIX; class TORCH_API RemoteProfilerManager { pu...
2,287
37.133333
80
h
null
pytorch-main/torch/csrc/distributed/rpc/profiler/server_process_global_profiler.h
#pragma once #include <shared_mutex> #include <torch/csrc/autograd/profiler.h> namespace torch { namespace distributed { namespace rpc { namespace profiler { namespace processglobal { using namespace torch::autograd::profiler; // Process global profiler state. // // This class holds information about a profiling r...
4,334
31.111111
79
h
null
pytorch-main/torch/csrc/distributed/rpc/testing/faulty_tensorpipe_agent.h
#pragma once #ifdef USE_TENSORPIPE #include <torch/csrc/distributed/rpc/message.h> #include <torch/csrc/distributed/rpc/tensorpipe_agent.h> namespace torch { namespace distributed { namespace rpc { struct TORCH_API FaultyTensorPipeRpcBackendOptions : public TensorPipeRpcBackendOptions { FaultyTensorPipeRpcBac...
3,819
34.045872
80
h
null
pytorch-main/torch/csrc/dynamo/cpython_defs.c
#include <torch/csrc/dynamo/cpython_defs.h> #ifdef _WIN32 #define unlikely(x) (x) #else #define unlikely(x) __builtin_expect((x), 0) #endif #define CHECK(cond) \ if (unlikely(!(cond))) { \ fprintf(stderr, "DEBUG CHE...
12,876
36.216763
124
c