Graphics card resource allocation method, device, electronic device and storage medium

By predicting access traffic and traffic impact factors, and rationally allocating graphics card resources, it solves the problem of difficult to meet graphics card resource requirements for large models on the computing platform, and improves the task execution effect and user experience of large models.

CN118484312BActive Publication Date: 2024-10-01CSC FINANCIAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410909822.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-10-01
Estimated Expiration
2044-07-09

AI Technical Summary

Technical Problem

On the computing platform, how to reasonably allocate graphics card resources to meet the computing needs of multiple large models, especially when the demand for graphics card resources is high in neural network model operations with huge parameters, the existing technology is difficult to effectively allocate, making the computing platform difficult to Meet the graphics card resource requirements of each large model.

Method used

By predicting the access traffic of each major model, a linear regression equation is established based on the traffic impact factors in the historical time period to determine the amount of graphics card resources required for each large inference model and training fine-tuning large model, and based on the total number of graphics cards on the computing platform. Allocation, priority is given to ensuring the graphics card resource requirements of large inference models, and graphics card resource allocation is dynamically adjusted to adapt to data processing pressure.

Benefits of technology

It achieves more accurate graphics card resource allocation, improves the task execution effect of large inference models, improves user experience, and rationally allocates graphics card resources of the computing platform to ensure the normal operation of large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118484312B_ABST
    Figure CN118484312B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a graphics card resource allocation method, device, electronic device and storage medium, which relates to the field of computer technology. The specific implementation scheme is: obtaining the predicted access traffic of each inference large model, wherein the predicted access traffic is obtained based on the factors that affect the traffic of the inference large model performing the inference task in the historical time period; for each inference large model, according to the corresponding relationship between the graphics card resource amount corresponding to the inference large model and the access traffic, the resource amount of the predicted graphics card resource required by the inference large model is determined, and the graphics card resource is allocated to the inference large model based on the number of graphics cards that can provide the predicted graphics card resource; according to the remaining number of graphics cards in the computing platform and the training fine-tuning priority of each training fine-tuning large model, the graphics card resource is allocated to each training fine-tuning large model. The scheme provided by the embodiment of the present invention can more reasonably allocate the graphics card resources in the computing platform to each large model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a graphics card resource allocation method, device, electronic device and storage medium. Background Art

[0002] As deep learning enters a new era, large artificial intelligence neural network models with parameters exceeding hundreds of billions or even trillions are constantly emerging. These large models require high computing resources, making them difficult to operate on a single computer. Therefore, computing platforms built with extensive graphics card resources are often used as the basic computing power infrastructure for large model operations.

[0003] Because these computing platforms have abundant graphics card resources, they typically run multiple large models, each performing its own tasks. Furthermore, since each large model requires graphics card resources to perform its tasks, allocating the computing platform's graphics card resources to each large model is an urgent technical challenge. Summary of the Invention

[0004] The purpose of the embodiments of the present invention is to provide a graphics card resource allocation method, device, electronic device, and storage medium to more reasonably allocate graphics card resources in a computing platform to each large model. The specific technical solution is as follows:

[0005] According to one aspect of an embodiment of the present invention, a method for allocating graphics card resources is provided, the method comprising:

[0006] Obtaining predicted access traffic for each large inference model, wherein the predicted access traffic is obtained based on a traffic impact factor in a historical time period, wherein the traffic impact factor is a factor that affects the traffic of the large inference model performing the inference task, and the large inference model is the large model performing the inference task;

[0007] For each large inference model, based on the corresponding relationship between the graphics card resource amount and the access traffic corresponding to the large inference model, determine the predicted amount of graphics card resources required by the large inference model to process its corresponding predicted access traffic; obtain the number of graphics cards that can provide the predicted graphics card resources based on the determined resource amount; and allocate graphics card resources to the large inference model based on the obtained number of graphics cards;

[0008] Determine the number of remaining graphics cards based on the total number of graphics cards on the computing platform and the number of graphics cards corresponding to each large inference model;

[0009] Graphics card resources are allocated to each training fine-tuning large model according to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, wherein the training fine-tuning large model is a large model that performs training fine-tuning tasks.

[0010] In one embodiment of the present invention, the graphics card resources include: video memory resources, graphics card computing resources, and memory bandwidth resources. Obtaining the number of graphics cards capable of providing the predicted graphics card resources based on the determined resource amounts includes:

[0011] Determining the number of first graphics cards capable of providing the predicted graphics card resources based on the amount of graphics card memory resources in the determined amount of resources;

[0012] Determining the number of second graphics cards capable of providing the graphics card computing resources in the predicted graphics card resources based on the graphics card computing resources in the determined resource amount;

[0013] Determining the number of third graphics cards capable of providing the memory bandwidth resources in the predicted graphics card resources based on the memory bandwidth resource amount in the determined resource amount;

[0014] The maximum value among the first number of graphics cards, the second number of graphics cards, and the third number of graphics cards is determined as the number of graphics cards that can provide the predicted graphics card resources.

[0015] In one embodiment of the present invention, the corresponding relationship between the amount of graphics card resources and the access traffic corresponding to each large inference model is obtained in the following manner:

[0016] For each historical time period in the first number of historical time periods, obtaining a historical data pair corresponding to the inference large model in the historical time period, wherein the historical data pair includes: historical access traffic and amount of graphics card resources used;

[0017] Using the obtained historical data pairs, a linear regression equation with access traffic as the independent variable is established;

[0018] The coefficients of the linear regression equation are calculated to obtain the corresponding relationship between the graphics card resource amount and the access traffic corresponding to the large inference model.

[0019] In one embodiment of the present invention, allocating graphics card resources to each training and fine-tuning large model according to the training and fine-tuning priority of each training and fine-tuning large model and the number of remaining graphics cards includes:

[0020] Calculate the product of the resource coefficient corresponding to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, and determine the number of graphics cards that can provide computing resources for each training fine-tuning large model to perform training fine-tuning tasks based on the product result;

[0021] Based on the number of graphics cards corresponding to each training and fine-tuning large model, graphics card resources are allocated to each training and fine-tuning large model.

[0022] In one embodiment of the present invention, the predicted access traffic is predicted in the following manner: feature extraction is performed on the traffic impact factor of each historical time period to obtain the impact factor feature of each historical time period, wherein each historical time period includes a second number of consecutive time periods before the time period to which the predicted access traffic belongs;

[0023] Extracting features of traffic impact factors of a second number of consecutive historical time periods before the time period to which the predicted access traffic belongs, to obtain impact factor features of each historical time period;

[0024] Perform forward semantic parsing on the influencing factor features of each historical time period in chronological order from front to back, and obtain the hidden semantic features of each historical time period, wherein the semantic parsing for a historical time period includes: obtaining the forgotten features, information update features, candidate retained features, and information output features corresponding to the influencing factor features of the historical time period according to the hidden semantic features corresponding to the adjacent time periods of the historical time period, and determining the retained features of the historical time period based on the retained features of the adjacent time periods, the forgotten features, the information update features, and the candidate retained features, and determining the features to be output among the retained features according to the information output features as the hidden semantic features of the historical time period. In the case of forward semantic parsing, the adjacent time periods are: the preceding adjacent time period, and in the case of backward semantic parsing, the adjacent time periods are: the following adjacent time period.

[0025] The hidden semantic features of each historical time period obtained by the forward semantic analysis are weighted and fused to obtain the forward hidden semantic features;

[0026] Perform backward semantic parsing on the impact factor features of each historical time period in chronological order from back to front, and obtain the hidden semantic features of each historical time period;

[0027] Perform weighted fusion on the hidden semantic features of each historical time period obtained by backward semantic parsing to obtain backward hidden semantic features;

[0028] The predicted access traffic is predicted based on the forward hidden semantic features and the backward hidden semantic features.

[0029] In one embodiment of the present invention, the traffic influencing factors include: at least one of the degree of change of the transaction index in the historical time period, news information documents, company announcement information, access traffic of each large inference model, and access time.

[0030] According to another aspect of an embodiment of the present invention, a graphics card resource allocation device is provided, the device comprising:

[0031] A traffic acquisition module is configured to obtain the predicted access traffic of each inference large model, wherein the predicted access traffic is obtained based on the traffic impact factor in the historical time period, wherein the traffic impact factor is a factor that affects the traffic of the inference large model performing the inference task, and the inference large model is the large model performing the inference task;

