Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributes+1
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_fake_quantize_learnable_per_tensor_affine_backward_cpu_dispatch.hAdded+23
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_pack_padded_sequence_backward_compositeimplicitautograd_dispatch.hAdded+24
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/add_ops.hAdded+83
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/argmin_meta_dispatch.hAdded+25
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/baddbmm_cuda_dispatch.hAdded+26
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/empty_strided_compositeexplicitautograd_dispatch.hAdded+26
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/lerp_compositeexplicitautogradnonfunctional_dispatch.hAdded+26
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/logit_backward_native.hAdded+23
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/lu_unpack_native.hAdded+23
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/native_batch_norm_cpu_dispatch.hAdded+25
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/nonzero_native.hAdded+24
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/special_legendre_polynomial_p.hAdded+67
- videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/sym_stride.hAdded+30
- vllm/lib/python3.10/site-packages/ray/_private/__pycache__/worker.cpython-310.pycAdded+3
- vllm/lib/python3.10/site-packages/ray/data/__pycache__/aggregate.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/__pycache__/block.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/__pycache__/context.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/__pycache__/exceptions.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/__pycache__/grouped_data.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/__pycache__/iterator.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/__pycache__/preprocessor.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/arrow_ops/transform_pyarrow.pyAdded+497
- vllm/lib/python3.10/site-packages/ray/data/_internal/datasource/__pycache__/__init__.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/datasource/__pycache__/hudi_datasource.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/datasource/__pycache__/webdataset_datasink.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/__pycache__/__init__.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/__pycache__/optimizers.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/__pycache__/util.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/__init__.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/logical_operator.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/logical_plan.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/operator.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/optimizer.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/physical_plan.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/plan.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/logical_operator.pyAdded+79
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/logical_plan.pyAdded+31
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/operator.pyAdded+58
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/optimizer.pyAdded+29
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/physical_plan.pyAdded+34
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__init__.pyAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/__init__.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/all_to_all_operator.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/count_operator.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/from_operators.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/input_data_operator.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/map_operator.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/n_ary_operator.cpython-310.pycAdded
- vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/one_to_one_operator.cpython-310.pycAdded
1481 unmodified lines1482148314841481 unmodified linesparrot/lib/python3.10/site-packages/numpy/random/_pcg64.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textparrot/lib/python3.10/site-packages/scipy/stats/tests/__pycache__/test_distributions.cpython-310.pyc filter=lfs diff=lfs merge=lfs -textparrot/lib/python3.10/site-packages/scipy/constants/__pycache__/_codata.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text1481 unmodified lines14821483148414851481 unmodified linesparrot/lib/python3.10/site-packages/numpy/random/_pcg64.cpython-310-x86_64-linux-gnu.so filter=lfs diff=lfs merge=lfs -textparrot/lib/python3.10/site-packages/scipy/stats/tests/__pycache__/test_distributions.cpython-310.pyc filter=lfs diff=lfs merge=lfs -textparrot/lib/python3.10/site-packages/scipy/constants/__pycache__/_codata.cpython-310.pyc filter=lfs diff=lfs merge=lfs -textvllm/lib/python3.10/site-packages/ray/_private/__pycache__/worker.cpython-310.pyc filter=lfs diff=lfs merge=lfs -text
1234567891011121314151617181920212223#pragma once// @generated by torchgen/gen.py from DispatchKeyFunction.h
// NB: The implementing C++ file is RegisterDispatchKey.cpp
// The only #includes we need are for custom classes that have defaults in the C++ API#include <c10/core/MemoryFormat.h>#include <c10/core/Scalar.h>#include <ATen/core/Reduction.h>
// Forward declarations of any types needed in the operator signatures.// We can't directly include these classes because it will cause circular include dependencies.// This file is included by TensorBody.h, which defines the Tensor class.#include <ATen/core/ATen_fwd.h>
namespace at {
namespace cpu {
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> _fake_quantize_learnable_per_tensor_affine_backward(const at::Tensor & grad, const at::Tensor & self, const at::Tensor & scale, const at::Tensor & zero_point, int64_t quant_min, int64_t quant_max, double grad_factor=1.0);
} // namespace cpu} // namespace at123456789101112131415161718192021222324#pragma once// @generated by torchgen/gen.py from DispatchKeyFunction.h
// NB: The implementing C++ file is RegisterDispatchKey.cpp
// The only #includes we need are for custom classes that have defaults in the C++ API#include <c10/core/MemoryFormat.h>#include <c10/core/Scalar.h>#include <ATen/core/Reduction.h>
// Forward declarations of any types needed in the operator signatures.// We can't directly include these classes because it will cause circular include dependencies.// This file is included by TensorBody.h, which defines the Tensor class.#include <ATen/core/ATen_fwd.h>
namespace at {
namespace compositeimplicitautograd {
TORCH_API at::Tensor _pack_padded_sequence_backward(const at::Tensor & grad, at::IntArrayRef input_size, const at::Tensor & batch_sizes, bool batch_first);TORCH_API at::Tensor _pack_padded_sequence_backward_symint(const at::Tensor & grad, c10::SymIntArrayRef input_size, const at::Tensor & batch_sizes, bool batch_first);
} // namespace compositeimplicitautograd} // namespace at1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283#pragma once
// @generated by torchgen/gen.py from Operator.h
#include <tuple>#include <vector>
// Forward declarations of any types needed in the operator signatures.// We can't directly include these classes because it will cause circular include dependencies.// This file is included by TensorBody.h, which defines the Tensor class.#include <ATen/core/ATen_fwd.h>
namespace at {namespace _ops {
struct TORCH_API add_Tensor { using schema = at::Tensor (const at::Tensor &, const at::Tensor &, const at::Scalar &); using ptr_schema = schema*; // See Note [static constexpr char* members for windows NVCC] STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::add") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "add.Tensor(Tensor self, Tensor other, *, Scalar alpha=1) -> Tensor") static at::Tensor call(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha); static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha);};
struct TORCH_API add__Tensor { using schema = at::Tensor & (at::Tensor &, const at::Tensor &, const at::Scalar &); using ptr_schema = schema*; // See Note [static constexpr char* members for windows NVCC] STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::add_") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Tensor") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "add_.Tensor(Tensor(a!) self, Tensor other, *, Scalar alpha=1) -> Tensor(a!)") static at::Tensor & call(at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha); static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha);};
struct TORCH_API add_out { using schema = at::Tensor & (const at::Tensor &, const at::Tensor &, const at::Scalar &, at::Tensor &); using ptr_schema = schema*; // See Note [static constexpr char* members for windows NVCC] STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::add") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "out") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "add.out(Tensor self, Tensor other, *, Scalar alpha=1, Tensor(a!) out) -> Tensor(a!)") static at::Tensor & call(const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha, at::Tensor & out); static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Tensor & other, const at::Scalar & alpha, at::Tensor & out);};
struct TORCH_API add_Scalar { using schema = at::Tensor (const at::Tensor &, const at::Scalar &, const at::Scalar &); using ptr_schema = schema*; // See Note [static constexpr char* members for windows NVCC] STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::add") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "add.Scalar(Tensor self, Scalar other, Scalar alpha=1) -> Tensor") static at::Tensor call(const at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha); static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha);};
struct TORCH_API add__Scalar { using schema = at::Tensor & (at::Tensor &, const at::Scalar &, const at::Scalar &); using ptr_schema = schema*; // See Note [static constexpr char* members for windows NVCC] STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::add_") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "add_.Scalar(Tensor(a!) self, Scalar other, Scalar alpha=1) -> Tensor(a!)") static at::Tensor & call(at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha); static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha);};
struct TORCH_API add_Scalar_out { using schema = at::Tensor & (const at::Tensor &, const at::Scalar &, const at::Scalar &, at::Tensor &); using ptr_schema = schema*; // See Note [static constexpr char* members for windows NVCC] STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::add") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "Scalar_out") STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "add.Scalar_out(Tensor self, Scalar other, Scalar alpha=1, *, Tensor(a!) out) -> Tensor(a!)") static at::Tensor & call(const at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha, at::Tensor & out); static at::Tensor & redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self, const at::Scalar & other, const at::Scalar & alpha, at::Tensor & out);};
}} // namespace at::_ops12345678910111213141516171819202122232425#pragma once// @generated by torchgen/gen.py from DispatchKeyFunction.h
// NB: The implementing C++ file is RegisterDispatchKey.cpp
// The only #includes we need are for custom classes that have defaults in the C++ API#include <c10/core/MemoryFormat.h>#include <c10/core/Scalar.h>#include <ATen/core/Reduction.h>
// Forward declarations of any types needed in the operator signatures.// We can't directly include these classes because it will cause circular include dependencies.// This file is included by TensorBody.h, which defines the Tensor class.#include <ATen/core/ATen_fwd.h>
namespace at {
namespace meta {
TORCH_API at::Tensor argmin(const at::Tensor & self, c10::optional<int64_t> dim=c10::nullopt, bool keepdim=false);TORCH_API at::Tensor & argmin_out(at::Tensor & out, const at::Tensor & self, c10::optional<int64_t> dim=c10::nullopt, bool keepdim=false);TORCH_API at::Tensor & argmin_outf(const at::Tensor & self, c10::optional<int64_t> dim, bool keepdim, at::Tensor & out);
} // namespace meta} // namespace at1234567891011121314151617181920212223242526#pragma once// @generated by torchgen/gen.py from DispatchKeyFunction.h
// NB: The implementing C++ file is RegisterDispatchKey.cpp
// The only #includes we need are for custom classes that have defaults in the C++ API#include <c10/core/MemoryFormat.h>#include <c10/core/Scalar.h>#include <ATen/core/Reduction.h>
// Forward declarations of any types needed in the operator signatures.// We can't directly include these classes because it will cause circular include dependencies.// This file is included by TensorBody.h, which defines the Tensor class.#include <ATen/core/ATen_fwd.h>
namespace at {
namespace cuda {
TORCH_API at::Tensor baddbmm(const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);TORCH_API at::Tensor & baddbmm_out(at::Tensor & out, const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);TORCH_API at::Tensor & baddbmm_outf(const at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta, const at::Scalar & alpha, at::Tensor & out);TORCH_API at::Tensor & baddbmm_(at::Tensor & self, const at::Tensor & batch1, const at::Tensor & batch2, const at::Scalar & beta=1, const at::Scalar & alpha=1);
} // namespace cuda} // namespace at1234567891011121314151617181920212223242526#pragma once// @generated by torchgen/gen.py from DispatchKeyFunction.h
// NB: The implementing C++ file is RegisterDispatchKey.cpp
// The only #includes we need are for custom classes that have defaults in the C++ API#include <c10/core/MemoryFormat.h>#include <c10/core/Scalar.h>#include <ATen/core/Reduction.h>
// Forward declarations of any types needed in the operator signatures.// We can't directly include these classes because it will cause circular include dependencies.// This file is included by TensorBody.h, which defines the Tensor class.#include <ATen/core/ATen_fwd.h>
namespace at {
namespace compositeexplicitautograd {
TORCH_API at::Tensor & empty_strided_out(at::Tensor & out, at::IntArrayRef size, at::IntArrayRef stride);TORCH_API at::Tensor & empty_strided_outf(at::IntArrayRef size, at::IntArrayRef stride, at::Tensor & out);TORCH_API at::Tensor & empty_strided_symint_out(at::Tensor & out, c10::SymIntArrayRef size, c10::SymIntArrayRef stride);TORCH_API at::Tensor & empty_strided_symint_outf(c10::SymIntArrayRef size, c10::SymIntArrayRef stride, at::Tensor & out);
} // namespace compositeexplicitautograd} // namespace at1234567891011121314151617181920212223242526#pragma once// @generated by torchgen/gen.py from DispatchKeyFunction.h
// NB: The implementing C++ file is RegisterDispatchKey.cpp
// The only #includes we need are for custom classes that have defaults in the C++ API#include <c10/core/MemoryFormat.h>#include <c10/core/Scalar.h>#include <ATen/core/Reduction.h>
// Forward declarations of any types needed in the operator signatures.// We can't directly include these classes because it will cause circular include dependencies.// This file is included by TensorBody.h, which defines the Tensor class.#include <ATen/core/ATen_fwd.h>
namespace at {
namespace compositeexplicitautogradnonfunctional {
TORCH_API at::Tensor lerp(const at::Tensor & self, const at::Tensor & end, const at::Scalar & weight);TORCH_API at::Tensor & lerp_(at::Tensor & self, const at::Tensor & end, const at::Scalar & weight);TORCH_API at::Tensor lerp(const at::Tensor & self, const at::Tensor & end, const at::Tensor & weight);TORCH_API at::Tensor & lerp_(at::Tensor & self, const at::Tensor & end, const at::Tensor & weight);
} // namespace compositeexplicitautogradnonfunctional} // namespace at1234567891011121314151617181920212223#pragma once
// @generated by torchgen/gen.py from NativeFunction.h
#include <c10/core/Scalar.h>#include <c10/core/Storage.h>#include <c10/core/TensorOptions.h>#include <c10/util/Deprecated.h>#include <c10/util/Optional.h>#include <c10/core/QScheme.h>#include <ATen/core/Reduction.h>#include <ATen/core/Tensor.h>#include <tuple>#include <vector>#include <ATen/ops/logit_backward_meta.h>
namespace at {namespace native {struct TORCH_API structured_logit_backward_out : public at::meta::structured_logit_backward {void impl(const at::Tensor & grad_output, const at::Tensor & self, c10::optional<double> eps, const at::Tensor & grad_input);};} // namespace native} // namespace at1234567891011121314151617181920212223#pragma once
// @generated by torchgen/gen.py from NativeFunction.h
#include <c10/core/Scalar.h>#include <c10/core/Storage.h>#include <c10/core/TensorOptions.h>#include <c10/util/Deprecated.h>#include <c10/util/Optional.h>#include <c10/core/QScheme.h>#include <ATen/core/Reduction.h>#include <ATen/core/Tensor.h>#include <tuple>#include <vector>#include <ATen/ops/lu_unpack_meta.h>
namespace at {namespace native {struct TORCH_API structured_lu_unpack_out : public at::meta::structured_lu_unpack {void impl(const at::Tensor & LU_data, const at::Tensor & LU_pivots, bool unpack_data, bool unpack_pivots, const at::Tensor & P, const at::Tensor & L, const at::Tensor & U);};} // namespace native} // namespace at12345678910111213141516171819202122232425#pragma once// @generated by torchgen/gen.py from DispatchKeyFunction.h
// NB: The implementing C++ file is RegisterDispatchKey.cpp
// The only #includes we need are for custom classes that have defaults in the C++ API#include <c10/core/MemoryFormat.h>#include <c10/core/Scalar.h>#include <ATen/core/Reduction.h>
// Forward declarations of any types needed in the operator signatures.// We can't directly include these classes because it will cause circular include dependencies.// This file is included by TensorBody.h, which defines the Tensor class.#include <ATen/core/ATen_fwd.h>
namespace at {
namespace cpu {
TORCH_API ::std::tuple<at::Tensor,at::Tensor,at::Tensor> native_batch_norm(const at::Tensor & input, const c10::optional<at::Tensor> & weight, const c10::optional<at::Tensor> & bias, const c10::optional<at::Tensor> & running_mean, const c10::optional<at::Tensor> & running_var, bool training, double momentum, double eps);TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> native_batch_norm_out(at::Tensor & out, at::Tensor & save_mean, at::Tensor & save_invstd, const at::Tensor & input, const c10::optional<at::Tensor> & weight, const c10::optional<at::Tensor> & bias, const c10::optional<at::Tensor> & running_mean, const c10::optional<at::Tensor> & running_var, bool training, double momentum, double eps);TORCH_API ::std::tuple<at::Tensor &,at::Tensor &,at::Tensor &> native_batch_norm_outf(const at::Tensor & input, const c10::optional<at::Tensor> & weight, const c10::optional<at::Tensor> & bias, const c10::optional<at::Tensor> & running_mean, const c10::optional<at::Tensor> & running_var, bool training, double momentum, double eps, at::Tensor & out, at::Tensor & save_mean, at::Tensor & save_invstd);
} // namespace cpu} // namespace at123456789101112131415161718192021222324#pragma once
// @generated by torchgen/gen.py from NativeFunction.h
#include <c10/core/Scalar.h>#include <c10/core/Storage.h>#include <c10/core/TensorOptions.h>#include <c10/util/Deprecated.h>#include <c10/util/Optional.h>#include <c10/core/QScheme.h>#include <ATen/core/Reduction.h>#include <ATen/core/Tensor.h>#include <tuple>#include <vector>
namespace at {namespace native {TORCH_API at::Tensor nonzero_cpu(const at::Tensor & self);TORCH_API at::Tensor & nonzero_out_cpu(const at::Tensor & self, at::Tensor & out);TORCH_API at::Tensor nonzero_cuda(const at::Tensor & self);TORCH_API at::Tensor & nonzero_out_cuda(const at::Tensor & self, at::Tensor & out);} // namespace native} // namespace at12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667#pragma once
// @generated by torchgen/gen.py from Function.h
#include <ATen/Context.h>#include <ATen/DeviceGuard.h>#include <ATen/TensorUtils.h>#include <ATen/TracerMode.h>#include <ATen/core/Generator.h>#include <ATen/core/Reduction.h>#include <ATen/core/Tensor.h>#include <c10/core/Scalar.h>#include <c10/core/Storage.h>#include <c10/core/TensorOptions.h>#include <c10/util/Deprecated.h>#include <c10/util/Optional.h>
#include <ATen/ops/special_legendre_polynomial_p_ops.h>
namespace at {
// aten::special_legendre_polynomial_p(Tensor x, Tensor n) -> Tensorinline at::Tensor special_legendre_polynomial_p(const at::Tensor & x, const at::Tensor & n) { return at::_ops::special_legendre_polynomial_p::call(x, n);}
// aten::special_legendre_polynomial_p.x_scalar(Scalar x, Tensor n) -> Tensorinline at::Tensor special_legendre_polynomial_p(const at::Scalar & x, const at::Tensor & n) { return at::_ops::special_legendre_polynomial_p_x_scalar::call(x, n);}
// aten::special_legendre_polynomial_p.n_scalar(Tensor x, Scalar n) -> Tensorinline at::Tensor special_legendre_polynomial_p(const at::Tensor & x, const at::Scalar & n) { return at::_ops::special_legendre_polynomial_p_n_scalar::call(x, n);}
// aten::special_legendre_polynomial_p.out(Tensor x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)inline at::Tensor & special_legendre_polynomial_p_out(at::Tensor & out, const at::Tensor & x, const at::Tensor & n) { return at::_ops::special_legendre_polynomial_p_out::call(x, n, out);}// aten::special_legendre_polynomial_p.out(Tensor x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)inline at::Tensor & special_legendre_polynomial_p_outf(const at::Tensor & x, const at::Tensor & n, at::Tensor & out) { return at::_ops::special_legendre_polynomial_p_out::call(x, n, out);}
// aten::special_legendre_polynomial_p.x_scalar_out(Scalar x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)inline at::Tensor & special_legendre_polynomial_p_out(at::Tensor & out, const at::Scalar & x, const at::Tensor & n) { return at::_ops::special_legendre_polynomial_p_x_scalar_out::call(x, n, out);}// aten::special_legendre_polynomial_p.x_scalar_out(Scalar x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)inline at::Tensor & special_legendre_polynomial_p_outf(const at::Scalar & x, const at::Tensor & n, at::Tensor & out) { return at::_ops::special_legendre_polynomial_p_x_scalar_out::call(x, n, out);}
// aten::special_legendre_polynomial_p.n_scalar_out(Tensor x, Scalar n, *, Tensor(a!) out) -> Tensor(a!)inline at::Tensor & special_legendre_polynomial_p_out(at::Tensor & out, const at::Tensor & x, const at::Scalar & n) { return at::_ops::special_legendre_polynomial_p_n_scalar_out::call(x, n, out);}// aten::special_legendre_polynomial_p.n_scalar_out(Tensor x, Scalar n, *, Tensor(a!) out) -> Tensor(a!)inline at::Tensor & special_legendre_polynomial_p_outf(const at::Tensor & x, const at::Scalar & n, at::Tensor & out) { return at::_ops::special_legendre_polynomial_p_n_scalar_out::call(x, n, out);}
}123456789101112131415161718192021222324252627282930#pragma once
// @generated by torchgen/gen.py from Function.h
#include <ATen/Context.h>#include <ATen/DeviceGuard.h>#include <ATen/TensorUtils.h>#include <ATen/TracerMode.h>#include <ATen/core/Generator.h>#include <ATen/core/Reduction.h>#include <ATen/core/Tensor.h>#include <c10/core/Scalar.h>#include <c10/core/Storage.h>#include <c10/core/TensorOptions.h>#include <c10/util/Deprecated.h>#include <c10/util/Optional.h>
#include <ATen/ops/sym_stride_ops.h>
namespace at {
// aten::sym_stride.int(Tensor self, int dim) -> SymIntinline c10::SymInt __dispatch_sym_stride(const at::Tensor & self, int64_t dim) { return at::_ops::sym_stride_int::call(self, dim);}
}123version https://git-lfs.github.com/spec/v1oid sha256:533616df3ad15bb7a8fd9a3e98b76407e4402a34776af33758cdd165caa17decsize 105370123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497from typing import TYPE_CHECKING, List, Union
import numpy as npfrom packaging.version import parse as parse_version
from ray._private.utils import _get_pyarrow_versionfrom ray.air.util.tensor_extensions.arrow import ( INT32_OVERFLOW_THRESHOLD, MIN_PYARROW_VERSION_CHUNKED_ARRAY_TO_NUMPY_ZERO_COPY_ONLY, PYARROW_VERSION,)
try: import pyarrowexcept ImportError: pyarrow = None
if TYPE_CHECKING: from ray.data._internal.planner.exchange.sort_task_spec import SortKey
def sort(table: "pyarrow.Table", sort_key: "SortKey") -> "pyarrow.Table": import pyarrow.compute as pac
indices = pac.sort_indices(table, sort_keys=sort_key.to_arrow_sort_args()) return take_table(table, indices)
def take_table( table: "pyarrow.Table", indices: Union[List[int], "pyarrow.Array", "pyarrow.ChunkedArray"],) -> "pyarrow.Table": """Select rows from the table.
This method is an alternative to pyarrow.Table.take(), which breaks for extension arrays. This is exposed as a static method for easier use on intermediate tables, not underlying an ArrowBlockAccessor. """ from ray.air.util.transform_pyarrow import ( _concatenate_extension_column, _is_column_extension_type, )
if any(_is_column_extension_type(col) for col in table.columns): new_cols = [] for col in table.columns: if _is_column_extension_type(col) and col.num_chunks > 1: # .take() will concatenate internally, which currently breaks for # extension arrays. col = _concatenate_extension_column(col) new_cols.append(col.take(indices)) table = pyarrow.Table.from_arrays(new_cols, schema=table.schema) else: table = table.take(indices) return table
def unify_schemas( schemas: List["pyarrow.Schema"],) -> "pyarrow.Schema": """Version of `pyarrow.unify_schemas()` which also handles checks for variable-shaped tensors in the given schemas.
This function scans all input schemas to identify columns that contain variable-shaped tensors or objects. For tensor columns, it ensures the use of appropriate tensor types (including variable-shaped tensor types). For object columns, it uses a specific object type to accommodate any objects present. Additionally, it handles columns with null-typed lists by determining their actual types from the given schemas.
Currently, it disallows the concatenation of tensor columns and pickled object columsn for performance reasons. """ import pyarrow as pa
from ray.air.util.object_extensions.arrow import ArrowPythonObjectType from ray.air.util.tensor_extensions.arrow import ( ArrowTensorType, ArrowVariableShapedTensorType, )
schemas_to_unify = [] schema_field_overrides = {}
# Rollup columns with opaque (null-typed) lists, to override types in # the following for-loop. cols_with_null_list = set()
all_columns = set() for schema in schemas: for col_name in schema.names: col_type = schema.field(col_name).type if pa.types.is_list(col_type) and pa.types.is_null(col_type.value_type): cols_with_null_list.add(col_name) all_columns.add(col_name)
from ray.air.util.tensor_extensions.arrow import ( get_arrow_extension_fixed_shape_tensor_types, get_arrow_extension_tensor_types, )
arrow_tensor_types = get_arrow_extension_tensor_types() arrow_fixed_shape_tensor_types = get_arrow_extension_fixed_shape_tensor_types()
columns_with_objects = set() columns_with_tensor_array = set() for col_name in all_columns: for s in schemas: indices = s.get_all_field_indices(col_name) if len(indices) > 1: # This is broken for Pandas blocks and broken with the logic here raise ValueError( f"Schema {s} has multiple fields with the same name: {col_name}" ) elif len(indices) == 0: continue if isinstance(s.field(col_name).type, ArrowPythonObjectType): columns_with_objects.add(col_name) if isinstance(s.field(col_name).type, arrow_tensor_types): columns_with_tensor_array.add(col_name)
if len(columns_with_objects.intersection(columns_with_tensor_array)) > 0: # This is supportable if we use object type, but it will be expensive raise ValueError( "Found columns with both objects and tensors: " f"{columns_with_tensor_array.intersection(columns_with_objects)}" ) for col_name in columns_with_tensor_array: tensor_array_types = [ s.field(col_name).type for s in schemas if isinstance(s.field(col_name).type, arrow_tensor_types) ]
if ArrowTensorType._need_variable_shaped_tensor_array(tensor_array_types): if isinstance(tensor_array_types[0], ArrowVariableShapedTensorType): new_type = tensor_array_types[0] elif isinstance(tensor_array_types[0], arrow_fixed_shape_tensor_types): new_type = ArrowVariableShapedTensorType( dtype=tensor_array_types[0].scalar_type, ndim=len(tensor_array_types[0].shape), ) else: raise ValueError( "Detected need for variable shaped tensor representation, " f"but schema is not ArrayTensorType: {tensor_array_types[0]}" ) schema_field_overrides[col_name] = new_type
for col_name in columns_with_objects: schema_field_overrides[col_name] = ArrowPythonObjectType()
if cols_with_null_list: # For each opaque list column, iterate through all schemas until we find # a valid value_type that can be used to override the column types in # the following for-loop. for col_name in cols_with_null_list: for schema in schemas: col_type = schema.field(col_name).type if not pa.types.is_list(col_type) or not pa.types.is_null( col_type.value_type ): schema_field_overrides[col_name] = col_type break
if schema_field_overrides: # Go through all schemas and update the types of columns from the above loop. for schema in schemas: for col_name, col_new_type in schema_field_overrides.items(): var_shaped_col = schema.field(col_name).with_type(col_new_type) col_idx = schema.get_field_index(col_name) schema = schema.set(col_idx, var_shaped_col) schemas_to_unify.append(schema) else: schemas_to_unify = schemas # Let Arrow unify the schema of non-tensor extension type columns. return pyarrow.unify_schemas(schemas_to_unify)
def _concatenate_chunked_arrays(arrs: "pyarrow.ChunkedArray") -> "pyarrow.ChunkedArray": """ Concatenate provided chunked arrays into a single chunked array. """ from ray.data.extensions import get_arrow_extension_tensor_types
tensor_types = get_arrow_extension_tensor_types()
# Single flat list of chunks across all chunked arrays. chunks = [] type_ = None for arr in arrs: if type_ is None: type_ = arr.type else: if isinstance(type_, tensor_types): raise ValueError( "_concatenate_chunked_arrays should only be used on non-tensor " f"extension types, but got a chunked array of type {type_}." ) assert type_ == arr.type, f"Types mismatch: {type_} != {arr.type}" # Add chunks for this chunked array to flat chunk list. chunks.extend(arr.chunks) # Construct chunked array on flat list of chunks. return pyarrow.chunked_array(chunks, type=type_)
def concat(blocks: List["pyarrow.Table"]) -> "pyarrow.Table": """Concatenate provided Arrow Tables into a single Arrow Table. This has special handling for extension types that pyarrow.concat_tables does not yet support. """ import pyarrow as pa
from ray.air.util.tensor_extensions.arrow import ArrowConversionError from ray.data.extensions import ( ArrowPythonObjectArray, ArrowPythonObjectType, ArrowTensorArray, get_arrow_extension_tensor_types, )
tensor_types = get_arrow_extension_tensor_types()
if not blocks: # Short-circuit on empty list of blocks. return blocks
if len(blocks) == 1: return blocks[0]
# Rollup columns with opaque (null-typed) lists, to process in following for-loop. cols_with_null_list = set() for b in blocks: for col_name in b.schema.names: col_type = b.schema.field(col_name).type if pa.types.is_list(col_type) and pa.types.is_null(col_type.value_type): cols_with_null_list.add(col_name)
# If the result contains pyarrow schemas, unify them schemas_to_unify = [b.schema for b in blocks] try: schema = unify_schemas(schemas_to_unify) except Exception as e: raise ArrowConversionError(str(blocks)) from e
if ( any(isinstance(type_, pa.ExtensionType) for type_ in schema.types) or cols_with_null_list ): # Custom handling for extension array columns. cols = [] for col_name in schema.names: col_chunked_arrays = [] for block in blocks: col_chunked_arrays.append(block.column(col_name))
if isinstance(schema.field(col_name).type, tensor_types): # For our tensor extension types, manually construct a chunked array # containing chunks from all blocks. This is to handle # homogeneous-shaped block columns having different shapes across # blocks: if tensor element shapes differ across blocks, a # variable-shaped tensor array will be returned. col = ArrowTensorArray._chunk_tensor_arrays( [chunk for ca in col_chunked_arrays for chunk in ca.chunks] ) elif isinstance(schema.field(col_name).type, ArrowPythonObjectType): chunks_to_concat = [] # Cast everything to objects if concatenated with an object column for ca in col_chunked_arrays: for chunk in ca.chunks: if isinstance(ca.type, ArrowPythonObjectType): chunks_to_concat.append(chunk) else: chunks_to_concat.append( ArrowPythonObjectArray.from_objects(chunk.to_pylist()) ) col = pa.chunked_array(chunks_to_concat) else: if col_name in cols_with_null_list: # For each opaque list column, iterate through all schemas until # we find a valid value_type that can be used to override the # column types in the following for-loop. scalar_type = None for arr in col_chunked_arrays: if not pa.types.is_list(arr.type) or not pa.types.is_null( arr.type.value_type ): scalar_type = arr.type break
if scalar_type is not None: for c_idx in range(len(col_chunked_arrays)): c = col_chunked_arrays[c_idx] if pa.types.is_list(c.type) and pa.types.is_null( c.type.value_type ): if pa.types.is_list(scalar_type): # If we are dealing with a list input, # cast the array to the scalar_type found above. col_chunked_arrays[c_idx] = c.cast(scalar_type) else: # If we are dealing with a single value, construct # a new array with null values filled. col_chunked_arrays[c_idx] = pa.chunked_array( [pa.nulls(c.length(), type=scalar_type)] )
col = _concatenate_chunked_arrays(col_chunked_arrays) cols.append(col)
# Build the concatenated table. table = pyarrow.Table.from_arrays(cols, schema=schema) # Validate table schema (this is a cheap check by default). table.validate() else: # No extension array columns, so use built-in pyarrow.concat_tables. if parse_version(_get_pyarrow_version()) >= parse_version("14.0.0"): # `promote` was superseded by `promote_options='default'` in Arrow 14. To # prevent `FutureWarning`s, we manually check the Arrow version and use the # appropriate parameter. table = pyarrow.concat_tables(blocks, promote_options="default") else: table = pyarrow.concat_tables(blocks, promote=True) return table
def concat_and_sort( blocks: List["pyarrow.Table"], sort_key: "SortKey") -> "pyarrow.Table": import pyarrow.compute as pac
ret = concat(blocks) indices = pac.sort_indices(ret, sort_keys=sort_key.to_arrow_sort_args()) return take_table(ret, indices)
def to_numpy( array: Union["pyarrow.Array", "pyarrow.ChunkedArray"], *, zero_copy_only: bool = True,) -> np.ndarray: """Wrapper for `Array`s and `ChunkedArray`s `to_numpy` API, handling API divergence b/w Arrow versions"""
import pyarrow as pa
if isinstance(array, pa.Array): return array.to_numpy(zero_copy_only=zero_copy_only) elif isinstance(array, pa.ChunkedArray): if PYARROW_VERSION >= MIN_PYARROW_VERSION_CHUNKED_ARRAY_TO_NUMPY_ZERO_COPY_ONLY: return array.to_numpy(zero_copy_only=zero_copy_only) else: return array.to_numpy() else: raise ValueError( f"Either of `Array` or `ChunkedArray` was expected, got {type(array)}" )
def combine_chunks(table: "pyarrow.Table") -> "pyarrow.Table": """This is counterpart for Pyarrow's `Table.combine_chunks` that's using extended `ChunkedArray` combination protocol.
For more details check out `combine_chunked_array` py-doc """
new_column_values_arrays = []
for col in table.columns: new_column_values_arrays.append(combine_chunked_array(col))
return pyarrow.Table.from_arrays(new_column_values_arrays, schema=table.schema)
def combine_chunked_array( array: "pyarrow.ChunkedArray",) -> Union["pyarrow.Array", "pyarrow.ChunkedArray"]: """This is counterpart for Pyarrow's `ChunkedArray.combine_chunks` that additionally
1. Handles `ExtensionType`s (like ArrowTensorType, ArrowTensorTypeV2, ArrowPythonObjectType, etc)
2. Making sure `ChunkedArray`s comprising provided `Table` are combined safely, ie avoiding overflows of Arrow's internal offsets (using int32 for most of its native types, other than "large" kind).
For more details check py-doc of `_try_combine_chunks_safe` method. """
import pyarrow as pa
from ray.air.util.transform_pyarrow import ( _concatenate_extension_column, _is_column_extension_type, )
assert isinstance( array, pa.ChunkedArray ), f"Expected `ChunkedArray`, got {type(array)}"
if _is_column_extension_type(array): # Arrow `ExtensionArray`s can't be concatenated via `combine_chunks`, # hence require manual concatenation return _concatenate_extension_column(array) elif len(array.chunks) == 0: # NOTE: In case there's no chunks, we need to explicitly create # an empty array since calling into `combine_chunks` would fail # due to it expecting at least 1 chunk to be present return pa.array([], type=array.type) else: return _try_combine_chunks_safe(array)
def _try_combine_chunks_safe( array: "pyarrow.ChunkedArray", max_chunk_size=INT32_OVERFLOW_THRESHOLD) -> Union["pyarrow.Array", "pyarrow.ChunkedArray"]: """This method provides a safe way of combining `ChunkedArray`s exceeding 2 GiB in size, which aren't using "large_*" types (and therefore relying on int32 offsets).
When handling provided `ChunkedArray` this method will be either
- Relying on PyArrow's default `combine_chunks` (therefore returning single contiguous `Array`) in cases when - Array's total size is < 2 GiB - Array's underlying type is of "large" kind (ie using one of the `large_*` type family) - Safely combining subsets of tasks such that resulting `Array`s to not exceed 2 GiB in size (therefore returning another `ChunkedArray` albeit with potentially smaller number of chunks that have resulted from clumping the original ones)
Returns: - pa.Array if it's possible to combine provided pa.ChunkedArray into single contiguous array - pa.ChunkedArray (albeit with chunks re-combined) if it's not possible to produce single pa.Array """
import pyarrow as pa
from ray.air.util.transform_pyarrow import _is_column_extension_type
assert not _is_column_extension_type( array ), f"Arrow `ExtensionType`s are not accepted (got {array.type})"
int64_type_predicates = [ pa.types.is_large_list, pa.types.is_large_string, pa.types.is_large_binary, pa.types.is_large_unicode, ]
if array.nbytes < max_chunk_size or any( p(array.type) for p in int64_type_predicates ): # It's safe to combine provided `ChunkedArray` in either of 2 cases: # - It's cumulative size is < 2 GiB # - It's of 'large' kind (ie one using int64 offsets internally) return array.combine_chunks()
# In this case it's actually *NOT* safe to try to directly combine # Arrow's `ChunkedArray` and is impossible to produce single, contiguous # `Array` since # - It's estimated to hold > 2 GiB # - Its type is not of the "large" kind (and hence is using int32 # offsets internally, which would overflow) # # In this case instead of combining into single contiguous array, we # instead just "clump" existing chunks into bigger ones, but no bigger # than 2 GiB each. # # NOTE: This branch actually returns `ChunkedArray` and not an `Array`
# To stay under 2 GiB limit we are slicing provided list of chunks into # slices no larger than 2 GiB (as compared to just directly using `concat_arrays`) slices = []
cur_slice_start = 0 cur_slice_size_bytes = 0
for i, chunk in enumerate(array.chunks): chunk_size = chunk.nbytes
if cur_slice_size_bytes + chunk_size > max_chunk_size: slices.append(array.chunks[cur_slice_start:i])
cur_slice_start = i cur_slice_size_bytes = 0
cur_slice_size_bytes += chunk_size
# Add remaining chunks as last slice slices.append(array.chunks[cur_slice_start:])
return pa.chunked_array([pa.concat_arrays(s) for s in slices])12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879from typing import TYPE_CHECKING, Iterator, List, Optional
from .operator import Operatorfrom ray.data.block import BlockMetadata
if TYPE_CHECKING: from ray.data._internal.execution.interfaces import RefBundle
class LogicalOperator(Operator): """Abstract class for logical operators.
A logical operator describes transformation, and later is converted into physical operator. """
def __init__( self, name: str, input_dependencies: List["LogicalOperator"], num_outputs: Optional[int] = None, ): super().__init__( name, input_dependencies, ) for x in input_dependencies: assert isinstance(x, LogicalOperator), x self._num_outputs = num_outputs
def estimated_num_outputs(self) -> Optional[int]: """Returns the estimated number of blocks that would be outputted by this logical operator.
This method does not execute the plan, so it does not take into consideration block splitting. This method only considers high-level block constraints like `Dataset.repartition(num_blocks=X)`. A more accurate estimation can be given by `PhysicalOperator.num_outputs_total()` during execution. """ if self._num_outputs is not None: return self._num_outputs elif len(self._input_dependencies) == 1: return self._input_dependencies[0].estimated_num_outputs() return None
# Override the following 3 methods to correct type hints.
@property def input_dependencies(self) -> List["LogicalOperator"]: return super().input_dependencies # type: ignore
@property def output_dependencies(self) -> List["LogicalOperator"]: return super().output_dependencies # type: ignore
def post_order_iter(self) -> Iterator["LogicalOperator"]: return super().post_order_iter() # type: ignore
def output_data(self) -> Optional[List["RefBundle"]]: """The output data of this operator, or ``None`` if not known.""" return None
def aggregate_output_metadata(self) -> BlockMetadata: """A ``BlockMetadata`` that represents the aggregate metadata of the outputs.
This method is used by methods like :meth:`~ray.data.Dataset.schema` to efficiently return metadata. """ return BlockMetadata(None, None, None, None, None)
def is_lineage_serializable(self) -> bool: """Returns whether the lineage of this operator can be serialized.
An operator is lineage serializable if you can serialize it on one machine and deserialize it on another without losing information. Operators that store object references (e.g., ``InputData``) aren't lineage serializable because the objects aren't available on the deserialized machine. """ return True12345678910111213141516171819202122232425262728293031from typing import TYPE_CHECKING, List
from .logical_operator import LogicalOperatorfrom .plan import Plan
if TYPE_CHECKING: from ray.data import DataContext
class LogicalPlan(Plan): """The plan with a DAG of logical operators."""
def __init__(self, dag: LogicalOperator, context: "DataContext"): super().__init__(context) self._dag = dag
@property def dag(self) -> LogicalOperator: """Get the DAG of logical operators.""" return self._dag
def sources(self) -> List[LogicalOperator]: """List of operators that are sources for this plan's DAG.""" # If an operator has no input dependencies, it's a source. if not any(self._dag.input_dependencies): return [self._dag]
sources = [] for op in self._dag.input_dependencies: sources.extend(LogicalPlan(op, self._context).sources()) return sources12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758from typing import Iterator, List
class Operator: """Abstract class for operators.
Operators live on the driver side of the Dataset only. """
def __init__( self, name: str, input_dependencies: List["Operator"], ): self._name = name self._input_dependencies = input_dependencies self._output_dependencies = [] for x in input_dependencies: assert isinstance(x, Operator), x x._output_dependencies.append(self)
@property def name(self) -> str: return self._name
@property def input_dependencies(self) -> List["Operator"]: """List of operators that provide inputs for this operator.""" assert hasattr( self, "_input_dependencies" ), "Operator.__init__() was not called." return self._input_dependencies
@property def output_dependencies(self) -> List["Operator"]: """List of operators that consume outputs from this operator.""" assert hasattr( self, "_output_dependencies" ), "Operator.__init__() was not called." return self._output_dependencies
def post_order_iter(self) -> Iterator["Operator"]: """Depth-first traversal of this operator and its input dependencies.""" for op in self.input_dependencies: yield from op.post_order_iter() yield self
def __repr__(self) -> str: if self.input_dependencies: out_str = ", ".join([str(x) for x in self.input_dependencies]) out_str += " -> " else: out_str = "" out_str += f"{self.__class__.__name__}[{self._name}]" return out_str
def __str__(self) -> str: return repr(self)1234567891011121314151617181920212223242526272829from typing import List
from .plan import Plan
class Rule: """Abstract class for optimization rule."""
def apply(self, plan: Plan) -> Plan: """Apply the optimization rule to the execution plan.""" raise NotImplementedError
class Optimizer: """Abstract class for optimizers.
An optimizers transforms a DAG of operators with a list of predefined rules. """
@property def rules(self) -> List[Rule]: """List of predefined rules for this optimizer.""" raise NotImplementedError
def optimize(self, plan: Plan) -> Plan: """Optimize operators with a list of rules.""" for rule in self.rules: plan = rule.apply(plan) return plan12345678910111213141516171819202122232425262728293031323334from typing import TYPE_CHECKING, Dict
from .logical_operator import LogicalOperatorfrom .plan import Plan
if TYPE_CHECKING: from ray.data import DataContext from ray.data._internal.execution.interfaces import PhysicalOperator
class PhysicalPlan(Plan): """The plan with a DAG of physical operators."""
def __init__( self, dag: "PhysicalOperator", op_map: Dict["PhysicalOperator", LogicalOperator], context: "DataContext", ): super().__init__(context) self._dag = dag self._op_map = op_map
@property def dag(self) -> "PhysicalOperator": """Get the DAG of physical operators.""" return self._dag
@property def op_map(self) -> Dict["PhysicalOperator", LogicalOperator]: """ Get a mapping from physical operators to their corresponding logical operator. """ return self._op_map.gitattributes+1
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_fake_quantize_learnable_per_tensor_affine_backward_cpu_dispatch.hAdded+23
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_pack_padded_sequence_backward_compositeimplicitautograd_dispatch.hAdded+24
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/add_ops.hAdded+83
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/argmin_meta_dispatch.hAdded+25
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/baddbmm_cuda_dispatch.hAdded+26
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/empty_strided_compositeexplicitautograd_dispatch.hAdded+26
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/lerp_compositeexplicitautogradnonfunctional_dispatch.hAdded+26
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/logit_backward_native.hAdded+23
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/lu_unpack_native.hAdded+23
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/native_batch_norm_cpu_dispatch.hAdded+25
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/nonzero_native.hAdded+24
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/special_legendre_polynomial_p.hAdded+67
videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/sym_stride.hAdded+30
vllm/lib/python3.10/site-packages/ray/_private/__pycache__/worker.cpython-310.pycAdded+3
vllm/lib/python3.10/site-packages/ray/data/__pycache__/aggregate.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/__pycache__/block.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/__pycache__/context.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/__pycache__/exceptions.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/__pycache__/grouped_data.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/__pycache__/iterator.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/__pycache__/preprocessor.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/arrow_ops/transform_pyarrow.pyAdded+497
vllm/lib/python3.10/site-packages/ray/data/_internal/datasource/__pycache__/__init__.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/datasource/__pycache__/hudi_datasource.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/datasource/__pycache__/webdataset_datasink.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/__pycache__/__init__.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/__pycache__/optimizers.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/__pycache__/util.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/__init__.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/logical_operator.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/logical_plan.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/operator.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/optimizer.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/physical_plan.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/__pycache__/plan.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/logical_operator.pyAdded+79
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/logical_plan.pyAdded+31
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/operator.pyAdded+58
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/optimizer.pyAdded+29
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/interfaces/physical_plan.pyAdded+34
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__init__.pyAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/__init__.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/all_to_all_operator.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/count_operator.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/from_operators.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/input_data_operator.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/map_operator.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/n_ary_operator.cpython-310.pycAdded
vllm/lib/python3.10/site-packages/ray/data/_internal/logical/operators/__pycache__/one_to_one_operator.cpython-310.pycAdded