vineyard 0.24.2


pip install vineyard

  Latest version

Released: Aug 29, 2024


Meta
Author: The vineyard team

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers
  • Science/Research

License
  • OSI Approved :: Apache Software License

Topic
  • Software Development :: Libraries
  • System :: Distributed Computing

Operating System
  • MacOS :: MacOS X
  • POSIX

Programming Language
  • Python
  • Python :: 3
  • Python :: 3.6
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
vineyard

vineyard: an in-memory immutable data manager

Vineyard CI Coverage Docs FAQ Discussion Slack License CII Best Practices FOSSA

PyPI crates.io Docker HUB Artifact HUB ACM DL

Vineyard (v6d) is an innovative in-memory immutable data manager that offers out-of-the-box high-level abstractions and zero-copy in-memory sharing for distributed data in various big data tasks, such as graph analytics (e.g., GraphScope), numerical computing (e.g., Mars), and machine learning.

Vineyard is a CNCF sandbox project

Vineyard is a CNCF sandbox project and indeed made successful by its community.

Table of Contents

What is vineyard

Vineyard is specifically designed to facilitate zero-copy data sharing among big data systems. To illustrate this, let’s consider a typical machine learning task of time series prediction with LSTM. This task can be broken down into several steps:

  • First, we read the data from the file system as a pandas.DataFrame.

  • Next, we apply various preprocessing tasks, such as eliminating null values, to the dataframe.

  • Once the data is preprocessed, we define the model and train it on the processed dataframe using PyTorch.

  • Finally, we evaluate the performance of the model.

In a single-machine environment, pandas and PyTorch, despite being two distinct systems designed for different tasks, can efficiently share data with minimal overhead. This is achieved through an end-to-end process within a single Python script.

Comparing the workflow with and without vineyard

What if the input data is too large to be processed on a single machine?

As depicted on the left side of the figure, a common approach is to store the data as tables in a distributed file system (e.g., HDFS) and replace pandas with ETL processes using SQL over a big data system such as Hive and Spark. To share the data with PyTorch, the intermediate results are typically saved back as tables on HDFS. However, this can introduce challenges for developers.

  1. For the same task, users must program for multiple systems (SQL & Python).

  2. Data can be polymorphic. Non-relational data, such as tensors, dataframes, and graphs/networks (in GraphScope) are becoming increasingly common. Tables and SQL may not be the most efficient way to store, exchange, or process them. Transforming the data from/to “tables” between different systems can result in significant overhead.

  3. Saving/loading the data to/from external storage incurs substantial memory-copies and IO costs.

Vineyard addresses these issues by providing:

  1. In-memory distributed data sharing in a zero-copy fashion to avoid introducing additional I/O costs by leveraging a shared memory manager derived from plasma.

  2. Built-in out-of-the-box high-level abstractions to share distributed data with complex structures (e.g., distributed graphs) with minimal extra development cost, while eliminating transformation costs.

As depicted on the right side of the above figure, we demonstrate how to integrate vineyard to address the task in a big data context.

First, we utilize Mars (a tensor-based unified framework for large-scale data computation that scales Numpy, Pandas, and Scikit-learn) to preprocess the raw data, similar to the single-machine solution, and store the preprocessed dataframe in vineyard.

single

data_csv = pd.read_csv('./data.csv', usecols=[1])

distributed

import mars.dataframe as md
dataset = md.read_csv('hdfs://server/data_full', usecols=[1])
# after preprocessing, save the dataset to vineyard
vineyard_distributed_tensor_id = dataset.to_vineyard()

Then, we modify the training phase to get the preprocessed data from vineyard. Here vineyard makes the sharing of distributed data between Mars and PyTorch just like a local variable in the single machine solution.

single

data_X, data_Y = create_dataset(dataset)

distributed

client = vineyard.connect(vineyard_ipc_socket)
dataset = client.get(vineyard_distributed_tensor_id).local_partition()
data_X, data_Y = create_dataset(dataset)