[0032] A first graphics card resource allocation module is configured to determine, for each large inference model, a predicted amount of graphics card resources required by the large inference model to process the corresponding predicted access traffic based on a correspondence between the amount of graphics card resources corresponding to the large inference model and the access traffic, obtain a number of graphics cards capable of providing the predicted graphics card resources based on the determined amount of resources, and allocate graphics card resources to the large inference model based on the obtained number of graphics cards;

[0033] A module for determining the number of remaining graphics cards, configured to determine the number of remaining graphics cards based on the total number of graphics cards on the computing platform and the number of graphics cards corresponding to each large inference model;

[0034] The second graphics card resource allocation module is used to allocate graphics card resources to each training fine-tuning large model according to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, wherein the training fine-tuning large model is a large model that performs training fine-tuning tasks.

[0035] In one embodiment of the present invention, the graphics card resources include: video memory resources, graphics card computing resources and memory bandwidth resources, and the first graphics card resource allocation module is specifically used to: determine the number of first graphics cards that can provide the video memory resources in the predicted graphics card resources based on the amount of video memory resources in the determined resource amount; determine the number of second graphics cards that can provide the graphics card computing resources in the predicted graphics card resources based on the amount of graphics card computing resources in the determined resource amount; determine the number of third graphics cards that can provide the memory bandwidth resources in the predicted graphics card resources based on the amount of memory bandwidth resources in the determined resource amount; and determine the maximum value among the first number of graphics cards, the second number of graphics cards and the third number of graphics cards as the number of graphics cards that can provide the predicted graphics card resources.

[0036] In one embodiment of the present invention, the correspondence between the amount of graphics card resources and the access traffic corresponding to each large inference model is obtained in the following manner: for each historical time period in a first number of historical time periods, a historical data pair corresponding to the large inference model in the historical time period is obtained, wherein the historical data pair includes: historical access traffic and the amount of graphics card resources used; using the obtained historical data pairs, a linear regression equation with access traffic as the independent variable is established; the coefficients of the linear regression equation are calculated to obtain the correspondence between the amount of graphics card resources and the access traffic corresponding to the large inference model.

[0037] In one embodiment of the present invention, the second graphics card resource allocation module is specifically used to: calculate the product of the resource coefficient corresponding to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, and determine the number of graphics cards that can provide computing resources for each training fine-tuning large model to perform training fine-tuning tasks based on the product result; and allocate graphics card resources to each training fine-tuning large model based on the number of graphics cards corresponding to each training fine-tuning large model.

[0038] In one embodiment of the present invention, the predicted access traffic is predicted in the following manner: feature extraction is performed on the traffic influencing factors of each historical time period to obtain the influencing factor features of each historical time period, wherein each historical time period includes a second number of consecutive time periods before the time period to which the predicted access traffic belongs; feature extraction is performed on the traffic influencing factors of the second number of consecutive historical time periods before the time period to which the predicted access traffic belongs to obtain the influencing factor features of each historical time period; forward semantic parsing is performed on the influencing factor features of each historical time period in chronological order from front to back to obtain the hidden semantic features of each historical time period, wherein semantic parsing for a historical time period includes: according to the hidden semantic features corresponding to the adjacent time periods of the historical time period, respectively obtaining the forgetting features, information updating features, candidate retention features and information output features corresponding to the influencing factor features of the historical time period, and based on the retention of the adjacent time periods The retained features, the forgotten features, the information update features and the candidate retained features are used to determine the retained features of the historical time period. The features that need to be output in the retained features are determined according to the information output features as the hidden semantic features of the historical time period. In the case of forward semantic parsing, the adjacent time periods are: the preceding adjacent time periods, and in the case of backward semantic parsing, the adjacent time periods are: the subsequent adjacent time periods; the hidden semantic features of each historical time period obtained by the forward semantic parsing are weighted and fused to obtain the forward hidden semantic features; the influencing factor features of each historical time period are subjected to backward semantic parsing in chronological order from back to front to obtain the hidden semantic features of each historical time period; the hidden semantic features of each historical time period obtained by the backward semantic parsing are weighted and fused to obtain the backward hidden semantic features; based on the forward hidden semantic features and the backward hidden semantic features, the predicted access traffic is predicted.

[0039] In one embodiment of the present invention, the traffic influencing factors include: at least one of the degree of change of the transaction index in the historical time period, news information documents, company announcement information, access traffic of each large inference model, and access time.

[0040] According to another aspect of an embodiment of the present invention, there is provided an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0041] Memory for storing computer programs;

[0042] The processor is configured to implement any of the above-mentioned graphics card resource allocation methods when executing a program stored in the memory.

[0043] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements any of the above-mentioned graphics card resource allocation methods.

[0044] According to another aspect of an embodiment of the present invention, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any of the above-mentioned graphics card resource allocation methods.

[0045] Beneficial effects of the embodiments of the present invention:

[0046] In the technical solution provided by the embodiment of the present invention, the predicted amount of graphics card resources for the inference model is determined based on the predicted access traffic corresponding to the inference model, thereby determining the number of graphics cards in the computing platform that can provide the predicted graphics card resources. The predicted access traffic is predicted based on a traffic influencing factor that affects the traffic flow of the inference model performing inference tasks. Thus, traffic prediction based on the traffic influencing factor can obtain a more accurate predicted access traffic for the inference model, thereby more accurately determining the predicted amount of graphics card resources for the inference model, and then reasonably allocating graphics card resources to the inference model based on the predicted graphics card resources.

[0047] In addition, graphics card resource allocation is prioritized for large inference models. After allocating graphics card resources to the large inference model, graphics card resources are then allocated from the remaining graphics cards on the computing platform to the large training and fine-tuning models. This prioritizes the graphics card resource needs of the large inference model, ensuring the effectiveness of the large inference model in executing inference tasks, and improving the user experience of using the large inference model. Furthermore, the amount of graphics card resources occupied by the large inference model is adjusted based on the predicted traffic flow, allowing the large inference model and the large training and fine-tuning model to dynamically adjust their occupied graphics card resources based on the data processing pressure of the large inference model, more rationally allocating graphics card resources on the computing platform to each large model.

[0048] Of course, it is not necessary to achieve all of the advantages described above simultaneously in order to implement any product or method of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0050] Figure 1 A schematic diagram of a flow chart of a graphics card resource allocation method provided by an embodiment of the present invention;

[0051] Figure 2 A flowchart of a method for obtaining a corresponding relationship provided by an embodiment of the present invention;

[0052] Figure 3 A flowchart of a method for obtaining predicted access traffic provided by an embodiment of the present invention;

[0053] Figure 4 A schematic structural diagram of a graphics card resource allocation device provided by an embodiment of the present invention;

[0054] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field based on the present invention are within the scope of protection of the present invention.

[0056] The following describes the background technology of the embodiments of the present invention.

[0057] Large models excel at understanding and generating semantic content, and they are highly capable of processing text, audio, image, and video data. Consequently, companies use large models for data analysis and to provide various services to users.

[0058] However, large models require higher graphics card resources to perform various data processing tasks. When each large model uses the graphics card resources in the same computing platform to perform various data processing tasks, if the amount of data that the large model needs to process increases, the graphics card resources required by the large model will also increase. Then, the graphics card resources in the computing platform may be difficult to meet the needs of each large model. Therefore, it is necessary to allocate the graphics card resources of the computing platform to each large model.

[0059] The following describes the execution subject of the embodiment of the present invention.

[0060] The solutions provided by the embodiments of the present invention can be applied to electronic devices such as desktop computers, laptops, tablet computers, and servers. These electronic devices can allocate graphics card resources from a computing platform. Alternatively, the computing platform can also be the execution entity of the solutions provided by the embodiments of the present invention. For ease of description, the execution entity of the graphics card resource allocation method provided by the embodiments of the present invention is collectively referred to as an allocation device.

[0061] The concepts involved in the embodiments of the present invention are described below.

[0062] 1. Reasoning Large Model

[0063] An inference model is a large model that performs inference tasks. Inference tasks can include information recommendation, text generation, data analysis, and information prediction. The inference model can be used to analyze data for the company or provide various services to users. However, if the user traffic to the inference model is too high, the inference tasks the model needs to perform will increase, and the amount of data the model needs to process will also increase. Therefore, when the inference model traffic is high, the graphics card resources required by the inference model will also be high. If the inference model requires high graphics card resources and the computing platform cannot provide sufficient graphics card resources for the inference model, the simulation and inference model may output inaccurate results.

[0064] 2. Training and Fine-tuning Large Models

