Accelerators for cluster computing
By introducing an accelerator for clustering calculation in the information processing system, the coordinated work of the arbitration module, data handling module and distance calculation module is solved, and the problem of large amount of calculations in the information processing system is improved, and data search is improved Speed and processing efficiency.
Patent Information
- Application Number
- CN202210095018.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-08-30
- Filing Date
- 2019-09-17
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2039-09-17
AI Technical Summary
In the prior art, the information processing system has a large amount of calculation when querying FTL tables, resulting in slow data search speed.
Provides an accelerator for clustering calculation, including an arbitration module, a data handling module and a distance calculation module. The request is sent through the arbitration module. The data handling module moves keywords and index values from the DDR to the distance calculation module, and the distance calculation module performs distance calculation. To obtain the minimum index value or feature value, improve query efficiency.
Significantly improves data search speed, reduces processor computing burden, reduces processing latency and improves data throughput.
Smart Images

Figure CN114461861B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to storage technology, and in particular, to an accelerator for cluster computing, and using the accelerator to implement read (Get) and put (write) operations. Background Art
[0002] Figure 1A The block diagram of the solid-state storage device is shown. The solid-state storage device 102 is coupled to the host to provide storage capacity for the host. The host and the solid-state storage device 102 can be coupled in a variety of ways, including but not limited to connecting the host and the solid-state storage device 102 through, for example, SATA (Serial Advanced Technology Attachment), SCSI (Small Computer System Interface), SAS (Serial Attached SCSI), IDE (Integrated Drive Electronics), USB (Universal Serial Bus), PCIE (Peripheral Component Interconnect Express, PCIe), NVMe (NVM Express), Ethernet, Fiber Channel, wireless communication network, etc. The host is an information processing device that can communicate with the storage device in the above manner, for example, a personal computer, a tablet computer, a server, a portable computer, a network switch, a router, a cellular phone, a personal digital assistant, etc. The storage device 102 includes an interface 103 , a control component 104 , one or more NVM chips 105 , and a DRAM (Dynamic Random Access Memory) 110 .
[0003] NAND flash memory, phase change memory, FeRAM (Ferroelectric RAM), MRAM (Magnetic Random Access Memory), RRAM (Resistive Random Access Memory), XPoint memory, etc. are common NVMs.
[0004] The interface 103 may be adapted to exchange data with the host via, for example, SATA, IDE, USB, PCIE, NVMe, SAS, Ethernet, Fibre Channel, etc.
[0005] The control component 104 is used to control data transmission between the interface 103, the NVM chip 105 and the DRAM 110, and is also used for storage management, mapping of host logical addresses to flash physical addresses, erase leveling, bad block management, etc. The control component 104 can be implemented in a variety of ways, such as software, hardware, firmware, or a combination thereof. For example, the control component 104 can be in the form of an FPGA (Field-programmable gate array), an ASIC (Application Specific Integrated Circuit), or a combination thereof. The control component 104 can also include a processor or a controller, in which software is executed to manipulate the hardware of the control component 104 to process IO (Input / Output) commands. The control component 104 can also be coupled to the DRAM 110 and can access the data of the DRAM 110. The data of the FTL table and / or cached IO commands can be stored in the DRAM.
[0006] The control component 104 includes a flash memory interface controller (or medium interface controller, flash memory channel controller), which is coupled to the NVM chip 105 and issues commands to the NVM chip 105 in a manner that complies with the interface protocol of the NVM chip 105 to operate the NVM chip 105, and receives command execution results output from the NVM chip 105. Known NVM chip interface protocols include "Toggle", "ONFI" and the like.
[0007] In the storage device, FTL (Flash Translation Layer) is used to maintain the mapping information from the logical address to the physical address. The logical address constitutes the storage space of the solid-state storage device perceived by the upper-layer software such as the operating system. The physical address is the address used to access the physical storage module of the solid-state storage device. In the related art, the address mapping can also be implemented using the intermediate address form. For example, the logical address is mapped to the intermediate address, and then the intermediate address is further mapped to the physical address. In these cases, the read / write command received by the storage device indicates the logical address.
[0008] The table structure that stores the mapping information from logical addresses to physical addresses is called an FTL table. The FTL table is an important metadata in a solid-state storage device. Usually, the entries in the FTL table record the address mapping relationship in units of data pages in the storage device.
[0009] Some storage devices' FTLs are provided by the host to which the storage device is coupled, with the host's memory storing the FTL table and the host's CPU executing software to provide the FTL. Other storage management devices provided by some storage management devices between the host and the storage device provide the FTL. In these cases, the read / write commands received by the storage device indicate physical addresses.
[0010] A storage device that supports the Key-Value (key-data, also referred to as "KV") storage model provides key-based read operations (Get(Key)) and write operations (Put(Key,Value)). To perform a write operation, the host provides the key (Key) and data (Value) to the storage device to write the data to the storage device, and uses the key as the index of the written data. To perform a read operation, the host provides the key to the storage device, the storage device finds the data based on the key, and provides the data to the host. Therefore, in a KV storage system, the key is an index used to access data, and the data (Value) is the data being accessed. Generally, the length of the key and the data is not fixed. And optionally, in order to reduce complexity, the length of the key and / or the data may have a specified range.
[0011] In Chinese patent applications with application numbers 201711392529.2, 201711474660.3, 201810332295.0, 201810286955.6 and 201810286986.1, a KV storage device or a distributed storage system utilizing a KV storage device is provided.
[0012] Figure 1B A schematic diagram of an address translation system of a KV storage device of the prior art is shown. The address translation system (also referred to as an FTL table) of the KV storage device provides a mapping from a keyword (K, also referred to as a key) to a logical address or a physical address (e.g., PPA, Physical Page Address). In response to obtaining a keyword (K), the FTL table is queried using the keyword (K) as an index to obtain a corresponding logical address or physical address.
[0013] Since the information processing system needs to store a large amount of data, each query of the FTL table based on a keyword requires a large amount of calculation, resulting in a slow data search speed. Summary of the invention
[0014] The embodiments of the present application provide an accelerator for clustering calculations to solve the technical problem of slow data search speed in the information processing system in the prior art.
[0015] According to a first aspect of the present application, a first accelerator for clustering computing according to the first aspect of the present application is provided, comprising an arbitration module, a data handling module and a distance calculation module, wherein the arbitration module sends a second request to the data handling module according to a received first request, the first request carries a keyword, or the first request carries the keyword and a first index value corresponding to the keyword, the first request is a read request or a write request, and the second request is a data move request; when the first request carries the keyword, the data handling module moves the keyword and X index values from the DDR to the distance calculation module according to the second request, where X is an integer greater than or equal to 2; the distance calculation module performs distance calculation on the keyword according to the X index values to obtain the first index value, and the first index value is the index value with the smallest distance from the keyword among the X index values.
[0016] According to the first accelerator for clustering computing according to the first aspect of the present application, a second accelerator for clustering computing according to the first aspect of the present application is provided, wherein when the first request carries the keyword and the first index value, the data handling module moves the keyword and N eigenvalues corresponding to the first index value from the DDR to the distance calculation module according to the second request; the distance calculation module performs distance calculation on the keyword according to the N eigenvalues to obtain M first eigenvalues with the smallest distance to the keyword from the N eigenvalues, wherein both N and M are integers greater than or equal to 1, and M is less than or equal to N.
[0017] According to the first or second accelerator for clustering computing according to the first aspect of the present application, a third accelerator for clustering computing according to the first aspect of the present application is provided, wherein the accelerator further includes a normalization module, and before the distance calculation module receives the keyword and the X index values, the normalization module performs a normalization operation on the keyword and the X index values, and sends the normalized keyword and the X index values to the distance calculation module.
[0018] According to the second or third accelerator for clustering computing according to the first aspect of the present application, a fourth accelerator for clustering computing according to the first aspect of the present application is provided, wherein when the first request carries the keyword and the first index value, the distance calculation module calculates the distance between each of the N eigenvalues and the keyword to obtain N first distances; the distance calculation module sorts the N first distances in ascending order of value to obtain a sorted distance queue; the distance calculation module selects the M first eigenvalues from the distance queue.
[0019] According to one of the second to fourth accelerators for cluster computing according to the first aspect of the present application, there is provided a fifth accelerator for cluster computing according to the first aspect of the present application, wherein M is less than or equal to 256.
[0020] According to the fourth accelerator for cluster computing according to the first aspect of the present application, a sixth accelerator for cluster computing according to the first aspect of the present application is provided, wherein the distance calculation module uses insertion sort to sort the N first distances, and the queue length of the distance queue is maintained at 256 items during the sorting process.
[0021] According to one of the first to sixth accelerators for clustering calculation according to the first aspect of the present application, a seventh accelerator for clustering calculation according to the first aspect of the present application is provided, wherein when the distance calculation module performs distance calculation on the keyword, the distance calculation module calculates the distance between each index value in the X index values and the keyword to obtain X second distances; the distance calculation module compares the sizes of any two second distances in the X second distances, and determines that the index value of the smallest second distance in the X index values is the first index value.
[0022] According to one of the first to seventh accelerators for clustering computing according to the first aspect of the present application, an eighth accelerator for clustering computing according to the first aspect of the present application is provided, wherein the distance calculation module includes Y computing units, the keyword includes Z groups of values, both Y and Z are integers greater than or equal to 1, and Z is less than or equal to Y, and the distance calculation module uses the Y computing units to simultaneously perform distance calculation on the Z group of values according to the X index values to obtain the index value corresponding to each value in the Z group of values.
[0023] According to one of the first to eighth accelerators for clustering computing according to the first aspect of the present application, a ninth accelerator for clustering computing according to the first aspect of the present application is provided, wherein the accelerator also includes a result processing module, and after the distance calculation module obtains the calculation result, the result processing module sends the calculation result to the DDR.
[0024] According to one of the first to ninth accelerators for cluster computing according to the first aspect of the present application, there is provided a tenth accelerator for cluster computing according to the first aspect of the present application, wherein the X index values are preconfigured.
[0025] According to one of the first to tenth accelerators for cluster computing according to the first aspect of the present application, an eleventh accelerator for cluster computing according to the first aspect of the present application is provided, wherein the arbitration module provides multiple channels to the firmware, and the arbitration module adopts a polling scheduling arbitration method to receive requests sent by the firmware to the multiple channels.
[0026] According to the eleventh accelerator for cluster computing according to the first aspect of the present application, there is provided a twelfth accelerator for cluster computing according to the first aspect of the present application, wherein the arbitration module uses a weighted round-robin arbitration method to process requests sent by the firmware to the multiple channels.
[0027] According to one of the first to eleventh accelerators for cluster computing according to the first aspect of the present application, there is provided a thirteenth accelerator for cluster computing according to the first aspect of the present application, wherein the first request also indicates a channel used by the accelerator to process the first request, and the arbitration module instructs at least one computing unit of the distance calculation module to process the first request according to the channel indicated by the first request.
[0028] According to the twelfth accelerator for cluster computing according to the first aspect of the present application, there is provided a fourteenth accelerator for cluster computing according to the first aspect of the present application, wherein the arbitration module assigns a computing unit identifier to each of the multiple first messages, and the computing unit identifier is used to indicate that the first computing unit in the distance calculation module processes the first message carrying the first computing unit identifier, and the first computing unit identifier corresponds to the first computing unit.
[0029] According to one of the fourteenth accelerators for cluster computing according to the first aspect of the present application, there is provided a fifteenth accelerator for cluster computing according to the first aspect of the present application, wherein, after the distance calculation module completes processing of the multiple first messages, the arbitration module instructs the distance calculation module to process the first messages waiting in the multiple channels.
[0030] According to the fourteenth or fifteenth accelerator for cluster computing of the first aspect of the present application, there is provided a sixteenth accelerator for cluster computing according to the first aspect of the present application, wherein, if the distance calculation module has not completed processing the multiple first messages, even if the number of the multiple first messages is less than the number of computing units in the distance calculation module and there are idle computing units in the distance calculation module, the arbitration module does not instruct the distance calculation module to process the messages in the multiple channels.
[0031] According to one of the first to sixteenth accelerators for clustering computing according to the first aspect of the present application, a seventeenth accelerator for clustering computing according to the first aspect of the present application is provided, wherein the arbitration module aggregates multiple first messages and instructs at least one computing unit of the distance calculation module to process the aggregated multiple first messages in parallel.
[0032] According to one of the first to seventeenth accelerators for cluster computing according to the first aspect of the present application, an eighteenth accelerator for cluster computing according to the first aspect of the present application is provided, wherein the distance calculation module also includes Y management units, each management unit is coupled to one of the Y computing units, the arbitration module assigns a computing unit identifier to the Z group of values when sending the second request, each management unit obtains a value whose computing unit identifier is the same as its own from the Z group of values, and each management unit sends the obtained value to the computing unit coupled to itself.
[0033] According to the second aspect of the present application, a first information processing system according to the second aspect of the present application is provided, comprising a host, an accelerator, a mapping manager, a processor and a solid-state drive, wherein the host generates and sends a first request to the processor according to an interface function, the first request comprising a read request and a write request, the first request carrying a keyword, or the first request carrying the keyword and a first index value corresponding to the keyword; the processor generates a second request according to the first request, the second request comprising one or more of a clustering request, a search request, an address allocation request, an address acquisition request and a storage device access request; the processor uses the second request to operate at least one of the accelerator, the mapping manager and the solid-state drive to complete the processing of one or more of the second requests, so as to obtain the processing result of the first request and return it to the host.
[0034] According to the first information processing system of the second aspect of the present application, a second information processing system according to the second aspect of the present application is provided, wherein, when the first request is a write request and the first request carries the keyword and the first index value, the processor generates the address allocation request and the access request to the storage device; or, when the first request is a write request and the first request carries the keyword, the processor generates the clustering request, the address allocation request and the access request to the storage device.
[0035] According to the first or second information processing system of the second aspect of the present application, a third information processing system according to the second aspect of the present application is provided, wherein, when the first request is a read request and the first request carries the keyword and the first index value, the processor generates the address acquisition request, the storage device access request and the search request; or, when the first request is a read request and the first request carries the keyword, the processor generates the clustering request, the address acquisition request, the storage device access request and the search request; or, when the first request is a read index request (Get_Index) and the first request carries the keyword, the processor only generates the clustering request.
[0036] According to the first or second information processing system of the second aspect of the present application, a fourth information processing system according to the second aspect of the present application is provided, wherein, if the second request generated by the processor includes the address allocation request and the access request to the storage device, the processor sends the address allocation request to the mapping manager and obtains the storage address provided by the mapping manager; the processor sends the access request to the storage device carrying the storage address to the solid-state drive to instruct the solid-state drive to save the data associated with the keyword according to the storage address.
[0037] According to the first or second information processing system of the second aspect of the present application, a fifth information processing system according to the second aspect of the present application is provided, wherein, if the second request generated by the processor includes the clustering request, the address allocation request and the access request, the processor sends the clustering request to the accelerator and obtains the first index value returned by the accelerator; the processor sends the address allocation request carrying the obtained first index value and / or the keyword to the mapping manager, and obtains the storage address allocated by the mapping manager to the keyword according to the first index value; the processor sends an access request to the storage device carrying the storage address to the solid-state drive to instruct the solid-state drive to save the data associated with the keyword according to the storage address.
[0038] According to the first or third information processing system of the second aspect of the present application, a sixth information processing system according to the second aspect of the present application is provided, wherein, if the second request generated by the processor only includes the clustering request, the processor sends the clustering request to the accelerator and obtains the first index value returned by the accelerator; and the processor returns the first index value to the host as the processing result of the first request.
[0039] According to the first or third information processing system of the second aspect of the present application, a seventh information processing system according to the second aspect of the present application is provided, wherein if the second request generated by the processor includes the address acquisition request, the access request and the search request, the processor sends the address acquisition request carrying the acquired first index value to the mapping manager, and obtains at least one storage address of at least one feature value corresponding to the first index value returned by the mapping manager; the processor uses the at least one storage address to access the solid-state drive and obtains the at least one feature value returned by the solid-state drive; the processor sends the search request indicating the keyword and the at least one feature value to the accelerator to obtain at least one first feature value corresponding to the keyword screened from the at least one feature value by the accelerator, and returns the at least one first feature value to the processor, the first feature value being a feature value whose distance from the keyword is less than a preset threshold or the at least one first feature value being M feature values with the smallest distance from the keyword among the at least one feature value, and the M being greater than or equal to 1; the processor returns the at least one first feature value to the host as the processing result of the first request.
[0040] According to the first or third information processing system of the second aspect of the present application, an eighth information processing system according to the second aspect of the present application is provided, wherein if the second request generated by the processor includes the clustering request, the address acquisition request, the access request and the search request, the processor sends the clustering request to the accelerator and obtains the first index value returned by the accelerator; the processor sends the address acquisition request carrying the obtained first index value to the mapping manager, and obtains the at least one storage address of at least one feature value corresponding to the first index value returned by the mapping manager; the processor accesses the solid-state drive with the at least one storage address to obtain the at least one feature value returned by the solid-state drive; the processor sends the search request indicating the keyword and the at least one feature value to the accelerator, and obtains the at least one first feature value returned by the accelerator, the first feature value is a feature value whose distance from the keyword is less than a preset threshold or the at least one first feature value is M feature values with the smallest distance from the keyword among the at least one feature value, and M is greater than or equal to 1; the processor returns the at least one first feature value to the host as the processing result of the first request.
[0041] According to one of the first to second information and fourth to fifth information processing systems of the second aspect of the present application, a ninth information processing system according to the second aspect of the present application is provided, wherein the processor indicates to the host that processing of the first request is completed in response to receiving completion information representing completion of storage of the keyword from the solid-state drive.
[0042] According to one of the first to ninth information processing systems of the second aspect of the present application, a tenth information processing system according to the second aspect of the present application is provided, wherein the interface function carries the type of request, the keyword and at least one of the first index value.
[0043] According to one of the first to tenth information processing systems of the second aspect of the present application, an eleventh information processing system according to the second aspect of the present application is provided, wherein, if the second request generated by the processor includes at least two requests among the clustering request, the search request, the address allocation request, the address acquisition request and the access request, the processor generates the at least two requests at one time according to the first request; or, the processor generates the at least two requests in multiple times according to the first request.
[0044] According to the eleventh information processing system of the second aspect of the present application, there is provided a twelfth information processing system according to the second aspect of the present application, wherein, if the second request generated by the processor includes the clustering request, the address allocation request and the access request, the processor generates the clustering request according to the first request, and sends the clustering request to the accelerator; in response to the clustering request, the accelerator determines a first index value corresponding to the keyword, and returns the first index value to the processor; after the processor receives the first index value, it generates the address allocation request according to the first request and the first index value, and sends the address allocation request to the mapping manager; in response to the address allocation request, the mapping manager allocates a storage address for the keyword according to the first index value, and returns the storage address to the processor, and the storage address is used to access the solid-state hard disk; after the processor receives the storage address, it generates an access request for the solid-state hard disk according to the first request and the storage address, and sends the access request for the solid-state hard disk to the solid-state hard disk; in response to the access request of the solid-state hard disk, the solid-state hard disk saves the keyword according to the storage address.
[0045] According to a third aspect of the present application, a first host according to the third aspect of the present application is provided, comprising an application module, an API interface module, a management module, an acceleration drive module, a mapping drive module and a hard disk drive module, wherein the application module calls an API provided by the API interface module; the management module sends a drive request to at least one of the acceleration drive module, the mapping drive module and the hard disk drive module according to the called API; if the drive request is received, the acceleration drive module operates the accelerator coupled to itself and returns a first operation result to the management module; if the drive request is received, the mapping drive module operates the mapping manager coupled to itself and returns a second operation result to the management module; if the drive request is received, the hard disk drive module operates the solid-state hard disk coupled to itself and returns a third operation result to the management module; after the management module receives the first operation result, the second operation result or the third operation result, the management module returns information indicating that the called API call is completed to the application module through the API interface module.
[0046] According to the first host of the third aspect of the present application, a second host according to the third aspect of the present application is provided, wherein the first operation result indicates a first index value corresponding to a keyword, and the keyword is the keyword provided by the application calling the API; the second operation result indicates access to one or more storage addresses of the solid-state drive; the third operation result indicates that the solid-state drive has processed the completion of the write operation to the one or more addresses, or the first feature value read from the solid-state drive, the first feature value is a feature value whose distance from the keyword is less than a preset threshold or the at least one first feature value is the M feature values with the smallest distance from the keyword among the at least one feature value, and M is greater than or equal to 1.
[0047] According to the fourth aspect of the present application, a first information processing method according to the fourth aspect of the present application is provided, including: in response to receiving a first request indicating a keyword (Key), generating one or more second requests, the second request including one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and a storage device access request; based on the processing results of the one or more second requests, generating a processing result of the first request.
[0048] According to the first information processing method of the fourth aspect of the present application, a second information processing method according to the fourth aspect of the present application is provided, further comprising: the clustering request indicates obtaining the index value closest to the keyword among the X index values, where X is a positive integer; the search request indicates obtaining the M feature values closest to the keyword among the N feature values, where M and N are positive integers; the address allocation request indicates obtaining one or more storage addresses corresponding to the keyword and / or the first index value; the address acquisition request indicates obtaining one or more storage addresses corresponding to the keyword that store the X index values; the storage device access request indicates the storage device accesses the one or more storage addresses.
[0049] According to the first or second information processing method of the fourth aspect of the present application, a third information processing method according to the fourth aspect of the present application is provided, which also includes: if the first request is a request indicating a keyword generated by calling the Get(Key) API, a clustering request is generated according to the keyword, an address acquisition request is generated using the index value returned by the clustering request, an access request to the storage device is generated according to the storage address returned by the address acquisition request, a search request is generated according to the X index values returned by the access request to the storage device, and the M feature values returned by the search request are used as the processing result of the first request.
[0050] According to one of the first to third information processing methods of the fourth aspect of the present application, a fourth information processing method according to the fourth aspect of the present application is provided, further comprising: if the first request is a request indicating a keyword and an index value generated by calling a Get_With_Index(Key, Index) API, an address acquisition request is generated according to the index value, an access request to the storage device is generated according to the storage address returned by the address acquisition request, a search request is generated according to the X index values returned by the access request to the storage device, and the M feature values returned by the search request are used as the processing result of the first request.
[0051] According to one of the first to fourth information processing methods of the fourth aspect of the present application, a fifth information processing method according to the fourth aspect of the present application is provided, further including: if the first request is a request indicating a keyword generated by calling the Get_Index(Key) API, a clustering request is generated according to the keyword, and the index value returned by the clustering request is used as the processing result of the first request.
[0052] According to one of the first to fifth information processing methods of the fourth aspect of the present application, a sixth information processing method according to the fourth aspect of the present application is provided, which also includes: if the first request is a request indicating a keyword generated by calling the Put (Key) API, a clustering request is generated according to the keyword, an address allocation request is generated using the index value returned by the clustering request and the keyword, and an access request to the storage device is generated according to the storage address returned by the address allocation request to write data corresponding to the keyword to the storage device.
[0053] According to one of the first to fifth information processing methods of the fourth aspect of the present application, a seventh information processing method according to the fourth aspect of the present application is provided, further comprising: if the first request is a request indicating a keyword and an index value generated by calling a Put_With_Index(Key, Index) API, an address allocation request is generated based on the index value and the keyword, and an access request to the storage device is generated based on the storage address returned by the address allocation request to write data corresponding to the keyword into the storage device.
[0054] According to the fifth aspect of the present application, a first information processing system according to the fifth aspect of the present application is provided, including: a first module, used to generate one or more second requests in response to receiving a first request indicating a keyword (Key), the second request including one or more of a clustering request, a search request, an address allocation request, an address acquisition request and a storage device access request; a second module, used to generate a processing result of the first request based on the processing results of the one or more second requests.
[0055] According to the sixth aspect of the present application, a first information processing system according to the sixth aspect of the present application is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the program: in response to receiving a first request indicating a keyword (Key), generating one or more second requests, the second request comprising one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and a storage device access request; and generating a processing result of the first request based on the processing results of the one or more second requests.
[0056] According to a seventh aspect of the present application, a first information processing system according to the seventh aspect of the present application is provided, comprising a host, an accelerator, a mapping manager and a storage device, wherein the accelerator, the mapping manager and the storage device are each coupled to the host; the host generates a second request according to the first request, the second request comprising one or more of a clustering request, a search request, an address allocation request, an address acquisition request and a storage device access request; the host uses the second request to operate at least one of the accelerator, the mapping manager and the solid-state drive to complete the processing of one or more of the second requests to obtain the processing result of the first request.
[0057] According to the first information processing system of the seventh aspect of the present application, a second information processing system according to the seventh aspect of the present application is provided, wherein the application of the host generates a first request; the management program of the host generates a second request according to the first request; the first request includes a read request or a write request, the first request carries a keyword, or the first request carries the keyword and an index value corresponding to the keyword.
[0058] According to the first or second information processing system of the seventh aspect of the present application, a third information processing system of the seventh aspect of the present application is provided, wherein, if the first request is a request carrying a keyword and a first index value generated by calling Put_With_Index(Key, Index) API, the host generates the address allocation request and the access request to the storage device; or, if the first request is a write request carrying a key generated by calling Put(Key) API, the host generates the clustering request, the address allocation request and the access request to the storage device.
[0059] According to one of the first to third information processing systems of the seventh aspect of the present application, a fourth information processing system of the seventh aspect of the present application is provided, wherein, if the first request is a read request carrying a keyword and an index value generated by calling Get_With_Index(Key, Index) API, the host generates the address acquisition request, the storage device access request and the search request; or, if the first request is a read request carrying a keyword generated by calling Get(Key) API, the host generates the clustering request, the address acquisition request, the storage device access request and the search request; or, if the first request is a read request generated by calling Get_Index() API, the processor only generates the clustering request.
[0060] According to one of the first to third information processing systems of the seventh aspect of the present application, a fifth information processing system of the seventh aspect of the present application is provided, wherein, if the second request generated by the host includes the address allocation request and the access request to the storage device, the host sends the address allocation request to the mapping manager and obtains the storage address provided by the mapping manager; the host sends an access request to the storage device carrying the storage address to the solid-state drive to instruct the solid-state drive to save the data associated with the keyword according to the storage address.
[0061] According to one of the first to third information processing systems of the seventh aspect of the present application, a sixth information processing system of the seventh aspect of the present application is provided, wherein, if the second request generated by the host includes the clustering request, the address allocation request and the access request, the host sends the clustering request to the accelerator and obtains the first index value returned by the accelerator; the host sends the address allocation request carrying the obtained first index value and / or the keyword to the mapping manager, and obtains the storage address allocated by the mapping manager to the keyword according to the first index value; the host sends an access request to the storage device carrying the storage address to the solid-state drive to instruct the solid-state drive to save the data associated with the keyword according to the storage address.
[0062] According to the first or fourth information processing system of the seventh aspect of the present application, a seventh information processing system of the seventh aspect of the present application is provided, wherein, if the second request generated by the host only includes the clustering request, the host sends the clustering request to the accelerator and obtains the first index value returned by the accelerator; and the host uses the first index value as the processing result of the first request.
[0063] According to the first or fourth information processing system of the seventh aspect of the present application, an eighth information processing system of the seventh aspect of the present application is provided, wherein, if the second request generated by the host includes the address acquisition request, the access request and the search request, the host sends the address acquisition request carrying the acquired first index value to the mapping manager, and obtains at least one storage address of at least one feature value corresponding to the first index value returned by the mapping manager; the host uses the at least one storage address to access the solid-state drive, and obtains the at least one feature value returned by the solid-state drive; the host sends the search request indicating the keyword and the at least one feature value to the accelerator, so as to obtain the at least one first feature value corresponding to the keyword screened by the accelerator from the at least one feature value, and returns the at least one first feature value to the processor, the first feature value being a feature value whose distance from the keyword is less than a preset threshold or the at least one first feature value being M feature values with the smallest distance from the keyword among the at least one feature value, and the M being greater than or equal to 1; the host uses the at least one first feature value as the processing result of the first request.
[0064] According to the first or fourth information processing system of the seventh aspect of the present application, a ninth information processing system of the seventh aspect of the present application is provided, wherein if the second request generated by the host includes the clustering request, the address acquisition request, the access request and the search request, the host sends the clustering request to the accelerator and obtains the first index value returned by the accelerator; the host sends the address acquisition request carrying the obtained first index value to the mapping manager, and obtains the at least one storage address of at least one feature value corresponding to the first index value returned by the mapping manager; the host uses the at least one storage address to access the solid-state drive to obtain the at least one feature value returned by the solid-state drive; the host sends the search request indicating the keyword and the at least one feature value to the accelerator, and obtains the at least one first feature value returned by the accelerator, the first feature value is a feature value whose distance from the keyword is less than a preset threshold or the at least one first feature value is M feature values with the smallest distance from the keyword among the at least one feature value, and M is greater than or equal to 1; the host uses the at least one first feature value as the processing result of the first request.
[0065] According to one of the first to third and fifth to sixth information processing systems of the seventh aspect of the present application, a tenth information processing system of the seventh aspect of the present application is provided, wherein the host recognizes that the processing of the first request is completed in response to receiving completion information from the solid-state drive for characterizing the completion of storage of the keyword.
[0066] According to one of the first to tenth information processing systems of the seventh aspect of the present application, an eleventh information processing system of the seventh aspect of the present application is provided, wherein the interface function carries the type of request, the keyword and at least one of the first index value.
[0067] According to one of the first to eleventh information processing systems of the seventh aspect of the present application, a twelfth information processing system of the seventh aspect of the present application is provided, wherein if the second request generated by the host includes at least two requests of the clustering request, the search request, the address allocation request, the address acquisition request and the access request, the host generates the at least two requests at one time according to the first request; or, the host generates the at least two requests in multiple times according to the first request.
[0068] According to the twelfth information processing system of the seventh aspect of the present application, there is provided a thirteenth information processing system of the seventh aspect of the present application, wherein, if the second request generated by the host includes the clustering request, the address allocation request and the access request, the host generates the clustering request according to the first request, and sends the clustering request to the accelerator; in response to the clustering request, the accelerator determines a first index value corresponding to the keyword, and returns the first index value to the host; after the host receives the first index value, it generates the address allocation request according to the first request and the first index value, and sends the address allocation request to the mapping manager; in response to the address allocation request, the mapping manager allocates a storage address for the keyword according to the first index value, and returns the storage address to the host, wherein the storage address is used to access the solid state drive; after the host receives the storage address, it generates an access request for the solid state drive according to the first request and the storage address, and sends the access request for the solid state drive to the solid state drive; in response to the access request of the solid state drive, the solid state drive saves the keyword according to the storage address.
[0069] According to the eighth aspect of the present application, a first information processing method according to the eighth aspect of the present application is provided, including: generating a second request based on a first request, the second request including one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and an access request to a storage device; using the second request to operate at least one of the accelerator, the mapping manager, and the solid-state drive to complete processing of one or more of the second requests to obtain a processing result of the first request.
[0070] According to the ninth aspect of the present application, a first information processing system according to the ninth aspect of the present application is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the program: generating a second request according to a first request, wherein the second request comprises one or more of a clustering request, a search request, an address allocation request, an address acquisition request, and a storage device access request; using the second request to operate at least one of the accelerator, the mapping manager, and the solid-state drive to complete processing of one or more of the second requests to obtain a processing result of the first request.
[0071] The management and driving of the accelerator, mapping manager and solid-state hard disk in the present application are implemented by the processor, thereby reducing the interaction between the host and the processor and improving the processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0073] Figure 1A A block diagram of a storage device in the prior art;
[0074] Figure 1B There is a schematic diagram of an FTL table in the prior art;
[0075] Figure 2 A schematic diagram of the structure of an accelerator for cluster computing provided in an embodiment of the present application;
[0076] Figure 3 A schematic diagram of the structure of a distance calculation module provided in an embodiment of the present application;
[0077] Figure 4 A schematic diagram of the result processing module merging calculation results provided in an embodiment of the present application;
[0078] Figure 5A A schematic diagram of the structure of an information processing system provided in an embodiment of the present application;
[0079] Figures 5B-5F A schematic diagram of the process flow of the information processing system provided in the embodiment of the present application;
[0080] Figure 6 It is shown that a host 600 is provided according to yet another embodiment of the present application. DETAILED DESCRIPTION
[0081] The following clearly and completely describes the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application.
[0082] As Figure 2 shown, Embodiment 1 of the present application provides an accelerator 200 for clustering calculation. The accelerator 200 is a hardware accelerator that provides functions such as clustering and searching. In the clustering function, the accelerator obtains a key value (Key) and a specified number of index values (Index), and gives the index value that is closest to the obtained key value. The index value represents multiple (e.g., X, where X is a positive integer) existing categories, and the index value output by the accelerator that is closest to the obtained key value is the index value with the smallest distance among the X distances obtained by comparing the key value with each of the X index values.
[0083] In the search function, the accelerator obtains a key value and a specified number (e.g., N, where N is a positive integer) of feature values (Vector), and gives M (M is a positive integer, M < N) feature values that are closest to the obtained key value. The N feature values belong to the same category and are associated with the same index value. Optionally, the N feature values are all the feature values of the specified category, and the accelerator finds M feature values that are closest to the obtained key value from all the feature values of the specified category. Similar to the clustering function, the accelerator obtains the degree of closeness between the key value and each feature value by calculating the distance.
[0084] The accelerator 200 includes an arbitration module 201, a data transfer module 202, and a distance calculation module 203.
[0085] An external unit using the accelerator 200 (e.g., a host, a processor running software or firmware, a user accessing the accelerator through a network, etc.) sends an acceleration request to the accelerator 200 and obtains the result of processing the acceleration request provided by the accelerator 200. The arbitration module 201 of the accelerator 200 sends a data transfer request to the data transfer module 202 according to the received acceleration request. As an example, the acceleration request indicating the clustering function carries a key value. In the clustering function, X index values also need to be obtained. For example, the arbitration module 201 of the accelerator knows the storage location of the X index values. Optionally, the external unit configures the accelerator 200 to indicate the X index values or their storage locations to the accelerator 200. Still optionally, the external unit also indicates that the storage location and / or quantity of the index values are updated, so that the arbitration module 201 can obtain the updated multiple or all index values.
[0086] As another example, an acceleration request indicating a search function carries a key value and an index value corresponding to the key value. In the search function, in addition to the key value and the index value corresponding to the key value, N feature values corresponding to the index value are also required. For example, the arbitration module 201 knows the storage location of the N feature values. For another example, the external unit configures the accelerator 200 to indicate the N feature values or their storage locations to the accelerator 200. For another example, the external unit also indicates to the accelerator 200 that the storage location and / or quantity of the N feature values are updated, so that the arbitration module 201 can obtain multiple or all of the updated feature values.
[0087] According to one embodiment, when the first request carries the key value, the data handling module 202 moves the key value and X index values from the double data rate synchronous dynamic random access memory (DDRSDRAM) to the distance calculation module 203 according to the second request, where X is an integer greater than or equal to 2; the distance calculation module 203 performs distance calculation on the key value according to the X index values to obtain a first index value, where the first index value is the index value with the smallest distance from the key value among the X index values.
[0088] It should be noted that the first request in the embodiment of the present application is sent by the host, and the first request is a read request or a write request. What the arbitration module 201 receives is not the first request sent by the host, but after the firmware receives the first request, it processes the first request or generates a new request based on the first request, such as a clustering request or a search request. A write request is, for example, an access to the accelerator generated by calling the Put(Key) or Put_With_Index(Key_Index) API (Application Programming Interface) function. A read request includes, for example, an access to the accelerator generated by calling Get(Key), GetIndex(Key) and Get_With_Index(Key_Index) API. Among them, the parameter Key of the API function is the key value, and the parameter Index represents the index value.
[0089] As an example, when the first request carries a key value and a first index value, the first request is an access request to the accelerator generated by Put_With_Index(Key_Index) or Get_With_Iindex(Key_Index); and when the first request carries a key value but does not carry a first index value, the first request is an access request to the accelerator generated by Put(Key), Get(Key) or GetIndex(Key). The first request is issued by the host and arrives at the accelerator 200 located at the hardware layer. As an example, the accelerator 200 receives a first request processed by the firmware layer, such as a clustering request or a search request, for example, the accelerator 200 receives a request that does not carry a key value and / or a first index value, but the request indicates the address of the key value and / or the first index value in a memory (e.g., a memory outside the accelerator 200 and coupled to the accelerator 200).
[0090] In the embodiment of the present application, the arbitration module 201 in the accelerator 200 is connected to the firmware and accepts access from the firmware. Optionally, the arbitration module 201 provides multiple channels to the firmware layer, and each channel logically processes acceleration requests independently and / or in parallel. Thus, from the firmware's point of view, the accelerator 200 provides multiple logical accelerators (one accelerator for each channel), and the acceleration request provided by the firmware to the accelerator 200 indicates the channel used.
[0091] The arbitration module 201 may receive the request sent by the firmware layer to the channel in the following manners, including:
[0092] Mode 1, the arbitration module 201 receives requests from each channel using a polling scheduling arbitration mode;
[0093] Mode 2, the arbitration module 201 receives requests from each channel using a weighted round-robin arbitration mode;
[0094] Mode 3: the arbitration module 201 receives requests from each channel in an arbitration manner according to a preset order.
[0095] The arbitration method of the arbitration module 201 is explained below by taking the case where the multiple channels are four channels as an example, wherein the four channels are channel 1, channel 2, channel 3 and channel 4 respectively.
[0096] For method 1, polling scheduling is implemented using the RoundRobin algorithm. The arbitration module 201 starts receiving requests from channel 1. If a request is received on channel 1 this time, the request is processed, and the next request is received from channel 2, the third time from channel 3, the fourth time from channel 4, and the fifth time back to channel 1.
[0097] For mode 2, weighted round-robin scheduling is implemented using the WeightedRoundRobin algorithm. At this time, the arbitration module 201 polls 4 channels, calculates the current weight of each channel in the 4 channels and the total weight of the 4 channels, and then selects the channel with the largest current weight among the 4 channels to receive the request. For example, the current weights of the 4 channels are: channel 1 has a weight of 1, channel 2 has a weight of 3, channel 3 has a weight of 2, and channel 4 has a weight of 4. Channel 4 with a weight of 4 is selected. After channel 4 is selected, the weights of the 4 channels change to: channel 1 has a weight of 1, channel 2 has a weight of 3, channel 3 has a weight of 2, and channel 4 has a weight of -6. The weights of the 4 channels before the next polling change to: channel 1 has a weight of 2, channel 2 has a weight of 6, channel 3 has a weight of 4, and channel 4 has a weight of -2.
[0098] For mode 3, the arbitration module 201 receives requests in a preset order, for example, the preset order is channel 3 → channel 1 → channel 4 → channel 2, and the arbitration module 201 first accesses channel 3. If there is no request waiting to be processed in channel 3, the arbitration module 201 continues to access channel 1. It should be noted that the arbitration module 201 starts accessing from channel 3 each time.
[0099] After receiving clustering requests or search requests from multiple channels, the arbitration module 201 sends a data transfer request to the data transfer module 202. The data transfer request instructs the data transfer module 202 to transfer data from the external memory to the distance calculation module 203.
[0100] Since the first request is Put(Key), Put_With_Index(Key, Index), GetIndex(Key), Get(Key) or Get_With-Iindex(Key_Index), etc., the arbitration module 201 receives a search request or a clustering request according to the first request. Therefore, the second request issued by the arbitration module 201 according to the search request or the clustering request also includes multiple situations, that is, the data to be transported is different according to the different instructions of the first request.
[0101] Table 1
[0102]
[0103]
[0104] As shown in Table 1, when the first request is Put(Key) or Get(Key), the data handling module 202 needs to carry the key value and X index values from the DDR, and when the first request is Get(Key) or GetWithIndex, the data handling module 202 needs to carry the key value and multiple feature values from the DDR. It should be noted that when the first request is Get(Key), the arbitration module 201 receives the clustering request and the search request twice, instead of receiving two requests at one time. It can be understood that the request does not indicate X index values, nor their storage locations. Instead, the arbitration module or the data moving module knows the X index values or their storage locations.
[0105] Here we explain the key value, index value (Index) and feature value (Vector). The information processing system has to process a variety of data. For example, videos, pictures, text files, etc. are unstructured data. Unstructured data is not easy to retrieve and use. In order to facilitate retrieval or use, unstructured data is structured. For example, tags are added to the original data to indicate the source, format, storage location, required access rights and other structured information of the original data. As another example, the content of the original data is analyzed, such as extracting, thumbnails, and summaries from videos or pictures, extracting objects such as portraits and cars, extracting facial features, height, gender, age and other features of people, and extracting features such as car brands and license plates. The tags, features, etc. associated with the original data are all structured information generated by structured processing. Structured information is easy to retrieve, and structured information is retrieved through databases or search engine technologies of existing technologies, or other search technologies that exist or will appear in the future.
[0106] One or more tags and / or features in structured information are used as keys, and the data associated with the structured information and / or the structured information itself is used as values, so that unstructured data can be recorded, accessed and retrieved through KV storage devices. The Chinese patent application with application number 2018102074169 and invention name "Method and device for generating keys and values of KV storage" provides a method for generating keys using machine learning components.
[0107] Using a machine learning component to process data such as a face picture will result in a feature value (also called a vector) associated with a specific face picture. A feature value is generated for each of the multiple pictures by the machine learning component. Compared to the data, the feature value has a smaller size, for example, 64 bytes to 4KB.
[0108] In the KV storage system, the input key value (key) is used to retrieve data (value). In order to facilitate retrieval and acquisition of data, in the embodiments of the present application, the key value, index value and eigenvalue are essentially indexes for data, that is, the key value, index value and eigenvalue can essentially be called eigenvalues, the difference is that the index value is pre-configured, the key value is input by the user into the host and carried in the first request, and the eigenvalue is calculated based on the data. Specifically, the form of the eigenvalue is different depending on the type of data to be stored in the information processing system. For example, the data to be stored is image data, and the eigenvalue is a vector obtained after image processing. The method of processing image data to obtain eigenvalues can be referred to the prior art and is not limited here.
[0109] When clustering multiple eigenvalues, multiple groups of eigenvalues are obtained. Each group includes one or more eigenvalues. Each group of eigenvalues is represented by an index value. For example, the central value (that is, the average value) obtained by averaging multiple eigenvalues belonging to the same group is used as the index value representing the group. On the contrary, the eigenvalue whose distance from the index value is less than a preset threshold can be regarded as the eigenvalue belonging to the group represented by the index value.
[0110] The distance between eigenvalues is the distance between vectors represented by the eigenvalues, and this distance includes Euclidean distance or cosine distance, etc. In one example, the index value is generated based on multiple eigenvalues; in another example, when there is no data at all in the information processing system using the accelerator 200, multiple index values can be preconfigured.
[0111] The second request carries the following information:
[0112] When the acceleration request is a clustering request, the second request carries the key value and the first physical address of the X index values, or the key value and a pointer for pointing to the first physical address; when the acceleration request is a search request, the second request carries the key value and N feature values, the key value and the second physical address of the N index values, or the key value and a pointer for pointing to the second physical address;
[0113] When the acceleration request is a clustering request or a search request, the second request also carries a physical address for storing the result output by the accelerator.
[0114] It should be noted that the key value involved in the embodiment of the present application can be a set of values, not just a single value. The first physical address and the second physical address are both addresses in the external memory, so that the data transfer module 202 can transfer the data in the external memory to the distance calculation module 203.
[0115] The data received by the distance calculation module 203 is different, and the distance calculation module 203 implements two functions, including a clustering function and a search function.
[0116] Specifically, when the first request carries the key value and the first index value, the data handling module 202 handles the key value and the N feature values to the distance calculation module 203, and the distance calculation module 203 implements the search function. At this time, the distance calculation module 203 performs distance calculation on the key value according to the N feature values to obtain the M feature values with the smallest distance from the key value from the N feature values, where N and M are both integers greater than or equal to 1, and M is less than or equal to N. It should be noted that these N feature values are all feature values in the category corresponding to the first index value.
[0117] Optionally, in order to obtain the minimum M first eigenvalues, the distance calculation module 203 calculates the distance between each of the N eigenvalues and the key value to obtain N first distances; the distance calculation module sorts the N first distances from small to large according to the values to obtain a sorted distance queue; the distance calculation module selects the first M first eigenvalues from the sorting results.
[0118] Taking N equal to 1000 as an example, the distance calculation module 203 performs 1000 distance calculations on the key value to obtain 1000 distances, and then sorts these 1000 distances from small to large to obtain a distance queue with a length of 1000, and then selects the M distances with the smallest values from the distance queue, and obtains the M first eigenvalues corresponding to these M distances.
[0119] In an optional embodiment, in order to reduce the cache resources required by the accelerator 200, when obtaining M first characteristic values, the length of the distance queue is pre-set to M, that is, the distance queue can only cache M first distances, and the distance calculation module 203 calculates the first distance each time, and inserts it into the distance queue with a queue length of M by insertion sorting, so that after all N distances are calculated, the M first distances with the smallest value can be directly obtained. The insertion sorting in the embodiment of the present application is to determine the position of the first distance in the distance queue by comparing the first distance and the first distance in the distance queue after calculating a first distance each time. For example, the first distance currently calculated is 0.8, the value of the first distance ranked third in the distance queue is 0.5, and the value of the first distance ranked fourth in the distance queue is 0.82, thereby determining that the position of the first distance currently calculated in the distance queue is the fourth, and the position of the first distance with a value of 0.82 in the distance queue needs to be postponed to the fifth. For another example, the currently calculated first distance is 10, and the value of the first distance ranked at the Mth position in the distance queue is 8.7. The currently calculated first distance value is too large and will not be placed in the distance queue.
[0120] In the embodiment of the present application, M is less than or equal to 256, and in an optional implementation, the value of M can be adjusted according to demand, such as 1024, 50, 128, etc. Optionally, when the N first distances are sorted by insertion sort, the queue length of the distance queue is always maintained at 256 items. It should be noted that, since N may be less than 256 or 256 first distances have not been calculated, there are empty items in the distance queue at this time.
[0121] When the first request carries the key value but does not carry the first index value, the data handling module 202 carries the key value and the X index values to the distance calculation module 203, and the distance calculation module 203 implements the clustering function, wherein the acceleration request received by the arbitration module 201 at this time is a clustering request, so that the data handling module 202 obtains X index values from the DDR, and the X index values are pre-stored in the external memory. At this time, the distance calculation module 203 performs distance calculation on the key value according to the X index values to obtain the first index value, and the first index value is the index value with the smallest distance from the key value among the X index values, and X is an integer greater than or equal to 2.
[0122] Optionally, when the distance calculation module 203 performs distance calculation on the key value, the distance calculation module 203 calculates the distance between each index value in the X index values and the key value to obtain X second distances;
[0123] The distance calculation module 203 compares the sizes of any two second distances among the X second distances, and determines the index value of the smallest second distance among the X index values as the first index value.
[0124] Specifically, after the distance calculation module 203 calculates all X second distances, it compares any two of the X second distances and finally obtains the first index value. The distance calculation module 203 also compares while calculating the second distances. For example, after calculating two second distances, it first compares the sizes of the two second distances, retains the smaller second distance, and then calculates the third second distance and compares it with the previously retained second distance, and so on. After each comparison, the second distance with the smaller value is retained until all X second distances are calculated and compared. The index value corresponding to the second distance left at the end is the first index value.
[0125] It should be noted that the distance calculation in the embodiment of the present application adopts Euclidean distance calculation or cosine distance calculation, wherein the Euclidean distance calculation is implemented by formula (1), and the cosine angle value calculation is implemented by formula (2), as follows:
[0126]
[0127]
[0128] Wherein, d is the Euclidean distance, cosθ represents the cosine distance, the vector {x1, x2, ..., xn} is the key value, and the vector {y1, y2, ..., yn} is the index value or eigenvalue. It should be noted that the vector in the formula is an n-dimensional vector (n is an integer greater than or equal to 1), and the key value, index value or eigenvalue in this application is in the form of but not limited to an n-dimensional vector, such as a number, a character, etc.
[0129] In this embodiment, the first distance and the second distance are calculated using the above formula (1) or formula (2), which can be selected according to needs and can also be calculated using methods in the prior art, which are not limited here.
[0130] Optionally, the accelerator 200 further includes a normalization module 204, which performs a normalization operation on the key value and the X index values before the distance calculation module 203 receives the key value and the X index values, and sends the normalized key value and the X index values to the distance calculation module 203; or,
[0131] Before the distance calculation module 203 receives the key value and the N eigenvalues, the normalization module 204 performs a normalization operation on the key value and the N eigenvalues, and sends the normalized key value and the N eigenvalues to the distance calculation module 203 .
[0132] The normalization module 204 uses the following formula (3) when performing the normalization operation:
[0133]
[0134] Wherein, A represents the input vector, and Len(A) is the length of vector A (ie, the modulus of vector A).
[0135] It should be noted that the normalization module 204 performs normalization operations on the key value and the X index values, or the key value and the N eigenvalues, which is to normalize the key value, each index value in the X index values, or each eigenvalue in the N eigenvalues. When the distance calculation adopts the cosine angle value, normalization in advance can simplify the calculation of the cosine angle value, thereby reducing the requirement for computing power. This is because when calculating the angle such as formula (2), the denominator part It is actually the product of the lengths of two vectors. After normalization, the length of the vector becomes 1, so formula (2) is simplified to formula (4), as follows:
[0136] cosθ=x1×y1+x2×y2+…+x n ×y n (4)
[0137] Among them, cosθ is the cosine value of the angle θ, the vector {x1, x2, ..., xn} is the normalized key value, and the vector {y1, y2, ..., yn} is the normalized index value or eigenvalue.
[0138] In one example, the distance calculation module 203 uses cosine distance calculation, so that before the distance calculation module 203 receives the key value and the X index values, the normalization module 204 performs a normalization operation on the key value and the X index values, and sends the normalized key value and the normalized X index values to the distance calculation module 203.
[0139] In one example, the distance calculation module 203 uses Euclidean distance calculation, so there is no need to perform normalization calculation, and the key value and X index values are sent to the distance calculation module 203 .
[0140] It can be understood that the distance calculation and the optional normalization calculation generate a large number of computing tasks. For the clustering function, the distance calculation is performed between the key value and each of the X index values, and a sorting operation is also required to obtain the index value closest to the key value. For the search function, the distance calculation is performed between the key value and each of the N feature values, and a sorting operation is also required to obtain M feature values. If these computing tasks are calculated by the processor through the execution program, a huge computing burden will be imposed on the processor, and the processing delay of processing read / write requests will be increased. In an embodiment of the present application, by providing an accelerator 200, the computing operations for clustering functions and search functions are undertaken, the burden on the processor is reduced, and the calculation is completed by hardware rather than executing the program, which reduces the processing delay and increases the data throughput. Optionally, when the arbitration module 201 obtains a request from one of the multiple channels, the arbitration module 201 obtains multiple first messages corresponding to the first request at a time, and the arbitration module 201 instructs multiple computing units in the distance calculation module 203 to process the multiple first messages.
[0141] See also Figure 3 , Figure 3 A possible structure of the distance calculation module 203 is given in FIG. The distance calculation module 203 includes a plurality of processing elements (PE) 2031, each of which performs calculations according to the above formula (1), formula (2) or formula (4).
[0142] It should be noted that the first request in the embodiment of the present application only represents the request sent by the host, and does not limit the number of first requests, that is, the host may send multiple requests, the firmware processes the request sent by the host, and sends the processed multiple requests to the arbitration module 201 through multiple channels, so that the arbitration module 201 may receive multiple requests in each of the multiple channels, therefore, the arbitration module 201 will obtain multiple first messages in one channel, each first message corresponding to a first request. Due to the existence of multiple first messages, the arbitration module 201 will specify a calculation unit for each first message, so that the distance calculation module 203 can process multiple first messages at the same time, that is, multiple calculation units process multiple first messages in parallel, and each first message here corresponds to a set of key values.
[0143] Specifically, since the first request sent by the host itself carries a key value, the key value carried by the first request may be one or more, that is, when the arbitration module 201 receives an acceleration request, the acceleration request includes a key value or a group of key value values in the key value. Further, multiple computing units process multiple first messages in parallel, so that the key values processed by the multiple computing units include the following situations:
[0144] Case 1: Each computing unit processes the value of a key value;
[0145] Case 2, each computing unit processes the value of a set of key values;
[0146] In case 3, each of a part of the plurality of computing units processes a value of one key value, and each of another part of the plurality of computing units processes a value of a group of key values.
[0147] For case 1, for example, the arbitration module 201 obtains 7 first messages from a channel, each of which carries only a value of a key value, so the distance calculation module 203 uses 7 calculation units to calculate a value carried in the 7 first messages respectively.
[0148] As an example, for situation 2, the arbitration module 201 obtains 5 first messages from a channel, each of which carries a set of key values, so the distance calculation module 203 uses 5 calculation units to respectively calculate a set of values carried in the 5 first messages.
[0149] As another example, for situation 3, the arbitration module 201 obtains 8 first messages from a channel, 3 first messages carry a key value, and 5 first messages carry a group of key value values, so that the distance calculation module 203 uses 3 calculation units to respectively calculate a value carried in the 3 first messages, and uses 5 calculation units to respectively calculate a group of values carried in the 5 first messages.
[0150] Optionally, the distance calculation module 203 includes Y calculation units, the key value includes Z groups of values, both Y and Z are integers greater than or equal to 1, and Z is less than or equal to Y.
[0151] The distance calculation module 203 uses the Y calculation units to simultaneously perform distance calculation on the Z groups of values according to the X index values, and obtains an index value corresponding to each value in the Z groups of values.
[0152] Specifically, since the distance calculation module 203 includes Y calculation units, each calculation unit processes a group of key values, the distance calculation module 203 processes at most Y groups of key values at the same time. Therefore, the arbitration module 201 obtains at most Y first messages at a time. For example, Y is equal to 8, and there are 12 first messages waiting in channel 1. The arbitration module 201 will only obtain 8 first messages from channel 1, and the remaining 4 need to wait for the arbitration module 201 to process later.
[0153] Optionally, the arbitration module 201 assigns the acquired multiple acceleration messages to multiple computing units. For example, one of the computing units is assigned to process one of the acceleration messages. As an example, each computing unit has a computing unit identifier, and the computing unit identifier is used to uniquely identify the computing unit. Figure 3 , each computing unit has a computing unit identifier (2031-1, 2031-2, ..., 2031-Y). The arbitration module 210 assigns a computing unit identifier to each acquired acceleration message to indicate that the acceleration message is processed by the computing unit with the computing unit identifier.
[0154] Optionally, the arbitration module 201 assigns a computing unit identifier to each first message of the multiple first messages, wherein the computing unit identifier indicates a corresponding computing unit in the distance calculation module 203 to process the first message carrying the computing unit identifier, and the first computing unit identifier corresponds to the first computing unit.
[0155] Optional, continue to see Figure 3 The distance calculation module 203 further includes Y management units 2032, each of which is coupled to one of the Y computing units. Each management unit has a computing unit identifier corresponding to the computing unit coupled to it.
[0156] The Y management units are all coupled to the data moving module 202. Each acceleration message with a computing unit identifier attached thereto provided by the data moving module to the computing unit is provided to all Y management units at the same time. In response to receiving the acceleration message, the management unit identifies whether the computing unit identifier carried therein is consistent with the computing unit identifier it has, and only obtains the acceleration message consistent with the computing unit identifier it has and provides it to the computing unit corresponding to itself.
[0157] The management unit also monitors the working status of the computing unit corresponding to itself to know whether the computing unit is idle and can process the acceleration message. The management unit only obtains and forwards the acceleration message for the computing unit that can process the acceleration message.
[0158] Optionally, the arbitration unit 201 provides Z acceleration messages to Y management units at the same time. Each of the Z acceleration messages is attached with a computing unit identifier. Each of the Y management units identifies an acceleration message that is consistent with its own computing unit identifier from the Z acceleration messages, and provides the acquired acceleration message to the computing unit corresponding to itself.
[0159] Still optionally, the arbitration unit 201 provides the Z acceleration messages obtained from the same channel (recorded as channel C) to Y management units. Each of the Z acceleration messages is attached with a computing unit identifier and the same channel number. Each of the Y management units identifies the acceleration message that is consistent with its own computing unit identifier from the Z acceleration messages, and provides the obtained acceleration message to the computing unit corresponding to itself. Further optionally, before these Z acceleration messages are processed, only subsequent acceleration messages from channel C are provided to the Y management units, and acceleration messages from other channels are no longer processed.
[0160] When sending the second request, the arbitration module 201 assigns a computing unit identifier to the Z group of values, and each management unit obtains a group of values whose computing unit identifier is the same as its own from the Z group of values, and each management unit sends the obtained group of values to the computing unit coupled to itself.
[0161] Specifically, the arbitration module 201 assigns a computing unit identifier to each first message to ensure that the data corresponding to the first message enters the designated computing unit for processing, thereby ensuring that the order of data will not be disordered when the distance calculation module 203 processes multiple first messages. For example, there are 3 first messages, numbered 1, 2, and 3, and there are 6 computing units in the distance calculation module 203, numbered 1, 2, ..., 6. The arbitration module 201 assigns computing unit identifier No. 1 to first message No. 1, computing unit identifier No. 2 to first message No. 2, and computing unit identifier No. 3 to first message No. 3, so that the distance calculation module 203 knows that the data corresponding to the first message No. 1 is processed by computing unit No. 1, and the data corresponding to the first message No. 1 will not be processed by computing unit No. 5.
[0162] Optionally, if the distance calculation module 203 has not completed processing the multiple first messages, even if the number of the multiple first messages is less than the number of computing units of the distance calculation module 203 and there are idle computing units in the distance calculation module 203, the arbitration module 201 does not instruct the distance calculation module 203 to process the messages in the multiple channels.
[0163] Specifically, in order to ensure the order of processing requests in multiple channels, even if the arbitration module 201 obtains less first messages than the number of computing units in the distance calculation module 203, it will not continue to obtain first messages in other channels to allow idle computing units to process.
[0164] Optionally, after acquiring the multiple first messages, the arbitration module 201 aggregates the multiple first messages, and instructs at least one calculation unit in the distance calculation module 203 to process the aggregated multiple first messages.
[0165] It should be noted that each computing unit in the distance calculation module 203 has the computing power to process a group of key values. If each first message corresponds to only one key value, it will cause a waste of the computing power of the computing unit. Therefore, the arbitration module 201 obtains the number of key values corresponding to each first message, and merges multiple first messages according to the computing power of the computing unit, so as to make full use of the computing power of the distance calculation module 203.
[0166] Optional, see Figure 2 The accelerator 200 further includes a result processing module 205. After the distance calculation module 203 obtains the calculation result, the result processing module 205 merges the calculation results of each calculation unit and sends the merged calculation result to the DDR.
[0167] Figure 4 Schematic diagram of the result processing module merging calculation results in the embodiment of the present application. Figure 4 As shown, the distance calculation module 203 includes 8 calculation units, and the result processing module 205 combines the 8 calculation results 401-408 into a result queue 409 according to the positions of the calculation units, and sends the data in the result queue 409 to the external memory according to the format of the result queue 409.
[0168] See also Figure 5A , Embodiment 2 of the present application provides an information processing system 500, including a host 501, a solid state drive 502, an accelerator 503, a mapping manager 504, and a processor 505. Among them, the accelerator 503 is, for example, an accelerator for cluster computing in the above-mentioned embodiment; the solid state drive 502 is, for example, a solid state drive such as NVMeSSD, OCSSD, KVSSD, etc.; the host 501 is a computer, and the processor 505 is an FPGA chip. The host 501 is directly coupled to the processor 505 or coupled through a network.
[0169] The host is coupled to electronic devices such as cameras, switches, servers, etc.
[0170] For example, an application is run on the host, and the application generates a request, and the request types include read requests (Get, Get_Index or Get_With_Index) and write requests (Put or Put_With_Index), so that the application generates a first request. As an example, the application calls the Get(Key) API to generate a read request to implement a query for a keyword (Key), and expects to obtain a set of feature values associated with the keyword (Key) or further data associated with this set of feature values. Specifically, the keyword (Key) comes from the feature value generated based on the picture input by the user, and the application calls the Get(Key) API to obtain a set of pictures similar to the picture input by the user.
[0171] As another example, an application implements a query on a keyword (Key) and an index (Index) and calls the Get(Key, Index) API to generate a read request. The keyword (Key) comes from the feature value generated based on the picture input by the user, and the index (Index) indicates the category of the search picture specified by the user (for example, a face or a license plate). The application calls the Get(Key, Index) API to obtain a set of pictures similar to the picture input by the user in the category specified by the index (Index).
[0172] As another example, the application implements a query for a keyword (Key) and calls the Get_Index(Key) API to generate a read request. The application calls the Get_Index(Key) API in the hope of obtaining the picture category associated with the picture input by the user.
[0173] Optionally, the first request includes multiple key values and multiple first index values.
[0174] In one embodiment, the application running on the host 501 calls Get / Put API to generate a first request, and the first request is sent to the processor 505 for processing. The processor 505 generates one or more of a clustering request, a search request, an address allocation request, and an address acquisition request to access a storage device according to the first request, and operates one or more of the accelerator 503, the solid state drive 502, and the mapping manager 504 to complete the processing of the first request, and returns the result to the host 501.
[0175] In another example, an application running on the host 501 calls Get / Put API to generate a first request, and a driver or management program running on the host 501 generates a clustering request, a search request, and / or a request to access a storage device according to the first request, and operates one or more of the accelerator 503, the solid state drive 502, and the mapping manager 504 through the processor 505. The results obtained by the accelerator 503, the solid state drive 502, and the mapping manager 504 in processing the request are all provided to the driver of the host 501, and the driver or management program provides the processing result to the application only after obtaining the processing result of the first request.
[0176] See also Figure 5B , Figure 5B A flowchart of the information processing system 500 processing a Get_Index(Key) request is given in FIG. The application running on the host 501 sends a Get_Index(Key) request by calling an API, and the driver or management program running on the host 501 generates a clustering request in response to the call to Get_Index(Key) and sends it to the processor 505. Thus, the processor 505 receives the clustering request. The clustering request carries a keyword (Key). Optionally, the host 501 also adds X index values or indicates the address of X index values to the request provided to the processor 505.
[0177] After the processor 505 clusters the request, it sends the clustering request to the accelerator 503. The clustering request indicates the keyword (Key) and X index values. Optionally, the processor 505 adds X index values to the clustering request or indicates the address of the X index values. The accelerator 503 works according to the method described in the above embodiment, compares the distance between the keyword (Key) and the X index values, and outputs the index value (first index value) with the minimum distance to the keyword (Key) to the processor 505.
[0178] Optionally, after the accelerator 503 writes the first index value into an external memory (not shown), the accelerator 503 also sends first completion information indicating that the calculation is completed to the processor 505 .
[0179] After receiving the first completion information, the processor 505 sends the first completion information and the first index value to the host 501. The driver or management program of the host 501 provides the first index value as the processing result of the Get_Index(Key) request to the application program that calls the API.
[0180] Optionally, if the application of the host 501 calls the Get(Key) or Put(Key) API (not shown), the driver or management program of the host 501 also generates a clustering request in response and sends it to the processor 505. The clustering request carries a keyword (Key) and X index values. The processor 505 obtains the keyword (Key) indicated by the clustering request. The processor 505 also obtains the X index values and sends a clustering request to the accelerator 503, where the clustering request indicates the input key value (Key) and the X index values.
[0181] In response to the clustering request, the calculation result provided by the accelerator 503 to the processor 505 indicates the first index value corresponding to the key value. Next, the processor 505 provides the key value and the N feature values corresponding to the first index value to the accelerator 503 to instruct the accelerator 503 to perform the function of searching for similar data. The calculation result provided by the accelerator 503 indicates the M feature values corresponding to the key value and the first index value. The processor 505 provides the M feature values obtained from the accelerator 503 to the host 501 as a response to the clustering request.
[0182] In an alternative embodiment, Figure 5B The operation of the driver or management program of the host 501 shown in the figure is implemented by the processor 505. This reduces the interaction between the processor 505 and the host 501 and improves the processing efficiency.
[0183] Figure 5C A flow chart of the information processing system 500 obtaining a feature value according to an index value is given. When processing a Get(Key), Get_With_Index(Key, Index), Put(Key) or Put_With_Index(Key, Index) request, it is necessary to obtain N feature values corresponding to the same index (Index). Under the instruction of the driver or management program of the host 501, the processor 505 accesses the mapping manager 504 to obtain the address storing the N feature values according to the index (Index), and accesses the solid state drive 502 according to the obtained address to obtain the N feature values.
[0184] After the host 501 issues a Get(Key) or Put(Key) request, the processor 505 first sends a Get(Key) or Put(Key) request to the accelerator 503 (see Figure 5B ) sends a clustering request to obtain the index value (Index) corresponding to the same keyword (Key). If the host 501 sends a Get_With_Index(Key, Index) or Put_With_Index(Key, Index) request, the index value (Index) is obtained from the parameters of the Get_With_Index(Key, Index) or Put_With_Index(Key, Index) request.
[0185] See also Figure 5C , the driver or management program of the host 501 sends the index value (Index) to the processor 505. Depending on whether the application program of the host 501 previously issued a read request or a write request, the driver or management program of the host 501 sends the index value (Index) to the processor 505 and also indicates the operation to be performed by the processor 505 through the mapping manager 504. The processor 505 sends the index value to the mapping manager 504.
[0186] After the mapping management module 504 receives the index value, if the request previously issued by the host application is a write request, such as Put(Key) or Put_With_Index(Key, Index), a storage address is allocated for the input key value according to the index value (Index), and the storage address is used to access the solid state drive 502. The mapping management module 504 provides the allocated storage address to the processor 505. If the request issued by the host is a read request, such as Get(Key) or Get_With_Index(Key, Index), after the mapping management module 504 receives the index value (Index), it obtains the storage addresses of all feature values corresponding to the same index value (Index), for example, obtains the N storage addresses of the N feature values in the category represented by the index value (Index), and sends the storage addresses of all feature values corresponding to the index value (Index) to the processor 505. The N storage addresses of the N feature addresses are N separate storage addresses or N consecutive storage addresses. When N storage addresses are continuous, the storage addresses of the N characteristic values can be represented by one storage address, and in this case, only this one storage address needs to be obtained.
[0187] The processor 505 sends the storage address returned by the mapping manager 504 to the host 501. The driver or management program of the host 501 generates a request to access the solid state drive 502 according to the received storage address and sends the request together with the storage address to the processor 505. If the application of the host 501 previously issued a read request, such as Get(Key) or Get_With_Index(Key, Index), the host 501 generates a request to read data from the solid state drive 502.
[0188] The processor 505 accesses the solid state drive 502 using the storage address and an indication of a read request or a write request.
[0189] The solid state drive 502 writes data to the received storage address or reads data from the storage address according to the received request. For example, the data read from the solid state drive is the N feature values corresponding to the same index value (Index); the data written to the solid state drive is the feature value to be written by the application by calling Put(Key) or Put_With_Index(Key, Index).
[0190] In response to the request to read data, the solid state drive 502 sends the read data (N characteristic values) to the processor 505. The processor 505 sends the read data to the host 501. The driver of the host 501 provides the read data to the application that calls the Get(Key) or Get_With_Index(Key, Index) API according to the received message indicating that the read data is completed and indicates that the API call is completed. At this point, the processing of the Get(Key) or Get_With_Index(Key, Index) previously issued by the host is completed.
[0191] For the request to write data, the solid state drive 502 sends a message indicating that the write data processing is completed to the processor 505. The processor 505 sends a message indicating that the write data is completed to the host 501 (not shown). The driver of the host 501 indicates the completion of the call to the application that calls the Put(Key) or Put_With_Index(Key, Index) API according to the received message indicating that the write data is completed. At this point, the processing of the Put(Key) or Put_With_Index(Key, Index) previously issued by the host is completed.
[0192] In an optional example, when the application of host 501 calls Put(Key) or Get(Key), first execute Figure 5B After receiving the index value, the host 501 continues Figure 5C process.
[0193] In an alternative embodiment, Figure 5C The operation of the driver or management program of the host 501 shown in the figure is implemented by the processor 505. This reduces the interaction between the processor 505 and the host 501 and improves the processing efficiency.
[0194] See also Figure 5D , the host 501 sends the search request to the processor 505 .
[0195] If the request sent by the host is a read request, such as Get(Key), the host 501 first sends a clustering request to the accelerator 503 through the processor 505, and the accelerator 503 returns the index value (Index) corresponding to the keyword (Key) (see also Figure 5B ), the host 501 then obtains N feature values (Vector) corresponding to the same index value (Index) from the mapping manager 504 and the solid state drive 502 through the processor 505 (see also Figure 5C ), then, as in Figure 5D As shown in FIG, the host 501 sends a search request to the accelerator 503 through the processor 505. The search request carries a keyword (Key) and N feature values. The host 501 expects the processor 505 to return the M index values closest to the keyword (Key) among the N feature values in response to the search request. If the host issues a read request by calling Get_With_Index(Key, Index), the host 501 first obtains the N feature values (Vector) corresponding to the same index value (Index) from the mapping manager 504 and the solid state drive 502 through the processor 505 (see also Figure 5C ), then, as in Figure 5D As shown in FIG. 5 , the host 501 sends a search request to the accelerator 503 through the processor 505 .
[0196] See also Figure 5D , the host 501 sends a search request carrying a keyword (Key) and N feature values to the processor 505.
[0197] After receiving the search request, the processor 505 sends the search request to the accelerator 503, so that the accelerator 503 works in the manner described in the above embodiment to search for M feature values that are closer to the keyword (Key) among the N feature values.
[0198] The accelerator 503 writes the calculation results of the M eigenvalues into the external memory, and the accelerator 503 sends completion information indicating that the search process is completed to the processor 505 .
[0199] After receiving the completion information, the processor 505 sends the completion information and the calculation result to the host 501. At this point, the application program of the host 501 calling Get(Key) or Get_With_Index(Key, Index) is processed and M characteristic values are obtained as the result.
[0200] In an alternative embodiment, Figure 5D The operation of the driver or management program of the host 501 shown in the figure is implemented by the processor 505. This reduces the interaction between the processor 505 and the host 501 and improves the processing efficiency.
[0201] As an example, Figure 5E A schematic diagram of the process of the information processing system 500 processing a Put (Key) request is given.
[0202] like Figure 5E As shown, in response to the application program of the host 501 calling the Put (Key) API, the driver or management program running on the host 501 generates a clustering request and sends it to the processor 505. The clustering request carries a keyword (Key) and X index values.
[0203] After receiving the clustering request, the processor 505 sends the clustering request to the accelerator 503, so that the accelerator 503 works in the manner described in the above embodiment and obtains the index value corresponding to the keyword (Key) of the clustering request.
[0204] The accelerator 503 stores the index value in the external memory, and sends first completion information indicating that the clustering operation is completed to the processor 505 .
[0205] After receiving the first completion information, the processor 505 sends the first completion information and the index value corresponding to the keyword (Key) of the same cluster request to the host 501. It can be understood that the processor 505 can send a data packet carrying the first completion information and / or the index value to the host 501, or indicate an interrupt to the host 501, and the host 501 actively obtains the first completion information and / or the index value.
[0206] After receiving the first completion information and the index value corresponding to the keyword (Key) of the same cluster request, the driver or management program of the host 501 sends an address allocation request to the processor 505 according to the Put (Key) request to be processed, and the address allocation request carries the keyword (Key) and the index value corresponding to the keyword (Key) of the same cluster request.
[0207] The processor 505 sends an address allocation request to the mapping management module 504 .
[0208] The mapping management module 504 allocates a storage address for the input keyword (Key) according to the received index value, and the storage address is an address in the solid state drive 502. Then, the mapping management module 504 sends the storage address and the second completion information to the processor 505.
[0209] The processor 505 sends the storage address and the second completion information to the host 501 .
[0210] After receiving the second completion information and the storage address, the driver or management program of the host 501 sends the storage address and the data to be written to the processor 505 according to the Put (Key) request to be processed. The written data is, for example, the keyword (Key) indicated when calling the Put (Key) API and / or the data corresponding to the keyword (Key).
[0211] The processor 505 sends the storage address and the data to be written to the solid state drive 502 .
[0212] According to the storage address, the solid state drive 502 writes the data and / or keyword (Key) to be written into the storage space indicated by the storage address, and sends the third completion information to the host 501 through the processor 505.
[0213] In response to receiving the third completion information, the driver or management program of the host 501 notifies the application program that the Put (Key) API processing called by the application program is completed.
[0214] In an alternative embodiment, Figure 5E The operation of the driver or management program of the host 501 shown in the figure is implemented by the processor 505. This reduces the interaction between the processor 505 and the host 501 and improves the processing efficiency.
[0215] As another example, Fig. 5F A schematic diagram of the process of the information processing system 500 processing a Get(Key) request is given. Fig. 5F As shown, the application of host 501 calls Get(Key) API. In response to the Get(Key) API being called, the driver of host 501 sends a clustering request to processor 505. The clustering request indicates a keyword (Key) and X index values.
[0216] After receiving the clustering request, the processor 505 sends the clustering request to the accelerator 503, so that the accelerator 503 completes the clustering operation in the manner described in the above embodiment and obtains the index value corresponding to the keyword (Key) of the clustering request.
[0217] The accelerator 503 writes the index value into the external storage device, and the accelerator 503 also sends first completion information indicating that the clustering operation is completed to the processor 505 .
[0218] After receiving the first completion information, the processor 505 sends the first completion information and the index value to the host 501 .
[0219] In response to receiving the first completion information and the index value, the driver or management program of the host 501 sends an address acquisition request to the processor 505 according to the Get(Key) API called by the application program. The address acquisition request indicates the keyword (Key) and the index value.
[0220] The processor 505 sends an address acquisition request to the mapping management module 504 .
[0221] The mapping management module 504 obtains one or more storage addresses of N feature values corresponding to the index value according to the index value indicated by the received address acquisition request, and the storage address is an address in the solid state drive 502. Then, the mapping management module 504 sends the one or more storage addresses and the second completion information to the processor 505.
[0222] The processor 505 sends one or more storage addresses and second completion information to the host 501 .
[0223] In response to receiving the second completion information and one or more storage addresses, the driver of host 501 sends one or more storage addresses to processor 505 according to the Get(Key) API called by the application to instruct processor 505 to read N characteristic values from SSD 502.
[0224] The processor 505 sends a data read request and one or more storage addresses to the solid state drive 502 .
[0225] In response, the solid state drive 502 reads N characteristic values corresponding to the one or more storage addresses from itself according to the one or more storage addresses, and sends the third completion information and the N characteristic values to the host 501 through the processor 505 .
[0226] In response to receiving the third completion information and the N characteristic values, the driver of the host 501 sends a search request to the processor 505 according to the called Get(Key) API. The search request indicates the keyword (Key) and the N characteristic values.
[0227] After receiving the search request, the processor 505 sends the search request to the accelerator 503 .
[0228] After receiving the search request, the accelerator 503 works in the manner described in the embodiment of the present application, and searches for M feature values closest to the keyword (Key) from the N feature values.
[0229] The accelerator 503 writes the M feature values into the external memory, and the accelerator 503 sends fourth completion information indicating that the search operation is completed to the processor 505 .
[0230] After receiving the fourth completion information, the processor 505 sends the fourth completion information and / or the M characteristic values to the host 501. In response to receiving the fourth completion information and / or the M characteristic values, the driver or management program of the host 501 notifies the application program that the Get(Key) API processing it called is completed.
[0231] In an alternative embodiment, Fig. 5F The operation of the driver or management program of the host 501 shown in the figure is implemented by the processor 505. This reduces the interaction between the processor 505 and the host 501 and improves the processing efficiency.
[0232] See also Figure 6 Yet another embodiment of the present application provides a host 600.
[0233] The host 600 includes an application program module 601 , an API interface module 605 , a management module 610 , an acceleration driver module 620 , a mapping driver module 630 , and a hard disk driver module 640 .
[0234] The application module 601 running in the host 600 calls the API provided by the API interface module 605. The API provided by the API interface module 605 includes, for example, Get(Key), Get_Index(Key), Get_With_Index(Key, Index), Put(Key), Put_With_Index(Key, Index), etc. In response to the API being called, the API interface 605 processes the called API through the management module 610.
[0235] The management module 610 sends a request to one or more of the acceleration driver module 620, the mapping driver module 630 and the hard disk driver module 640 according to the called API, and obtains a result for responding to the called API according to the result given by the acceleration driver module 620, the mapping driver module 630 and / or the hard disk driver module 640 in response to the request, and provides it to the API interface module 605. The API interface module 605 provides the result to the application program module 601 that calls the API.
[0236] The acceleration driver module 620 manages and operates the accelerator according to the embodiment of the present application as a driver (for example, Figure 5A The accelerator 503 is shown); the mapping driver module 630 manages and operates the mapping manager 504 according to the embodiment of the present application as a driver; the hard disk driver module 640 manages and operates the solid state disk 502 according to the embodiment of the present application as a driver.
[0237] As an example, if the application module 601 calls the Put(Key) API, the management module 610 first sends a clustering request to the acceleration driver module 620. The clustering request indicates the keyword (Key) of the Put(Key) API. In response to the acceleration driver module 620 providing the result of the clustering request (indicating the index value corresponding to the keyword (Key)), the management module 610 also sends an address acquisition request (indicating the index value and the keyword (Key)) to the mapping driver module 630. In response to the mapping driver module 630 providing the result of the address acquisition request (one or more addresses), the management module 610 sends the storage address and the data to be written to the hard disk driver module 640. The hard disk driver module 640 writes the data provided by the management module 610 to the specified storage address of the solid-state hard disk, and indicates to the management module 610 that the data writing is completed, and the management module 610 indicates to the application module 601 through the API interface 605 that the call to the Put(Key) API is completed.
[0238] As another example, the application module 601 calls the Get(Key) API, and the management module 610 first sends a clustering request to the acceleration driver module 620. The clustering request indicates the keyword (Key) of the Get(Key) API. In response to the acceleration driver module 620 providing the result of the clustering request (indicating the index value corresponding to the keyword (Key)), the management module 610 also sends an address acquisition request (indicating the index value and the keyword (Key)) to the mapping driver module 630. In response to the mapping driver module 630 providing the result of the address acquisition request (one or more addresses), the management module 610 sends a storage address to the hard disk driver module 640. The hard disk driver module 640 reads data from the storage address of the solid state drive, and the read data is N feature values corresponding to the index value. The hard disk driver module 640 provides the read N feature values to the management module 610. In response, the management module sends a search request (indicating the keyword (Key) and the N feature values) to the acceleration driver module 620. The acceleration driving module 620 operates the accelerator to provide the M feature values closest to the keyword (Key) among the N feature values to the management module 610. The management module 610 provides the M feature values to the application module 601 through the API interface 605 and indicates that the call to the Get(Key) API is completed.
[0239] As another example, the application module 601 calls the Put_With_Index(Key, Index) API. The management module 610 sends an address acquisition request (indicating the index value and the keyword (Key)) to the mapping driver module 630. In response to the mapping driver module 630 providing the result of the address acquisition request (one or more addresses), the management module 610 sends a storage address to the hard disk driver module 640. The hard disk driver module 640 reads data from the storage address of the solid state drive, and the read data is N feature values corresponding to the index value. The hard disk driver module 640 provides the read N feature values to the management module 610. In response, the management module sends a search request (indicating the keyword (Key) and the N feature values) to the acceleration driver module 620. The acceleration driver module 620 operates the accelerator to provide the management module 610 with the M feature values that are closest to the keyword (Key) among the N feature values. The management module 610 provides M characteristic values to the application module 601 through the API interface 605 and indicates that the call to the Get_With_Index(Key, Index) API is completed.
[0240] As still another example, if the application module 601 calls the Put_With_Index(Key, Index) API, the management module 610 sends an address acquisition request (indicating the index value and the keyword (Key)) to the mapping driver module 630. In response to the mapping driver module 630 providing the result of the address acquisition request (one or more addresses), the management module 610 sends the storage address and the data to be written to the hard disk driver module 640. The hard disk driver module 640 writes the data provided by the management module 610 to the specified storage address of the solid state drive, and indicates to the management module 610 that the data writing is completed, and the management module 610 indicates to the application module 601 through the API interface 605 that the call to the Put_With_Index(Key) API is completed.
[0241] As still another example, the application module 601 calls the Get_Index(Key) API. The management module 610 first sends a clustering request to the acceleration driver module 620. The clustering request indicates the keyword (Key) of the Get_Index(Key) API. In response to the acceleration driver module 620 providing the result of the clustering request (indicating the index value corresponding to the keyword (Key)), the management module 610 provides the index value to the application module 601 through the API interface 605 and indicates that the call to the Get_Index(Key) API is completed.
[0242] Although the present application is described with reference to examples, this is for illustrative purposes only and is not intended to limit the present application, and changes, additions and / or deletions to the embodiments may be made without departing from the scope of the present application.
[0243] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An accelerator for cluster computing, characterized in that: It includes an arbitration module, a data handling module and a distance calculation module, wherein: The arbitration module sends a second request to the data handling module according to the received access request generated based on the first request, wherein the first request is a Put(Key) or Put_With_Index(Key, Index) request based on a key (Key) provided by the host, and the second request is a data movement request; The data moving module moves a keyword, X index values or N feature values from the DDR to the distance calculation module according to the second request, where the keyword is the keyword carried by the first request, X is an integer greater than or equal to 2, and N is an integer greater than or equal to 1; In response to moving the X index values to the distance calculation module, the distance calculation module performs distance calculation on the keyword according to the X index values to obtain a first index value, where the first index value is the index value with the smallest distance from the keyword among the X index values; In response to moving the N eigenvalues to the distance calculation module, the distance calculation module performs distance calculation on the keyword based on the N eigenvalues to obtain M first eigenvalues with the smallest distance to the keyword from the N eigenvalues, the N eigenvalues being all eigenvalues in the category corresponding to the first index value, M being an integer greater than or equal to 1, and M being less than or equal to N.
2. The accelerator according to claim 1, characterized in that If the first request is a request indicating the keyword generated by calling a Put(Key) API function, the access request received by the arbitration module includes a clustering request.
3. The accelerator according to claim 2, characterized in that The data moving module moves the keyword, the X index values or the N feature values from the DDR to the distance calculation module according to the second request, including: In response to the access request being the clustering request, the data moving module moves the keyword and the X index values from the DDR to the distance calculation module according to the second request.
4. The accelerator according to claim 2 or 3, characterized in that: If the first request is a request indicating the keyword and the first index value generated by calling a Put_With_Index(Key, Index) API function, the access request received by the arbitration module includes a search request.
5. The accelerator according to claim 4, characterized in that The data moving module moves the keyword, the X index values or the N feature values from the DDR to the distance calculation module according to the second request, including: In response to the access request being the search request, the data moving module moves the keyword and the N feature values from the DDR to the distance calculation module according to the second request.
6. The accelerator according to claim 1, characterized in that The first request also indicates a channel used by the accelerator to process the first request, and the arbitration module instructs at least one computing unit of the distance calculation module to process the first request according to the channel indicated by the first request.
7. The accelerator according to claim 5, characterized in that The first request also indicates a channel used by the accelerator to process the first request, and the arbitration module instructs at least one computing unit of the distance calculation module to process the first request according to the channel indicated by the first request.
8. The accelerator according to claim 7, characterized in that The arbitration module assigns a computing unit identifier to each first message among multiple first messages, and the computing unit identifier is used to instruct a first computing unit in the distance calculation module to process a first message carrying the first computing unit identifier, and the first computing unit identifier corresponds to the first computing unit.
9. The accelerator according to claim 8, characterized in that If the distance calculation module has not processed the multiple first messages, the arbitration module does not instruct the distance calculation module to process the messages in the multiple channels even if the number of the multiple first messages is less than the number of computing units in the distance calculation module and there are idle computing units in the distance calculation module.
10. The accelerator according to claim 1 or 2, characterized in that The distance calculation module also includes Y management units, each management unit is coupled to one of the Y calculation units, the arbitration module assigns a calculation unit identifier to the Z group of values when sending the second request, each management unit obtains a value whose calculation unit identifier is the same as its own from the Z group of values, and each management unit sends the obtained value to the calculation unit coupled to itself.
Citation Information
Patent Citations
An address conversion method and system for KV storage equipment
CN109947669A
KV storage device for providing logic keys and method thereof
CN110019016A
Cloud computing and fog computing system utilizing KV storage equipment
CN110324380A
KV storage equipment in cloud computing and fog computing system
CN110324381A
Distributed KV storage system
CN110377535A