Finally, we execute the training phase in a distributed manner across the cluster.

From this example, it is evident that with vineyard, the task in the big data context can be addressed with only minor adjustments to the single-machine solution. Compared to existing approaches, vineyard effectively eliminates I/O and transformation overheads.

Features

Efficient In-Memory Immutable Data Sharing

Vineyard serves as an in-memory immutable data manager, enabling efficient data sharing across different systems via shared memory without additional overheads. By eliminating serialization/deserialization and IO costs during data exchange between systems, Vineyard significantly improves performance.

Out-of-the-Box High-Level Data Abstractions

Computation frameworks often have their own data abstractions for high-level concepts. For example, tensors can be represented as torch.tensor, tf.Tensor, mxnet.ndarray, etc. Moreover, every graph processing engine has its unique graph structure representation.

The diversity of data abstractions complicates data sharing. Vineyard addresses this issue by providing out-of-the-box high-level data abstractions over in-memory blobs, using hierarchical metadata to describe objects. Various computation systems can leverage these built-in high-level data abstractions to exchange data with other systems in a computation pipeline concisely and efficiently.

Stream Pipelining for Enhanced Performance

A computation doesn’t need to wait for all preceding results to arrive before starting its work. Vineyard provides a stream as a special kind of immutable data for pipelining scenarios. The preceding job can write immutable data chunk by chunk to Vineyard while maintaining data structure semantics. The successor job reads shared-memory chunks from Vineyard’s stream without extra copy costs and triggers its work. This overlapping reduces the overall processing time and memory consumption.

Versatile Drivers for Common Tasks

Many big data analytical tasks involve numerous boilerplate routines that are unrelated to the computation itself, such as various IO adapters, data partition strategies, and migration jobs. Since data structure abstractions usually differ between systems, these routines cannot be easily reused.

Vineyard provides common manipulation routines for immutable data as drivers. In addition to sharing high-level data abstractions, Vineyard extends the capability of data structures with drivers, enabling out-of-the-box reusable routines for the boilerplate parts in computation jobs.

Try Vineyard

Vineyard is available as a python package and can be effortlessly installed using pip:

pip3 install vineyard

For comprehensive and up-to-date documentation, please visit https://v6d.io.

If you wish to build vineyard from source, please consult the Installation guide. For instructions on building and running unittests locally, refer to the Contributing section.

After installation, you can initiate a vineyard instance using the following command:

python3 -m vineyard

For further details on connecting to a locally deployed vineyard instance, please explore the Getting Started guide.

Deploying on Kubernetes

Vineyard is designed to efficiently share immutable data between different workloads, making it a natural fit for cloud-native computing. By embracing cloud-native big data processing and Kubernetes, Vineyard enables efficient distributed data sharing in cloud-native environments while leveraging the scaling and scheduling capabilities of Kubernetes.

To effectively manage all components of Vineyard within a Kubernetes cluster, we have developed the Vineyard Operator. For more information, please refer to the Vineyard Operator documentation.

FAQ

Vineyard shares many similarities with other open-source projects, yet it also has distinct features. We often receive the following questions about Vineyard:

  • Q: Can clients access the data while the stream is being filled?

    Sharing one piece of data among multiple clients is a target scenario for Vineyard, as the data stored in Vineyard is immutable. Multiple clients can safely consume the same piece of data through memory sharing, without incurring extra costs or additional memory usage from copying data back and forth.

  • Q: How does Vineyard avoid serialization/deserialization between systems in different languages?

    Vineyard provides high-level data abstractions (e.g., ndarrays, dataframes) that can be naturally shared between different processes, eliminating the need for serialization and deserialization between systems in different languages.

  • … …

For more detailed information, please refer to our FAQ page.

Get Involved

  • Join the CNCF Slack and participate in the #vineyard channel for discussions and collaboration.

  • Familiarize yourself with our contribution guide to understand the process of contributing to vineyard.

  • If you encounter any bugs or issues, please report them by submitting a GitHub issue or engage in a conversation on Github discussion.

  • We welcome and appreciate your contributions! Submit them using pull requests.