[0065] A large training and fine-tuning model is a large model used to perform training and fine-tuning tasks. It can be used to assist with tasks such as model training and fine-tuning.

[0066] III. Historical Time Period

[0067] The historical time period is a time period before the time period of the predicted access traffic to be predicted. The length of the historical time period can be in units of one hour, two hours, or one day.

[0068] 4. Traffic Influencing Factors

[0069] Traffic impact factors are factors that influence the traffic volume of the inference model executing inference tasks. The time period for obtaining the predicted access traffic using the traffic impact factors can be a preset number of consecutive historical time periods adjacent to the time period for the predicted access traffic. For example, if the predicted access traffic volume obtained for each inference model is for hour t of a day, the traffic impact factors from hours t-6 to hours t-1 of that day can be used to obtain the predicted access traffic volume for hour t.

[0070] Specifically, in the financial sector, traffic influencing factors can include financial news information and time information. For example, traffic influencing factors can include at least one of the following: the degree of change in trading indices over a historical period, news documents, company announcements, access traffic to each large inference model, and access time.

[0071] Specifically, the greater the degree of change in the trading index, the more likely the traffic to the inference model will increase. Large fluctuations in the trading index lead to a greater desire for users to perform trading operations such as buy and sell. Users will then use the inference model to analyze data and then perform corresponding trading operations based on the results of this analysis. Therefore, by combining the degree of change in the trading index over a historical time period with the traffic to the inference model during the same time period, we can determine the impact of the degree of change in the trading index on the traffic to the inference model. For example, the degree of change in the trading index can include the magnitude of the increase or decrease in the CSI 300 Index.

[0072] Similarly, by combining news documents, company announcements, and the access traffic of the inference model in the same time period, we can also determine the impact of the degree of change in the trading index on the access traffic of the inference model.

[0073] By combining the access time and the access traffic of the inference model in the same time period in the traffic influencing factor, the time characteristics of the user's transaction operations can be taken into account. For example, in the financial field, transaction operations may not be possible on weekends and holidays, so the possibility of users using the inference model is low, and the access traffic of the inference model on these weekends and holidays is low. Alternatively, the time characteristics can also include the hour of the day, and different time periods of the day may also affect the access traffic of the inference model. In this way, by combining the access time and the access traffic of the inference model in the same time period, the impact of the access time on the access traffic of the inference model can be determined.

[0074] It can be seen that traffic influencing factors include changes in transaction index, news information documents, company announcement information, access time and other angles to predict access traffic. It can consider the impact of different factors on access traffic, so that more accurate prediction of access traffic can be obtained.

[0075] The graphics card resource allocation method provided by the embodiment of the present invention is described below with reference to specific embodiments.

[0076] In one embodiment of the present invention, see Figure 1 A flowchart of a graphics card resource allocation method is provided, which includes the following steps S101-S104.

[0077] Step S101: Obtain the predicted access traffic of each large inference model.

[0078] The predicted access traffic is obtained based on traffic impact factors in a historical time period.

[0079] The method for obtaining the predicted access traffic is described in the following embodiments and will not be described in detail here.

[0080] Step S102: For each large inference model, determine the amount of predicted graphics card resources required for the large inference model to process its corresponding predicted access traffic based on the corresponding relationship between the graphics card resource amount and the access traffic. According to the determined resource amount, obtain the number of graphics cards that can provide the predicted graphics card resources, and allocate graphics card resources to the large inference model based on the obtained number of graphics cards.

[0081] The following describes the method for determining the resource amount of the predicted graphics card resources in step S102.

[0082] In one implementation method, the correspondence between the amount of graphics card resources and the access traffic corresponding to the large inference model can be determined in advance, and the allocation device can determine the value corresponding to the predicted access traffic in the above correspondence based on the predicted access traffic as the resource amount of the predicted graphics card resources.

[0083] In the case where the graphics card resources include: graphics memory resources, graphics card computing resources and memory bandwidth resources, the allocation device may obtain the predicted graphics card resources corresponding to each type of graphics card resource respectively.

[0084] For video memory resources, the above correspondence includes a video memory traffic correspondence between video memory resources and access traffic, and the predicted video memory resource amount is determined based on the video memory traffic correspondence.

[0085] For graphics card computing resources, the above correspondence includes a computing flow correspondence between graphics card computing resources and access traffic, and the predicted amount of graphics card computing resources is determined based on the computing flow correspondence.

[0086] For memory bandwidth resources, the above correspondence includes a correspondence between memory bandwidth resources and bandwidth flow of access traffic. The predicted memory bandwidth resource amount is determined based on the bandwidth flow correspondence.

[0087] The method of obtaining the number of graphics cards in step S102 and the corresponding relationship between the amount of graphics card resources and access traffic corresponding to each large inference model can be found in the following embodiments and will not be described in detail here.

[0088] Step S103: Determine the number of remaining graphics cards based on the total number of graphics cards in the computing platform and the number of graphics cards corresponding to each large inference model.

[0089] Specifically, the allocation device subtracts the number of graphics cards corresponding to each large inference model from the total number of graphics cards to obtain the remaining number of graphics cards.

[0090] For example, if the number of large inference models is n, the allocation device can determine the number of graphics cards corresponding to each large inference model according to the following expression:

[0091] ;

[0092] in, The number of graphics cards corresponding to each large inference model, is the number of graphics cards corresponding to the first large inference model, is the number of graphics cards corresponding to the second large inference model, The number of graphics cards corresponding to the n-th inference model.

[0093] The allocation device can determine the number of remaining graphics cards according to the following expression:

[0094] ;

[0095] in, is the number of remaining graphics cards, The total number of graphics cards.

[0096] Step S104: allocating graphics card resources to each training and fine-tuning large model according to the training and fine-tuning priority of each training and fine-tuning large model and the number of remaining graphics cards.

[0097] Specifically, the allocation device can calculate the product of the resource coefficient corresponding to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, and determine the number of graphics cards that can provide computing resources for each training fine-tuning large model to perform training fine-tuning tasks based on the product result, and allocate graphics card resources to each training fine-tuning large model based on the number of graphics cards corresponding to each training fine-tuning large model.

[0098] The resource coefficient is explained below.

[0099] In one implementation, the training and fine-tuning priority of each large training and fine-tuning model can be an integer value, where a higher value indicates a higher priority for the corresponding large training and fine-tuning model. The training and fine-tuning priorities of each large training and fine-tuning model are then normalized, and the normalized value is used as the resource coefficient corresponding to the training and fine-tuning priority.

[0100] For example, the training and fine-tuning priorities of three large training and fine-tuning models can be 2, 4, and 6 respectively. Then, the resource coefficient of the first large training and fine-tuning model is 2 / 12, the resource coefficient of the first large training and fine-tuning model is 4 / 12, and the resource coefficient of the first large training and fine-tuning model is 6 / 12.

[0101] In another implementation, the training fine-tuning priority of each training fine-tuning large model can be directly set as a percentage, and the training fine-tuning priority can be directly used as a resource coefficient.

[0102] The following describes a method for determining the number of graphics cards that can provide computing resources for performing training and fine-tuning tasks for each large training and fine-tuning model based on the product result.

[0103] For each large training and fine-tuning model, the allocation device can determine the number of graphics cards that can provide computing resources for performing training and fine-tuning tasks for the large training and fine-tuning model according to the following expression:

[0104] ;

[0105] in, The number of graphics cards that can provide computing resources for the training and fine-tuning tasks of the large model. Fine-tune the resource coefficients of the large model for this training.

[0106] In this way, graphics card resources can be allocated more reasonably for training and fine-tuning large models according to priority, ensuring the normal execution of more important training and fine-tuning tasks, and thus more reasonably allocating graphics card resources in the computing platform.

[0107] In the technical solution provided by the embodiment of the present invention, the predicted amount of graphics card resources for the inference model is determined based on the predicted access traffic corresponding to the inference model, thereby determining the number of graphics cards in the computing platform that can provide the predicted graphics card resources. The predicted access traffic is predicted based on a traffic influencing factor that affects the traffic flow of the inference model performing inference tasks. Thus, traffic prediction based on the traffic influencing factor can obtain a more accurate predicted access traffic for the inference model, thereby more accurately determining the predicted amount of graphics card resources for the inference model, and then reasonably allocating graphics card resources to the inference model based on the predicted graphics card resources.

