Gradient updating method and device, equipment, medium and program product

By storing sparse parameters and their gradients into the buffer and merging and deduplication, the gradient update of sparse parameters in the click-through rate estimation model is achieved, solving the problem of inapplicable dense parameter methods in the existing technology, and improving training efficiency .

CN119168007APending Publication Date: 2024-12-20BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310736094.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

When training the click-through rate estimation model, the existing deep learning framework cannot effectively support the gradient accumulation of sparse parameters, resulting in the inability to apply to gradient updates of sparse parameters.

Method used

A gradient update method is proposed. By storing sparse parameters and their gradients into preset buffers, merging and deduplication are performed after reaching the preset storage threshold, the gradient update of sparse parameters is realized.

Benefits of technology

The gradient update of sparse parameters in the click-through rate estimate model is realized, and the problem that dense parameter methods in the existing technology are not suitable for sparse parameters is solved, which improves the efficiency and flexibility of model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119168007A_ABST
    Figure CN119168007A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a gradient updating method and device, equipment, a medium and a program product. A specific embodiment of the method comprises the following steps: for parameters in a click rate prediction model, determining a gradient corresponding to the parameters according to an actual click rate corresponding to a training sample group used in a current training round and a sample click rate contained in the training sample group; in response to the fact that the parameters are determined to be sparse parameters, the parameters and gradients corresponding to the parameters are stored in a preset buffer area, and the number of storage times is updated; in response to determining that the number of times of storage is equal to a preset threshold value of the number of times of storage, combining a plurality of gradients in the gradient buffer area to obtain a combined gradient group, and de-duplicating a plurality of parameters in the parameter buffer area to obtain a de-duplicated parameter group; and updating the gradient according to the combined gradient group, the deduplication parameter group and a preset storage frequency threshold. The implementation mode is related to artificial intelligence, and gradient updating of the sparse parameters in the click rate prediction model is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a gradient updating method, apparatus, device, medium, and program product. Background Art

[0002] Deep neural networks have been widely used in business scenarios such as search, advertising, and recommendation. In these scenarios, the click-through rate prediction model is the most typical. As the amount of model data continues to increase, in order to ensure the timeliness of the model and reduce the cost of training, model training acceleration is imminent. Related deep learning frameworks, such as PyTorch and TensorFlow, can use gradient accumulation to train deep neural networks to reduce the occupation of video memory.

[0003] However, the inventors have found that when the above method is used for model training, the following technical problems often occur:

[0004] First, the parameter types of the click-through rate prediction model include dense parameters and sparse parameters. For sparse parameters, both the remote parameter server architecture and the local parameter server architecture do not support the implementation of gradient accumulation.

[0005] Second, unlike dense parameters, sparse parameters are variable-length data and are stored in partitioned storage, with each node (Worker) storing only part of the data. These differences make the gradient accumulation method for dense parameters inapplicable to sparse parameters.

[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the inventive concept and therefore it may contain information that does not form the prior art that is already known in this country to a person of ordinary skill in the art. Summary of the invention

[0007] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0008] Some embodiments of the present disclosure propose gradient updating methods, devices, equipment, computer-readable media, and program products to solve one or more of the technical problems mentioned in the above background technology section.

[0009] In a first aspect, some embodiments of the present disclosure provide a gradient updating method, which includes: for parameters in a click-through rate prediction model, determining the gradient corresponding to the parameter based on the actual click-through rate corresponding to the training sample group used in the current training round and the sample click-through rate contained in the training sample group; in response to determining that the parameter is a sparse parameter, storing the parameter and the gradient corresponding to the parameter in a pre-set buffer, respectively, the buffer including a gradient buffer and a parameter buffer, and updating the number of storage times; in response to determining that the number of storage times is equal to a preset storage number threshold, merging multiple gradients in the gradient buffer to obtain a merged gradient group, and deduplicating multiple parameters in the parameter buffer to obtain a deduplicated parameter group; updating the gradient based on the merged gradient group, the deduplicated parameter group and the preset storage number threshold.

