File access method and device

By mounting the user-mode file system on the system kernel of the computing node and using the process adapter to complete file system access in the user-mode, the problem of low data storage and access efficiency in large language models is solved and efficient data access performance is achieved.

CN118796772AActive Publication Date: 2024-10-18ALIPAY (HANGZHOU) INFORMATION TECH CO LTD

Patent Information

Application Number
CN202411276575.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-10-18
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

When existing storage systems process large language model (LLM) data, their IO performance is insufficient, resulting in low data access efficiency and high system overhead, which affects the performance of computing tasks.

Method used

Mount the user-mode file system on the system kernel of the computing node, and implement process adapter programs between user-mode processes to intercept and forward file access requests and results to complete file system access in the user-mode and reduce system kernel calls. frequency.

Benefits of technology

Significantly improves access performance to user-mode file systems, reduces system overhead, and improves data access efficiency for large-scale computing tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796772A_ABST
    Figure CN118796772A_ABST
Patent Text Reader

Abstract

The file access method is applied to a computing node for executing a computing task, and a user mode file system running in a user mode is mounted on a system kernel of the computing node. A first process adaptation program is realized in the first user mode process corresponding to the calculation task; a second process adaptation program is realized in a second user mode process corresponding to the user mode file system; comprising the steps that a first process adaptation program intercepts an access request of a first user mode process for a user mode file system; the first process adaptation program transmits the access request to a second process adaptation program in a user mode, and the second process adaptation program submits the access request to a second user mode process; and the second process adaptive program intercepts an access result generated by the second user state process for access processing of the user state file system, and transmits the access result to the first process adaptive program in the user state, and the first process adaptive program submits the access result to the first user state program.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of this specification belong to the field of artificial intelligence technology, and more particularly, to a file access method and device. Background Art

[0002] With the rapid development of LLM (Large Language Model), not only the amount of data related to LLM models is rapidly expanding, but also the requirements for the storage and reading and writing of these data are constantly changing. For example, LLM models usually consist of billions or even tens of billions of parameters, so in addition to storing the data required for reasoning, a large amount of storage resources are also required to store these model parameters. In addition, when the LLM model is running, it is usually necessary to read and write data at high speed so that data can be processed quickly during the reasoning stage. This requires the optimization of the existing storage system to ensure that the LLM model can quickly access the required data.

[0003] On this basis, changes in data storage and reading and writing requirements are bound to pose new challenges to the IO performance of existing storage systems. Summary of the invention

[0004] The present specification proposes a file access method, which is applied to a computing node that performs a computing task, wherein a user-mode file system running in user mode is mounted on a system kernel of the computing node; the user-mode file system is used to store files related to the computing task; a first process adapter is implemented in a first user-mode process corresponding to the computing task; a second process adapter is implemented in a second user-mode process corresponding to the user-mode file system; the method comprises: The first process adapter intercepts an access request for the user-mode file system triggered by the first user-mode process during its operation; In response to the intercepted access request, the first process adapter transmits the access request to the second process adapter in the user state, and the second process adapter further submits the access request to the second user state process, so that the second user state process executes the access request to access the user state file system; The second process adapter intercepts the access result generated by the second user-state process performing access processing on the user-state file system, and transmits the access result to the first process adapter in the user state, and the first process adapter further submits the access result to the first user-state program, so that the first user-state program completes the computing task based on the access result.

[0005] Optionally, the execution code run by the first user state process includes a first function for initiating a system call to the system kernel to access the user state file system; correspondingly, the first process adapter includes a second function for accessing the user state file system in the user state; The first process adapter program intercepts an access request for the user-mode file system triggered by the first user-mode process during operation, including: In response to a call to the first function by the first user state process during operation, the first function is replaced by the second function, so that the first user state process further initiates a call to the second function, and submits an access request to the user state file system triggered during operation as a call parameter to the first process adapter; The first process adapter transmits the access request to the second process adapter in user mode, including: The first process adapter executes the second function and transmits the access request to the second process adapter in user mode.

[0006] Optionally, the execution code run by the second user state process includes a third function for initiating a system call to the system kernel to return an access result to the user state file system to the first user state process; correspondingly, the second process adapter includes a fourth function for returning the access result to the user state file system to the first user state process in the user state; The second process adapter intercepts the access result generated by the second user state process performing access processing on the user state file system, including: In response to the second user state process calling the third function during operation, replacing the third function called by the second user state process with the fourth function, so that the second user state process further initiates a call to the fourth function, and submits an access result generated by performing access processing on the user state file system as a call parameter to the second process adapter; The second process adapter program transmits the access result to the first process adapter program in user mode, including: The second process adapter executes the fourth function and transmits the access result to the first process adapter in user mode.

[0007] Optionally, the first process adapter program transmits the access request to the second process adapter program in user mode, including: The first process adapter transmits the access request to the second process adapter in a user state in a memory sharing manner; The second process adapter transmits the access result to the first process adapter in user mode, including: The second process adapter transmits the access result to the first process adapter in a user state in a memory sharing manner.