[0108] In addition, graphics card resource allocation is prioritized for large inference models. After allocating graphics card resources to the large inference model, graphics card resources are then allocated from the remaining graphics cards on the computing platform to the large training and fine-tuning models. This prioritizes the graphics card resource needs of the large inference model, ensuring the effectiveness of the large inference model in executing inference tasks, and improving the user experience of using the large inference model. Furthermore, the amount of graphics card resources occupied by the large inference model is adjusted based on the predicted traffic flow, allowing the large inference model and the large training and fine-tuning model to dynamically adjust their occupied graphics card resources based on the data processing pressure of the large inference model, more rationally allocating graphics card resources on the computing platform to each large model.

[0109] The following describes the method for obtaining the number of graphics cards in step S102.

[0110] In one implementation method, the resource quantity conversion coefficient between the graphics card resource quantity and the number of graphics cards can be determined based on the unit graphics card resource quantity that each graphics card can provide, and then the allocation device can determine the number of graphics cards that can provide the above-mentioned predicted graphics card resources based on the above-mentioned resource quantity conversion coefficient.

[0111] In the case where graphics card resources include: graphics card memory resources, graphics card computing resources and memory bandwidth resources, after determining the amount of graphics card memory resources, the first number of graphics cards that can provide the graphics card memory resources in the predicted graphics card resources is determined based on the amount of graphics card memory resources in the determined resource amount.

[0112] Specifically, taking video memory resources as an example, assuming that a graphics card has 24GB of video memory, the conversion factor between the video memory resources and the number of graphics cards can be determined to be 1 / 24. If the predicted video memory resources in the predicted graphics card resources are 60GB, multiplying the above resource conversion factor by the predicted video memory resources yields: 60 1 / 24=2.5. When the number of graphics cards is not an integer, the smallest integer greater than the value obtained by the above multiplication can be taken as the number of graphics cards that provide the above-determined predicted graphics card resources. For example, when the resource quantity conversion coefficient is multiplied by the predicted video memory resources to obtain 2.5, the first number of graphics cards can be determined to be 3.

[0113] After determining the amount of graphics card computing resources, the number of second graphics cards that can provide the graphics card computing resources in the predicted graphics card resources is determined based on the amount of graphics card computing resources in the determined amount of resources.

[0114] Specifically, taking the graphics card computing resources as an example, assuming that the graphics card computing resources of a graphics card are 80 TFLOPS (a counting unit that represents the computing power of the graphics card), it can be determined that the conversion factor of the graphics card computing resources and the number of graphics cards is 1 / 80. When the predicted graphics card computing resources in the predicted graphics card resources are 300 TFLOPS, the above resource conversion factor is multiplied by the predicted graphics card computing resources to obtain: 300 1 / 80=3.75, so we can determine that the number of second graphics cards is 4.

[0115] After the memory bandwidth resource amount is determined, the number of third graphics cards that can provide the memory bandwidth resource in the predicted graphics card resources is determined based on the memory bandwidth resource amount in the determined resource amount.

[0116] Specifically, taking memory bandwidth resources as an example, assuming that the memory bandwidth resources of a graphics card are 384GB / s, the conversion coefficient of memory bandwidth resources and the number of graphics cards can be determined to be 1 / 384. When the predicted memory bandwidth resources in the predicted graphics card resources are 960GB / s, multiplying the above resource quantity conversion coefficient by the predicted memory bandwidth resources can obtain: 960 1 / 384=2.5, so we can determine that the number of third graphics cards is 3.

[0117] The maximum value among the first number of graphics cards, the second number of graphics cards, and the third number of graphics cards is determined as the number of graphics cards that can provide the predicted graphics card resources.

[0118] Specifically, taking the above content as an example, the number of first graphics cards is 4, the number of second graphics cards is 4, and the number of third graphics cards is 3. Then, it can be determined that the number of graphics cards that can provide predicted graphics card resources is 4.

[0119] For example, the allocation device may determine the number of graphics cards that can provide the predicted graphics card resources corresponding to the inference large model A according to the following expression:

[0120] ;

[0121] in, The number of graphics cards required for inference of large model A, is the conversion factor for video memory quantity, is the amount of video memory resources corresponding to the inference large model A, To calculate the resource quantity conversion factor, is the amount of video memory resources corresponding to the inference large model A, is the bandwidth conversion factor, is the memory bandwidth resource corresponding to the inference large model A.

[0122] In this way, priority is given to ensuring that the number of graphics cards allocated to the large inference model can meet the graphics card resources required by the large inference model, ensuring the effectiveness of the large inference model in executing inference tasks, and improving the user experience of using the large inference model.

[0123] The following describes a method for obtaining the corresponding relationship between the amount of graphics card resources and access traffic corresponding to each large inference model.

[0124] In one embodiment of the present invention, see Figure 2 A flowchart of a method for obtaining a corresponding relationship is provided, and the method includes the following steps S201-S203.

[0125] Step S201: For each historical time period in the first number of historical time periods, obtain a historical data pair corresponding to the inference large model in the historical time period.

[0126] The historical data includes: historical access traffic and graphics card resources used;

[0127] Specifically, in a historical time period, for each large inference model, the historical access traffic, graphics card resource volume, and historical time of accessing the large inference model in the historical time period are recorded.

[0128] For example, for each of the 1st to the i-th historical time periods, the historical access traffic of the inference model A can be recorded. For example, the historical access traffic corresponding to each historical time period can be expressed as:

[0129] ;

[0130] in, Represents the historical access traffic of the inference model A in the i-th historical time period.

[0131] For each of the 1st to the i-th historical time periods, the amount of graphics card resources used by the inference model A is recorded. For example, the amount of graphics card resources used by the inference model A corresponding to each historical time period can be expressed as:

[0132] ;

[0133] in, Indicates the amount of graphics card resources used by the inference model A in the i-th historical time period.

[0134] Similarly, for each inference large model such as inference large model B and inference large model C, the historical access traffic and graphics card resource amount corresponding to each of the above historical time periods can be recorded.

[0135] Then, the historical access traffic and graphics card resource usage for the same inference model in the same historical time period are the historical data pairs corresponding to the inference model in the historical time period. For example, and is the historical data pair corresponding to the inference model A in the first historical time period.

[0136] Step S202: Using the obtained historical data pairs, a linear regression equation is established with the access traffic as the independent variable.

[0137] For example, a linear regression equation with access traffic as the independent variable for the inference model A can be established according to the following expression:

[0138] ;

[0139] in, To predict the graphics card resources for the inference of large model A, To infer the predicted access traffic of the large model A, 、 and are the coefficients of the linear regression equation.

[0140] Step S203: Calculate the coefficients of the linear regression equation to obtain the corresponding relationship between the graphics card resource amount and the access traffic corresponding to the large inference model.

[0141] Specifically, the coefficients of the linear regression equation are solved based on the historical data obtained in step S201. For example, the coefficients of the linear regression equation in the formula of step S202 are calculated. 、 and .

[0142] In this way, based on the historical access traffic and the amount of graphics card resources used in the historical time period, a correspondence between the access traffic and the amount of graphics card resources used can be constructed. Based on the predicted access traffic, the predicted amount of graphics card resources can be accurately obtained from the correspondence between the amount of graphics card resources corresponding to the inference large model and the access traffic. The predicted amount of graphics card resources of the inference large model can be further accurately determined, and then graphics card resources can be reasonably allocated to the inference large model based on the predicted graphics card resources.

[0143] In another embodiment of the present invention, when graphics card resources include video memory resources, graphics card computing resources, and memory bandwidth resources, for each of the first to the i-th historical time periods, the amount of graphics card resources used by the inference large model A corresponding to each historical time period can be expressed as follows:

[0144] ;

[0145] in, Indicates the amount of video memory resources used by the inference model A in the i-th historical time period.

[0146] ;

[0147] in, Indicates the amount of graphics card computing resources used by the inference model A in the i-th historical time period.

[0148] ;

[0149] in, Indicates the memory bandwidth resources used by the inference model A in the i-th historical time period.

[0150] For each graphics card resource, three different linear regression equations can be constructed.

[0151] For the amount of video memory resources, the constructed linear regression equation is as follows:

[0152] ;

[0153] in, is the predicted amount of video memory resources for inference of large model A, To infer the predicted access traffic of the large model A, 、 and are the coefficients of the linear regression equation.

[0154] For the amount of graphics card computing resources, the constructed linear regression equation is as follows:

[0155] ;

[0156] in, is the amount of computing resources required to infer the predictions of the large model A, To infer the predicted access traffic of the large model A, 、 and are the coefficients of the linear regression equation.

