Manuscript Offprint

arXiv:2608.22795

VersaDB: A High-Performance AI Storage Database for Unifying Mutimodal Datasets

Cong Wang, Zelin Liu, Yang Luo Ran Zhang, Zhijian Guo, Hui Zhang, Fan Yu, Yanfei Cao, Naijie Gu, Jun Yu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Cong Wang†, Zelin Liu†, Yang Luo†, Ran Zhang, Zhijian Guo, Hui Zhang, Fan Yu, Yanfei Cao, Naijie Gu‡, Jun Yu‡

Abstract—The AI field has been rapidly developing, leading to the emergence of a large number of AI training datasets of various types. These datasets contain different modalities, including text, images, audio, etc., and may come in various data storage formats. With the advancement of AI hardware, AI computation units like GPUs, TPUs, and NPUs can greatly accelerate the training speed of AI models, which in turn increases the demand for faster data processing. When using existing AI processing frameworks to handle datasets with different modalities and storage formats, processing speeds may be suboptimal due to issues such as data layout and the way users handle the data. Therefore, using a unified database to store multiple data formats can better manage and optimize data access. In this paper, we introduce VersaDB, a database designed specifically for AI datasets with various modalities. We implemented a page-based storage system, separating structured and unstructured data. Additionally, we generated B+ tree-based index files to accelerate data access. VersaDB supports automatic sharding and maintains a hierarchical metadata management system, with corresponding metadata maintained at the page, shard, and global levels, forming the foundation for the efficient operation of the database. We also focused on ease of use by providing APIs for directly converting datasets into VersaDB, as well as APIs for converting popular AI data storage formats (e.g., CSV, TFRecord, .bin) into VersaDB. Our experiments show that using VersaDB can achieve up to 5.35x acceleration and maintain consistent performance across different parallelism levels.

Index Terms—AI data management, Multimodal, Memory Usage Optimization.

I. Introduction

WITH the rapid development of multi-sensor fusion applications and AI, we are closer than ever to creating an AI agent capable of perceiving the world and interacting in a human-like manner using multiple senses [1]. AI advances are driven by big data [2], and recent datasets exhibit trends of richer modalities and larger scales [3], such as Conceptual 12m [4] Laion-400m [5] X-world [6]. With the development of AI computing hardware, such as Nvidia's GPUs, Google's TPUs, Huawei's NPUs, and accelerators designed for specific networks [7] [8], along with various model optimization techniques [9], data loading may become a bottleneck in AI training [10] [11]. This is not only because the improvement in computational power and efficiency increases data throughput but also because data publishers release AI data in different formats, researchers are unable to read the data using a unified and efficient data reading architecture, leading to significant performance variations between different datasets.

To accelerate data reading and processing, various AI frameworks use different methods. For example, Pytorch [12], Mindspore, and Tensorflow all support multithreaded parallel processing, distributing data loading and preprocessing tasks across multiple threads to achieve parallel processing, thereby reducing waiting time during model training or inference. Prefetching is another effective method. It works by loading data in advance so that it is ready in memory when needed. This effectively overlaps GPU computation with CPU data reading time, reducing the impact of I/O time [10]. However, acceleration techniques in AI frameworks face several issues: Firstly, increasing the number of threads can lead to additional overhead [13] (e.g., thread switching and inter-process communication), and prefetching is only effective when model training time exceeds data processing time [14]. Secondly, acceleration techniques typically cannot change the layout and organization of data, and lack in indexing systems, which may slow down data indexing or increase memory overhead. Thirdly, the issue of requiring different reading architectures for different modal data has yet to be solved, potentially leading to inconsistent performance.

This work was supported by National Key R&D Program of China under Grant No.2021ZD0110400

This work was supported by the University of Science and Technology of China (First Affiliation) and the Huawei (Second Affiliation) MindSpore open source project.

† These authors contributed equally to this work.

‡ These authors are co-corresponding authors.

Naijie Gu, Hui Zhang, Jun Yu, Yanfei Cao are with the University of Science and Technology of China, Anhui, China(e-mail: {gunj,fzhh,harryjun}@ustc.edu.cn, caoyf@mail.ustc.edu.cn).

Ran Zhang is with the South China University of Technology, Guangzhou, China(e-mail: 202164010462@mail.scut.edu.cn).