[0008] Optionally, the access request includes a read request for a target file stored in the user-state file system; correspondingly, the access result includes the target file read from the user-state file system; or, The access request includes a write request to write a target file into the user-mode file system; correspondingly, the access result includes a write result of writing the target file into the user-mode file system.

[0009] Optionally, the file stored in the user-mode file system is a file block composed of several files.

[0010] Optionally, the user-state file system is connected to a storage system for storing files related to the computing task; wherein an RDMA connection is established between the user-state file system and the storage system; The method further comprises: Before the computing node executes the computing task, the files related to the computing task are synchronized from the storage system to the user-mode file system for storage based on the RDMA connection.

[0011] Optionally, the operating system used by the computing node is a Linux system; the process adapter is an Adaptor adapter implemented in a user-mode process based on an LD_PRELOAD mechanism supported by the Linux system.

[0012] Optionally, the user-state file system is a user-state file system created based on a libfuse library provided by a Linux system; the user-state file system is mounted to the Linux system through a Fuse kernel module of the Linux system.

[0013] Optionally, the computing task is a training task for training an LLM model; or, a reasoning task for performing logical reasoning based on the LLM model.

[0014] Optionally, the user-mode file system is a file system implemented based on a flash storage device carried by the computing node.

[0015] Optionally, the user-mode file system is a distributed file system implemented based on a flash storage device carried by each computing node in a computing node cluster that jointly executes the computing task.

[0016] The specification also proposes a file access device, which is applied to a computing node that performs a computing task, wherein a user-mode file system running in user mode is mounted on a system kernel of the computing node; the user-mode file system is used to store files related to the computing task; a first process adapter is implemented in a first user-mode process corresponding to the computing task; a second process adapter is implemented in a second user-mode process corresponding to the user-mode file system; the device comprises: A first interception module, wherein the first process adapter intercepts an access request for the user-mode file system triggered by the first user-mode process during its operation; a first transmission module, in response to the intercepted access request, the first process adapter transmits the access request to the second process adapter in the user state, and the second process adapter further submits the access request to the second user state process, so that the second user state process executes the access request to access the user state file system; A second interception module, the second process adapter program intercepts an access result generated by the second user state process performing access processing on the user state file system; The second transmission module, the second process adapter transmits the access result to the first process adapter in user mode, and the first process adapter further submits the access result to the first user mode program, so that the first user mode program completes the computing task based on the access result.

[0017] In the above embodiment, by implementing process adapters on the user state process corresponding to the computing task and the user state process corresponding to the user state file system mounted on the system kernel, respectively, when the user state process corresponding to the computing task accesses the user state file system, the access interaction with the user state file system can be completed in the user state through the implemented process adapter, without the need to initiate a call to the system kernel, thereby optimizing the access link to the user state file system, significantly reducing the number of calls to the system kernel, reducing system overhead, and further improving the access performance when accessing the user state file system. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0019] Figure 1 is an interactive diagram showing a computing node accessing a user-mode file system through a system kernel in an embodiment of this specification; Figure 2 is a flow chart of a file access method shown in an embodiment of this specification; Figure 3 is an interactive diagram showing a computing node accessing a user-mode file system in user mode in an embodiment of this specification; Figure 4 is a schematic structural diagram of an electronic device shown in an embodiment of this specification; Figure 5 It is a block diagram of a file access device shown in one embodiment of this specification. DETAILED DESCRIPTION

[0020] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0021] In practical applications, when computing nodes perform computing tasks such as training tasks for LLM models or reasoning tasks based on LLM models, in order to achieve high-speed data access to files related to computing tasks, a user-state file system running in user state is usually implemented on the computing node as a cache layer based on the storage resources carried by the computing node, and the user-state file system is mounted on the system kernel of the computing node.

[0022] Before the computing node starts to execute the computing task, the computing node can cache the files related to the computing task in the user-mode file system in advance. When the computing node starts to execute the computing task, if the user-mode process corresponding to the computing task needs to access the above user-mode file system, it can initiate access to the above user-mode file system through the computing node's system kernel as a transfer.

[0023] See also Figure 1 , Figure 1 The figure shows an interaction diagram of a computing node accessing a user-mode file system through a system kernel.

[0024] like Figure 1 As shown, taking the Linux system as an example, in the Linux system, the user-state file system can be a user-state file system created based on the libfuse library provided by the Linux system; the user-state file system can be mounted to the Linux system through the Fuse kernel module of the Linux system.

[0025] In the user state of the Linux system, a first user state process corresponding to a computing task can be run, and a second user state process corresponding to the user state file system can also be run. The first user state process can usually be used to execute the computing task, and the second user state process can usually be used to manage the user state file system.

[0026] The first user-mode process corresponding to the computing task, during the process of executing the execution code related to the computing task, if it needs to access files stored in the user-mode file system, can usually access the user-mode file system by calling the system function in the system kernel.