[0157] For the amount of graphics card computing resources, the constructed linear regression equation is as follows:

[0158] ;

[0159] in, Memory bandwidth resources for reasoning about the predictions of large model A, To infer the predicted access traffic of the large model A, 、 and are the coefficients of the linear regression equation.

[0160] The following describes how to obtain the predicted access traffic.

[0161] In one embodiment of the present invention, see Figure 3 A flowchart of a method for obtaining predicted access traffic is provided, and the method includes the following steps S301-S306.

[0162] Step S301: extracting features of the traffic impact factors of each historical time period to obtain the impact factor features of each historical time period.

[0163] Each historical time period includes a second number of consecutive time periods before the time period to which the predicted access traffic belongs. For example, when the length of each time period is 1 hour and the second number is 6 hours, the impact factor characteristics of each historical time period can be expressed as 、 、 、 、 as well as .in, arrive They represent the impact factor characteristics from the 1st historical time period to the 6th historical time period respectively.

[0164] The following describes the method of obtaining the impact factor characteristics in step S301.

[0165] Specifically, after obtaining the data of the flow influencing factors, the data of the flow influencing factors are first digitized to obtain the digitized processing results. However, since some characteristic values ​​may be missing during the process of collecting the flow influencing factors, the digitized processing results can be interpolated using missing interpolation technology. The results of the missing interpolation processing are then normalized to obtain normalized data. The normalization process can be performed according to the following expression: , Z is the normalized data, k is the unnormalized data, A is the average, and SD is the standard deviation. Feature extraction is then performed on the normalized data to obtain the influencing factor features. For example, a convolution operation can be used for feature extraction.

[0166] The following describes a method for collecting data on flow influencing factors.

[0167] Furthermore, when the traffic influencing factors include: the degree of change of the trading index in the historical time period, news information documents, company announcement information, access traffic and access time of each large inference model, the data of the traffic influencing factors can be obtained in the following way.

[0168] For textual information such as news documents and company announcements, structured events can be extracted using open information extraction and dependency analysis methods. Timestamp information is then published for each event record. Based on a pre-built sentiment knowledge base, events are matched with keywords or word combinations to perform sentiment analysis on each event, determining whether the sentiment is positive or negative, as well as the degree of correspondence. For the degree of change in the trading index and the access traffic of each inference model, when recording the degree of change and traffic data, the timestamp information corresponding to the degree of change and traffic data is also recorded. This allows the timestamp information corresponding to each traffic influencing factor to be used to determine the degree of change in the trading index, news documents, company announcements, and access traffic of each inference model within the same historical time period. Furthermore, based on the timestamp information, it is possible to determine whether the access time falls on a weekend and the hour of the day. This information is then used as the traffic influencing factor data for that historical time period.

[0169] For example, if we use the above method to obtain data on the degree of change in the trading index in time period t, the sentiment and correspondence of news documents, the sentiment and correspondence of company announcements, the access volume of each inference model, whether the access time falls on the weekend, and the hour of the day, then the influencing factor characteristics for the above eight historical time periods belonging to time period t can be expressed as: .in, arrive These are the characteristics of the above 8 influencing factors belonging to time period t.

[0170] The following describes the method of digitization processing.

[0171] After obtaining the data on traffic influencing factors, different numerical methods can be used for processing depending on the data type of the traffic influencing factors. For example, for traffic influencing factors with a large number of data types, such as the degree of correspondence between news documents and company announcements, and the hour of the day the access time falls, serial number encoding can be used for numerical processing. For example, there are 24 data types for the hour of the day, which is a relatively large number of data types. For traffic influencing factors with only two data types, such as the positive or negative sentiment of news documents and company announcements, and whether the access time falls on the weekend, the data types are relatively small, and one-hot encoding can be used for numerical processing.

[0172] Step S302: Perform forward semantic parsing on the impact factor features of each historical time period in chronological order from front to back, to obtain the hidden semantic features of each historical time period.

[0173] Among them, the semantic parsing processing for a historical time period includes: according to the hidden semantic features corresponding to the adjacent time periods of the historical time period, respectively obtaining the forgotten features, information update features, candidate retention features and information output features corresponding to the influencing factor features of the historical time period, and based on the retention features, forgotten features, information update features and candidate retention features of the adjacent time periods, determining the retention features of the historical time period, and determining the features that need to be output in the retained features according to the information output features as the hidden semantic features of the historical time period.

[0174] In the case of forward semantic parsing, the adjacent time periods are: preceding adjacent time periods; in the case of backward semantic parsing, the adjacent time periods are: following adjacent time periods.

[0175] The following describes the method of performing forward semantic parsing processing for a historical time period in step S302.

[0176] For example, a historical time period is the tth time period. represents the hidden semantic features of the t-th time period, represents the hidden semantic features of the t-1th time period, that is, the hidden semantic features of the preceding adjacent time period of a historical time period. Indicates the impact factor characteristics of the t-th time period, represents the forgetting characteristics of the t-th time period, represents the information update characteristics of the t-th time period, represents the candidate retained features for the tth time period, represents the information output characteristics of the t-th time period, Represents the retained features of the tth time period, wherein the right-pointing arrow indicates that the above contents are the hidden semantic features, forgotten features, information update features, candidate retained features, information output features, and retained features obtained in the forward semantic parsing process, etc.

[0177] Specifically, according to the time period t and ,Sure 、 、 as well as .in, The features that need to be removed from the features retained in the t-1 time period corresponding to the time period t are represented, that is, the features that need to be forgotten among the features retained in the t-1 time period in the t time period. Characterizes the features of the impact factor features that need to be updated to the retained features of time period t. is the candidate feature to be retained corresponding to the time period t. Characterize the features that need to be output from the retained features during time period t.

[0178] Furthermore, according to and the retention characteristics of time period t-1 , determine the features after removing the features that need to be forgotten from the features retained in the previous time period, and then and , determine the new features of time period t, and then combine the features after removing the features that need to be forgotten from the retained features of the previous time period with the new features of time period t to obtain the retained features of time period t .

[0179] In getting and Finally, the features that need to be output in time period t are determined as hidden semantic features.

[0180] For example, For example, for each historical period, we can get 、 、 、 、 as well as When performing forward semantic analysis, first perform forward semantic analysis on the influencing factor features of the time period t=1, and obtain , in getting Then, we perform forward semantic parsing on the impact factor features of the time period t=2, and obtain , and so on, until we get Among them, when t=1, the time period of t=0 can be as well as Initialized to the zero vector.

[0181] Step S303: performing weighted fusion on the hidden semantic features of each historical time period obtained by the forward semantic parsing process to obtain the forward hidden semantic features.

[0182] Specifically, according to the preset weights of the latent semantic features corresponding to each historical time period, the latent semantic features obtained in step S302 are weightedly fused, and the fused result is used as the forward latent semantic feature.

[0183] For example, the forward hidden semantic features can be obtained: .

[0184] Step S304: Perform backward semantic parsing on the impact factor features of each historical time period in chronological order from back to front, to obtain the hidden semantic features of each historical time period.

[0185] The following describes the method of performing backward semantic parsing processing for a historical time period in step S304.

[0186] For example, a historical time period is the tth time period. represents the hidden semantic features of the t-th time period, represents the hidden semantic features of the t+1th time period, that is, the hidden semantic features of the subsequent adjacent time periods of a historical time period. Indicates the impact factor characteristics of the t-th time period, represents the forgetting characteristics of the t-th time period, represents the information update characteristics of the t-th time period, represents the candidate retained features for the tth time period, represents the information output characteristics of the t-th time period, Represents the retained features of the tth time period, wherein the left-pointing arrow indicates that the above contents are the hidden semantic features, forgotten features, information update features, candidate retained features, information output features, and retained features obtained in the backward semantic parsing process, etc.

[0187] Specifically, according to the time period t and ,Sure 、 、 as well as .in, The features that need to be removed from the features retained in the t-1 time period corresponding to the time period t are represented, that is, the features that need to be forgotten among the features retained in the t-1 time period in the t time period. Characterizes the features of the impact factor features that need to be updated to the retained features of time period t. is the candidate feature to be retained corresponding to the time period t. Characterize the features that need to be output from the retained features during time period t.

[0188] Furthermore, according to and the retained features of time period t+1 , determine the features after removing the features that need to be forgotten from the features retained in the previous time period, and then and , determine the new features of time period t, and then combine the features after removing the features that need to be forgotten from the retained features of the previous time period with the new features of time period t to obtain the retained features of time period t .