[0010] In a second aspect, some embodiments of the present disclosure provide a gradient updating device, the device comprising: a determination unit, configured to determine, for a parameter in a click-through rate prediction model, a gradient corresponding to the parameter according to the actual click-through rate corresponding to the training sample group used in the current training round and the click-through rate of samples contained in the training sample group; a storage unit, configured to, in response to determining that the parameter is a sparse parameter, store the parameter and the gradient corresponding to the parameter in a pre-set buffer, respectively, the buffer comprising a gradient buffer and a parameter buffer, and update the number of storage times; a deduplication merging unit, configured to, in response to determining that the number of storage times is equal to a preset storage number threshold, merge multiple gradients in the gradient buffer to obtain a merged gradient group, and deduplicate multiple parameters in the parameter buffer to obtain a deduplication parameter group; an updating unit, configured to update the gradient according to the merged gradient group, the deduplication parameter group and the preset storage number threshold.

[0011] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0012] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0013] In a fifth aspect, some embodiments of the present disclosure provide a computer program product, including a computer program, which implements the method described in any implementation manner of the above-mentioned first aspect when executed by a processor.

[0014] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: the gradient update of sparse parameters in the click-through rate prediction model is realized. Specifically, the relevant gradient update method is limited to the gradient update of dense parameters, and the method of gradient update for dense parameters is not applicable to sparse parameters. Based on this, the gradient update method of some embodiments of the present disclosure, combined with the characteristics of sparse parameters, stores the gradients and parameters in the gradient buffer and the parameter buffer respectively, and stores them multiple times until the preset storage threshold is reached. In this process, the data stored multiple times are spliced ​​in the buffer. Afterwards, de-duplication and merging are performed to finally realize the gradient update for the sparse parameters. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0016] Figure 1 It is a flow chart of updating the gradient of the click rate prediction model in the prior art;

[0017] Figure 2 is a flow chart of some embodiments of the gradient updating method according to the present disclosure;

[0018] Figure 3 An exemplary schematic diagram showing merging multiple gradients to obtain a merged gradient group and removing duplicates from multiple parameters to obtain a deduplicated parameter group is shown;

[0019] Figure 4 is a flowchart of some other embodiments of the gradient updating method according to the present disclosure;

[0020] Figure 5 is a schematic diagram of the structure of some embodiments of the gradient updating device according to the present disclosure;

[0021] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0022] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0023] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0024] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0025] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0026] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0027] With regard to the collection, storage, and use of user personal information involved in this disclosure, before performing the corresponding operations, the relevant organizations or individuals shall fulfill their obligations, including conducting personal information security impact assessments, fulfilling the obligation to inform the personal information subject, and obtaining the authorization and consent of the personal information subject in advance, as well as complying with the provisions of relevant laws and regulations.

[0028] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0029] In order to better illustrate the present disclosure, Figure 1 This is a flow chart for updating the gradient of the click rate prediction model in the prior art.

[0030] like Figure 1 As shown in the figure, for each training round, the current parameter value is first read. Then, a small portion of sample data (mini-batch) is randomly obtained. The size of the randomly obtained data is related to the batch size. On this basis, the predicted value is obtained through forward propagation, and then the predicted value is back-propagated to determine the gradient of the parameter. Then the parameter calculation and parameter update are performed, and finally the training is terminated by judging whether the training target or the number of training times has been reached. The training stage of gradient accumulation change is Figure 1 The parameters shown in the dashed box are calculated and the gradients are updated.

[0031] Continue to refer Figure 2 , shows a process 200 of some embodiments of the gradient updating method according to the present disclosure. The gradient updating method comprises the following steps:

[0032] Step 201 : For parameters in a click-through rate prediction model, the gradients corresponding to the parameters are determined according to the actual click-through rates corresponding to the training sample group used in the current training round and the click-through rates of samples included in the training sample group.