[0027] For example, the access behavior of the first user-mode process to the user-mode file system may generally include the reading behavior of files stored in the user-mode file system and the writing behavior of files written to the user-mode file system. The above-mentioned system functions may include read functions and write functions. When the first user-mode process has the need to read files stored in the user-mode file system, it may initiate the reading operation of files stored in the user-mode file system by calling the read function in the system kernel; when the first user-mode process has the need to write files to the user-mode file system, it may initiate the operation of writing files to the user-mode file system by calling the write function in the system kernel.

[0028] Please continue to see Figure 1 , taking the access scenario where the first user state process reads a file stored in the user state file system as an example, Figure 1 In the access link for the user-mode file system shown, when the first user-mode process calls the read function in the system kernel, it is usually necessary to transfer the read request (that is, the call request for the read function) through the VFS (Virtual Filesystem) layer in the system kernel to the kernel-mode FUSE module in the system kernel.

[0029] After receiving the read request, if the size of the read request exceeds the single request that the system kernel can handle, the Fuse module will usually continue to split the read request into multiple read requests; for example, the default size of a single request that can be processed by the system kernel of the Linux system is usually 128K, then the Fuse module will further split the received read request into multiple read requests of 128K in size.

[0030] Then, the Fuse module can continue to send the split read request to the user-mode file system created based on the libfuse library running in the user mode. After receiving the read request sent by the Fuse module, the second user-mode process corresponding to the user-mode file system can call the implementation logic in the user-mode file system to implement the reading of the file, and then return the read file to the kernel-mode Fuse module in the system kernel according to the same link, and the Fuse module continues to return the read file to the VFS layer in the system kernel, and finally the VFS layer returns the read file to the above-mentioned first user-mode process.

[0031] The first user state process and the second user state process may continuously repeat the above interaction process until all split read requests are processed.

[0032] However, in the above scheme, on the one hand, since each split read request needs to pass through the system kernel, be processed multiple times in the kernel state and be transferred multiple times before being sent to the user-mode file system in the user mode, the problem of excessive system overhead will occur; for example, assuming that the above read request is a read request for a single large block file, such as a read request for a large block file of 128MB, then if the read request is split according to the default size of 128K of a single request that can be processed by the system kernel of the Linux system, it will be split into 1024 sub-read requests. These 1024 read requests all pass through the system kernel, are processed multiple times in the kernel state and are transferred multiple times before being sent to the user-mode file system in the user mode, which obviously causes a lot of system overhead.

[0033] On the other hand, since the file finally read needs to be copied back and forth multiple times between user state and kernel state before it can be finally transmitted back to the first user state process in user state, there will obviously be a problem of too high access delay for the file, which will affect the access performance to the user state file system.

[0034] Based on this, this specification proposes a technical solution that can bypass the system kernel to complete the access to the user-mode file system in the user mode.

[0035] During implementation, a first process adapter may be implemented in a first user-mode process corresponding to a computing task, and a second process adapter may be implemented in a second user-mode process corresponding to a user-mode file system.

[0036] When the first user state process is running, the first process adapter can intercept an access request for the user state file system triggered by the first user state process during its running, and then transmit the access request to the second process adapter in the user state.

[0037] After receiving the access request transmitted by the first process adapter in the user state, the second process adapter may submit the access request to the second user state process, and the second user state process continues to execute the access request to access the user state file system.

[0038] When the second user state process executes the access request, the second process adapter can intercept the access result generated by the second user state process accessing the user state file system, and then transmit the access result to the first process adapter in the user state according to the same link.

[0039] After receiving the access result transmitted by the second process adapter in the user state, the first process adapter may further submit the access result to the first user state program, so that the first user state program completes the computing task based on the access result.

[0040] In the above technical scheme, by implementing process adapters on the user-state process corresponding to the computing task and the user-state process corresponding to the user-state file system mounted on the system kernel, respectively, when the user-state process corresponding to the computing task accesses the user-state file system, the access interaction for the user-state file system can be completed in the user state through the implemented process adapter, without the need to initiate a call to the system kernel, thereby optimizing the access link to the user-state file system, significantly reducing the number of calls to the system kernel, reducing system overhead, and thus improving the access performance when accessing the user-state file system.

[0041] See also Figure 2 , Figure 2 The flowchart of a file access method shown in this specification, wherein the method is applied to a computing node that performs a computing task, a user-mode file system running in user mode is mounted on the system kernel of the computing node; the user-mode file system is used to store files related to the computing task; a first process adapter is implemented in a first user-mode process corresponding to the computing task; a second process adapter is implemented in a second user-mode process corresponding to the user-mode file system; the method includes the following execution process: Step 202: The first process adapter intercepts an access request for the user-mode file system triggered by the first user-mode process during its operation; The above-mentioned computing tasks may specifically include large-scale computing tasks of task types; for example, in one embodiment shown, the above-mentioned computing tasks may specifically include training tasks for training the LLM model, and reasoning tasks for performing logical reasoning based on the LLM model, and so on.

