diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_cholesky_solve_helper_cpu_dispatch.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_cholesky_solve_helper_cpu_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..cc9099cb356e4911015355a8b6b7ed3dbe67e0b8 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_cholesky_solve_helper_cpu_dispatch.h @@ -0,0 +1,23 @@ +#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 +#include +#include + +// 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 + +namespace at { + +namespace cpu { + +TORCH_API at::Tensor _cholesky_solve_helper(const at::Tensor & self, const at::Tensor & A, bool upper); + +} // namespace cpu +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_fake_quantize_learnable_per_tensor_affine_backward_cuda_dispatch.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_fake_quantize_learnable_per_tensor_affine_backward_cuda_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..912a42505a09a237a6d84215d546f7e3a1f071e2 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/_fake_quantize_learnable_per_tensor_affine_backward_cuda_dispatch.h @@ -0,0 +1,23 @@ +#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 +#include +#include + +// 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 + +namespace at { + +namespace cuda { + +TORCH_API ::std::tuple _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 cuda +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/blackman_window.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/blackman_window.h new file mode 100644 index 0000000000000000000000000000000000000000..5d01a3cf53be571f0704bd50f8cc00c751671b64 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/blackman_window.h @@ -0,0 +1,61 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::blackman_window(int window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor +inline at::Tensor blackman_window(int64_t window_length, at::TensorOptions options={}) { + return at::_ops::blackman_window::call(window_length, optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt()); +} +// aten::blackman_window(int window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor +inline at::Tensor blackman_window(int64_t window_length, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory) { + return at::_ops::blackman_window::call(window_length, dtype, layout, device, pin_memory); +} + +// aten::blackman_window.periodic(int window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor +inline at::Tensor blackman_window(int64_t window_length, bool periodic, at::TensorOptions options={}) { + return at::_ops::blackman_window_periodic::call(window_length, periodic, optTypeMetaToScalarType(options.dtype_opt()), options.layout_opt(), options.device_opt(), options.pinned_memory_opt()); +} +// aten::blackman_window.periodic(int window_length, bool periodic, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor +inline at::Tensor blackman_window(int64_t window_length, bool periodic, c10::optional dtype, c10::optional layout, c10::optional device, c10::optional pin_memory) { + return at::_ops::blackman_window_periodic::call(window_length, periodic, dtype, layout, device, pin_memory); +} + +// aten::blackman_window.out(int window_length, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & blackman_window_out(at::Tensor & out, int64_t window_length) { + return at::_ops::blackman_window_out::call(window_length, out); +} +// aten::blackman_window.out(int window_length, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & blackman_window_outf(int64_t window_length, at::Tensor & out) { + return at::_ops::blackman_window_out::call(window_length, out); +} + +// aten::blackman_window.periodic_out(int window_length, bool periodic, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & blackman_window_out(at::Tensor & out, int64_t window_length, bool periodic) { + return at::_ops::blackman_window_periodic_out::call(window_length, periodic, out); +} +// aten::blackman_window.periodic_out(int window_length, bool periodic, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & blackman_window_outf(int64_t window_length, bool periodic, at::Tensor & out) { + return at::_ops::blackman_window_periodic_out::call(window_length, periodic, out); +} + +} diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/cross_native.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/cross_native.h new file mode 100644 index 0000000000000000000000000000000000000000..690888f30bfd407f02b9616b8621227a797d615a --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/cross_native.h @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor cross(const at::Tensor & self, const at::Tensor & other, c10::optional dim=c10::nullopt); +TORCH_API at::Tensor & cross_out(const at::Tensor & self, const at::Tensor & other, c10::optional dim, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/embedding_backward_native.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/embedding_backward_native.h new file mode 100644 index 0000000000000000000000000000000000000000..d51667baddde7e77e3ca3a69e9da9ed6adb86452 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/embedding_backward_native.h @@ -0,0 +1,21 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor embedding_backward_symint(const at::Tensor & grad, const at::Tensor & indices, c10::SymInt num_weights, c10::SymInt padding_idx, bool scale_grad_by_freq, bool sparse); +} // namespace native +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/fft_irfft2_native.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/fft_irfft2_native.h new file mode 100644 index 0000000000000000000000000000000000000000..5b4dc96b6c1a7f4697b74304f3e4579aa7c2a9c4 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/fft_irfft2_native.h @@ -0,0 +1,22 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor fft_irfft2_symint(const at::Tensor & self, at::OptionalSymIntArrayRef s=c10::nullopt, at::IntArrayRef dim={-2,-1}, c10::optional norm=c10::nullopt); +TORCH_API at::Tensor & fft_irfft2_symint_out(const at::Tensor & self, at::OptionalSymIntArrayRef s, at::IntArrayRef dim, c10::optional norm, at::Tensor & out); +} // namespace native +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/fractional_max_pool2d_compositeexplicitautogradnonfunctional_dispatch.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/fractional_max_pool2d_compositeexplicitautogradnonfunctional_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..bf6f82acb6027a80f801cb557d25a351a87b7f50 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/fractional_max_pool2d_compositeexplicitautogradnonfunctional_dispatch.h @@ -0,0 +1,23 @@ +#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 +#include +#include + +// 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 + +namespace at { + +namespace compositeexplicitautogradnonfunctional { + +TORCH_API ::std::tuple fractional_max_pool2d(const at::Tensor & self, at::IntArrayRef kernel_size, at::IntArrayRef output_size, const at::Tensor & random_samples); + +} // namespace compositeexplicitautogradnonfunctional +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/grid_sampler_3d_backward_compositeexplicitautograd_dispatch.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/grid_sampler_3d_backward_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..3d64163bacdb598ee2ab24c56280239a84594eb4 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/grid_sampler_3d_backward_compositeexplicitautograd_dispatch.h @@ -0,0 +1,24 @@ +#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 +#include +#include + +// 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 + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API ::std::tuple grid_sampler_3d_backward_out(at::Tensor & out0, at::Tensor & out1, const at::Tensor & grad_output, const at::Tensor & input, const at::Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners, ::std::array output_mask); +TORCH_API ::std::tuple grid_sampler_3d_backward_outf(const at::Tensor & grad_output, const at::Tensor & input, const at::Tensor & grid, int64_t interpolation_mode, int64_t padding_mode, bool align_corners, ::std::array output_mask, at::Tensor & out0, at::Tensor & out1); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/index_fill.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/index_fill.h new file mode 100644 index 0000000000000000000000000000000000000000..f2df0dbc43767cd06ec424b3f516dcfd691b3f6b --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/index_fill.h @@ -0,0 +1,63 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::index_fill.int_Scalar(Tensor self, int dim, Tensor index, Scalar value) -> Tensor +inline at::Tensor index_fill(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value) { + return at::_ops::index_fill_int_Scalar::call(self, dim, index, value); +} + +// aten::index_fill.int_Tensor(Tensor self, int dim, Tensor index, Tensor value) -> Tensor +inline at::Tensor index_fill(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & value) { + return at::_ops::index_fill_int_Tensor::call(self, dim, index, value); +} + +// aten::index_fill.Dimname_Scalar(Tensor self, Dimname dim, Tensor index, Scalar value) -> Tensor +inline at::Tensor index_fill(const at::Tensor & self, at::Dimname dim, const at::Tensor & index, const at::Scalar & value) { + return at::_ops::index_fill_Dimname_Scalar::call(self, dim, index, value); +} + +// aten::index_fill.Dimname_Tensor(Tensor self, Dimname dim, Tensor index, Tensor value) -> Tensor +inline at::Tensor index_fill(const at::Tensor & self, at::Dimname dim, const at::Tensor & index, const at::Tensor & value) { + return at::_ops::index_fill_Dimname_Tensor::call(self, dim, index, value); +} + +// aten::index_fill.int_Scalar_out(Tensor self, int dim, Tensor index, Scalar value, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & index_fill_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value) { + return at::_ops::index_fill_int_Scalar_out::call(self, dim, index, value, out); +} +// aten::index_fill.int_Scalar_out(Tensor self, int dim, Tensor index, Scalar value, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & index_fill_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Scalar & value, at::Tensor & out) { + return at::_ops::index_fill_int_Scalar_out::call(self, dim, index, value, out); +} + +// aten::index_fill.int_Tensor_out(Tensor self, int dim, Tensor index, Tensor value, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & index_fill_out(at::Tensor & out, const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & value) { + return at::_ops::index_fill_int_Tensor_out::call(self, dim, index, value, out); +} +// aten::index_fill.int_Tensor_out(Tensor self, int dim, Tensor index, Tensor value, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & index_fill_outf(const at::Tensor & self, int64_t dim, const at::Tensor & index, const at::Tensor & value, at::Tensor & out) { + return at::_ops::index_fill_int_Tensor_out::call(self, dim, index, value, out); +} + +} diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/index_native.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/index_native.h new file mode 100644 index 0000000000000000000000000000000000000000..72573ecd7035bfc9ae37e28d042f3c13838fb69f --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/index_native.h @@ -0,0 +1,24 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace at { +namespace native { +struct TORCH_API structured_index_out : public at::meta::structured_index_Tensor { +void impl(const at::Tensor & self, at::DimVector sizes, at::DimVector strides, const at::Tensor & out); +}; +TORCH_API at::Tensor quantized_index(const at::Tensor & self, const c10::List> & indices); +} // namespace native +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/linalg_slogdet_compositeimplicitautograd_dispatch.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/linalg_slogdet_compositeimplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..fee5b0c5dd3c0e4f257b16fcdb171b2e89f7e712 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/linalg_slogdet_compositeimplicitautograd_dispatch.h @@ -0,0 +1,25 @@ +#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 +#include +#include + +// 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 + +namespace at { + +namespace compositeimplicitautograd { + +TORCH_API ::std::tuple linalg_slogdet(const at::Tensor & A); +TORCH_API ::std::tuple linalg_slogdet_out(at::Tensor & sign, at::Tensor & logabsdet, const at::Tensor & A); +TORCH_API ::std::tuple linalg_slogdet_outf(const at::Tensor & A, at::Tensor & sign, at::Tensor & logabsdet); + +} // namespace compositeimplicitautograd +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/max_meta_dispatch.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/max_meta_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..9680e33f3f4f259b6cf3f0cd76260b0791c55cbf --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/max_meta_dispatch.h @@ -0,0 +1,25 @@ +#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 +#include +#include + +// 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 + +namespace at { + +namespace meta { + +TORCH_API ::std::tuple max(const at::Tensor & self, int64_t dim, bool keepdim=false); +TORCH_API ::std::tuple max_out(at::Tensor & max, at::Tensor & max_values, const at::Tensor & self, int64_t dim, bool keepdim=false); +TORCH_API ::std::tuple max_outf(const at::Tensor & self, int64_t dim, bool keepdim, at::Tensor & max, at::Tensor & max_values); + +} // namespace meta +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/negative.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/negative.h new file mode 100644 index 0000000000000000000000000000000000000000..9ba0394665d5e06b3b4fc3e319eef7ddcacff4ab --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/negative.h @@ -0,0 +1,44 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::negative(Tensor self) -> Tensor +inline at::Tensor negative(const at::Tensor & self) { + return at::_ops::negative::call(self); +} + +// aten::negative_(Tensor(a!) self) -> Tensor(a!) +inline at::Tensor & negative_(at::Tensor & self) { + return at::_ops::negative_::call(self); +} + +// aten::negative.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & negative_out(at::Tensor & out, const at::Tensor & self) { + return at::_ops::negative_out::call(self, out); +} +// aten::negative.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!) +inline at::Tensor & negative_outf(const at::Tensor & self, at::Tensor & out) { + return at::_ops::negative_out::call(self, out); +} + +} diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/real_ops.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/real_ops.h new file mode 100644 index 0000000000000000000000000000000000000000..217dac7768bb8a651a91880631d19ece290632ff --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/real_ops.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from Operator.h + +#include +#include + +// 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 + +namespace at { +namespace _ops { + + +struct TORCH_API real { + using schema = at::Tensor (const at::Tensor &); + using ptr_schema = schema*; + // See Note [static constexpr char* members for windows NVCC] + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(name, "aten::real") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(overload_name, "") + STATIC_CONSTEXPR_STR_INL_EXCEPT_WIN_CUDA(schema_str, "real(Tensor(a) self) -> Tensor(a)") + static at::Tensor call(const at::Tensor & self); + static at::Tensor redispatch(c10::DispatchKeySet dispatchKeySet, const at::Tensor & self); +}; + +}} // namespace at::_ops diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/reflection_pad2d_backward.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/reflection_pad2d_backward.h new file mode 100644 index 0000000000000000000000000000000000000000..7d9c05a0c6e26d28769326dc0af77b6b6ef9739c --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/reflection_pad2d_backward.h @@ -0,0 +1,91 @@ +#pragma once + +// @generated by torchgen/gen.py from Function.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +#include + +namespace at { + + +// aten::reflection_pad2d_backward.grad_input(Tensor grad_output, Tensor self, SymInt[4] padding, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & reflection_pad2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding) { + return at::_ops::reflection_pad2d_backward_grad_input::call(grad_output, self, c10::fromIntArrayRefSlow(padding), grad_input); +} +namespace symint { + template ::value>> + at::Tensor & reflection_pad2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding) { + return at::_ops::reflection_pad2d_backward_grad_input::call(grad_output, self, c10::fromIntArrayRefSlow(padding), grad_input); + } +} + +// aten::reflection_pad2d_backward.grad_input(Tensor grad_output, Tensor self, SymInt[4] padding, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & reflection_pad2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input) { + return at::_ops::reflection_pad2d_backward_grad_input::call(grad_output, self, c10::fromIntArrayRefSlow(padding), grad_input); +} +namespace symint { + template ::value>> + at::Tensor & reflection_pad2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding, at::Tensor & grad_input) { + return at::_ops::reflection_pad2d_backward_grad_input::call(grad_output, self, c10::fromIntArrayRefSlow(padding), grad_input); + } +} + +// aten::reflection_pad2d_backward.grad_input(Tensor grad_output, Tensor self, SymInt[4] padding, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & reflection_pad2d_backward_symint_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding) { + return at::_ops::reflection_pad2d_backward_grad_input::call(grad_output, self, padding, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & reflection_pad2d_backward_out(at::Tensor & grad_input, const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding) { + return at::_ops::reflection_pad2d_backward_grad_input::call(grad_output, self, padding, grad_input); + } +} + +// aten::reflection_pad2d_backward.grad_input(Tensor grad_output, Tensor self, SymInt[4] padding, *, Tensor(a!) grad_input) -> Tensor(a!) +inline at::Tensor & reflection_pad2d_backward_symint_outf(const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding, at::Tensor & grad_input) { + return at::_ops::reflection_pad2d_backward_grad_input::call(grad_output, self, padding, grad_input); +} +namespace symint { + template ::value>> + at::Tensor & reflection_pad2d_backward_outf(const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding, at::Tensor & grad_input) { + return at::_ops::reflection_pad2d_backward_grad_input::call(grad_output, self, padding, grad_input); + } +} + +// aten::reflection_pad2d_backward(Tensor grad_output, Tensor self, SymInt[4] padding) -> Tensor +inline at::Tensor reflection_pad2d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding) { + return at::_ops::reflection_pad2d_backward::call(grad_output, self, c10::fromIntArrayRefSlow(padding)); +} +namespace symint { + template ::value>> + at::Tensor reflection_pad2d_backward(const at::Tensor & grad_output, const at::Tensor & self, at::IntArrayRef padding) { + return at::_ops::reflection_pad2d_backward::call(grad_output, self, c10::fromIntArrayRefSlow(padding)); + } +} + +// aten::reflection_pad2d_backward(Tensor grad_output, Tensor self, SymInt[4] padding) -> Tensor +inline at::Tensor reflection_pad2d_backward_symint(const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding) { + return at::_ops::reflection_pad2d_backward::call(grad_output, self, padding); +} +namespace symint { + template ::value>> + at::Tensor reflection_pad2d_backward(const at::Tensor & grad_output, const at::Tensor & self, c10::SymIntArrayRef padding) { + return at::_ops::reflection_pad2d_backward::call(grad_output, self, padding); + } +} + +} diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/unbind_compositeexplicitautograd_dispatch.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/unbind_compositeexplicitautograd_dispatch.h new file mode 100644 index 0000000000000000000000000000000000000000..771af8c02bbbf3a0da35a7f8128c1630af6c12e0 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/unbind_compositeexplicitautograd_dispatch.h @@ -0,0 +1,23 @@ +#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 +#include +#include + +// 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 + +namespace at { + +namespace compositeexplicitautograd { + +TORCH_API ::std::vector unbind(const at::Tensor & self, int64_t dim=0); + +} // namespace compositeexplicitautograd +} // namespace at diff --git a/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/zero_native.h b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/zero_native.h new file mode 100644 index 0000000000000000000000000000000000000000..39751b677ee39d3614b38dd58454ef41143fec97 --- /dev/null +++ b/videollama2/lib/python3.10/site-packages/torch/include/ATen/ops/zero_native.h @@ -0,0 +1,28 @@ +#pragma once + +// @generated by torchgen/gen.py from NativeFunction.h + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +namespace at { +namespace native { +TORCH_API at::Tensor zero(const at::Tensor & self); +TORCH_API at::Tensor & zero_out(const at::Tensor & self, at::Tensor & out); +TORCH_API at::Tensor & zero_(at::Tensor & self); +TORCH_API at::Tensor & zero_nested_(at::Tensor & self); +TORCH_API at::Tensor & zero_sparse_(at::Tensor & self); +TORCH_API at::Tensor & zero_sparse_csr_(at::Tensor & self); +TORCH_API at::Tensor & zero_meta_(at::Tensor & self); +TORCH_API at::Tensor & mkldnn_zero_(at::Tensor & self); +} // namespace native +} // namespace at diff --git a/vllm/lib/python3.10/site-packages/ray/__pycache__/__init__.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..06a1abd5fcfd379c12dcc71f79ba4558772fc82a Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/__pycache__/__init__.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/__pycache__/cluster_utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/__pycache__/cluster_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1938ad36abf044715f94558fdf0f434550e3a8f1 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/__pycache__/cluster_utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/__pycache__/cross_language.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/__pycache__/cross_language.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2726d622b718e400f7a5d2694ddc2ff100211d3f Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/__pycache__/cross_language.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/__pycache__/remote_function.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/__pycache__/remote_function.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5f9261cfda46268f9fd57578389e89996320ed07 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/__pycache__/remote_function.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/__pycache__/runtime_context.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/__pycache__/runtime_context.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..84684f5f20db6a93856f4d7c597d26b754c3e382 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/__pycache__/runtime_context.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/__pycache__/setup-dev.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/__pycache__/setup-dev.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f46ced72d7dfa94a478372d2db7f3a1dc7ee7f47 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/__pycache__/setup-dev.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/__init__.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c88b34650d99d533c2eafd84c16264dbcda23408 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/__init__.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/async_compat.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/async_compat.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d15fc13d06cefa82f8fec0de15e3f5e96bb39b07 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/async_compat.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/auto_init_hook.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/auto_init_hook.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8fd213ef9e81e6849459602ec622f54e41e30fda Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/auto_init_hook.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/client_mode_hook.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/client_mode_hook.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cd3ce080a9036131028737d0c314b9f608a7acb3 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/client_mode_hook.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/compat.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/compat.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..dde85e97394ccfebed2ae883a3cfbdd063f6f26e Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/compat.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/conftest_utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/conftest_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..eb20f4aa55f11d369fd55c6ae63bdbdcfd539ce8 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/conftest_utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/dict.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/dict.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3c37551c2d1d05bd1692ec5fcbfbc4749e271924 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/dict.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/external_storage.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/external_storage.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..490beb3a0faa899e39fb95d46dac3628bbda3fe3 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/external_storage.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_aio_client.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_aio_client.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3096c873bb189e36dbb26f01fca364bbfc695367 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_aio_client.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_pubsub.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_pubsub.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5c307f4692699482adad307074a6312002aa079b Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_pubsub.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4e6faaddee9dbaac9cf909fdb8f744c359187dd4 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/gcs_utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/internal_api.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/internal_api.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6c8019f3d5bc723c309e7a62c05f9d1bdc055356 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/internal_api.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/log.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/log.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..de02de494ee1f6a5365985bcbdbaa750e23d62fe Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/log.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/log_monitor.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/log_monitor.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..872d1c00cdfcad43ef76005b15fa8c01f6dd8502 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/log_monitor.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/logging_utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/logging_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c7d293a5a3db5df58147e0d2ee56c6e09c27e4c7 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/logging_utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/memory_monitor.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/memory_monitor.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8c712f6eb400a177d54a88a512859f2e6cf4cab9 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/memory_monitor.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/metrics_agent.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/metrics_agent.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7bfb10c0d3a15503814718db0677e8196e337f53 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/metrics_agent.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/node.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/node.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0f620f27a6aa6e404b2cb671e250d5f1c93e500f Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/node.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/parameter.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/parameter.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6235ea494b979024c703d252e784f582cb2516c7 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/parameter.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/process_watcher.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/process_watcher.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e956999ab7e65048e8b93dfc9f5908a7546a53be Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/process_watcher.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/profiling.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/profiling.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4ac5ef343559039fa6e8b2918fee42e9485106f2 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/profiling.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/prometheus_exporter.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/prometheus_exporter.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..44cc874ff5a7ad105d3d8e1dd6637bbdf7c0f290 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/prometheus_exporter.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/protobuf_compat.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/protobuf_compat.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7f0805a57ba116728c1c1a825adba0e5c7be80ff Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/protobuf_compat.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/pydantic_compat.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/pydantic_compat.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..49a53caa2c90bc40283dedf7b57375a09becbef0 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/pydantic_compat.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_client_microbenchmark.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_client_microbenchmark.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c050176a0623090aa174e26bbb5226c0ffa9eb2c Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_client_microbenchmark.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_constants.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_constants.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b25b195abb17cdea13b439c6f9903e7ff32d2c9f Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_constants.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_experimental_perf.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_experimental_perf.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a9a16d62ab4ac1219a5871803b32d16e40e43e7 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_experimental_perf.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_microbenchmark_helpers.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_microbenchmark_helpers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d996eb232945449fbce96c4e50df8ac5319a67ea Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_microbenchmark_helpers.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_option_utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_option_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6f76d7535ec7c5119fe3a5850cf3241f5e6fee02 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_option_utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_perf.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_perf.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f8e0b5b036d4e7637ffe6134ff4c1b8386cc84b1 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_perf.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_process_reaper.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_process_reaper.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fb5681d7ec4ee2a2cddbca9728a8bbee9092401 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/ray_process_reaper.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/resource_spec.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/resource_spec.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8363d830795a4d07fb86239457641f258e9e6fe7 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/resource_spec.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/serialization.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/serialization.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..cb9e2e099bb1bf14eff7a4b603e80ca4c9b8a11d Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/serialization.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/services.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/services.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e321d9b64060ae0f84daa9c3e7e88dcf02dc93f5 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/services.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/signature.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/signature.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..709f6294e395b88b698ea80c88cdae5251b4a3c0 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/signature.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/state_api_test_utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/state_api_test_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..26c0e59b5069e4a31a1faad32f8b3a1781bb8192 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/state_api_test_utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/storage.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/storage.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4fa666f8a2f2bc81565467293994027c3bfeb0ea Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/storage.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/test_utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/test_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..33ec817885b019928d872ef9ad993ea5274f7d5f Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/test_utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/tls_utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/tls_utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..b0c09ca90ee6f804305dd8bd93d990c7926d93d2 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/tls_utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/utils.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/utils.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7fc1c8b729b3c165298d9d3b8f9e1550541b6812 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/__pycache__/utils.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/usage/__init__.py b/vllm/lib/python3.10/site-packages/ray/_private/usage/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vllm/lib/python3.10/site-packages/ray/_private/usage/usage_constants.py b/vllm/lib/python3.10/site-packages/ray/_private/usage/usage_constants.py new file mode 100644 index 0000000000000000000000000000000000000000..2b5b97ad175e334aa963e2f02629329830c57ff8 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/ray/_private/usage/usage_constants.py @@ -0,0 +1,63 @@ +SCHEMA_VERSION = "0.1" + +# The key to store / obtain cluster metadata. +CLUSTER_METADATA_KEY = b"CLUSTER_METADATA" + +# The name of a json file where usage stats will be written. +USAGE_STATS_FILE = "usage_stats.json" + +USAGE_STATS_ENABLED_ENV_VAR = "RAY_USAGE_STATS_ENABLED" + +USAGE_STATS_SOURCE_ENV_VAR = "RAY_USAGE_STATS_SOURCE" + +USAGE_STATS_SOURCE_OSS = "OSS" + +USAGE_STATS_ENABLED_FOR_CLI_MESSAGE = ( + "Usage stats collection is enabled. To disable this, add `--disable-usage-stats` " + "to the command that starts the cluster, or run the following command:" + " `ray disable-usage-stats` before starting the cluster. " + "See https://docs.ray.io/en/master/cluster/usage-stats.html for more details." +) + +USAGE_STATS_ENABLED_FOR_RAY_INIT_MESSAGE = ( + "Usage stats collection is enabled. To disable this, run the following command:" + " `ray disable-usage-stats` before starting Ray. " + "See https://docs.ray.io/en/master/cluster/usage-stats.html for more details." +) + +USAGE_STATS_DISABLED_MESSAGE = "Usage stats collection is disabled." + +USAGE_STATS_ENABLED_BY_DEFAULT_FOR_CLI_MESSAGE = ( + "Usage stats collection is enabled by default without user confirmation " + "because this terminal is detected to be non-interactive. " + "To disable this, add `--disable-usage-stats` to the command that starts " + "the cluster, or run the following command:" + " `ray disable-usage-stats` before starting the cluster. " + "See https://docs.ray.io/en/master/cluster/usage-stats.html for more details." +) + +USAGE_STATS_ENABLED_BY_DEFAULT_FOR_RAY_INIT_MESSAGE = ( + "Usage stats collection is enabled by default for nightly wheels. " + "To disable this, run the following command:" + " `ray disable-usage-stats` before starting Ray. " + "See https://docs.ray.io/en/master/cluster/usage-stats.html for more details." +) + +USAGE_STATS_CONFIRMATION_MESSAGE = ( + "Enable usage stats collection? " + "This prompt will auto-proceed in 10 seconds to avoid blocking cluster startup." +) + +LIBRARY_USAGE_SET_NAME = "library_usage_" + +HARDWARE_USAGE_SET_NAME = "hardware_usage_" + +# Keep in-sync with the same constants defined in usage_stats_client.h +EXTRA_USAGE_TAG_PREFIX = "extra_usage_tag_" +USAGE_STATS_NAMESPACE = "usage_stats" + +KUBERNETES_SERVICE_HOST_ENV = "KUBERNETES_SERVICE_HOST" +KUBERAY_ENV = "RAY_USAGE_STATS_KUBERAY_IN_USE" + +PROVIDER_KUBERNETES_GENERIC = "kubernetes" +PROVIDER_KUBERAY = "kuberay" diff --git a/vllm/lib/python3.10/site-packages/ray/_private/workers/__init__.py b/vllm/lib/python3.10/site-packages/ray/_private/workers/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/__init__.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78cff4db91b00269572a05d90ba45fefe995419d Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/__init__.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/default_worker.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/default_worker.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2569cdb91b491bb0979dfc56be198784bf62a48c Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/default_worker.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/setup_worker.cpython-310.pyc b/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/setup_worker.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..52fbf8b4fb09f5bb36d63a6c10305571fce0e286 Binary files /dev/null and b/vllm/lib/python3.10/site-packages/ray/_private/workers/__pycache__/setup_worker.cpython-310.pyc differ diff --git a/vllm/lib/python3.10/site-packages/ray/_private/workers/default_worker.py b/vllm/lib/python3.10/site-packages/ray/_private/workers/default_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..6d778391def30ad3f03abd3edafe001b8f0089e7 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/ray/_private/workers/default_worker.py @@ -0,0 +1,296 @@ +import os +import argparse +import base64 +import json +import time + +import ray +import ray._private.node +import ray._private.ray_constants as ray_constants +import ray._private.utils +import ray.actor +from ray._private.async_compat import try_install_uvloop +from ray._private.parameter import RayParams +from ray._private.ray_logging import configure_log_file, get_worker_log_file_name +from ray._private.runtime_env.setup_hook import load_and_execute_setup_hook + +parser = argparse.ArgumentParser( + description=("Parse addresses for the worker to connect to.") +) +parser.add_argument( + "--cluster-id", + required=True, + type=str, + help="the auto-generated ID of the cluster", +) +parser.add_argument( + "--node-id", + required=True, + type=str, + help="the auto-generated ID of the node", +) +parser.add_argument( + "--node-ip-address", + required=True, + type=str, + help="the ip address of the worker's node", +) +parser.add_argument( + "--node-manager-port", required=True, type=int, help="the port of the worker's node" +) +parser.add_argument( + "--raylet-ip-address", + required=False, + type=str, + default=None, + help="the ip address of the worker's raylet", +) +parser.add_argument( + "--redis-address", required=True, type=str, help="the address to use for Redis" +) +parser.add_argument( + "--gcs-address", required=True, type=str, help="the address to use for GCS" +) +parser.add_argument( + "--redis-password", + required=False, + type=str, + default=None, + help="the password to use for Redis", +) +parser.add_argument( + "--object-store-name", required=True, type=str, help="the object store's name" +) +parser.add_argument("--raylet-name", required=False, type=str, help="the raylet's name") +parser.add_argument( + "--logging-level", + required=False, + type=str, + default=ray_constants.LOGGER_LEVEL, + choices=ray_constants.LOGGER_LEVEL_CHOICES, + help=ray_constants.LOGGER_LEVEL_HELP, +) +parser.add_argument( + "--logging-format", + required=False, + type=str, + default=ray_constants.LOGGER_FORMAT, + help=ray_constants.LOGGER_FORMAT_HELP, +) +parser.add_argument( + "--temp-dir", + required=False, + type=str, + default=None, + help="Specify the path of the temporary directory use by Ray process.", +) +parser.add_argument( + "--storage", + required=False, + type=str, + default=None, + help="Specify the persistent storage path.", +) +parser.add_argument( + "--load-code-from-local", + default=False, + action="store_true", + help="True if code is loaded from local files, as opposed to the GCS.", +) +parser.add_argument( + "--worker-type", + required=False, + type=str, + default="WORKER", + help="Specify the type of the worker process", +) +parser.add_argument( + "--metrics-agent-port", + required=True, + type=int, + help="the port of the node's metric agent.", +) +parser.add_argument( + "--runtime-env-agent-port", + required=True, + type=int, + default=None, + help="The port on which the runtime env agent receives HTTP requests.", +) +parser.add_argument( + "--object-spilling-config", + required=False, + type=str, + default="", + help="The configuration of object spilling. Only used by I/O workers.", +) +parser.add_argument( + "--logging-rotate-bytes", + required=False, + type=int, + default=ray_constants.LOGGING_ROTATE_BYTES, + help="Specify the max bytes for rotating " + "log file, default is " + f"{ray_constants.LOGGING_ROTATE_BYTES} bytes.", +) +parser.add_argument( + "--logging-rotate-backup-count", + required=False, + type=int, + default=ray_constants.LOGGING_ROTATE_BACKUP_COUNT, + help="Specify the backup count of rotated log file, default is " + f"{ray_constants.LOGGING_ROTATE_BACKUP_COUNT}.", +) +parser.add_argument( + "--runtime-env-hash", + required=False, + type=int, + default=0, + help="The computed hash of the runtime env for this worker.", +) +parser.add_argument( + "--startup-token", + required=True, + type=int, + help="The startup token assigned to this worker process by the raylet.", +) +parser.add_argument( + "--ray-debugger-external", + default=False, + action="store_true", + help="True if Ray debugger is made available externally.", +) +parser.add_argument("--session-name", required=False, help="The current session name") +parser.add_argument( + "--webui", + required=False, + help="The address of web ui", +) +parser.add_argument( + "--worker-launch-time-ms", + required=True, + type=int, + help="The time when raylet starts to launch the worker process.", +) + +parser.add_argument( + "--worker-preload-modules", + type=str, + required=False, + help=( + "A comma-separated list of Python module names " + "to import before accepting work." + ), +) + +if __name__ == "__main__": + # NOTE(sang): For some reason, if we move the code below + # to a separate function, tensorflow will capture that method + # as a step function. For more details, check out + # https://github.com/ray-project/ray/pull/12225#issue-525059663. + args = parser.parse_args() + ray._private.ray_logging.setup_logger(args.logging_level, args.logging_format) + worker_launched_time_ms = time.time_ns() // 1e6 + if args.worker_type == "WORKER": + mode = ray.WORKER_MODE + elif args.worker_type == "SPILL_WORKER": + mode = ray.SPILL_WORKER_MODE + elif args.worker_type == "RESTORE_WORKER": + mode = ray.RESTORE_WORKER_MODE + else: + raise ValueError("Unknown worker type: " + args.worker_type) + + # Try installing uvloop as default event-loop implementation + # for asyncio + try_install_uvloop() + + raylet_ip_address = args.raylet_ip_address + if raylet_ip_address is None: + raylet_ip_address = args.node_ip_address + ray_params = RayParams( + node_ip_address=args.node_ip_address, + raylet_ip_address=raylet_ip_address, + node_manager_port=args.node_manager_port, + redis_address=args.redis_address, + redis_password=args.redis_password, + plasma_store_socket_name=args.object_store_name, + raylet_socket_name=args.raylet_name, + temp_dir=args.temp_dir, + storage=args.storage, + metrics_agent_port=args.metrics_agent_port, + runtime_env_agent_port=args.runtime_env_agent_port, + gcs_address=args.gcs_address, + session_name=args.session_name, + webui=args.webui, + cluster_id=args.cluster_id, + node_id=args.node_id, + ) + node = ray._private.node.Node( + ray_params, + head=False, + shutdown_at_exit=False, + spawn_reaper=False, + connect_only=True, + default_worker=True, + ) + + # NOTE(suquark): We must initialize the external storage before we + # connect to raylet. Otherwise we may receive requests before the + # external storage is intialized. + if mode == ray.RESTORE_WORKER_MODE or mode == ray.SPILL_WORKER_MODE: + from ray._private import external_storage, storage + + storage._init_storage(args.storage, is_head=False) + if args.object_spilling_config: + object_spilling_config = base64.b64decode(args.object_spilling_config) + object_spilling_config = json.loads(object_spilling_config) + else: + object_spilling_config = {} + external_storage.setup_external_storage( + object_spilling_config, node.node_id, node.session_name + ) + + ray._private.worker._global_node = node + ray._private.worker.connect( + node, + node.session_name, + mode=mode, + runtime_env_hash=args.runtime_env_hash, + startup_token=args.startup_token, + ray_debugger_external=args.ray_debugger_external, + worker_launch_time_ms=args.worker_launch_time_ms, + worker_launched_time_ms=worker_launched_time_ms, + ) + + worker = ray._private.worker.global_worker + + # Setup log file. + out_file, err_file = node.get_log_file_handles( + get_worker_log_file_name(args.worker_type) + ) + configure_log_file(out_file, err_file) + worker.set_out_file(out_file) + worker.set_err_file(err_file) + + if mode == ray.WORKER_MODE and args.worker_preload_modules: + module_names_to_import = args.worker_preload_modules.split(",") + ray._private.utils.try_import_each_module(module_names_to_import) + + # If the worker setup function is configured, run it. + worker_process_setup_hook_key = os.getenv( + ray_constants.WORKER_PROCESS_SETUP_HOOK_ENV_VAR + ) + if worker_process_setup_hook_key: + error = load_and_execute_setup_hook(worker_process_setup_hook_key) + if error is not None: + worker.core_worker.drain_and_exit_worker("system", error) + + if mode == ray.WORKER_MODE: + worker.main_loop() + elif mode in [ray.RESTORE_WORKER_MODE, ray.SPILL_WORKER_MODE]: + # It is handled by another thread in the C++ core worker. + # We just need to keep the worker alive. + while True: + time.sleep(100000) + else: + raise ValueError(f"Unexcepted worker mode: {mode}") diff --git a/vllm/lib/python3.10/site-packages/ray/_private/workers/setup_worker.py b/vllm/lib/python3.10/site-packages/ray/_private/workers/setup_worker.py new file mode 100644 index 0000000000000000000000000000000000000000..23ba980a5bb22b2ce648c6df45f8ba0b7e73f3dd --- /dev/null +++ b/vllm/lib/python3.10/site-packages/ray/_private/workers/setup_worker.py @@ -0,0 +1,33 @@ +import argparse +import logging + +from ray._private.ray_constants import LOGGER_FORMAT, LOGGER_LEVEL +from ray._private.ray_logging import setup_logger +from ray._private.runtime_env.context import RuntimeEnvContext +from ray.core.generated.common_pb2 import Language + +logger = logging.getLogger(__name__) + +parser = argparse.ArgumentParser( + description=("Set up the environment for a Ray worker and launch the worker.") +) + +parser.add_argument( + "--serialized-runtime-env-context", + type=str, + help="the serialized runtime env context", +) + +parser.add_argument("--language", type=str, help="the language type of the worker") + + +if __name__ == "__main__": + setup_logger(LOGGER_LEVEL, LOGGER_FORMAT) + args, remaining_args = parser.parse_known_args() + # NOTE(edoakes): args.serialized_runtime_env_context is only None when + # we're starting the main Ray client proxy server. That case should + # probably not even go through this codepath. + runtime_env_context = RuntimeEnvContext.deserialize( + args.serialized_runtime_env_context or "{}" + ) + runtime_env_context.exec_worker(remaining_args, Language.Value(args.language)) diff --git a/vllm/lib/python3.10/site-packages/ray/widgets/__init__.py b/vllm/lib/python3.10/site-packages/ray/widgets/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..2479501640ba3f2b0be30c3548ee465a13a481a9 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/ray/widgets/__init__.py @@ -0,0 +1,4 @@ +from ray.widgets.render import Template +from ray.widgets.util import make_table_html_repr + +__all__ = ["Template", "make_table_html_repr"] diff --git a/vllm/lib/python3.10/site-packages/ray/widgets/render.py b/vllm/lib/python3.10/site-packages/ray/widgets/render.py new file mode 100644 index 0000000000000000000000000000000000000000..f9e861d39925680c403ff996e9279d4d349bafe5 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/ray/widgets/render.py @@ -0,0 +1,39 @@ +import pathlib +from typing import List + +from ray.util.annotations import DeveloperAPI + + +@DeveloperAPI +class Template: + """Class which provides basic HTML templating.""" + + def __init__(self, file: str): + with open(pathlib.Path(__file__).parent / "templates" / file, "r") as f: + self.template = f.read() + + def render(self, **kwargs) -> str: + """Render an HTML template with the given data. + + This is done by replacing instances of `{{ key }}` with `value` + from the keyword arguments. + + Returns: + HTML template with the keys of the kwargs replaced with corresponding + values. + """ + rendered = self.template + for key, value in kwargs.items(): + if isinstance(value, List): + value = "".join(value) + rendered = rendered.replace("{{ " + key + " }}", value if value else "") + return rendered + + @staticmethod + def list_templates() -> List[pathlib.Path]: + """List the available HTML templates. + + Returns: + A list of files with .html.j2 extensions inside ../templates/ + """ + return (pathlib.Path(__file__).parent / "templates").glob("*.html.j2") diff --git a/vllm/lib/python3.10/site-packages/ray/widgets/templates/title_data.html.j2 b/vllm/lib/python3.10/site-packages/ray/widgets/templates/title_data.html.j2 new file mode 100644 index 0000000000000000000000000000000000000000..1731a157d17b4674e3d7cc427164065dafe49de2 --- /dev/null +++ b/vllm/lib/python3.10/site-packages/ray/widgets/templates/title_data.html.j2 @@ -0,0 +1,11 @@ + + diff --git a/vllm/lib/python3.10/site-packages/ray/widgets/util.py b/vllm/lib/python3.10/site-packages/ray/widgets/util.py new file mode 100644 index 0000000000000000000000000000000000000000..2f171c6519cde57fd69033e040a9305ebbbdf53b --- /dev/null +++ b/vllm/lib/python3.10/site-packages/ray/widgets/util.py @@ -0,0 +1,207 @@ +import importlib +import logging +import sys +import textwrap +from functools import wraps +from typing import Any, Callable, Iterable, Optional, TypeVar, Union + +from packaging.version import Version + +from ray._private.thirdparty.tabulate.tabulate import tabulate +from ray.util.annotations import DeveloperAPI +from ray.widgets import Template + +logger = logging.getLogger(__name__) + +F = TypeVar("F", bound=Callable[..., Any]) + + +@DeveloperAPI +def make_table_html_repr( + obj: Any, title: Optional[str] = None, max_height: str = "none" +) -> str: + """Generate a generic html repr using a table. + + Args: + obj: Object for which a repr is to be generated + title: If present, a title for the section is included + max_height: Maximum height of the table; valid values + are given by the max-height CSS property + + Returns: + HTML representation of the object + """ + data = {} + for k, v in vars(obj).items(): + if isinstance(v, (str, bool, int, float)): + data[k] = str(v) + + elif isinstance(v, dict) or hasattr(v, "__dict__"): + data[k] = Template("scrollableTable.html.j2").render( + table=tabulate( + v.items() if isinstance(v, dict) else vars(v).items(), + tablefmt="html", + showindex=False, + headers=["Setting", "Value"], + ), + max_height="none", + ) + + table = Template("scrollableTable.html.j2").render( + table=tabulate( + data.items(), + tablefmt="unsafehtml", + showindex=False, + headers=["Setting", "Value"], + ), + max_height=max_height, + ) + + if title: + content = Template("title_data.html.j2").render(title=title, data=table) + else: + content = table + + return content + + +def _has_missing( + *deps: Iterable[Union[str, Optional[str]]], message: Optional[str] = None +): + """Return a list of missing dependencies. + + Args: + deps: Dependencies to check for + message: Message to be emitted if a dependency isn't found + + Returns: + A list of dependencies which can't be found, if any + """ + missing = [] + for (lib, _) in deps: + if importlib.util.find_spec(lib) is None: + missing.append(lib) + + if missing: + if not message: + message = f"Run `pip install {' '.join(missing)}` for rich notebook output." + + # stacklevel=3: First level is this function, then ensure_notebook_deps, + # then the actual function affected. + logger.info(f"Missing packages: {missing}. {message}", stacklevel=3) + + return missing + + +def _has_outdated( + *deps: Iterable[Union[str, Optional[str]]], message: Optional[str] = None +): + outdated = [] + for (lib, version) in deps: + try: + + module = importlib.import_module(lib) + if version and Version(module.__version__) < Version(version): + outdated.append([lib, version, module.__version__]) + except ImportError: + pass + + if outdated: + outdated_strs = [] + install_args = [] + for lib, version, installed in outdated: + outdated_strs.append(f"{lib}=={installed} found, needs {lib}>={version}") + install_args.append(f"{lib}>={version}") + + outdated_str = textwrap.indent("\n".join(outdated_strs), " ") + install_str = " ".join(install_args) + + if not message: + message = f"Run `pip install -U {install_str}` for rich notebook output." + + # stacklevel=3: First level is this function, then ensure_notebook_deps, + # then the actual function affected. + logger.info(f"Outdated packages:\n{outdated_str}\n{message}", stacklevel=3) + + return outdated + + +@DeveloperAPI +def repr_with_fallback( + *notebook_deps: Iterable[Union[str, Optional[str]]] +) -> Callable[[F], F]: + """Decorator which strips rich notebook output from mimebundles in certain cases. + + Fallback to plaintext and don't use rich output in the following cases: + 1. In a notebook environment and the appropriate dependencies are not installed. + 2. In a ipython shell environment. + 3. In Google Colab environment. + See https://github.com/googlecolab/colabtools/ issues/60 for more information + about the status of this issue. + + Args: + notebook_deps: The required dependencies and version for notebook environment. + + Returns: + A function that returns the usual _repr_mimebundle_, unless any of the 3 + conditions above hold, in which case it returns a mimebundle that only contains + a single text/plain mimetype. + """ + message = ( + "Run `pip install -U ipywidgets`, then restart " + "the notebook server for rich notebook output." + ) + if _can_display_ipywidgets(*notebook_deps, message=message): + + def wrapper(func: F) -> F: + @wraps(func) + def wrapped(self, *args, **kwargs): + return func(self, *args, **kwargs) + + return wrapped + + else: + + def wrapper(func: F) -> F: + @wraps(func) + def wrapped(self, *args, **kwargs): + return {"text/plain": repr(self)} + + return wrapped + + return wrapper + + +def _get_ipython_shell_name() -> str: + if "IPython" in sys.modules: + from IPython import get_ipython + + return get_ipython().__class__.__name__ + return "" + + +def _can_display_ipywidgets(*deps, message) -> bool: + # Default to safe behavior: only display widgets if running in a notebook + # that has valid dependencies + if in_notebook() and not ( + _has_missing(*deps, message=message) or _has_outdated(*deps, message=message) + ): + return True + + return False + + +@DeveloperAPI +def in_notebook(shell_name: Optional[str] = None) -> bool: + """Return whether we are in a Jupyter notebook or qtconsole.""" + if not shell_name: + shell_name = _get_ipython_shell_name() + return shell_name == "ZMQInteractiveShell" + + +@DeveloperAPI +def in_ipython_shell(shell_name: Optional[str] = None) -> bool: + """Return whether we are in a terminal running IPython""" + if not shell_name: + shell_name = _get_ipython_shell_name() + return shell_name == "TerminalInteractiveShell"