Thank you in advance for your valuable contributions to vineyard!

Publications

If you use this software, please cite our paper using the following metadata:

@article{yu2023vineyard,
   author = {Yu, Wenyuan and He, Tao and Wang, Lei and Meng, Ke and Cao, Ye and Zhu, Diwen and Li, Sanhong and Zhou, Jingren},
   title = {Vineyard: Optimizing Data Sharing in Data-Intensive Analytics},
   year = {2023},
   issue_date = {June 2023},
   publisher = {Association for Computing Machinery},
   address = {New York, NY, USA},
   volume = {1},
   number = {2},
   url = {https://doi.org/10.1145/3589780},
   doi = {10.1145/3589780},
   journal = {Proc. ACM Manag. Data},
   month = {jun},
   articleno = {200},
   numpages = {27},
   keywords = {data sharing, in-memory object store}
}

Acknowledgements

We thank the following excellent open-source projects:

  • apache-arrow, a cross-language development platform for in-memory analytics.

  • boost-leaf, a C++ lightweight error augmentation framework.

  • cityhash, CityHash, a family of hash functions for strings.

  • dlmalloc, Doug Lea’s memory allocator.

  • etcd-cpp-apiv3, a C++ API for etcd’s v3 client API.

  • flat_hash_map, an efficient hashmap implementation.

  • gulrak/filesystem, an implementation of C++17 std::filesystem.

  • libcuckoo, libcuckoo, a high-performance, concurrent hash table.

  • mimalloc, a general purpose allocator with excellent performance characteristics.

  • nlohmann/json, a json library for modern c++.

  • pybind11, a library for seamless operability between C++11 and Python.

  • s3fs, a library provide a convenient Python filesystem interface for S3.

  • skywalking-infra-e2e A generation End-to-End Testing framework.

  • skywalking-swck A kubernetes operator for the Apache Skywalking.

  • wyhash, C++ wrapper around wyhash and wyrand.

  • BBHash, a fast, minimal-memory perfect hash function.

  • rax, an ANSI C radix tree implementation.

  • MurmurHash3, a fast non-cryptographic hash function.

License

Vineyard is distributed under Apache License 2.0. Please note that third-party libraries may not have the same license as vineyard.

FOSSA Status

0.24.2 Aug 29, 2024
0.24.1 Aug 22, 2024
0.24.0 Aug 19, 2024
0.23.2 Jun 20, 2024
0.23.0 Jun 20, 2024
0.22.2 Jun 06, 2024
0.21.5 Mar 14, 2024
0.21.4 Mar 13, 2024
0.21.3 Mar 01, 2024
0.21.1 Feb 22, 2024
0.21.0 Feb 18, 2024
0.20.2 Jan 21, 2024
0.20.0 Jan 17, 2024
0.19.3 Dec 26, 2023
0.19.2 Dec 21, 2023
0.19.1 Dec 18, 2023
0.18.2 Nov 16, 2023
0.18.1 Nov 09, 2023
0.18.0 Nov 02, 2023
0.17.3 Sep 22, 2023
0.17.2 Sep 20, 2023
0.17.1 Sep 08, 2023
0.16.5 Aug 22, 2023
0.16.4 Aug 17, 2023
0.16.3 Aug 14, 2023
0.16.2 Jul 28, 2023
0.16.1 Jul 17, 2023
0.15.3 Jul 03, 2023
0.15.2 Jun 27, 2023
0.15.1 Jun 24, 2023
0.15.0 Jun 05, 2023
0.14.8 May 30, 2023
0.14.7 May 27, 2023
0.14.6 May 23, 2023
0.14.5 May 08, 2023
0.14.4 May 08, 2023
0.14.3 Apr 28, 2023
0.14.2 Apr 24, 2023
0.14.1 Apr 21, 2023
0.14.0 Apr 13, 2023
0.13.4 Mar 27, 2023
0.13.3 Mar 13, 2023
0.13.2 Mar 10, 2023
0.13.1 Mar 07, 2023
0.13.0 Mar 06, 2023
0.12.2 Feb 01, 2023
0.11.7 Jan 15, 2023
0.11.6 Jan 13, 2023
0.11.4 Jan 03, 2023
0.11.3 Dec 27, 2022
0.11.2 Dec 21, 2022
0.11.1 Dec 06, 2022
0.11.0 Dec 02, 2022
0.10.2 Nov 15, 2022
0.10.1 Oct 31, 2022
0.10.0 Oct 31, 2022
0.9.0 Sep 28, 2022
0.8.6 Sep 26, 2022
0.8.5 Sep 26, 2022
0.8.4 Sep 20, 2022
0.8.3 Sep 19, 2022
0.8.2 Sep 09, 2022
0.8.1 Sep 09, 2022
0.8.0 Sep 08, 2022
0.7.2 Aug 25, 2022
0.7.1 Aug 10, 2022
0.7.0 Aug 04, 2022
0.6.2 Jul 28, 2022
0.6.1 Jul 15, 2022
0.6.0 Jul 01, 2022
0.5.3 Jun 21, 2022
0.5.2 Jun 16, 2022
0.5.0 Jun 06, 2022
0.4.2 May 19, 2022
0.4.1 May 19, 2022
0.4.0 Apr 26, 2022
0.3.21 Mar 21, 2022
0.3.20 Mar 21, 2022
0.3.19 Feb 17, 2022
0.3.18 Feb 17, 2022
0.3.17 Feb 15, 2022
0.3.16 Dec 31, 2021
0.3.15 Dec 29, 2021
0.3.14 Dec 28, 2021
0.3.13 Dec 20, 2021
0.3.12 Dec 03, 2021
0.3.11 Nov 26, 2021
0.3.10 Nov 25, 2021
0.3.9 Nov 12, 2021
0.3.8 Nov 11, 2021
0.3.7 Nov 09, 2021
0.3.6 Nov 05, 2021
0.3.5 Nov 04, 2021
0.3.4 Nov 02, 2021
0.3.3 Nov 01, 2021
0.3.2 Oct 26, 2021
0.3.1 Oct 12, 2021
0.3.0 Oct 11, 2021
0.2.13 Sep 29, 2021
0.2.12 Sep 23, 2021
0.2.11 Sep 22, 2021
0.2.10 Sep 18, 2021
0.2.9 Sep 07, 2021
0.2.8 Sep 06, 2021
0.2.7 Aug 19, 2021
0.2.6 Jul 19, 2021
0.2.5 Jul 01, 2021
0.2.4 Jun 18, 2021
0.2.3 Jun 08, 2021
0.2.2 Jun 02, 2021
0.2.1 Apr 29, 2021
0.2.0 Apr 25, 2021
0.1.15 Apr 09, 2021
0.1.14 Mar 31, 2021
0.1.13 Mar 30, 2021
0.1.12 Mar 11, 2021
0.1.11 Feb 25, 2021
0.1.10 Feb 04, 2021
0.1.9 Feb 03, 2021
0.1.8 Jan 27, 2021
0.1.7 Jan 22, 2021
0.1.6 Jan 18, 2021
0.1.5 Jan 07, 2021
0.1.4 Dec 22, 2020
0.1.3 Dec 09, 2020
0.1.2 Dec 08, 2020
0.1.1 Nov 22, 2020
0.1.0 Nov 22, 2020
Extras:
Dependencies:
argcomplete
click
etcd-distro
lazy-import
makefun
numpy (>=1.18.5)
psutil
pyarrow
pyyaml
setuptools
sortedcontainers
treelib
vineyard-bdist (==0.24.2)
pandas (<1.0.0)
pandas (<1.2.0)
pickle5
shared-memory38
pandas (>=1.0.0)