[0042] The above-mentioned computing nodes can be physical nodes for executing computing tasks or virtual nodes. For example, in practical applications, large-scale computing tasks such as training tasks for LLM models or reasoning tasks based on LLM models usually need to be executed through a large-scale distributed computing cluster. The computing cluster can further include several sites distributed in different regions, and the above-mentioned computing nodes can be physical devices deployed in each site, or virtual devices (such as virtual machines) obtained by further virtualizing physical devices. In this scenario, the computing task performed by each computing node can be a subtask obtained by splitting the computing task jointly performed by each computing node in the computing cluster according to the number of computing nodes.

[0043] In practical applications, in order to achieve high-speed data access to files related to computing tasks, a user-mode file system running in user mode can be implemented on the computing node as a cache layer based on the storage resources carried by the computing node, and the user-mode file system can be mounted on the system kernel of the computing node.

[0044] For example, in one embodiment shown, taking the Linux system as an example of the operating system carried by the above-mentioned computing node, in the Linux system, the above-mentioned user-state file system can be a user-state file system created based on the libfuse library provided by the Linux system; the user-state file system can be mounted to the Linux system through the Fuse kernel module of the Linux system.

[0045] It should be noted that the type of storage resources used by the user-mode file system implemented on the computing node is not specifically limited in this specification.

[0046] In one embodiment shown, the storage resources mounted on the computing node may generally include a flash memory device (flash memory). In this case, a user-mode file system may be implemented on the computing node using the flash memory device mounted on the computing node.

[0047] For example, in practical applications, a GPU is usually installed on a computing node to perform large-scale computing tasks such as training tasks for LLM models or reasoning tasks based on LLM models. In this case, the GPU can be directly connected to a flash storage device (such as an SSD solid-state drive) running the NVMe protocol. This allows the GPU to directly transfer files stored in the above user-mode file system from the flash storage device to the GPU memory without going through the CPU and system memory.

[0048] In this way, the high read and write speed characteristics of flash storage devices can be fully utilized, thereby improving the overall access performance of the user-mode file system.

[0049] In one embodiment shown, for large-scale computing tasks, it is usually necessary to jointly execute the computing tasks through a computing node cluster. In this case, the above-mentioned user-state file system can specifically be a distributed user-state file system implemented based on the storage resources carried by each computing node in the above-mentioned computing node cluster.

[0050] For example, still taking the example of executing the above-mentioned computing tasks through a large-scale distributed computing cluster, in actual applications, the computing cluster can further include several sites distributed in different regions, and each site can include several physical devices or virtual devices serving as computing nodes. In this case, for each site, a distributed user-mode file system can be implemented within the site based on the storage resources carried by the several physical devices or virtual devices serving as computing nodes within the site.

[0051] After the above-mentioned user-mode file system is implemented on the computing node based on the storage resources carried by the computing node, the computing node can cache the files related to the computing task in the user-mode file system in advance before starting to execute the computing task.

[0052] In one embodiment shown, a user-mode file system implemented on a computing node can be used as a cache layer to connect to a storage system for storing files related to computing tasks. The storage system can pre-establish an RDMA connection with the user-mode file system as a high-speed data transmission channel, and then the computing node can synchronize the files related to the computing task from the storage system to the user-mode file system for caching based on the established RDMA connection before executing the computing task.

[0053] It should be noted that the specific implementation process of pre-establishing an RDMA connection between the storage system and the user-mode file system will not be described in detail in this specification, and those skilled in the art may refer to the records in the relevant technology. Of course, in addition to pre-establishing an RDMA connection as a high-speed data transmission channel between the storage system and the user-mode file system, in actual applications, other forms of connections that support high-speed data transmission can obviously be established as data transmission channels, which will not be listed one by one in this specification.

[0054] In one embodiment shown, in order to improve the access efficiency of files, the files stored in the user-mode file system may be file blocks composed of a number of small files. That is, in practical applications, the small files stored in the user-mode file system may be aggregated into file blocks, which are stored and maintained as the smallest storage unit.

[0055] For example, in actual applications, the user-mode file system may specifically define a general file block format with a fixed size. After synchronizing files related to computing tasks from the storage system, the synchronized small files may be encapsulated into file blocks with a fixed size according to the file block format, and then stored and maintained in the form of this general file block.

[0056] It should be noted that, in actual applications, the storage system to which the user-mode file system is connected may also be a distributed storage system.

[0057] For example, still taking the example of executing the above computing tasks through a large-scale distributed computing cluster, in actual applications, the computing cluster can further include several sites distributed in different regions, and each site can include several physical devices or virtual devices as computing nodes. In this case, the above storage system can be a distributed storage system based on the storage resources carried by each site.