[0033] In some embodiments, the parameters in the click-through rate prediction model include but are not limited to weights, step sizes, intermediate values, and the like. Parameter types include dense parameters and sparse parameters. The execution body of the gradient update method can first determine the actual click-through rate and sample click-through rate corresponding to the training sample group (mini-batch) used in the current training round. Among them, the training samples in the training sample group include sample feature data and sample click-through rates corresponding to the sample feature data. By inputting the sample feature data into the above-mentioned click-through rate prediction model, the actual click-through rate can be obtained. On this basis, the gradient corresponding to each parameter can be calculated by back propagation.

[0034] Step 202, in response to determining that the parameter is a sparse parameter, the parameter and the gradient corresponding to the parameter are respectively stored in a pre-set buffer, the buffer including a gradient buffer and a parameter buffer, and an update storage number.

[0035] In some embodiments, the above-mentioned execution entity can determine whether the parameter is a sparse parameter. Among them, the sparse parameter is the parameter corresponding to the sparse feature in the click-through rate prediction model. For example, if the user clicks "X City" in the "City List", if there are 200 cities to choose from in the "City List", then the behavior of clicking "X City" can be expressed as [1,0,0,0,0,0,0,0,…], where the dimensions are 200, 1 represents selection, and 0 represents unselection. At this time, [1,0,0,0,0,0,0,0,…] is a sparse feature.

[0036] In some embodiments, in response to determining that the parameter is a sparse parameter, the execution entity may append the gradient to the gradient buffer and append the parameter to the parameter buffer. On this basis, the storage times are updated, for example, the storage times are increased by 1. It can be understood that step 202 can be repeatedly executed, and each time step 202 is executed, the storage times are updated, that is, they are increased by 1 based on the last update. Therefore, the storage times can represent the cumulative number of steps.

[0037] In some optional implementations of some embodiments, before step 203, the method further includes: applying for a buffer for storing parameters and gradients corresponding to the parameters, wherein the initial storage space of the buffer is obtained according to the storage space required by the parameters and the expansion factor. For example, the initial storage space can be obtained by multiplying twice the storage space required by the current parameters by the expansion factor.

[0038] Step 203 , in response to determining that the number of storage times is equal to a preset storage times threshold, multiple gradients in the gradient buffer are merged to obtain a merged gradient group, and multiple parameters in the parameter buffer are deduplicated to obtain a deduplicated parameter group.

[0039] In some embodiments, in response to determining that the number of storage times reaches a preset storage times threshold (i.e., a preset cumulative number of steps), the execution entity may merge multiple gradients in the gradient buffer to obtain a merged gradient group, and deduplicate multiple parameters in the parameter buffer to obtain a deduplicated parameter group. Figure 3 As shown, an exemplary schematic diagram of merging multiple gradients to obtain a merged gradient group and deduplicating multiple parameters to obtain a deduplicated parameter group is shown. Among them, [123, 789, 123, 456] are 4 parameters, that is, 4 keys. The gradients corresponding to the 4 parameters are [grad1, grad2, grad3, grad4]. The 4 parameters and the 4 gradients are one-to-one corresponding, that is, 123 corresponds to grad1, 789 corresponds to grad2, 123 corresponds to grad3, and 456 corresponds to grad4.

[0040] As an example, for two or more repeated parameters, only one is retained, and the remaining repeated parameters are deleted to obtain a deduplicated parameter group. Also, two or more gradients with the same corresponding parameters are added together to obtain a merged gradient group.

[0041] In some optional implementations of some embodiments, merging multiple gradients in a gradient buffer to obtain a merged gradient group, and deduplicating multiple parameters in a parameter buffer to obtain a deduplicated parameter group, includes the following steps:

[0042] Step 1: Sort multiple gradients and multiple parameters respectively to obtain gradient sequences and parameter sequences. Figure 3 As shown, for example, the parameter values ​​are sorted in ascending order, and the parameter sequence obtained after sorting is [123, 123, 456, 789], and the corresponding gradient sequence is [grad1, grad3, grad4, grad2].

[0043] Step 2: For each parameter in the parameter sequence, generate the index corresponding to the parameter. The same parameters have the same index.

[0044] like Figure 3 As shown, the index sequence corresponding to the parameter sequence is [0,0,1,2].