[0189] In getting and Finally, the features that need to be output in time period t are determined as hidden semantic features.

[0190] For example, For example, for each historical period, we can get 、 、 、 、 as well as When performing backward semantic analysis, first perform backward semantic analysis on the impact factor features of the t=6 time period, and obtain , in getting After that, the backward semantic parsing process is performed on the impact factor features of the time period t=5, and the obtained , and so on, until we get Among them, at t=6, the time period of t=7 can be as well as Initialized to the zero vector.

[0191] Step S305: performing weighted fusion on the latent semantic features of each historical time period obtained by the backward semantic parsing process to obtain the backward latent semantic features.

[0192] The implementation of step S305 is similar to that of step S303, the only difference being the name, which will not be described in detail here.

[0193] Step S306: predicting the access traffic based on the forward hidden semantic features and the backward hidden semantic features.

[0194] Specifically, the forward hidden semantic features and the backward hidden semantic features may be connected, and then traffic prediction may be performed based on the connected forward hidden semantic features and backward hidden semantic features.

[0195] The following describes the time sequence of predicted access traffic, forward hidden semantic features, and backward hidden semantic features.

[0196] When obtaining the predicted access traffic of each inference large model in step S101, the predicted access traffic of a future time period that has not yet occurred is predicted based on the forward hidden semantic features and backward hidden semantic features obtained by semantically parsing the traffic influencing factors of the historical time period. For example, if the current time is the end time point of the t=6 time period, then the forward hidden semantic features and backward hidden semantic features corresponding to t=[1,2,3,4,5,6] in the historical time period can be obtained, and the predicted access traffic of t=7 can be predicted. In the case where the current time point is the end time point of the t=6 time period, that is, the start time point of the t=7 time period, the t=7 time period has not yet ended, so the future time period can be the t=7 time period.

[0197] As can be seen from the above, in the process of forward and backward semantic parsing, the features that need to be forgotten from the retained features of the previous adjacent time period and the features that need to be updated in the historical time period are determined based on the retained features and hidden semantic features of the adjacent time periods of the historical time period. The retained features of the historical time period thus obtained retain the features that are related to each time period. The output hidden semantic features can be combined, and semantic parsing can be performed separately in the order from front to back and from back to front in time. For each historical time period, the features corresponding to the previous and subsequent time periods can be combined. In this way, the hidden semantic features obtained are more accurate, and the predicted access traffic obtained is more accurate, and the graphics card resources can be allocated more reasonably based on the predicted access traffic.

[0198] In another embodiment of the present invention, the predicted access traffic can be obtained through a pre-trained traffic prediction model.

[0199] The traffic prediction model may include: an input layer, a bidirectional hidden layer, and an output layer.

[0200] The input layer is used to extract the features of the traffic influencing factors of each historical time period and obtain the features of the influencing factors of each historical time period.

[0201] For details, please refer to the content of step S301, which will not be described in detail here.

[0202] The bidirectional hidden layer can be used to perform forward semantic parsing on the influencing factor features of each historical time period in chronological order from front to back, to obtain the hidden semantic features of each historical time period. The hidden semantic features of each historical time period obtained by the forward semantic parsing are weighted and fused to obtain the forward hidden semantic features. The backward semantic parsing on the influencing factor features of each historical time period in chronological order from back to front, to obtain the hidden semantic features of each historical time period. The hidden semantic features of each historical time period obtained by the backward semantic parsing are weighted and fused to obtain the backward hidden semantic features.

[0203] The bidirectional hidden layer can be constructed based on the bidirectional long short-term memory network model structure. If the number of nodes in the bidirectional hidden layer is too large, it may cause the traffic prediction model to overfit. In this case, the number of layers and nodes in the bidirectional hidden layer can be set to 1 and 128, respectively.

[0204] During the forward semantic parsing process, for each historical time period, the forgetting feature can be obtained according to the following expression:

[0205] ;

[0206] in, Represents the sigmoid (a neural network model activation function) activation function, Represents the weight matrix corresponding to the forgotten feature, Represents the bias term corresponding to the forgotten feature.

[0207] The information update characteristics are obtained according to the following expression:

[0208] ;

[0209] in, Represents the weight matrix corresponding to the information update feature, Indicates the bias term corresponding to the information update feature.

[0210] The information output characteristics are obtained according to the following expression:

[0211] ;

[0212] in, Represents the weight matrix corresponding to the information output feature, Represents the bias term corresponding to the information output feature.

[0213] The candidate retained features are obtained according to the following expression:

[0214] ;

[0215] in, represents the tangent activation function, represents the weight matrix corresponding to the candidate retained features, Represents the bias term corresponding to the candidate retained feature.

[0216] The retained features are determined according to the following expression:

[0217] ;

[0218] The hidden state is obtained as follows:

[0219] ;

[0220] During the backward semantic parsing process, for each historical time period, the forgetting feature can be obtained according to the following expression:

[0221] ;

[0222] The information update characteristics are obtained according to the following expression:

[0223] ;

[0224] The information output characteristics are obtained according to the following expression:

[0225] ;

[0226] The candidate retained features are obtained according to the following expression:

[0227] ;

[0228] The retained features are determined according to the following expression:

[0229] ;

[0230] The hidden state is obtained as follows:

[0231] ;

[0232] In the bidirectional hidden layer, the forward hidden semantic features are obtained and backward hidden semantic features After that, we can get the connected forward hidden semantic features and backward hidden semantic features: .

[0233] Then the output of the bidirectional hidden layer is Input to the fully connected layer, the fully connected layer is based on the obtained Forecast the predicted access traffic. For example, you can get the prediction result according to the following expression: ,in, represents the weight matrix corresponding to the fully connected layer, Indicates the bias term corresponding to the prediction result.

[0234] The following describes the flow prediction model training process.

[0235] The following describes how to obtain training samples.

[0236] Specifically, for each historical time period, data of the flow influencing factors may be collected. The data collection method may refer to the method of collecting the flow influencing factors data in step S301, and will not be described in detail here.

[0237] The collected data of flow influencing factors are digitized, interpolated, and normalized to obtain processed normalized data as training samples.

[0238] The training sample is used as input data and fed into the traffic prediction model to obtain the prediction result output by the traffic prediction model. If the difference between the prediction result and the true value is less than the preset error prediction, the traffic prediction model training is completed.

[0239] If the difference between the predicted result and the true value is greater than the preset error prediction, the loss function is used to calculate the loss value. The gradient of the traffic prediction model weights is then calculated based on the loss value. The parameters of the traffic prediction model are adjusted based on the calculated gradient and learning rate. The training sample is then re-entered as input data into the traffic prediction model to continue model training.

[0240] In addition, a regularization method is used between the bidirectional hidden layer and the fully connected layer to avoid overfitting during training. For example, the Dropout (random inactivation) technique can be used to implement the regularization method, and the regularization parameter value can be 0.05.

[0241] Corresponding to the above-mentioned graphics card resource providing method, an embodiment of the present invention further provides a graphics card resource allocation device.

[0242] In one embodiment of the present invention, see Figure 4 A schematic diagram of the structure of a graphics card resource allocation device is provided, the device comprising:

[0243] The traffic acquisition module 401 is used to obtain the predicted access traffic of each inference large model, wherein the predicted access traffic is obtained based on the traffic impact factor in the historical time period, and the traffic impact factor is a factor that affects the traffic of the inference large model performing the inference task. The inference large model is a large model that performs the inference task.

[0244] The first graphics card resource allocation module 402 is used to determine, for each large inference model, the amount of predicted graphics card resources required by the large inference model to process its corresponding predicted access traffic based on the corresponding relationship between the amount of graphics card resources corresponding to the large inference model and the access traffic, obtain the number of graphics cards that can provide the predicted graphics card resources based on the determined amount of resources, and allocate graphics card resources to the large inference model based on the obtained number of graphics cards.

[0245] The module 403 for determining the number of remaining graphics cards is used to determine the number of remaining graphics cards based on the total number of graphics cards in the computing platform and the number of graphics cards corresponding to each large inference model.

[0246] The second graphics card resource allocation module 404 is used to allocate graphics card resources to each training fine-tuning large model according to the training fine-tuning priority and the number of remaining graphics cards of each training fine-tuning large model, wherein the training fine-tuning large model is a large model that performs training fine-tuning tasks.