Normalizing data to a unified format or database is a convenient approach for management and reading. Additionally, rearranging the data can lead to better reading performance. For example, the LMDB storage database stores key-value data using a B+ tree, offering features such as multi-version concurrency control, fast disk I/O, and others [15]. Due to its ability to provide rapid data access [16], it is suitable for deep learning tasks. Similarly, converting data to TFRecord is another common choice.

Zelin Liu is with the Shanghai Jiao Tong University, Shanghai, China(e-mail: julio1@sjtu.edu.cn).

Cong Wang, Yang Luo, Fan Yu, and Zhijian Guo are with Huawei, China(e-mail: {wangcong64, luoyang42, fan.yu, guozhijian}@huawei.com).

0000-0000/00$00.00[17]2018]119E. TFRecord [20] is an efficient data storage format designed specifically for Tensorflow, aiming at improving the efficiency of loading and processing large-scale datasets. Data stored in TFRecord are serialized in the protobuf binary format, supporting parallel reading and prefetching using Tensorflow APIs.

However, existing AI storage management solutions still have some issues. For example, due to the B+ tree structure of LMDB, it requires knowledge of the parent node and related information to locate the record's exact address. As a result, direct random access is not currently supported, and sequential access must be performed using a "cursor." TFRecord, designed specifically for Tensorflow, has a major issue of being incompatible with other AI frameworks. Furthermore, since both writing and reading in TFRecord are sequential, it cannot perform reading while writing. Both storage methods share some common issues: first, they do not support modifications to the data. If a user wishes to modify the data, the entire data file must be regenerated, which is very time-consuming when dealing with large datasets. Secondly, when storing data in memory, they do not distinguish between different modalities or data structures. LMDB uses key-value pairs to store all different data, and the data is generally stored in a serialized form. TFRecord, on the other hand, stores all different data sequentially, without considering the data types.

To address the above issues and the characteristics of AI data, we designed an AI database with the following considerations. First, our database should not only perform well during sequential reads but also handle random access efficiently, as shuffling plays a crucial role in AI training. It can significantly improve unbiased learning and convergence accuracy [21] [22], and to some extent, prevent overfitting [23]. Secondly, we considered the current organizational characteristics of AI data, such as the diversity of modalities (e.g., text, audio, video) that may be either structured or unstructured, with most corresponding labels being structured. We also considered the reading and writing of ultra-large datasets. Storing an entire large dataset in a single file is clearly unreasonable, as it would significantly impact data transfer and mobility.

We designed an efficient and user-friendly AI database called VersaDB. We divide the data storage into raw data and blob data sections for storing structured and unstructured data, respectively. In the data storage section, we implement page-based storage, with pages as the smallest storage unit, allowing for direct random access via page offsets. To accelerate data access, we create a separate index file outside the data storage file, implementing a B+ tree-based structure. We also employ a two-level sharding mechanism: the physical layer stores data, while the logical layer maps data through a distributed hash table. Shard information is managed by a hierarchical metadata system, which includes global, shard, and page-level dataset information, forming the foundation for the efficient operation of the data format. On top of these features, we support dynamic field extension capabilities and seamless integration of diverse data types, while also implementing a hierarchical lock manager to enable finer-grained locking, allowing data reading without affecting write operations.

Fig. 1 illustrates the VersaDB file generation workflow. The process begins by parsing input data according to the user-defined schema, writing structured data to the raw data section and unstructured data to the blob data section. During this process, the system generates statistics and shard metadata while constructing the index structure. The final step integrates the header, raw data, and blob data into a cohesive data file.

In summary, this paper makes the following contributions:

  • AI-specific adaptation. The AI database we designed implements a page-based storage model, where data is stored separately according to its type. It can automatically generate multi-level index files based on the B+ tree structure according to the stored data, and meticulously maintain multi-dimensional metadata. This design fully adapts to the diverse ecosystem of current AI datasets and meets the demand for fast data access.

  • High performance. We tested multiple datasets from common modalities such as images, text, and audio in two different machine environments. The test tasks included Pure reading, Shuffle reading, and Preprocessing, achieving up to 5.35x acceleration under default conditions. We also evaluated the performance of VersaDB at different parallelism levels and distributed levels. The experimental results demonstrate that our data structure offers exceptional performance and scalability.

• Memory consumption Optimization. The memory consumption of VersaDB has been specially optimized. We use the HyperLogLog structure for cardinality estimation, apply specific compression schemes to both the outer and inner layers of pages, and implement strategies such as the scalar-blob separation strategy and dynamic page replacement policy.

References (39)