[0045] Step 3: Merge multiple gradients with the same corresponding index in the gradient sequence to obtain a merged gradient group.

[0046] like Figure 3As shown in the figure, since the indexes corresponding to grad1 and grad3 are both 0, the two gradients are merged to obtain a merged gradient group [grad1+grad3,grad4,grad2].

[0047] Step 4: Remove duplicate parameters with the same corresponding index in the parameter sequence to obtain a duplicate-free parameter group. Figure 3 As shown, the deduplication parameter group after deduplication is [123,456,789].

[0048] Step 204: update the gradient according to the merged gradient group, the deduplication parameter group and the preset storage times threshold.

[0049] In some embodiments, the execution entity may divide the gradient in the merged gradient group by a preset storage times threshold to obtain an averaged gradient, and replace the original gradient with the averaged gradient to update the gradient.

[0050] The method provided by some embodiments of the present disclosure combines the characteristics of sparse parameters, stores the gradient and parameters in the gradient buffer and the parameter buffer respectively, and stores them multiple times until a preset storage threshold is reached. In this process, the data stored multiple times are spliced ​​in the buffer. After that, de-duplication and merging are performed, and finally the gradient of the sparse parameter is updated.

[0051] Further references Figure 4 , which shows a process 400 of another embodiment of the gradient updating method. The process 400 of the gradient updating method includes the following steps:

[0052] Step 401 : For parameters in a click-through rate prediction model, the gradient corresponding to the parameters is determined according to the actual click-through rate corresponding to the training sample group used in the current training round and the click-through rate of samples included in the training sample group.

[0053] In some embodiments, the specific implementation of step 401 and the technical effects thereof can be referred to in Figure 2 The corresponding embodiments will not be described in detail here.

[0054] Step 402, in response to determining that the parameter is a sparse parameter, the parameter and the gradient corresponding to the parameter are stored in a pre-set buffer, the buffer including a gradient buffer and a parameter buffer, and an update storage number.

[0055] In some embodiments, step 402 further includes the following steps 4021-4024:

[0056] Step 4021, in response to determining that the parameter is a sparse parameter, and determining whether the storage space required by the parameter is less than or equal to the remaining storage space of the buffer.

[0057] Step 4022, in response to determining that the storage space required for the parameter is less than or equal to the remaining storage space of the buffer, the parameter and the gradient corresponding to the parameter are respectively stored in a pre-set buffer, the buffer including a gradient buffer and a parameter buffer, and the storage times are updated.

[0058] Step 4023, in response to determining that the storage space required by the parameter is greater than the remaining storage space of the buffer, the buffer is expanded to obtain an expanded buffer.

[0059] In some embodiments, capacity expansion can be performed through the following steps: applying for temporary space corresponding to the buffer; copying data in the buffer to the temporary space; increasing the storage space of the buffer by a target value to obtain an expanded buffer, wherein the target value is obtained based on the storage space required by the parameters and the expansion factor; and copying data in the temporary space to the expanded buffer.

[0060] Step 4024, storing the parameters and the gradients corresponding to the parameters in the expanded buffer respectively, and updating the storage times.

[0061] Step 403 , in response to determining that the number of storage times is equal to a preset storage times threshold, multiple gradients in the gradient buffer are merged to obtain a merged gradient group, and multiple parameters in the parameter buffer are deduplicated to obtain a deduplicated parameter group.

[0062] Step 404: update the gradient according to the merged gradient group, the deduplication parameter group and the preset storage times threshold.

[0063] from Figure 4 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 4 In the corresponding process 400 of the gradient updating method in some embodiments, the buffer is expanded according to the storage space required by the parameters, thereby realizing flexible expansion of the buffer.