[0058] In this specification, when a computing node starts to execute a computing task, if the first user state process corresponding to the computing task needs to access the user state file system, it can usually initiate access to the user state file system through the system kernel of the computing node as a transfer. In this specification, the access link of the first user state process to the user state file system can be optimized so that the first user state process can directly access the user state file system in the user state.

[0059] See also Figure 3 , Figure 3 This is an interactive diagram of a computing node accessing a user-mode file system in user mode, as shown in this specification.

[0060] like Figure 3 As shown, a first process adapter can be implemented in a first user state process corresponding to a computing task, and a second process adapter can be implemented in a second user state process corresponding to a user state file system.

[0061] The first process adapter can be used to intercept the access request for the user-mode file system triggered by the first user-mode process during operation, and transmit the intercepted access request to the second process adapter in the user mode. The second process adapter can be used to intercept the access result generated by the second user-mode process performing access processing on the user-mode file system, and transmit the access result to the first process adapter in the user mode.

[0062] It should be noted that, in actual applications, the process adapter can be implemented in the user state process by loading a shared library for the user state process and expanding the functionality of the user state process without modifying the execution code contained in the original user state process.

[0063] For example, Figure 3 The operating system used by the computing node is taken as an example as Linux system. In this case, the above process adapter can be an Adaptor adapter created in the user mode process based on the LD_PRELOAD mechanism supported by the Linux system.

[0064] Among them, the LD_PRELOAD mechanism supported by the Linux system is a mechanism that expands the functionality of the user-mode process by loading shared libraries for the user-mode process without modifying the execution code contained in the original user-mode process. The specific implementation process of creating an Adaptor adapter in the user-mode process based on the LD_PRELOAD mechanism will not be described in detail in this specification, and those skilled in the art may refer to the records in the relevant technology.

[0065] Please continue to see Figure 3 When the computing node starts to execute the computing task, the first user state process is in the process of running, and the first process adapter can intercept the access request for the user state file system triggered by the first user state process in the process of running.

[0066] When the first process adapter intercepts the access request for the user-mode file system triggered by the first user-mode process during operation, it can be implemented by replacing the system function in the system kernel originally called by the first process adapter with a user-mode function.

[0067] For example, in one embodiment shown, the execution code running by the first user-mode process may generally include a first function for initiating a system call to the system kernel to access the user-mode file system; and in order to allow the first user-mode process to initiate access to the user-mode file system without going through the system kernel, the first process adapter may include an implementation of a second function for accessing the user-mode file system in user mode.

[0068] In this case, when the first user state process is running, when the first process adapter monitors that the first user state process has initiated a call to the above-mentioned first function during the running process, the above-mentioned first function can be replaced with the above-mentioned second function in response to the call to the first function by the first user state process during the running process, so that the first user state process can further initiate a call to the second function, and submit the access request to the user state file system triggered during the running process as a call parameter to the first process adapter, thereby completing the interception of the first user state process's access request to the user state file system.

[0069] It should be noted that the access request of the first user-state process to the user-state file system can specifically be a read request for a target file stored in the user-state file system, or a write request to write the target file to the user-state file system, which is not particularly limited in this specification.

[0070] For example, when the access request of the first user-mode process to the user-mode file system is a read request for a target file stored in the user-mode file system, the first function may be a kernel-mode read function, and the second function may be a user-mode read function implemented in the first process adapter. When the access request of the first user-mode process to the user-mode file system is a write request to write a target file into the user-mode file system, the first function may be a kernel-mode write function, and the second function may be a user-mode write function implemented in the first process adapter.

[0071] Step 104: In response to the intercepted access request, the first process adapter transmits the access request to the second process adapter in the user state, and the second process adapter further submits the access request to the second user state process, so that the second user state process executes the access request to access the user state file system; Please continue to see Figure 3 After intercepting the access request of the first user state process to the user state file system, the first process adapter can further transmit the access request to the second process adapter in the user state.

[0072] For example, in one embodiment shown, after the first process adapter intercepts the first user state process's access request to the user state file system by replacing the first function with the second function, the first process adapter can continue to execute the second function in the user state and transmit the access request to the second process adapter in the user state.

[0073] It should be noted that the specific transmission method adopted by the first process adapter to transmit the access request to the second process adapter in the user mode is not particularly limited in this specification.

[0074] For example, in one embodiment shown, the first process adapter and the second process adapter may share memory in user mode. In this case, the first process adapter may transmit the access request to the second process adapter in user mode in a memory sharing manner.

[0075] Of course, in addition to using shared memory to transmit information in user mode, the first process adapter and the second process adapter can also use other methods to transmit information in user mode in actual applications, such as message queues, sockets, etc.

[0076] Please continue to see Figure 3 After obtaining the access request transmitted by the first process adapter in the user state, the second process adapter can further submit the access request to the second user state process; for example, the access request can be submitted to the second user state process in a cross-thread manner within the process.