[0247] In the technical solution provided by the embodiment of the present invention, the predicted amount of graphics card resources for the inference model is determined based on the predicted access traffic corresponding to the inference model, thereby determining the number of graphics cards in the computing platform that can provide the predicted graphics card resources. The predicted access traffic is predicted based on a traffic influencing factor that affects the traffic flow of the inference model performing inference tasks. Thus, traffic prediction based on the traffic influencing factor can obtain a more accurate predicted access traffic for the inference model, thereby more accurately determining the predicted amount of graphics card resources for the inference model, and then reasonably allocating graphics card resources to the inference model based on the predicted graphics card resources.

[0248] In addition, graphics card resource allocation is prioritized for large inference models. After allocating graphics card resources to the large inference model, graphics card resources are then allocated from the remaining graphics cards on the computing platform to the large training and fine-tuning models. This prioritizes the graphics card resource needs of the large inference model, ensuring the effectiveness of the large inference model in executing inference tasks, and improving the user experience of using the large inference model. Furthermore, the amount of graphics card resources occupied by the large inference model is adjusted based on the predicted traffic flow, allowing the large inference model and the large training and fine-tuning model to dynamically adjust their occupied graphics card resources based on the data processing pressure of the large inference model, more rationally allocating graphics card resources on the computing platform to each large model.

[0249] In one embodiment of the present invention, graphics card resources include: video memory resources, graphics card computing resources and memory bandwidth resources. The first graphics card resource allocation module is specifically used to: determine the number of first graphics cards that can provide video memory resources in the predicted graphics card resources based on the amount of video memory resources in the determined resource amount; determine the number of second graphics cards that can provide graphics card computing resources in the predicted graphics card resources based on the amount of graphics card computing resources in the determined resource amount; determine the number of third graphics cards that can provide memory bandwidth resources in the predicted graphics card resources based on the amount of memory bandwidth resources in the determined resource amount; and determine the maximum value among the first number of graphics cards, the second number of graphics cards and the third number of graphics cards as the number of graphics cards that can provide the predicted graphics card resources.

[0250] In this way, priority is given to ensuring that the number of graphics cards allocated to the large inference model can meet the graphics card resources required by the large inference model, ensuring the effectiveness of the large inference model in executing inference tasks, and improving the user experience of using the large inference model.

[0251] In one embodiment of the present invention, the correspondence between the amount of graphics card resources and the access traffic corresponding to each large inference model is obtained in the following manner: for each historical time period in a first number of historical time periods, a historical data pair corresponding to the large inference model in the historical time period is obtained, wherein the historical data pair includes: historical access traffic and the amount of graphics card resources used; using the obtained historical data pairs, a linear regression equation with access traffic as the independent variable is established; the coefficients of the linear regression equation are calculated to obtain the correspondence between the amount of graphics card resources and the access traffic corresponding to the large inference model.

[0252] In this way, based on the historical access traffic and the amount of graphics card resources used in the historical time period, a linear regression equation of access traffic and graphics card resources is constructed. Based on the predicted access traffic, the predicted amount of graphics card resources can be accurately obtained from the linear regression equation of the graphics card resources and access traffic corresponding to the inference large model. The predicted amount of graphics card resources of the inference large model can be further accurately determined, and then the graphics card resources can be reasonably allocated to the inference large model based on the predicted graphics card resources.

[0253] In one embodiment of the present invention, the second graphics card resource allocation module is specifically used to: calculate the product of the resource coefficient corresponding to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, and determine the number of graphics cards that can provide computing resources for each training fine-tuning large model to perform training fine-tuning tasks based on the product result; and allocate graphics card resources to each training fine-tuning large model based on the number of graphics cards corresponding to each training fine-tuning large model.

[0254] In this way, graphics card resources can be allocated more reasonably for training and fine-tuning large models according to priority, ensuring the normal execution of more important training and fine-tuning tasks, and thus more reasonably allocating graphics card resources in the computing platform.

[0255] In one embodiment of the present invention, the access traffic is predicted in the following manner: feature extraction is performed on the traffic influencing factors of each historical time period to obtain the influencing factor features of each historical time period, wherein each historical time period includes a second number of consecutive time periods before the time period to which the access traffic is predicted; feature extraction is performed on the traffic influencing factors of the second number of consecutive historical time periods before the time period to which the access traffic is predicted to belong to obtain the influencing factor features of each historical time period; forward semantic parsing is performed on the influencing factor features of each historical time period in chronological order from front to back to obtain the hidden semantic features of each historical time period, wherein semantic parsing for a historical time period includes: according to the hidden semantic features corresponding to the adjacent time periods of the historical time period, respectively obtaining the forgetting features, information updating features, candidate retention features and information output features corresponding to the influencing factor features of the historical time period, and based on the adjacent time periods The retention features, forgetting features, information update features and candidate retention features of the segment are used to determine the retention features of the historical time period. The features that need to be output in the retention features are determined according to the information output features as the hidden semantic features of the historical time period. In the case of forward semantic parsing, the adjacent time periods are: the preceding adjacent time periods, and in the case of backward semantic parsing, the adjacent time periods are: the subsequent adjacent time periods. The hidden semantic features of each historical time period obtained by the forward semantic parsing are weighted and fused to obtain the forward hidden semantic features. The influencing factor features of each historical time period are subjected to backward semantic parsing in chronological order from back to front to obtain the hidden semantic features of each historical time period. The hidden semantic features of each historical time period obtained by the backward semantic parsing are weighted and fused to obtain the backward hidden semantic features. The access traffic is predicted based on the forward hidden semantic features and the backward hidden semantic features.

[0256] As can be seen from the above, in the process of forward and backward semantic parsing, the features that need to be forgotten from the retained features of the previous adjacent time period and the features that need to be updated in the historical time period are determined based on the retained features and hidden semantic features of the adjacent time periods of the historical time period. The retained features of the historical time period thus obtained retain the features that are related to each time period. The output hidden semantic features can be combined, and semantic parsing can be performed separately in the order from front to back and from back to front in time. For each historical time period, the features corresponding to the previous and subsequent time periods can be combined. In this way, the hidden semantic features obtained are more accurate, and the predicted access traffic obtained is more accurate, and the graphics card resources can be allocated more reasonably based on the predicted access traffic.

[0257] In one embodiment of the present invention, the traffic influencing factors include: at least one of the degree of change of the transaction index in the historical time period, news information documents, company announcement information, access traffic of each large inference model, and access time.

[0258] It can be seen that traffic influencing factors include changes in transaction index, news information documents, company announcement information, access time and other angles to predict access traffic. It can consider the impact of different factors on access traffic, so that more accurate prediction of access traffic can be obtained.

[0259] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501 , a communication interface 502 , a memory 503 and a communication bus 504 , wherein the processor 501 , the communication interface 502 and the memory 503 communicate with each other via the communication bus 504 .

[0260] Memory 503, used for storing computer programs;

[0261] The processor 501 is configured to implement the graphics card resource allocation method in any of the above embodiments when executing the program stored in the memory 503 .

[0262] The communication bus mentioned in the electronic devices mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into address buses, data buses, control buses, etc. For ease of illustration, only a single thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.

[0263] The communication interface is used for communication between the above electronic device and other devices.

[0264] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.

[0265] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0266] In another embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned graphics card resource allocation methods are implemented.

[0267] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes any graphics card resource allocation method in the above embodiments.

[0268] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disk, hard disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid-state disk (SSD)).

[0269] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0270] Each embodiment in this specification is described in a related 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 device, electronic device, storage medium, and computer program product embodiments are generally similar to the method embodiments, so their descriptions are relatively simple. For related portions, reference can be made to the descriptions of the method embodiments.

[0271] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.

Claims

1. A graphics card resource allocation method, It is characterized in that The method comprises: Obtaining the predicted access traffic of each inference big model, wherein the predicted access traffic is obtained based on the traffic impact factor in the historical time period, and the traffic impact factor is a factor that affects the traffic of the inference big model performing the inference task, and the inference big model is a big model that performs the inference task; For each large inference model, according to the corresponding relationship between the graphics card resource amount and the access traffic corresponding to the large inference model, determine the resource amount of the predicted graphics card resources required by the large inference model to process the corresponding predicted access traffic, obtain the number of graphics cards that can provide the predicted graphics card resources according to the determined resource amount, and allocate graphics card resources to the large inference model based on the obtained number of graphics cards; Determine the number of remaining graphics cards based on the total number of graphics cards on the computing platform and the number of graphics cards corresponding to each large inference model; Allocate graphics card resources to each training fine-tuning large model according to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, wherein the training fine-tuning large model is a large model that performs the training fine-tuning task; The graphics card resources include: graphics memory resources, graphics card computing resources and memory bandwidth resources. The step of obtaining the number of graphics cards capable of providing the predicted graphics card resources according to the determined resource amount includes: Determine the number of first graphics cards that can provide the graphics card resources in the predicted graphics card resources according to the amount of graphics card memory resources in the determined amount of resources; Determine the number of second graphics cards that can provide the graphics card computing resources in the predicted graphics card resources according to the graphics card computing resources in the determined resource amount; Determine the number of third graphics cards that can provide the memory bandwidth resources in the predicted graphics card resources according to the memory bandwidth resource amount in the determined resource amount; A maximum value among the first number of graphics cards, the second number of graphics cards, and the third number of graphics cards is determined as the number of graphics cards that can provide the predicted graphics card resources.