[0064] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a gradient updating device. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0065] like Figure 5As shown, the gradient updating device 500 of some embodiments includes: a determination unit 501, configured to determine the gradient corresponding to the parameter in the click-through rate prediction model according to the actual click-through rate corresponding to the training sample group used in the current training round and the sample click-through rate contained in the training sample group; a storage unit 502, configured to store the parameter and the gradient corresponding to the parameter in a pre-set buffer respectively in response to determining that the parameter is a sparse parameter, the buffer including a gradient buffer and a parameter buffer, and update the storage times; a deduplication merging unit 503, configured to merge multiple gradients in the gradient buffer to obtain a merged gradient group and deduplicate multiple parameters in the parameter buffer to obtain a deduplication parameter group in response to determining that the storage times are equal to a preset storage times threshold; an updating unit 504, configured to update the gradient according to the merged gradient group, the deduplication parameter group and the preset storage times threshold.

[0066] In some optional implementations of some embodiments, the deduplication and merging unit 503 is further configured to: sort multiple gradients and multiple parameters respectively to obtain a gradient sequence and a parameter sequence; for each parameter in the parameter sequence, generate an index corresponding to the parameter, and the same parameters have the same index; merge multiple gradients with the same corresponding index in the gradient sequence to obtain a merged gradient group; deduplicate parameters with the same corresponding index in the parameter sequence to obtain a deduplication parameter group.

[0067] In some optional implementations of some embodiments, the storage unit 502 is further configured to: in response to determining that a parameter is a sparse parameter, and determining whether the storage space required for the parameter is less than or equal to the remaining storage space of the buffer; in response to determining that the storage space required for the parameter is less than or equal to the remaining storage space of the buffer, store the parameter and the gradient corresponding to the parameter in a pre-set buffer, the buffer including a gradient buffer and a parameter buffer, and update the storage times.

[0068] In some optional implementations of some embodiments, the storage unit 502 is further configured to: in response to determining that the storage space required for the parameters is greater than the remaining storage space of the buffer, expand the buffer to obtain an expanded buffer; store the parameters and the gradients corresponding to the parameters in the expanded buffer, respectively, and update the number of storage times.

[0069] In some optional implementations of some embodiments, the storage unit 502 is further configured to: apply for a temporary space corresponding to the buffer; copy the data in the buffer to the temporary space; increase the storage space of the buffer by a target value to obtain an expanded buffer, wherein the target value is obtained based on the storage space required by the parameters and the expansion factor; copy the data in the temporary space to the expanded buffer.

[0070] In some optional implementations of some embodiments, the device 500 also includes: an application unit, configured to apply for a buffer for storing parameters and gradients corresponding to the parameters, and the initial storage space of the buffer is obtained based on the storage space required by the parameters and the expansion factor.

[0071] It is understood that the units described in the device 500 are similar to those described in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0072] Reference below Figure 6 , which shows a structural schematic diagram of an electronic device 600 suitable for implementing some embodiments of the present disclosure. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0073] like Figure 6 As shown, the electronic device 600 may include a processing device 601 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0074] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0075] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0076] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0077] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0078] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: for the parameters in the click-through rate prediction model, according to the actual click-through rate corresponding to the training sample group used in the current training round and the sample click-through rate contained in the training sample group, the gradient corresponding to the parameter is determined; in response to determining that the parameter is a sparse parameter, the parameter and the gradient corresponding to the parameter are respectively stored in a pre-set buffer, the buffer includes a gradient buffer and a parameter buffer, and the number of storage updates; in response to determining that the number of storages is equal to a preset storage number threshold, multiple gradients in the gradient buffer are merged to obtain a merged gradient group, and multiple parameters in the parameter buffer are deduplicated to obtain a deduplicated parameter group; the gradient is updated according to the merged gradient group, the deduplicated parameter group and the preset storage number threshold.

[0079] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0080] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0081] The units described in some embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, for example, may be described as: a processor including a determination unit, a storage unit, a deduplication and merging unit, and an update unit. The names of these units do not, in some cases, constitute limitations on the units themselves, for example, the determination unit may also be described as a "gradient determination unit".

[0082] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0083] Some embodiments of the present disclosure further provide a computer program product, including a computer program, which implements any of the above-mentioned gradient updating methods when executed by a processor.