[0077] After receiving the access request, the second user state process may continue to execute the access request and perform access processing on the user state file system.

[0078] For example, in one example, when the access request is a read request for a target file stored in the user-state file system, the second user-state process can continue to execute the read request and read the target file from the target-state file system. At this time, the access result generated by the second user-state process performing access processing on the user-state file system is the target file read from the user-state file system.

[0079] In another example, when the access request is a write request to write the target file into the user state file system, the second user state process can continue to execute the write request to write the target file into the target state file system. At this time, the access result generated by the second user state process performing access processing on the user state file system is the write result of writing the target file into the user state file system.

[0080] It should be noted that the specific type of the file that the first user-mode process needs to write to the user-mode file system usually depends on the type of the above-mentioned computing task.

[0081] For example, if the above-mentioned computing task is a training task for model training of the LLM model, the file that the first user-state process needs to write to the user-state file system may specifically be a model snapshot generated at a specific time point during the model training of the LLM model. Model snapshots are usually used to describe the model state of the LLM model at a specific time point, also known as checkpoints, and the model snapshots may generally include model parameters learned during the training process. If the above-mentioned computing task is a reasoning task for logical reasoning based on the LLM model, the file that the first user-state process needs to write to the user-state file system may specifically be a reasoning result generated by logical reasoning based on the LLM model.

[0082] Step 106: The second process adapter intercepts the access result generated by the second user state process performing access processing on the user state file system, and transmits the access result in the user state to the first process adapter, and the first process adapter further submits the access result to the first user state program, so that the first user state program completes the computing task based on the access result.

[0083] Please continue to see Figure 3 During the process in which the second user state process performs access processing on the user state file system, the second process adapter can intercept the access result generated by the second user state process performing access processing on the user state file system.

[0084] Among them, when the second process adapter intercepts the access result generated by the second user state process performing access processing on the user state file system, it can also be implemented by replacing the system function in the system kernel originally called by the second process adapter with a user state function.

[0085] In one embodiment shown, the execution code run by the second user-mode process may generally include a third function for initiating a system call to the system kernel to return the access result to the user-mode file system to the first user-mode process; and in order to allow the first user-mode process to return the access result to the first user-mode process without going through the system kernel, the second process adapter may include a fourth function implemented in the user mode to return the access result to the user-mode file system to the first user-mode process. For example, the third function may be a kernel-mode callback function, and the fourth function may be a user-mode callback function implemented in the second process adapter.

[0086] In this case, when the second user state process is in the process of performing access processing on the user state file system, when the second process adapter monitors that the second user state process has initiated a call to the above-mentioned third function during its running process, the above-mentioned third function can be replaced with the above-mentioned fourth function in response to the call to the third function by the second user state process during its running process, so that the second user state process can further initiate a call to the fourth function, and submit the access result generated in the process of performing access processing on the user state file system as a call parameter to the second process adapter, thereby completing the interception of the access result generated by the second user state process performing access processing on the user state file system.

[0087] Please continue to see Figure 3 After intercepting the access result generated by the second user state process performing access processing on the user state file system, the second process adapter can further transmit the access request to the second process adapter in the user state.

[0088] In one embodiment shown, after the second process adapter intercepts the access result generated by the second user state process performing access processing on the user state file system by replacing the above-mentioned third function with the fourth function, the second process adapter can continue to execute the fourth function in the user state and transmit the access result to the second process adapter in the user state.

[0089] It should be noted that the specific transmission method adopted by the first process adapter to transmit the access request to the second process adapter in the user mode is not particularly limited in this specification.

[0090] For example, in one embodiment shown, the second process adapter may also transmit the access result to the first process adapter in a user state in a memory sharing manner.

[0091] Please continue to see Figure 3 After obtaining the access result transmitted by the second process adapter in the user state, the first process adapter can further submit the access result to the first user state process; for example, the access result can still be submitted to the first user state process in a cross-thread manner within the process.

[0092] After receiving the access result, the first user state process can continue to complete the computing task based on the access result.

[0093] For example, in one example, when the access request is a read request for a target file stored in a user-mode file system, the access result generated by the second user-mode process performing access processing on the user-mode file system is the target file read from the user-mode file system. In this case, after receiving the target file, the first user-mode process can continue to execute the computing task based on the target file.

[0094] In another example, when the access request is a write request to write a target file into the user-mode file system, the access result generated by the second user-mode process performing access processing on the user-mode file system is a write result of writing the target file into the user-mode file system.

[0095] In this case, after receiving the write result, the first user state process indicates that the computing task may have been completed, and at this time, the result indicating that the computing task has been completed can be directly returned.

[0096] In the above technical scheme, by implementing process adapters on the user-state process corresponding to the computing task and the user-state process corresponding to the user-state file system mounted on the system kernel, respectively, when the user-state process corresponding to the computing task accesses the user-state file system, the access interaction for the user-state file system can be completed in the user state through the implemented process adapter, without the need to initiate a call to the system kernel, thereby optimizing the access link to the user-state file system, significantly reducing the number of calls to the system kernel, reducing system overhead, and thus improving the access performance when accessing the user-state file system.