2. The method according to claim 1, It is characterized in that The corresponding relationship between the amount of graphics card resources and access traffic corresponding to each large inference model is obtained in the following way: For each historical time period in the first number of historical time periods, a historical data pair corresponding to the inference large model in the historical time period is obtained, wherein the historical data pair includes: historical access traffic and the amount of graphics card resources used; Using the obtained historical data pairs, a linear regression equation with access traffic as the independent variable is established; The coefficients of the linear regression equation are calculated to obtain the corresponding relationship between the graphics card resource amount and the access traffic corresponding to the large inference model.

3. The method according to claim 1, It is characterized in that The allocating graphics card resources to each training fine-tuning large model according to the training fine-tuning priority of each training fine-tuning large model and the remaining number of graphics cards includes: Calculate the product of the resource coefficient corresponding to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, and determine the number of graphics cards that can provide computing resources for each training fine-tuning large model to perform training fine-tuning tasks based on the product result; Based on the number of graphics cards corresponding to each training and fine-tuning large model, graphics card resources are allocated to each training and fine-tuning large model.

4. The method according to any one of claims 1 to 3, It is characterized in that The predicted access traffic is predicted as follows: Extracting features of the traffic influencing factors of each historical time period to obtain features of the influencing factors of each historical time period, wherein each historical time period includes a second number of consecutive time periods before the time period to which the predicted access traffic belongs; Performing forward semantic parsing processing on the influencing factor features of each historical time period in order from front to back in time, and obtaining the hidden semantic features of each historical time period, wherein the semantic parsing processing for a historical time period includes: obtaining the forgotten features, information update features, candidate retained features and information output features corresponding to the influencing factor features of the historical time period according to the hidden semantic features corresponding to the adjacent time periods of the historical time period, and determining the retained features of the historical time period based on the retained features of the adjacent time periods, the forgotten features, the information update features and the candidate retained features, and determining the features to be output in the retained features according to the information output features as the hidden semantic features of the historical time period, in the case of forward semantic parsing processing, the adjacent time period is: the preceding adjacent time period, and in the case of backward semantic parsing processing, the adjacent time period is: the succeeding adjacent time period; The hidden semantic features of each historical time period obtained by the forward semantic analysis are weighted and fused to obtain the forward hidden semantic features; Perform backward semantic analysis on the influencing factor features of each historical time period in order from back to front in time, and obtain the hidden semantic features of each historical time period; The hidden semantic features of each historical time period obtained by the backward semantic analysis are weighted and fused to obtain the backward hidden semantic features; The predicted access traffic is predicted based on the forward hidden semantic features and the backward hidden semantic features.

5. The method according to any one of claims 1 to 3, It is characterized in that The traffic influencing factors include: at least one of the degree of change of the transaction index in the historical time period, news information documents, company announcement information, access traffic of each large inference model, and access time.

6. A graphics card resource allocation device, It is characterized in that The device comprises: A traffic acquisition module, used to obtain the predicted access traffic of each inference big model, wherein the predicted access traffic is obtained based on the traffic impact factor in the historical time period, and the traffic impact factor is a factor that affects the traffic of the inference big model performing the inference task, and the inference big model is a big model performing the inference task; A first graphics card resource allocation module is used to determine, for each inference large model, the amount of predicted graphics card resources required by the inference large model to process the corresponding predicted access traffic according to the corresponding relationship between the amount of graphics card resources corresponding to the inference large model and the access traffic, obtain the number of graphics cards that can provide the predicted graphics card resources according to the determined amount of resources, and allocate graphics card resources to the inference large model based on the obtained number of graphics cards; A module for determining the number of remaining graphics cards, used to determine the number of remaining graphics cards based on the total number of graphics cards on the computing platform and the number of graphics cards corresponding to each large inference model; A second graphics card resource allocation module is used to allocate graphics card resources to each training fine-tuning large model according to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, wherein the training fine-tuning large model is a large model that performs a training fine-tuning task; The graphics card resources include: video memory resources, graphics card computing resources and memory bandwidth resources. The first graphics card resource allocation module is specifically used to: determine the number of first graphics cards that can provide the video memory resources in the predicted graphics card resources according to the amount of video memory resources in the determined resource amount; determine the number of second graphics cards that can provide the graphics card computing resources in the predicted graphics card resources according to the amount of graphics card computing resources in the determined resource amount; determine the number of third graphics cards that can provide the memory bandwidth resources in the predicted graphics card resources according to the amount of memory bandwidth resources in the determined resource amount; and determine the maximum value among the first number of graphics cards, the second number of graphics cards and the third number of graphics cards as the number of graphics cards that can provide the predicted graphics card resources.

7. The device according to claim 6, It is characterized in that The corresponding relationship between the amount of graphics card resources and the access traffic corresponding to each large inference model is obtained in the following manner: for each historical time period in the first number of historical time periods, a historical data pair corresponding to the large inference model in the historical time period is obtained, wherein the historical data pair includes: historical access traffic and the amount of graphics card resources used; using the obtained historical data pair, a linear regression equation with the access traffic as an independent variable is established; calculating the coefficient of the linear regression equation, and obtaining the corresponding relationship between the amount of graphics card resources and the access traffic corresponding to the large inference model; and / or The second graphics card resource allocation module is specifically used to: calculate the product of the resource coefficient corresponding to the training fine-tuning priority of each training fine-tuning large model and the number of remaining graphics cards, and determine the number of graphics cards that can provide computing resources for each training fine-tuning large model to perform training fine-tuning tasks based on the product result; allocate graphics card resources to each training fine-tuning large model based on the number of graphics cards corresponding to each training fine-tuning large model; and / or The predicted access traffic is predicted in the following manner: feature extraction is performed on the traffic influencing factors of each historical time period to obtain the influencing factor features of each historical time period, wherein each historical time period includes a second number of consecutive time periods before the time period to which the predicted access traffic belongs; feature extraction is performed on the traffic influencing factors of the second number of consecutive historical time periods before the time period to which the predicted access traffic belongs to obtain the influencing factor features of each historical time period; forward semantic parsing is performed on the influencing factor features of each historical time period in chronological order from front to back to obtain the hidden semantic features of each historical time period, wherein semantic parsing for a historical time period includes: according to the hidden semantic features corresponding to the adjacent time periods of the historical time period, respectively obtaining the forgetting features, information updating features, candidate retention features and information output features corresponding to the influencing factor features of the historical time period, and based on the retention features of the adjacent time periods, the candidate retention features and information output features of the adjacent time periods The forgotten features, information update features and candidate retention features are used to determine the retention features of the historical time period. The features to be output in the retention features are determined according to the information output features as the hidden semantic features of the historical time period. In the case of forward semantic parsing, the adjacent time period is: the preceding adjacent time period, and in the case of backward semantic parsing, the adjacent time period is: the following adjacent time period; the hidden semantic features of each historical time period obtained by the forward semantic parsing are weighted and fused to obtain the forward hidden semantic features; the influencing factor features of each historical time period are sequentially subjected to backward semantic parsing in order from back to front in time to obtain the hidden semantic features of each historical time period; the hidden semantic features of each historical time period obtained by the backward semantic parsing are weighted and fused to obtain the backward hidden semantic features; based on the forward hidden semantic features and the backward hidden semantic features, the predicted access traffic is predicted; and / or The traffic influencing factors include: at least one of the degree of change of the transaction index in the historical time period, news information documents, company announcement information, access traffic of each large inference model, and access time.

8. An electronic device, It is characterized in that It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-5 when executing a program stored in a memory.

9. A computer-readable storage medium, It is characterized in that The computer-readable 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 5 is implemented.