[0084] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A gradient updating method, comprising: For parameters in the click-through rate prediction model, the gradient corresponding to the parameter is determined according to the actual click-through rate corresponding to the training sample group used in the current training round and the click-through rate of samples included in the training sample group; In response to determining that the parameter is a sparse parameter, the parameter and the gradient corresponding to the parameter are stored in a preset buffer respectively, the buffer including a gradient buffer and a parameter buffer, and a storage update count; In response to determining that the number of storage times is equal to a preset storage times threshold, merging multiple gradients in the gradient buffer to obtain a merged gradient group, and deduplicating multiple parameters in the parameter buffer to obtain a deduplicated parameter group; The gradient is updated according to the merged gradient group, the deduplication parameter group and the preset storage times threshold.

2. The method according to claim 1, wherein: The merging of the multiple gradients in the gradient buffer to obtain a merged gradient group, and the deduplication of the multiple parameters in the parameter buffer to obtain a deduplication parameter group, include: sorting the plurality of gradients and the plurality of parameters respectively to obtain a gradient sequence and a parameter sequence; For each parameter in the parameter sequence, generate an index corresponding to the parameter, where the same parameters have the same indexes; Merging multiple gradients with the same corresponding index in the gradient sequence to obtain the merged gradient group; Parameters with the same corresponding indexes in the parameter sequence are deduplicated to obtain the deduplicated parameter group.

3. The method according to claim 1, wherein: In response to determining that the parameter is a sparse parameter, the parameter and the gradient corresponding to the parameter are stored in a preset buffer respectively, the buffer including a gradient buffer and a parameter buffer, and the number of storage updates includes: In response to determining that the parameter is a sparse parameter, and determining whether a storage space required by the parameter is less than or equal to a remaining storage space of the buffer; In response to determining that the storage space required for the parameter is less than or equal to the remaining storage space of the buffer, the parameter and the gradient corresponding to the parameter are respectively stored in a pre-set buffer, the buffer including a gradient buffer and a parameter buffer, and a storage update count.

4. The method according to claim 3, wherein: In response to determining that the parameter is a sparse parameter, the parameter and the gradient corresponding to the parameter are stored in a preset buffer respectively, the buffer including a gradient buffer and a parameter buffer, and the number of storage updates, and further including: In response to determining that the storage space required by the parameter is greater than the remaining storage space of the buffer, expanding the buffer to obtain an expanded buffer; The parameters and the gradients corresponding to the parameters are respectively stored in the expanded buffer, and the number of storage times is updated.

5. The method according to claim 4, wherein: The step of expanding the buffer to obtain an expanded buffer includes: Apply for temporary space corresponding to the buffer zone; Copying the data in the buffer to the temporary space; Increasing the storage space of the buffer by a target value to obtain an expanded buffer, wherein the target value is obtained based on the storage space required by the parameter and the expansion factor; The data in the temporary space is copied to the expanded buffer.

6. The method according to claim 1, wherein: Before storing the parameters and the gradients corresponding to the parameters in a preset buffer respectively, the method further includes: A buffer for storing the parameter and the gradient corresponding to the parameter is applied for, wherein the initial storage space of the buffer is obtained according to the storage space required by the parameter and the expansion factor.

7. A gradient updating device, comprising: A determination unit configured to determine, for a parameter in a click-through rate prediction model, a gradient corresponding to the parameter according to an actual click-through rate corresponding to a training sample group used in a current training round and a click-through rate of samples included in the training sample group; A storage unit, configured to, in response to determining that the parameter is a sparse parameter, store the parameter and the gradient corresponding to the parameter in a preset buffer, the buffer including a gradient buffer and a parameter buffer, and update the storage times; a deduplication merging unit, configured to, in response to determining that the number of storage times is equal to a preset storage times threshold, merge multiple gradients in the gradient buffer to obtain a merged gradient group, and deduplication multiple parameters in the parameter buffer to obtain a deduplication parameter group; An updating unit is configured to update the gradient according to the merged gradient group, the deduplication parameter group and the preset storage times threshold.

8. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • DeepSpeed-based gradient unloading optimization method and device and storage medium

    CN120144304A