[0097] For example, taking the Linux operating system as an example, assuming that the default size of a single request that can be processed by the Linux kernel is 128K, and the access request is a read request for a 128MB file stored in the user-mode file system, then according to Figure 1 The link for accessing the user-mode file system through the system kernel is shown. After being transmitted to the Linux system kernel, the read request may need to be split into 1024 sub-read requests in the kernel. If all these 1024 read requests pass through the system kernel, are processed multiple times in the kernel mode and transferred multiple times before being sent to the user-mode file system in the user mode, there will obviously be huge system overhead.

[0098] If you follow Figure 3As shown in the optimized access link, the read request only needs to be transmitted to the user-mode file system in the user mode once through shared memory in the user mode, and does not need to pass through the system kernel. The read request is also not at risk of being split. Obviously, it can significantly reduce the number of calls to the system kernel and reduce system overhead, thereby improving the access performance when accessing the user-mode file system.

[0099] Corresponding to the embodiments of the aforementioned method, this specification also provides embodiments of an apparatus, an electronic device, and a storage medium.

[0100] Figure 4 is a schematic structural diagram of an electronic device provided by an exemplary embodiment. Figure 4 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include other required hardware. One or more embodiments of this specification may be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0101] like Figure 5 As shown, Figure 5 is a block diagram of a file access device according to an exemplary embodiment of the present specification, which can be applied to Figure 4 In the electronic device shown, the technical solution of this specification is implemented. The device can be applied to a computing node that performs a computing task, and a user-mode file system running in user mode is mounted on the system kernel of the computing node; the user-mode file system is used to store files related to the computing task; a first process adapter is implemented in a first user-mode process corresponding to the computing task; a second process adapter is implemented in a second user-mode process corresponding to the user-mode file system; the device 500 includes: A first interception module 501, the first process adapter intercepts an access request for the user-mode file system triggered by the first user-mode process during its operation; The first transmission module 502, in response to the intercepted access request, transmits the access request to the second process adapter in the user state, and the second process adapter further submits the access request to the second user state process, so that the second user state process executes the access request to access the user state file system; A second interception module 503, the second process adapter intercepts the access result generated by the second user state process performing access processing on the user state file system; The second transmission module 504, the second process adapter transmits the access result to the first process adapter in the user state, and the first process adapter further submits the access result to the first user state program, so that the first user state program completes the computing task based on the access result.

[0102] Accordingly, the present specification also provides an electronic device, which includes a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the steps in all the method flows described above.

[0103] Accordingly, the present specification also provides a computer-readable storage medium on which executable computer program instructions are stored; wherein, when the instructions are executed by a processor, the steps in all the method flows described above are implemented.

[0104] Accordingly, the present specification also provides a computer program product having executable computer program instructions stored thereon; wherein, when the computer program instructions are executed by a processor, the steps in all the method flows described above are implemented.

[0105] In the 1990s, it was very clear whether the improvement of a technology was hardware improvement (for example, improvement of the circuit structure of diodes, transistors, switches, etc.) or software improvement (improvement of the method flow). However, with the development of technology, many improvements of the method flow today can be regarded as direct improvements of the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be implemented with hardware entity modules. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask chip manufacturers to design and make dedicated integrated circuit chips. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0106] The controller may be implemented in any suitable manner, for example, the controller may take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (e.g., software or firmware) executable by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C2051F320. The memory controller may also be implemented as part of the control logic of the memory. It is also known to those skilled in the art that, in addition to implementing the controller in a purely computer-readable program code manner, the controller may be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, such a controller may be considered as a hardware component, and the devices included therein for implementing various functions may also be considered as structures within the hardware component. Or even, the devices for implementing various functions may be considered as both software modules for implementing the method and structures within the hardware component.

[0107] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, it is not excluded that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0108] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.

[0109] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0110] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0111] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0112] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0113] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0114] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0115] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0116] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0117] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0118] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.

[0119] The above description is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the scope of the claims.

Claims

1. A file access method, applied to a computing node that performs a computing task, wherein a user-mode file system running in user mode is mounted on a system kernel of the computing node; the user-mode file system is used to store files related to the computing task; A first process adapter is implemented in a first user mode process corresponding to the computing task; A second process adapter is implemented in a second user state process corresponding to the user state file system; the method comprises: The first process adapter intercepts an access request for the user-mode file system triggered by the first user-mode process during its operation; In response to the intercepted access request, the first process adapter transmits the access request to the second process adapter in the user state, and the second process adapter further submits the access request to the second user state process, so that the second user state process executes the access request to access the user state file system; The second process adapter intercepts the access result generated by the second user-state process performing access processing on the user-state file system, and transmits the access result to the first process adapter in the user state, and the first process adapter further submits the access result to the first user-state program, so that the first user-state program completes the computing task based on the access result.

