Data processing method and apparatus, and storage medium and electronic device
By obtaining the data to be processed in the serverless inference system, judging the processing process capabilities, and selecting the appropriate configuration combination and storage location, the problem of memory consumption and delay is solved, and efficient data processing is achieved.
Patent Information
- Application Number
- PCT/CN2023/124084
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-10
- Filing Date
- 2023-10-11
- Publication Date
- 2024-09-19
AI Technical Summary
Existing serverless inference systems are memory-intensive, causing memory consumption to become a bottleneck, and request batch processing increases latency, making it difficult to reduce server memory usage without increasing latency.
By obtaining the data to be processed, determine whether the current processing process can process the set amount of data. If not, obtain the data processing time under different configuration combinations, select the target configuration combination, create the target processing process, and optimize the storage location of the parameter tensor to Reduce memory usage.
Without increasing the data processing delay, the server memory resource usage is reduced, the memory consumption of the serverless inference system is optimized, the memory usage is reduced and the processing efficiency is improved.
Smart Images

Figure CN2023124084_19092024_PF_FP_ABST
Abstract
Description
Data processing method, device, storage medium and electronic device Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, device, storage medium, and electronic device. Background Art
[0002] In recent years, with the widespread application of machine learning, especially deep learning algorithms, scenarios such as the Internet of Things (IoT) and mobile application backends have become heavily reliant on inference services based on these models. Serverless computing, due to its ease of use, low cost, and automatic scaling, has gained support and rapid adoption among major cloud service providers. A growing number of efforts are focused on building inference services based on serverless platforms. However, as current serverless inference systems are typically memory-intensive, memory consumption has become a bottleneck in the development of this technology.
[0003] During data processing, the server generates a corresponding processing request for each pending data item. For each processing request, the server invokes a processing process to handle it. To reduce the server's memory usage, requests are typically batched, combining multiple requests into a single, larger request that shares a single processing process. However, batching introduces additional request queuing time, especially when the server is underpowered, making batching often impossible. This approach can actually increase data processing latency.
[0004] Therefore, how to reduce the usage of server memory resources without increasing the delay time of the data processing process is an urgent problem to be solved.
[0005] Summary of the Invention
[0006] The present disclosure provides a data processing method, apparatus, medium, and device to partially solve the above-mentioned problems existing in the prior art.
[0007] This disclosure adopts the following technical solutions:
[0008] The present disclosure provides a data processing method, comprising:
[0009] Get the data to be processed;
[0010] determining whether the data processing model can process a set amount of data to be processed under a current processing process, and in response to determining that the data processing model cannot process the set amount of data to be processed under the current processing process, obtaining data processing times of the data processing model under multiple configuration combinations;
[0011] determining, for each of the plurality of configuration combinations, a data volume that can be processed by the data processing model within the data processing time as a target data volume;
[0012] With the data processing model being able to process a set amount of data to be processed as a goal, a target configuration combination is selected from the multiple configuration combinations according to the target data amount, and a processing process under the target configuration combination is created;
[0013] The data to be processed is processed according to the processing process under the created target configuration combination.
[0014] Optionally, the configuration combination includes at least one of: the number of central processing units (CPUs), batch size, data parallelism, and storage locations of parameter tensors corresponding to operators, and the storage locations of the parameter tensors include: local memory nodes and remote memory nodes.
[0015] Optionally, before obtaining the data processing time of the data processing model under multiple configurations, the method further includes:
[0016] Inputting multiple configuration combinations into a preset performance estimation model, and determining, for each configuration combination in the multiple configuration combinations, the data processing time corresponding to each operator included in the data processing model under the configuration combination using the performance estimation model;
[0017] According to the data processing time corresponding to each operator under the configuration, the data processing time corresponding to the data processing model under the configuration combination is determined.
[0018] Optionally, the method further includes:
[0019] If the data processing model includes at least two parallel linear networks, determining the data processing time corresponding to each linear network under the configuration combination;
[0020] The maximum value of the data processing time corresponding to each linear network under the configuration combination is used as the data processing time corresponding to the data processing model under the configuration combination.
[0021] Optionally, with the data processing model being able to process a set amount of data to be processed as a goal, a target configuration combination is selected from the multiple configuration combinations according to the target data volume, and a processing process under the target configuration combination is created, specifically including:
[0022] Selecting a target configuration combination from a plurality of configuration combinations according to the target data volume, and creating a processing process under the target configuration combination;
[0023] Determining whether the data processing model is capable of processing the set amount of data to be processed after creating the processing process under the target configuration combination;
[0024] If the data processing model cannot process the set amount of data to be processed, then continue to determine a new target configuration combination from other configuration combinations other than the target configuration combination based on the target data volume, and create a processing process under the new target configuration combination until the data processing model can process the set amount of data to be processed.
[0025] Optionally, with the data processing model being able to process a set amount of data to be processed as a goal, a target configuration combination is selected from the multiple configuration combinations according to the target data volume, and a processing process under the target configuration combination is created, specifically including:
[0026] For each target configuration combination in the multiple configuration combinations, setting the storage location of each parameter tensor in the target configuration combination to a remote memory node;
[0027] According to the actual target data volume of the data processing model, redundant processing processes are deleted.
[0028] Optionally, with the data processing model being able to process a set amount of data to be processed as a goal, selecting a target configuration combination from the multiple configuration combinations according to the target data volume specifically includes:
[0029] For each configuration combination in the multiple configuration combinations, if each parameter tensor in the configuration combination is stored in the local memory node, determine a data processing time corresponding to the data processing model under the configuration combination as a first processing time;
[0030] For each parameter tensor in the configuration combination, determining a data processing time corresponding to the data processing model when storing the parameter tensor in the remote memory node as a second processing time;
[0031] Determine, based on the first processing time and the second processing time, an additional data processing time after the parameter tensor is changed from being stored in the local memory node to being stored in the remote memory node as a delay rise time;
[0032] Determine the greedy coefficient corresponding to the parameter tensor based on the memory size occupied by the parameter tensor and the delay rise time corresponding to the parameter tensor, and use the parameter tensor with the highest greedy coefficient as the target parameter tensor allowed for remote access;
[0033] Determining a data processing time corresponding to the data processing model after storing the target parameter tensor in the remote memory, and determining whether the data processing time is greater than a preset quality of service constraint duration;
[0034] If it is determined that the data processing time is less than or equal to the preset quality of service constraint duration, the configuration combination when the target parameter tensor is stored in the remote memory is used as the target configuration combination.
[0035] Optionally, the delay rise time corresponding to the parameter tensor is negatively correlated with the greedy coefficient corresponding to the parameter tensor, and the memory size occupied by the parameter tensor is positively correlated with the greedy coefficient corresponding to the parameter tensor.
[0036] Optionally, the method further includes:
[0037] If the data processing time is less than the quality of service constraint duration after the target parameter tensor is stored in the remote memory, the next target parameter tensor is determined until the data processing time is greater than the quality of service constraint duration.
[0038] Optionally, performing data processing on the to-be-processed data according to the processing process under the created target configuration combination specifically includes:
[0039] determining a target data volume corresponding to each of the plurality of processing processes according to a plurality of target configuration combinations respectively corresponding to the plurality of processing processes;
[0040] The to-be-processed data required to be processed by the multiple processing processes are allocated according to the target data volume corresponding to each processing process in the multiple processing processes.
[0041] Optionally, performing data processing on the to-be-processed data according to the processing process under the created target configuration combination specifically includes:
[0042] Determining parameter tensors that need to be loaded into the data processing model;
[0043] For each parameter tensor, query whether the parameter tensor is stored in the local memory node;
[0044] If the parameter tensor is stored in the local memory node, map the parameter tensor memory in the local memory node in a memory-mapped manner and load the parameter tensor; if the parameter tensor is not stored in the local memory node, determine whether the parameter tensor is allowed to be stored in the remote memory node under the current configuration;
[0045] If the parameter tensor is allowed to be stored in the remote memory node under the current configuration, after querying the remote memory node to store the parameter tensor, the parameter tensor memory in the remote memory node is mapped in a memory mapping manner and the parameter tensor is loaded;
[0046] Data processing is performed on the data to be processed according to the processing process under the created target configuration combination and the loaded parameter tensor.
[0047] Optionally, the method further includes:
[0048] If the parameter tensor is not allowed to be stored in the remote memory node under the current configuration combination, a memory area is created in the local memory, and the parameter tensor is added to the local memory node corresponding to the memory area.
[0049] Optionally, the method further includes:
[0050] If it is determined that the parameter tensor is allowed to be stored in the remote memory node under the current configuration combination, but the parameter tensor is not stored in the remote memory node, a memory area is created in the local memory, and the parameter tensor is added to the local memory node corresponding to the memory area.
[0051] Optionally, for each parameter tensor, querying whether the parameter tensor is stored in the local memory node specifically includes:
[0052] For each parameter tensor, determine the hash value corresponding to the parameter tensor;
[0053] The local memory node is accessed using the hash value as the authentication information corresponding to the parameter tensor, and a query is made as to whether the parameter tensor is stored in the local memory node.
[0054] Optionally, performing data processing on the data to be processed according to the processing process under the created target configuration combination specifically includes:
[0055] Determining the number of mappings corresponding to each parameter tensor according to the processing process included in the data processing model;
[0056] Determining a reference count corresponding to each parameter tensor according to the mapping number corresponding to each parameter tensor;
[0057] For each parameter tensor, if the reference count corresponding to the parameter tensor is cleared during the data processing of the to-be-processed data, the tensor memory corresponding to the parameter tensor is reclaimed.
[0058] Optionally, creating a processing process under the target configuration combination specifically includes:
[0059] For each processing process, based on the memory size and CPU number corresponding to the processing process, the server nodes that do not meet the configuration combination requirements are filtered out, and the remaining server nodes are used as candidate server nodes;
[0060] For each candidate server node, determine the maximum memory allowed to be shared on the candidate server node;
[0061] According to the maximum memory allowed to be shared on each candidate server node, a designated server node is selected as the target server node, and the processing process is scheduled to the target server node.
[0062] Optionally, the method is applied to a serverless platform, and the local memory node and the remote memory node are memory nodes on a non-uniform memory access (NUMA) memory.
[0063] The present disclosure provides a data processing device, comprising:
[0064] Get module to get data to be processed;
[0065] a calling module for determining whether the data processing model can process a set amount of data to be processed under a current processing process, and in response to determining that the data processing model cannot process the set amount of data to be processed under the current processing process, obtaining data processing time of the data processing model under multiple configuration combinations;
[0066] a determination module, for determining, for each of the plurality of configuration combinations, a data volume that can be processed by the data processing model within the data processing time, as a target data volume;
[0067] a creation module, which takes the data processing model being able to process a set amount of data to be processed as a goal, selects a target configuration combination from the multiple configuration combinations according to the target data amount, and creates a processing process under the target configuration combination;
[0068] The processing module processes the data to be processed according to the processing process under the created target configuration combination.
[0069] The present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned data processing method is implemented.
[0070] The present disclosure provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned data processing method when executing the program.
[0071] At least one of the above technical solutions adopted in the present disclosure can achieve the following beneficial effects:
[0072] In the data processing method provided by the present invention, the server obtains each piece of data to be processed, determines whether the data processing model can process a set number of data to be processed under the current processing process, and if not, retrieves the data processing time of the data processing model under different configuration combinations, and for the data processing time under each configuration combination, determines the amount of data that the data processing model can process within the data processing time as the target data amount, and takes the ability of the data processing model to process the set number of data to be processed as the goal. According to the target data amount, a target configuration combination is selected from each configuration combination, and a processing process under the target configuration combination is created to process the data to be processed.
[0073] It can be seen from the above method that during the data processing process, when it is determined that the data processing model cannot process all the data to be processed at one time under the current processing process, this solution can determine the target data volume of the data processing model under different configuration combinations, and then select the corresponding target configuration to expand the new processing process, thereby ensuring that the data processing model can complete the processing of the preset number of data to be processed at one time under the premise of expanding fewer processing processes, and reduce the occupancy of server memory resources without increasing the delay time of the data processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The drawings described herein are used to provide a further understanding of the present disclosure and constitute a part of the present disclosure. The exemplary embodiments of the present disclosure and their descriptions are used to explain the present disclosure and do not constitute an improper limitation of the present disclosure. In the drawings:
[0075] FIG1 is a flow chart of a data processing method provided in the present disclosure;
[0076] FIG2 is a schematic diagram of performance loss caused by accessing a NUMA memory node provided in the present disclosure;
[0077] FIG3 is a schematic diagram of a mapping method of parameter tensors in a single server node provided by the present disclosure;
[0078] FIG4 is a schematic structural diagram of a data processing system provided in the present disclosure;
[0079] FIG5 is a schematic diagram of the structure of a decision layer of a data processing system provided in the present disclosure;
[0080] FIG6 is a schematic diagram of a data processing device provided in the present disclosure;
[0081] FIG7 is a schematic diagram of an electronic device provided by the present disclosure corresponding to FIG1 . DETAILED DESCRIPTION
[0082] To make the objectives, technical solutions, and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the specific embodiments of the present disclosure and the corresponding drawings. The described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present disclosure.
[0083] The technical solutions provided by various embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0084] FIG1 is a flow chart of a data processing method provided in the present disclosure, including steps S101 - S105 .
[0085] S101: Obtain data to be processed.
[0086] Typically, when deploying inference services using existing serverless computing platforms (such as AWS Lambda), it's difficult to deploy large models. For example, AWS Lambda limits function memory usage to ≤10GB, while the recent MT-NLG language model even requires 2TB of memory to load its 530 billion parameters. Furthermore, this results in significant memory waste. For example, AWS Lambda's one-to-one mapping strategy between requests and functions results in a large amount of duplication of libraries and model tensors in memory when function instances (processes) are running. Furthermore, due to the low triggering frequency, short execution time, and long in-memory cache time of serverless inference functions, they typically occupy less system CPU (Central Processing Unit) time and a large amount of system memory, making it particularly important to optimize the memory consumption of serverless inference systems.
[0087] On the other hand, current data centers utilize servers based on the Non-Uniform Memory Access (NUMA) architecture on a large scale. In a NUMA architecture, each CPU socket has a corresponding local memory node, and accessing local memory nodes is much faster than accessing remote memory nodes. Data processing tasks for machine learning and deep learning models require access to a large number of model parameters during execution. Accessing remote memory nodes can significantly increase inference latency (the performance loss caused by accessing NUMA memory nodes is shown in Figure 2).
[0088] FIG2 is a schematic diagram of performance loss caused by accessing a NUMA memory node provided in the present disclosure.
[0089] NUMA memory node 1 shown in the figure is a local memory node, and NUMA memory node 2 is a remote memory node. During data processing in a data processing model, the performance loss (latency) incurred by accessing the memory nodes is increased due to accessing the remote memory nodes. Data processing models include deep learning models. Operators can refer to the basic computing units that constitute a data processing model. For example, different activation functions can be used as different operators; different convolution operations can be used as different operators; and operations such as summation, product, and modulo can also be used as separate operators. A data processing model can be composed of multiple operators.
[0090] Therefore, in order to reduce inference latency, containers deploying data processing models are usually bound to separate CPU sockets under the NUMA architecture and restricted to accessing only local memory nodes. This restriction further increases the overall memory consumption of the system.
[0091] In order to reduce memory usage, related technologies have proposed a runtime sharing method to reduce the runtime redundancy of processing processes, that is, by batch processing of requests or increasing the parallelism of processing processes, multiple requests can be executed simultaneously in the same processing process, thereby reducing the number of processing processes in the system and further reducing the consumption of server memory.
[0092] However, tensor memory in serverless inference systems suffers from significant redundancy. This redundancy is often caused by the horizontal scaling of multiple processes within the same data processing model. This is because these processes share the same model parameters. Furthermore, due to the widespread use of pre-trained models or transfer learning techniques, significant tensor redundancy can also exist across a large number of different data processing models. To optimize memory consumption, eliminating this redundancy in tensor memory is essential.
[0093] However, under the NUMA architecture, it is difficult to reduce the runtime redundancy and tensor redundancy of the processing process. The reason is that the distribution of the parameter tensors of the data processing model on the NUMA memory nodes will greatly affect the inference latency of the model.
[0094] For example, if all parameter tensor redundancy in the machine memory is eliminated and only one copy is retained on one NUMA memory node, then the inference containers deployed on all other CPU sockets will experience a significant increase in inference latency due to accessing the remote memory node. Therefore, it is necessary to reasonably design the system to reduce memory consumption while balancing the performance loss caused by accessing NUMA memory nodes, ultimately minimizing memory consumption in the system while ensuring user latency requirements.
[0095] Based on this, the present disclosure provides a data processing method, wherein a server needs to obtain data to be processed.
[0096] In the present disclosure, the server may be a server in a serverless platform, and each time the server receives a piece of data to be processed, it generates a corresponding processing request and processes the data to be processed through a data processing model under the current processing process.
[0097] In a serverless system, each server that processes a request generates a corresponding function instance. Each function instance corresponds to a processing process and is deployed in the container corresponding to the server.
[0098] It's important to note that the serverless system mentioned in this disclosure is a cloud-native development model that allows developers to focus on building and running applications without having to manage servers. Servers still exist in a serverless system, but they don't need to be considered in application development. The cloud provider handles the routine tasks of provisioning, maintaining, and scaling the server infrastructure. Developers can simply package their code into containers and deploy them. Once deployed, the serverless system responds to user data processing requests.
[0099] S102: Determine whether the data processing model can process a set amount of data to be processed under the current processing process; if not, retrieve the data processing time of the data processing model under multiple configuration combinations.
[0100] During the process of the server processing data through the data processing model, when the load increases, it may not be able to process the set number of pending data, and it needs to wait in queue, which will undoubtedly increase the overall data processing time. Therefore, when the server determines that the data processing model cannot process the set number of pending data at one time under the current processing process (the server cannot currently execute the set number of processing requests), the server can determine the processing requests that cannot be executed, that is, determine the remaining pending data that cannot be processed.
[0101] In the present disclosure, the above-mentioned set quantity can be all the to-be-processed data or all the processing requests sent by the current user, and can also be set according to actual conditions. The present disclosure does not make any specific limitation on this.
[0102] During this process, the server may pre-deploy a corresponding performance estimation module, and use the performance estimation module to determine the data processing time corresponding to the data processing model under each configuration combination.
[0103] The server can retrieve the data processing time of the data processing model under different configuration combinations through the performance estimation module. Specifically, since the data processing model is composed of multiple computing units, each computing unit is an operator (OP). For each operator, its execution time is affected by the number of allocated central processing units (CPUs), batch size, data parallelism, and the storage location of the called parameter tensor. Therefore, the above configuration combination may include: the number of central processing units (CPUs), batch size, data parallelism, and the storage location of the parameter tensor corresponding to each operator, etc., wherein the above batch size can be the requested batch size, which is used to characterize the amount of data allowed to be processed by the current process. It may also include the memory capacity allocated to each operator, which is not specifically limited in this disclosure.
[0104] It should be noted that for ops that require input parameter tensors (for example, the convolution operator requires input parameter tensors of the convolution kernel), its execution time will be affected by the corresponding storage location of the input parameter tensor. In the present disclosure, the storage location can be the distribution location of the parameter tensor on the NUMA memory node, including the local memory node and remote memory node of the NUMA. In actual applications, any non-local NUMA node that requires cross-node access by the operator can be used as a remote memory node.
[0105] The performance estimation module can use the profiling method to record the actual processing performance of each operator under all configuration combinations. Since the processing performance of an operator corresponds to its corresponding data processing time, its processing performance can also be expressed by the data processing time. For the processing performance corresponding to each operator, the processing time corresponding to the operator can be expressed as t op =f(c,b,p,L), where c is the number of allocated CPUs, b is the batch size, p is the degree of data parallelism, L is a set of Boolean variables representing whether each input parameter tensor of the op is stored in the remote memory node of NUMA, and f represents the mapping relationship between these configurations and processing time. The actual f is obtained through characterization.
[0106] The performance estimation module feeds different configuration combinations into a pre-trained performance estimation model, which then determines the corresponding data processing time for each operator in the data processing model under these configuration combinations. The performance estimation model can be derived through characterization or prediction using a machine learning model based on the characterization results.
[0107] During this process, for the data processing model, the server will continuously modify its configuration through the performance estimation module<c,b,p> , and for each op that contains input parameter tensors, the storage location of its input parameter tensors is constantly modified <l>, and for each configuration combination, multiple inferences are performed, and the average processing time of each op is recorded, and finally the processing time of the op under all configuration combinations is obtained, thereby obtaining the performance function f of the op, and the output of the performance characterization is all ops in the data processing model i Performance model f i .
[0108] It should be noted that for the data processing model, configuration<c,b,p> It is shared by all nodes in the entire model network, that is, each operator in the entire data processing model has the same number of CPUs, batch size, and parallelism. However, since the parameter tensors of each operator are different, the storage location of the parameter tensors corresponding to each operator may be different. Therefore, the storage location of the parameter tensors corresponding to each operator is set on the server. <l>When , what is actually set is whether the storage location of each parameter tensor input to the operator is stored on the remote memory node of NUMA.
[0109] Different execution environment configurations for this data processing model<c,b,p> , and a collection of storage locations for each parameter tensor <s>(Whether each parameter tensor is stored in a remote memory node), the performance estimation module can first calculate the storage location of the parameter tensor input to each node, and then for each configuration combination<c,b,p,L> For each op, the server can estimate the processing time of the op under the configuration combination Then the processing time of the entire data processing model is determined.
[0110] Specifically, if the model structure of the data processing model is a simple linear network, the processing time corresponding to the data processing model can be the sum of the processing time of all operations, that is, If the data processing model contains multiple parallel linear network branches, the data processing process can be considered to be executed by multiple linear networks in parallel. Assuming that the execution time of each linear network is t chain , then the server can use the maximum value of all linear network inference times as the data processing time corresponding to the entire data processing model, that is,
[0111] S103: For the data processing time of each configuration combination in the multiple configuration combinations, determine the amount of data that the data processing model can process within the data processing time as the target data amount.
[0112] In some embodiments, the data throughput of the data processing model within the data processing time can be determined as the target data volume based on the data processing time of each configuration combination in the multiple configuration combinations.
[0113] Because the performance of the data processing model's processing processes varies under different configuration combinations, to minimize server memory consumption during data processing while reducing data processing latency, when the server load increases, the server can identify the pending data that cannot currently be processed, and determine the processing processes that need to be expanded and the corresponding configuration for each processing process. To minimize memory consumption, the server can greedily select the configuration combination that has the highest throughput and meets the data throughput requirements until the processing power of the expanded instance can meet the current data throughput requirements, that is, it can process all the current pending data at once. When the load decreases, to minimize memory consumption, the server can release the processing processes with the lowest data throughput.
[0114] The server may pre-deploy a corresponding processing process expansion and contraction module, and use the expansion and contraction module to expand the processing process and continue to delete redundant processing processes.
[0115] Specifically, the server can first determine the processing request corresponding to the pending data that cannot be processed by the data processing model through the expansion and contraction module. The expansion and contraction module can first determine the processing request corresponding to the pending data that cannot be processed by the data processing model according to each configuration combination.<c,b,p,S> The processing time t corresponding to the data processing model N N , and then calculate the amount of data that the data processing model can process within the data processing time based on the processing time and will As the target data volume. In practical applications, the target data volume can be equivalent to the data throughput of the data processing model under this configuration combination.
[0116] S104: With the data processing model being able to process a set amount of data to be processed as a goal, a target configuration combination is selected from multiple configuration combinations according to the target data amount, and a processing process under the target configuration combination is created.
[0117] S105: Processing the data to be processed according to the created processing process under the target configuration combination.
[0118] In the above process, in order to ensure that the data volume corresponding to the processing request of the current data to be processed is met while minimizing memory consumption, the scaling module can first calculate the target data volume corresponding to different configuration combinations, and then select the configuration combination with the largest target data volume as the target configuration combination each time, and create a processing process (function instance) under the target configuration combination. At this time, the remaining processing requests will also be reduced, and then the server can select the new configuration combination with the largest target data volume as the new target configuration combination, and continue to create new processing processes until the data processing model can process the set amount of data to be processed at one time under the current process, and the server can complete all processing requests.
[0119] In other words, let R be the amount of data to be processed that the data processing model cannot handle, and R will decrease accordingly each time a new processing process is generated, that is, During this process, the configuration combination with the largest target data volume will be continuously selected as the target configuration combination and new processing processes will be expanded until R≤0, indicating that the data processing model can process the set amount of data to be processed at one time under the expanded processing process, and the server can complete all processing requests at one time. At this time, the number of expanded processing processes is the least.
[0120] It should be noted that since the scaling module does not know in advance which server node the extended processing process will be scheduled to during this process, nor does it know which ops in the instance after scheduling access the remote memory node of NUMA, the scaling module can assume that at least some nodes in the data processing model access the remote memory node, and construct a new processing process under such an assumption.
[0121] In other words, if the newly generated processing process can complete all processing requests when all ops in the data processing model access the remote memory, then when actually performing instance scheduling (scheduling the processing process), even if some or all operators in the processing process are changed to access the remote memory node, it will not cause performance loss during the data processing process. In this way, there will be fewer constraints and a larger decision space during the scheduling process of the processing process, thereby reducing more memory consumption. The scheduling process of the processing process will be described in detail below, and the present disclosure will not elaborate too much here.
[0122] Since the scaling module will set the storage location of all parameter tensors in all configuration combinations to the remote memory node during the process of expanding the processing process, and this conservative method will expand too many instances, thereby increasing memory consumption. Therefore, after all processing processes are scheduled to the server node, the scaling module can delete redundant processing processes according to the actual access situation of each node to the storage location, so as to save memory. In practical applications, the redundant processing process can be a processing process that is idle during the data processing process. Even if it is deleted during this process, the server can still complete all processing requests at one time.
[0123] In practical applications, users usually set a corresponding service quality constraint duration, that is, the delay for the server to complete all processing requests is limited not to exceed the service quality constraint duration t of the server slo , so, during the process of the server determining the target configuration combination, it will first determine the configuration combinations that do not meet the requirements. These configuration combinations that do not meet the requirements will cause t N >t slo , and then the server can filter out these configuration combinations that do not meet the requirements through the scaling module.
[0124] Furthermore, if the data processing time t_upper when all ops in the data processing model access the remote memory node, and the data processing time when all ops access the local memory node is t_lower, there may be t_upper > t_slo, while t_lower < t_slo. Therefore, for the configuration combination <c, b, p, S> that causes the above situation, the server can first <s>Each element in is set to false, assuming that all its ops access local memory nodes. Then for <s>Each element in tries to set it to true, that is, try to store each parameter tensor to the remote memory node separately. <s>Store the tensor i in the remote memory node and calculate the latency rise time caused by the change to storage in the remote node. Where represents the second processing time of the overall data processing model after changing the parameter tensor i to be stored in the remote memory node and the first processing time of the data processing model when it is placed in the local NUMA memory node in the original case The difference, that is The overall network latency rise time here can be obtained by calling the performance prediction module, which will be described in detail below and will not be elaborated here.
[0125] Next, the scaling module can calculate the greedy coefficient of the parameter tensor i where m i represents the memory size occupied by the tensor i. The scaling module can select the g i highest parameter tensors each time and use them as the target parameter tensors allowed for remote access, that is, set the i-th element of S to true and recalculate the data processing time t of the entire data processing model N , repeat the above steps until t_N > t_slo. Thus, the configuration combination when the target parameter tensors satisfying t N < t_slo are stored in the remote memory is used as the target configuration combination. In this way, the server can set some nodes in the network to access the remote memory, while others do not, so as to minimize memory consumption as much as possible under the premise of meeting the user service quality constraints.
[0126] Finally, due to the error in calculating the processing duration of the data processing model under different configuration combinations by the scaling module and the conservative strategy in the process of processing process expansion, it may lead to too many processing processes being expanded in the system, and thus cause more memory consumption. Therefore, the server can continuously check the actual throughput (target data volume) of the processing processes in the system through the scaling module and delete the excess processing processes (delete the one with the least actual throughput each time).
[0127] Since the configurations <c, b, p, S> of different processing processes are different, resulting in different processing capabilities, when performing load balancing on processing requests, the differences between different processing processes need to be considered. Therefore, the server can pre-deploy the corresponding request forwarding module, forward the processing requests through this request forwarding module, and complete the load balancing of the processing requests.
[0128] The request forwarding module can use a weighted random method for load balancing, that is, forwarding more processing requests to processing processes with strong processing capabilities, and the corresponding data to be processed under more processing requests is relatively less, while forwarding relatively fewer processing requests to processing processes with weak processing capabilities, and the corresponding data to be processed under fewer processing requests is less.
[0129] Specifically, for each processing process, the request forwarding module can first try to obtain the actual data throughput T of the processing process. real (i.e. the actual recorded value in the server), but in actual applications, there may be cases where the processing process has not been accessed before, so the actual throughput (target data volume) may not be obtained. In the case that the actual target data volume cannot be obtained, the request forwarding module can first obtain the actual configuration of the processing process.<c,b,p,S> Then call the performance estimation module to get the data processing time t of data processing model N N , and based on this we can estimate the processing process n i The target data volume T of the data processing model estimate .
[0130] Then for all processing processes, the request forwarding module can set its T_real or T estimate To determine the weight of load balancing, a weighted random load balancing strategy is ultimately implemented. Specifically, the larger the target data volume corresponding to a processing process, the greater the load balancing weight, and the more processing requests and pending data are assigned to it. The smaller the target data volume, the smaller the load balancing weight, and the fewer processing requests and pending data are assigned to it.
[0131] In addition, in order to solve the problem of tensor redundancy, the server can first traverse the calculation graph of the data processing model when loading the data processing model, determine the parameter tensors that need to be loaded during the data processing model's processing of the data to be processed, and add these parameter tensors to the queue to be loaded.
[0132] The server can pre-set and deploy the corresponding model loading module to load the parameter tensors that need to be called by the data processing model through the model loading module.
[0133] The server can then use the model loading module to randomize the parameter tensors in the queue to be loaded to reduce subsequent lock contention. For each parameter tensor in the queue to be loaded, the model loading module can first read its corresponding hash value in the pre-stored model file.
[0134] The model loading module can obtain the tensor lock corresponding to each parameter tensor based on the hash value corresponding to each parameter tensor as the identity document (ID). For each parameter tensor, if the tensor lock corresponding to the parameter tensor does not exist in the server, the model loading module can create a tensor lock corresponding to the parameter tensor based on the hash value corresponding to the parameter tensor.
[0135] At the same time, the model loading module can use the hash value of the parameter tensor as ID to access the preset tensor storage module and query whether the parameter tensor is already stored in the tensor storage module of the local memory node. If so, the model loading module can map the parameter tensor memory in the local memory node in a memory-mapped manner and load the parameter tensor. Otherwise, the server can use the hash value of the parameter tensor as ID to query the configuration file to determine whether the parameter tensor is allowed to be stored in the remote memory under the current configuration.
[0136] If not allowed, the model loading module can create a corresponding memory area in the local tensor storage module, and read the corresponding parameter values from the model file and add them to the memory node corresponding to the memory area.
[0137] If the parameter tensor is allowed to be stored in remote memory under the current configuration, the tensor storage module on the remote memory node will determine whether the parameter tensor is stored in the remote memory node in turn. If so, the model loading module can map the parameter tensor memory in the remote memory node in a memory-mapped manner and load the parameter tensor. Otherwise, a corresponding memory area is created in the local tensor storage module, and the corresponding parameter value is read from the model file and added to the memory node corresponding to the memory area.
[0138] During this process, each time a parameter tensor is loaded, the model loading module can release the tensor lock corresponding to the parameter tensor until each parameter tensor in the above-mentioned queue to be loaded is loaded. The model loading module can process the data to be processed according to the processing process under the newly created target configuration combination and the loaded parameter tensors.
[0139] It should be noted that the tensor storage module stores the memory for all parameter tensors (parameters, constants, etc.), and by default, the tensor storage module is shared by all processing processes on the server node. Every processing process on the same server node can access the parameter tensors in the tensor storage module. Because the hash value is independent of the underlying framework of the processing model, each parameter tensor is uniquely identified by a hash value that can be calculated based on the content and size of the parameter tensor.
[0140] In addition, each parameter tensor also has a corresponding tensor lock to ensure the safe operation of its construction, mapping, or recycling. The tensor storage module is initially empty and does not hold any tensors or locks. During system operation, the model loading module continuously adds parameter tensors to it while loading parameter tensors. Each parameter tensor is assigned a reference count after creation. Every time the model loading module adds a new mapping to an existing parameter tensor, the reference count is increased by 1. Similarly, every time a processing process is completed and released, the reference count is decreased by 1.
[0141] Moreover, although the parameter tensor storage module is shared by all processing processes on the same server node by default, it also supports setting up separate tensor storage modules for specific combinations of processing processes (such as functions belonging to the same tenant), and different parameter tensor storage modules are not visible to each other.
[0142] Since there may be multiple NUMA memory nodes on a server node, the server can create a tensor storage module on each NUMA memory node. The model loading module will decide which tensor storage module to place the parameter tensor in at runtime, and the tensor recycling module ensures that the tensors in all tensor storage modules are correctly recycled.
[0143] During the data processing process, since the memory of the same parameter tensor may be called by multiple different processing processes at the same time, the server can reclaim it when it detects that the reference count of the parameter tensor is cleared to 0.
[0144] Among them, when the server is loading the parameter tensor, each time a new mapping is added to the existing parameter tensor, its reference count will be increased by 1. Similarly, each time a process that calls the parameter tensor is released after execution, the reference count corresponding to the parameter tensor will be reduced by 1. Therefore, the server can determine the number of mappings corresponding to each parameter tensor based on the processing processes included in the data processing model, and then determine the reference count corresponding to each parameter tensor based on the number of mappings. Then, for each parameter tensor, the server can recycle the parameter tensor and release the memory it occupies when it detects that the reference count corresponding to the parameter tensor is cleared to 0.
[0145] In order to speed up the creation of subsequent processing processes, the server can delay the recovery of parameter tensors. For each parameter tensor, the server can monitor that the count of the parameter tensor is cleared, and then recycle the parameter tensor after keeping it in the memory for a preset time. The preset time can be set according to actual conditions, and this disclosure does not make any specific restrictions on this.
[0146] In addition, the server can also set a storage upper limit for the tensor storage module. When the server detects that the tensor storage module has reached the storage upper limit, the server can recycle the parameter tensor that has not been used for the longest time.
[0147] Of course, the server can also dynamically determine how long each tensor remains in memory after the reference count is cleared according to the histogram of the access frequency of each parameter tensor over a period of time.
[0148] It should be noted that the server's parameter tensor recycling process can be completed through a pre-configured tensor recycling module. Each server node can deploy and run an instance of the tensor recycling module. This tensor recycling module instance will be responsible for recycling the parameter tensor memory in the tensor storage modules on all NUMA memory nodes in the server node. For ease of understanding, this disclosure provides a schematic diagram of the mapping method of parameter tensors in a single server node, as shown in Figure 3.
[0149] FIG3 is a schematic diagram of a mapping method of parameter tensors in a single server node provided by the present disclosure.
[0150] Among them, there are multiple containers in a server node, each container corresponds to a function instance (processing process). The tensor storage module can map the parameter tensors of the data processing model stored in the NUMA memory node to the corresponding container through memory mapping. In addition, during the data processing process, the tensor recovery module can recycle the memory of the parameter tensor with a reference count of 0.
[0151] Since all processing processes on the same server node can share parameter tensors with each other, but processing processes between different server nodes cannot share, and different processes scheduled to different server nodes can share different proportions of parameter tensors, it is necessary to appropriately select the scheduling location of the processing process to minimize the system's memory consumption.
[0152] Specifically, the server can set up and deploy a corresponding scheduling module. After the scheduling module receives a request to schedule a new processing process, the scheduling module will decode the configuration combination of the processing process to be scheduled (such as the number of CPUs, parallelism, etc.) from the request, and whether each parameter tensor in the data processing model N run by the processing process allows remote NUMA memory access. Then the scheduling module can obtain the parameter tensor set T that can be remotely NUMA memory shared in the entire data processing model. NS , in addition, the server can set the set of all parameter tensors of the network as T N .
[0153] During scheduling, the scheduling module first filters out server nodes that don't meet the memory and CPU requirements of the processing process. The remaining server nodes that meet the requirements are considered candidate server nodes. For each candidate server node, since multiple NUMA nodes may exist on the candidate server node, the server can further filter out NUMA nodes that don't meet the resource requirements.
[0154] If there are K NUMA nodes that meet the conditions on a candidate server node, these K NUMA nodes have corresponding tensor storage modules, where the tensor set in the i-th tensor storage module is If the processing process is scheduled to the jth NUMA node, the set of tensors that the processing process can share on the local NUMA node is The set of tensors that can be shared by this function on remote memory nodes can be expressed as:
[0155] The set of all tensors that the processing process can share on the server node is:
[0156] The server can now calculate The sum of the memory of all tensors in M j For all j∈[1,K], the server can calculate the corresponding memory sum M j Then the maximum amount of memory that the processing process can share on the current server node can be expressed as:
[0157] The server can then calculate the maximum amount of memory on all server nodes that meet the resource conditions and schedule the processing process to the node with the largest amount of memory. On the corresponding NUMA memory node on the server node.
[0158] In the actual process of executing data processing, the server can build a complete data processing system through the above modules, and complete the processing of the data to be processed through the data processing system. For ease of understanding, the present disclosure provides a structural diagram of a data processing system, as shown in Figure 4.
[0159] FIG4 is a schematic structural diagram of a data processing system provided in the present disclosure.
[0160] The server is deployed with the data processing model submitted by the developer. When the user sends a data processing request, the server first performs load balancing through the request forwarding module to assign the processing request to different processing processes for processing. The scaling module will expand the processing process based on the received processing request and the data throughput under different configuration combinations obtained by the performance estimation module. Then, through the scheduling module, the expanded processing process (function instance) will be scheduled to the specified server node and the processing request will be forwarded.
[0161] It should also be noted that the data processing system is also equipped with corresponding model loading modules, tensor recovery modules and tensor storage modules (not shown in the figure). These modules are used to load parameter tensors that need to be called by the data processing model, to recover idle parameter tensors during the data processing process, and to store parameter tensor processes.
[0162] The data processing system described above can be divided into two layers: the decision layer and the execution layer. The decision-making goal is to reduce overall system memory consumption through memory sharing while ensuring inference performance under the NUMA architecture. Each processing process first passes through the decision layer to determine the configuration of the function instance, such as the CPU, memory, batch size, degree of parallelism, the memory location of each parameter tensor in the data processing model (whether it can be placed in remote memory), and the scheduling of the function instance to a specific NUMA memory node on a specific server. The execution layer is responsible for initializing and setting parameters for the processing process based on the specific configuration, and setting the corresponding parameter tensor memory mapping.
[0163] The decision-layer components include the model inference module, the performance estimation module, the scaling module, and the instance scheduling module. The execution layer components primarily include the tensor loading module, the tensor storage module, and the tensor recycling module. For ease of understanding, this disclosure also provides a schematic diagram of the decision-layer structure of the data processing system, as shown in Figure 5.
[0164] FIG5 is a schematic diagram of the structure of a decision layer of a data processing system provided in the present disclosure.
[0165] Among them, the decision parameters of the decision layer can include different configurations in the configuration combination. These decision parameters are used for runtime sharing technology in decision components such as performance estimation modules and scaling modules. The node distribution of parameter tensors and the server nodes and NUMA memory nodes to which the expanded processing processes are scheduled will be used as parameters related to the tensor sharing technology for the scheduling module. The goal of the entire decision layer is to reduce the overall memory loss of the system through memory sharing under the premise of ensuring reasoning capabilities under the NUMA architecture.
[0166] It should be noted that the data to be processed mentioned in the present disclosure may be image data, audio data and text data. Accordingly, the process of processing the data to be processed may be image recognition or image classification of image data, voiceprint recognition of audio data, and text extraction or semantic recognition of text data, etc. Of course, it may also include other types of data to be processed and corresponding data processing methods, and the present disclosure does not make specific limitations on this.
[0167] It can be seen from the above method that during the data processing process, when it is determined that the data processing model cannot process all the data to be processed at one time under the current processing process, this solution can determine the data throughput of the data processing model under different configuration combinations, and then select the corresponding target configuration to expand the new processing process, thereby ensuring that the data processing model can complete the processing of all the data to be processed at one time under the premise of expanding fewer processing processes, and reduce the occupation of server memory resources without increasing the delay time of the data processing process.
[0168] In addition, the present disclosure proposes a runtime sharing strategy that combines request batching with increasing the parallelism of processing processes, and designs corresponding performance prediction and dynamic scaling algorithms for and in combination with the distribution of tensor NUMA memory nodes. When the function is scaled, the memory efficiently sets the corresponding configuration for each expanded processing process, and at the same time designs a corresponding processing request forwarding mechanism for inconsistent function instances. As for tensor sharing, the present disclosure first proposes a safe, lightweight, and performance-insensitive tensor sharing mechanism between multiple NUMA memory nodes and function instances on the same server node, so that multiple processing processes can transparently identify and share the memory of the same tensor parameters. Since different processing processes are scheduled to different server nodes and the proportion of parameter tensors shared on NUMA memory nodes is different, this solution can fully reduce the memory consumption of cluster-level server nodes through the server node scheduling algorithm.
[0169] Compared to existing work, this solution demonstrates significant improvements. Compared to the latest serverless inference systems, it reduces memory usage by up to 93% and increases function deployment density by 30 times. It also maintains the efficiency of data processing models and accelerates the creation of function instances (processes) by over 90%, significantly accelerating both cold starts and scaling of function instances.
[0170] The above are one or more methods for implementing data processing of the present disclosure. Based on the same idea, the present disclosure also provides a corresponding data processing device, as shown in FIG6 .
[0171] FIG6 is a schematic diagram of a data processing device provided in the present disclosure, comprising:
[0172] An acquisition module 601 is used to acquire data to be processed;
[0173] a calling module 602 for determining whether the data processing model can process a set amount of data to be processed under the current processing process, and in response to determining that the data processing model cannot process the set amount of data to be processed under the current processing process, obtaining data processing time of the data processing model under multiple configuration combinations;
[0174] A determination module 603 is configured to determine, for each of the plurality of configuration combinations, a data volume that can be processed by the data processing model within the data processing time, as a target data volume;
[0175] A creation module 604 is configured to select a target configuration combination from the plurality of configuration combinations based on the target data volume, with the data processing model being able to process a set amount of data to be processed as a goal, and to create a processing process under the target configuration combination;
[0176] The processing module 605 is configured to process the data to be processed according to the processing process under the created target configuration combination.
[0177] The configuration combination includes at least one of the number of central processing units (CPUs), batch size, data parallelism, and storage locations of parameter tensors corresponding to each operator, and the storage locations of the parameter tensors include local memory nodes and remote memory nodes.
[0178] Optionally, before obtaining the data processing time of the data processing model under multiple configurations, the calling module 602 is also used to input multiple configuration combinations into a preset performance estimation model, and for each configuration combination in the multiple configuration combinations, determine the data processing time corresponding to each operator included in the data processing model under the configuration combination through the performance estimation model; based on the data processing time corresponding to each operator under the configuration, determine the data processing time corresponding to the data processing model under the configuration combination.
[0179] Optionally, the calling module 602 is also used to, if the data processing model contains at least two parallel linear networks, determine the data processing time corresponding to each linear network under the configuration combination; and take the maximum value of the data processing time corresponding to each linear network under the configuration combination as the data processing time corresponding to the data processing model under the configuration combination.
[0180] Optionally, the creation module 604 is specifically used to select a target configuration combination from multiple configuration combinations based on the target data volume, and create a processing process under the target configuration combination; determine whether the data processing model can process the set number of data to be processed after creating the processing process under the target configuration combination; if the data processing model cannot process the set number of data to be processed, continue to determine a new target configuration combination in other configuration combinations other than the target configuration combination based on the target data volume, and create a processing process under the new target configuration combination until the data processing model can process the set number of data to be processed.
[0181] Optionally, the creation module 604 is specifically used to set the storage location of each parameter tensor in each target configuration combination in the multiple configuration combinations to a remote memory node; and delete redundant processing processes based on the actual target data volume of the data processing model.
[0182] Optionally, the creation module 604 is specifically used to, for each configuration combination in the multiple configuration combinations, if each parameter tensor in the configuration combination is stored in the local memory node, determine the data processing time corresponding to the data processing model under the configuration combination as the first processing time; for each parameter tensor in the configuration combination, determine the data processing time corresponding to the data processing model when the parameter tensor is stored in the remote memory node as the second processing time; based on the first processing time and the second processing time, determine the additional data processing time after the parameter tensor is changed from being stored in the local memory node to being stored in the remote memory node. as the delayed rise time; determine the greedy coefficient corresponding to the parameter tensor according to the memory size occupied by the parameter tensor and the delayed rise time corresponding to the parameter tensor, and use the parameter tensor with the highest greedy coefficient as the target parameter tensor allowed for remote access; determine the data processing time corresponding to the data processing model after storing the target parameter tensor in the remote memory, and determine whether the data processing time is greater than the preset service quality constraint duration; if it is determined that the data processing time is less than or equal to the preset service quality constraint duration, use the configuration combination when the target parameter tensor is stored in the remote memory as the target configuration combination.
[0183] Optionally, the delay rise time corresponding to the parameter tensor is negatively correlated with the greedy coefficient corresponding to the parameter tensor, and the memory size occupied by the parameter tensor is positively correlated with the greedy coefficient corresponding to the parameter tensor.
[0184] Optionally, the creation module 604 is also used to continue determining the next target parameter tensor if the data processing time is less than the quality of service constraint duration after the target parameter tensor is stored in the remote memory, until the data processing time is greater than the quality of service constraint duration.
[0185] Optionally, the processing module 605 is specifically used to determine the target data volume corresponding to each of the multiple processing processes based on multiple target configuration combinations corresponding to the multiple processing processes; and to allocate the to-be-processed data required to be processed by the multiple processing processes based on the target data volume corresponding to each of the multiple processing processes.
[0186] Optionally, the processing module 605 is specifically used to determine the parameter tensors that need to be loaded by the data processing model; for each parameter tensor, query whether the parameter tensor is stored in the local memory node; if the parameter tensor is stored in the local memory node, map the parameter tensor memory in the local memory node in a memory mapping manner and load the parameter tensor; if the parameter tensor is not stored in the local memory node, determine whether the parameter tensor is allowed to be stored in the remote memory node under the current configuration; if the parameter tensor is allowed to be stored in the remote memory node under the current configuration, then after querying that the parameter tensor is stored in the remote memory node, map the parameter tensor memory in the remote memory node in a memory mapping manner and load the parameter tensor; perform data processing on the data to be processed according to the processing process under the created target configuration combination and the loaded parameter tensor.
[0187] Optionally, the processing module 605 is also used to create a memory area in the local memory and add the parameter tensor to the local memory node corresponding to the memory area if the parameter tensor is not allowed to be stored in the remote memory node under the current configuration combination.
[0188] Optionally, the processing module 605 is also used to create a memory area in the local memory and add the parameter tensor to the local memory node corresponding to the memory area if it is determined that the parameter tensor is allowed to be stored in the remote memory node under the current configuration combination, but the parameter tensor is not stored in the remote memory node.
[0189] Optionally, the processing module 605 is also used to determine, for each parameter tensor, a hash value corresponding to the parameter tensor; use the hash value as the authentication information corresponding to the parameter tensor, access the local memory node, and query whether the parameter tensor is stored in the local memory node.
[0190] Optionally, the processing module 605 is also used to determine the number of mappings corresponding to each parameter tensor based on the processing process included in the data processing model; determine the reference count corresponding to each parameter tensor based on the number of mappings corresponding to each parameter tensor; for each parameter tensor, if the reference count corresponding to the parameter tensor is cleared during the data processing of the data to be processed, the tensor memory corresponding to the parameter tensor is recycled.
[0191] Optionally, the creation module 604 is specifically used to, for each processing process, filter out server nodes that do not meet the configuration combination requirements based on the memory size and CPU number corresponding to the processing process, and use the remaining server nodes as candidate server nodes; for each candidate server node, determine the maximum memory allowed to be shared on the candidate server node; based on the maximum memory allowed to be shared on each candidate server node, select a designated server node as the target server node, and schedule the processing process to the target server node.
[0192] Optionally, the method is applied to a serverless platform, and the local memory node and the remote memory node are memory nodes on a non-uniform memory access (NUMA) memory.
[0193] The present disclosure also provides a computer-readable storage medium, which stores a computer program. The computer program can be used to execute a data processing method provided in FIG. 1 above.
[0194] The present disclosure also provides a schematic structural diagram of an electronic device corresponding to Figure 1 as shown in Figure 7. As shown in Figure 7, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the data processing method described in Figure 1 above. Of course, in addition to software implementation, the present disclosure does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0195] Improvements to a technology can be clearly distinguished as either hardware improvements (for example, improvements to circuit structures such as diodes, transistors, and switches) or software improvements (improvements to process flows). However, with technological advancements, many process flow improvements can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using a hardware module. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system onto a PLD by programming it themselves, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly performed using "logic compiler" software. This is similar to the software compilers used during program development. Before compilation, the original code must be written in a specific programming language, called a hardware description language (HDL). There are many different HDLs, including 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, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also appreciate that by simply programming the method flow in one of these hardware description languages and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.
[0196] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.
[0197] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, 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.
[0198] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing the present disclosure, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0199] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0200] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0201] These computer program instructions may also be stored in a computer-readable memory that can direct 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 a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0202] 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, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0203] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0204] 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. Memory is an example of a computer-readable medium.
[0205] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The 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 disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk 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 transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0206] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a..." does not preclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0207] Those skilled in the art will appreciate that embodiments of the present disclosure may be provided as methods, systems, or computer program products. Thus, the present disclosure may take the form of a fully hardware embodiment, a fully software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0208] The present disclosure 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, and the like that perform specific tasks or implement specific abstract data types. The present disclosure may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0209] The various embodiments of this disclosure are described in a progressive manner. Similar portions between the various embodiments can be referenced to each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so their description is relatively simple. For relevant portions, refer to the description of the method embodiments.< / s> < / s> < / s> < / s> < / l> < / l>
Claims
1. A method for data processing, characterized in that: include: Get the data to be processed; Determining whether the data processing model can process a set amount of data to be processed under the current processing process, and in response to determining that the data processing model cannot process the set amount of data to be processed under the current processing process, obtaining data processing time of the data processing model under multiple configuration combinations; For each of the plurality of configuration combinations, determining the amount of data that can be processed by the data processing model within the data processing time as the target data amount; Taking the data processing model being able to process a set amount of data to be processed as a goal, selecting a target configuration combination from the multiple configuration combinations according to the target data amount, and creating a processing process under the target configuration combination; The to-be-processed data is processed according to the processing process under the created target configuration combination.
2. The method according to claim 1, characterized in that The configuration combination includes at least one of the number of central processing units (CPUs), batch size, data parallelism, and storage locations of parameter tensors corresponding to operators, and the storage locations of the parameter tensors include local memory nodes and remote memory nodes.
3. The method according to claim 2, characterized in that Before obtaining the data processing time of the data processing model under multiple configurations, the method further includes: Inputting a plurality of configuration combinations into a preset performance estimation model, and determining, for each configuration combination in the plurality of configuration combinations, the data processing time corresponding to each operator included in the data processing model under the configuration combination through the performance estimation model; According to the data processing time corresponding to each operator under the configuration, the data processing time corresponding to the data processing model under the configuration combination is determined.
4. The method according to claim 3, characterized in that The method further comprises: If the data processing model includes at least two parallel linear networks, determining the data processing time corresponding to each linear network under the configuration combination; The maximum value of the data processing time corresponding to each linear network under the configuration combination is used as the data processing time corresponding to the data processing model under the configuration combination.
5. The method according to claim 1, characterized in that Taking the data processing model being able to process a set amount of data to be processed as a goal, selecting a target configuration combination from the multiple configuration combinations according to the target data volume, and creating a processing process under the target configuration combination, including: According to the target data volume, a target configuration combination is selected from multiple configuration combinations, and a processing process under the target configuration combination is created; Determining whether the data processing model can process the set amount of data to be processed after creating the processing process under the target configuration combination; If the data processing model cannot process the set amount of data to be processed, then continue to determine a new target configuration combination from other configuration combinations other than the target configuration combination based on the target data volume, and create a processing process under the new target configuration combination until the data processing model can process the set amount of data to be processed.
6. The method according to claim 2, characterized in that Taking the data processing model being able to process a set amount of data to be processed as a goal, selecting a target configuration combination from the multiple configuration combinations according to the target data volume, and creating a processing process under the target configuration combination, including: For each target configuration combination in the multiple configuration combinations, setting the storage location of each parameter tensor in the target configuration combination to a remote memory node; According to the actual target data volume of the data processing model, redundant processing processes are deleted.
7. The method according to claim 2, characterized in that Taking the data processing model being able to process a set amount of data to be processed as a goal, selecting a target configuration combination from the multiple configuration combinations according to the target data volume includes: For each configuration combination in the multiple configuration combinations, if each parameter tensor in the configuration combination is stored in the local memory node, determine a data processing time corresponding to the data processing model under the configuration combination as a first processing time; For each parameter tensor in the configuration combination, determine a data processing time corresponding to the data processing model when storing the parameter tensor in the remote memory node as a second processing time; Determine, according to the first processing time and the second processing time, an increased data processing time after changing the parameter tensor from being stored in the local memory node to being stored in the remote memory node as a delay rise time; According to the memory size occupied by the parameter tensor and the delay rise time corresponding to the parameter tensor, the greedy coefficient corresponding to the parameter tensor is determined, and the parameter tensor with the highest greedy coefficient is used as the target parameter tensor allowed for remote access; Determine the data processing time corresponding to the data processing model after storing the target parameter tensor in the remote memory, and determine whether the data processing time is greater than a preset quality of service constraint duration; If it is determined that the data processing time is less than or equal to the preset service quality constraint duration, the configuration combination when the target parameter tensor is stored in the remote memory is used as the target configuration combination.
8. The method according to claim 7, characterized in that The delay rise time corresponding to the parameter tensor is negatively correlated with the greedy coefficient corresponding to the parameter tensor, and the memory size occupied by the parameter tensor is positively correlated with the greedy coefficient corresponding to the parameter tensor.
9. The method according to claim 7, characterized in that The method further comprises: If the data processing time is less than the quality of service constraint duration after the target parameter tensor is stored in the remote memory, the next target parameter tensor is determined until the data processing time is greater than the quality of service constraint duration.
10. The method according to claim 1, characterized in that Processing the data to be processed according to the processing process under the created target configuration combination includes: Determining a target data volume corresponding to each processing process in the plurality of processing processes according to a plurality of target configuration combinations respectively corresponding to the plurality of processing processes; According to the target data volume corresponding to each of the multiple processing processes, the to-be-processed data required to be processed by the multiple processing processes are allocated.
11. The method according to claim 1, characterized in that Processing the data to be processed according to the processing process under the created target configuration combination includes: Determining the parameter tensor that needs to be loaded into the data processing model; For each parameter tensor, query whether the parameter tensor is stored in the local memory node; If the parameter tensor is stored in the local memory node, map the parameter tensor memory in the local memory node in a memory mapping manner and load the parameter tensor; if the parameter tensor is not stored in the local memory node, determine whether the parameter tensor is allowed to be stored in the remote memory node under the current configuration; If the parameter tensor is allowed to be stored in a remote memory node under the current configuration, after the parameter tensor is found to be stored in the remote memory node, the parameter tensor memory in the remote memory node is mapped in a memory mapping manner and the parameter tensor is loaded; The data to be processed is processed according to the processing process under the created target configuration combination and the loaded parameter tensor.
12. The method according to claim 11, characterized in that The method further comprises: If the parameter tensor is not allowed to be stored in the remote memory node under the current configuration combination, a memory area is created in the local memory, and the parameter tensor is added to the local memory node corresponding to the memory area.
13. The method according to claim 11, characterized in that The method further comprises: If it is determined that the parameter tensor is allowed to be stored in the remote memory node under the current configuration combination, but the parameter tensor is not stored in the remote memory node, a memory area is created in the local memory and the parameter tensor is added to the remote memory node. In the local memory node corresponding to the memory area.
14. The method according to claim 11, characterized in that For each parameter tensor, query whether the parameter tensor is stored in the local memory node, including: For each parameter tensor, determine the hash value corresponding to the parameter tensor; The local memory node is accessed using the hash value as the identity authentication information corresponding to the parameter tensor, and a query is made as to whether the parameter tensor is stored in the local memory node.
15. The method according to claim 11, characterized in that According to the processing process under the created target configuration combination, data processing is performed on the data to be processed, including: Determining the number of mappings corresponding to each parameter tensor according to the processing process included in the data processing model; Determine a reference count corresponding to each parameter tensor according to the mapping number corresponding to each parameter tensor; For each parameter tensor, if the reference count corresponding to the parameter tensor is cleared during the data processing of the to-be-processed data, the tensor memory corresponding to the parameter tensor is reclaimed.
16. The method according to claim 2, characterized in that Creating a processing process under the target configuration combination includes: For each processing process, according to the memory size and CPU number corresponding to the processing process, filter out the server nodes that do not meet the configuration combination requirements, and use the remaining server nodes as candidate server nodes; For each candidate server node, determine the maximum memory allowed to be shared on the candidate server node; According to the maximum memory allowed to be shared on each candidate server node, a designated server node is selected as the target server node, and the processing process is scheduled to the target server node.
17. The method according to claim 2, characterized in that The method is applied to a serverless platform, and the local memory node and the remote memory node are memory nodes on a non-uniform memory access (NUMA) memory.
18. A data processing device, characterized in that: include: Acquisition module, obtains the data to be processed; A calling module is used to determine whether the data processing model can process a set amount of data to be processed under the current processing process, and in response to determining that the data processing model cannot process the set amount of data to be processed under the current processing process, obtain the data processing time of the data processing model under multiple configuration combinations; A determination module, for determining the data processing time under each configuration combination in the multiple configuration combinations, determines the amount of data that can be processed by the data processing model within the data processing time as the target data amount; A creation module, with the data processing model being able to process a set amount of data to be processed as a goal, selects a target configuration combination from the multiple configuration combinations according to the target data amount, and creates a processing process under the target configuration combination; The processing module performs data processing on the data to be processed according to the processing process under the created target configuration combination.
19. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 17 is implemented.
20. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 17 is implemented.
Citation Information
Patent Citations
Data processing, memory management method, device, device and medium
CN109471731A
Batch data processing method and device, computer equipment and storage medium
CN110297711A
Data processing method and device, storage medium and electronic equipment
CN115544555A
Data processing method and device, storage medium and electronic equipment
CN115964181A
Capacity scheduling in a data-processing cluster
US20190227842A1
Cited By
Memory scheduling method, system and product based on separated memory system
CN119149210A