2. The method according to claim 1, wherein the execution code executed by the first user-mode process includes a first function for initiating a system call to the system kernel to access the user-mode file system; correspondingly, the first process adapter includes a second function for accessing the user-mode file system in the user mode; The first process adapter program intercepts an access request for the user-mode file system triggered by the first user-mode process during operation, including: In response to a call to the first function by the first user state process during operation, the first function is replaced by the second function, so that the first user state process further initiates a call to the second function, and submits an access request to the user state file system triggered during operation as a call parameter to the first process adapter; The first process adapter transmits the access request to the second process adapter in user mode, including: The first process adapter executes the second function and transmits the access request to the second process adapter in user mode.

3. The method according to claim 1, wherein the execution code executed by the second user state process includes a third function for initiating a system call to the system kernel to return the access result to the user state file system to the first user state process; correspondingly, the second process adapter includes a fourth function for returning the access result to the user state file system to the first user state process in the user state; The second process adapter intercepts the access result generated by the second user state process performing access processing on the user state file system, including: In response to the second user state process calling the third function during operation, replacing the third function called by the second user state process with the fourth function, so that the second user state process further initiates a call to the fourth function, and submits an access result generated by performing access processing on the user state file system as a call parameter to the second process adapter; The second process adapter program transmits the access result to the first process adapter program in user mode, including: The second process adapter executes the fourth function and transmits the access result to the first process adapter in user mode.

4. The method according to claim 1, wherein the first process adapter transmits the access request to the second process adapter in user mode, comprising: The first process adapter transmits the access request to the second process adapter in a user state in a memory sharing manner; The second process adapter program transmits the access result to the first process adapter program in user mode, including: The second process adapter transmits the access result to the first process adapter in a user state in a memory sharing manner.

5. The method according to claim 1, wherein the access request comprises a read request for a target file stored in the user-mode file system; and correspondingly, the access result comprises the target file read from the user-mode file system; or The access request includes a write request to write a target file into the user-mode file system; correspondingly, the access result includes a write result of writing the target file into the user-mode file system.

6. The method according to claim 1, wherein the file stored in the user-mode file system is a file block composed of a plurality of files.

7. The method according to claim 1, wherein the user-mode file system is connected to a storage system for storing files related to the computing task; wherein: An RDMA connection is established between the user-mode file system and the storage system; The method further comprises: Before the computing node executes the computing task, the files related to the computing task are synchronized from the storage system to the user-mode file system for storage based on the RDMA connection.

8. The method according to claim 1, wherein the operating system used by the computing node is a Linux system; and the process adapter is an Adaptor adapter implemented in a user-mode process based on the LD_PRELOAD mechanism supported by the Linux system.

9. According to the method as claimed in claim 1, the user-state file system is a user-state file system created based on the libfuse library provided by the Linux system; the user-state file system is mounted to the Linux system through the Fuse kernel module of the Linux system.

10. The method according to claim 1, wherein the computing task is a training task for training an LLM model; or a reasoning task for performing logical reasoning based on an LLM model.

11. The method according to claim 1, wherein the user-mode file system is a file system implemented based on a flash storage device mounted on the computing node.

12. According to the method as claimed in claim 11, the user-mode file system is a distributed file system implemented based on a flash storage device installed on each computing node in a computing node cluster that jointly executes the computing task.

13. A file access device, applied to a computing node for executing a computing task, wherein a user-mode file system running in user mode is mounted on a system kernel of the computing node; the user-mode file system is used to store files related to the computing task; A first process adapter is implemented in a first user mode process corresponding to the computing task; A second process adapter is implemented in a second user state process corresponding to the user state file system; the device comprises: A first interception module, wherein the first process adapter intercepts an access request for the user-mode file system triggered by the first user-mode process during its operation; a first transmission module, in response to the intercepted access request, the first process adapter transmits the access request to the second process adapter in the user state, and the second process adapter further submits the access request to the second user state process, so that the second user state process executes the access request to access the user state file system; A second interception module, the second process adapter program intercepts an access result generated by the second user state process performing access processing on the user state file system; The second transmission module, the second process adapter transmits the access result to the first process adapter in user mode, and the first process adapter further submits the access result to the first user mode program, so that the first user mode program completes the computing task based on the access result.

14. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 12 are implemented.

15. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 12.

16. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 12 are implemented.

Citation Information

Patent Citations

  • Method and device for accessing user space file system

    CN103617039A

  • Data processing method and device

    CN110275782A

  • NAS (Network Attached Storage) access method and system for FPGA (Field Programmable Gate Array) control storage equipment

    CN117992420A

  • User mode file system performance optimization method based on system call interception technology

    CN118502846A

  • Integrating kernel-bypass user-level file systems into legacy applications

    US20200257459A1

Cited By

  • Computing chip and execution method of computing task

    CN119336520A