Base recognizer and base recognition method based on DCU hardware platform

By dividing the current signal sequence into signal blocks of the same length on the DCU hardware platform and using multi-threaded asynchronous queues and ping-pong mechanisms, the problems of insufficient computing performance and unbalanced load of base recognition systems on domestic DCU platforms in the existing technology are solved. , achieving high throughput and load balancing base recognition effect.

CN119007830APending Publication Date: 2024-11-22CHINA SCI & TECH WESTERN RES INST OF COMPUTING TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411175345.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

When the existing base recognition system runs on CPU or some GPU platforms, the processing speed cannot meet the needs of large-scale data, and the support for domestic DCU hardware platforms is insufficient, resulting in insufficient computing performance and poor hardware compatibility, which cannot meet domestic hardware needs. .

Method used

A base recognizer based on the DCU hardware platform was designed to divide the current signal sequence into signal blocks of consistent lengths, and use multi-threaded asynchronous queues and ping-pong mechanisms to perform base recognition to ensure that each signal block is processed independently and avoid The load imbalance problem caused by the difference in current signal sequence length is improved, and the throughput of base recognition is improved.

Benefits of technology

Significantly improve the throughput of base recognition tasks, with a single card environment throughput reaching 1.08E+6Samples/s, a dual card environment throughput 1.99 times that of a single card, and a computing performance reaching 17.99 times that of a CPU benchmark, ensuring multiple DCUs load balancing and efficient resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119007830A_ABST
    Figure CN119007830A_ABST
Patent Text Reader

Abstract

The invention discloses a base recognizer based on a DCU hardware platform and a base recognition method, relates to the field of bioinformatics, and is used for remarkably improving the throughput of a base recognition task under the condition of being compatible with a domestic DCU. The base recognizer comprises an input unit, a base recognition unit and an output unit, the base identification unit sequentially divides the current signal sequence input by the input unit into signal blocks with the same length, packs the signal blocks with the size of each batch into one batch by using two base identification working threads through a ping-pong mechanism, and sends the signal blocks to an identifier for base identification, and after all the signal blocks of each current signal sequence are identified, the current signal sequence is identified; transmitting a base sequence for identifying the current signal sequence to an output unit; the recognizer performs a base recognition process on the DCU. According to the invention, a plurality of signal blocks can be identified in batches, the base identification throughput is obviously improved, and the loads of a plurality of DCUs are balanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of bioinformatics, and in particular to a base identifier based on a DCU hardware platform, and a method for performing base identification using the base identifier. Background Art

[0002] High-throughput sequencing (HTS) is an important tool in current genomic research, and base recognition is a key step. With the continuous increase in the amount of sequencing data, the traditional CPU-based base recognition method can no longer meet the requirements of speed and accuracy, and is gradually being replaced by GPU-based parallel acceleration methods. However, the existing base recognition system is mainly optimized for foreign GPU hardware platforms, and has little support for hardware platforms.

[0003] The shortcomings of traditional base calling systems include:

[0004] 1. Insufficient computing performance: When existing systems run on CPU or some GPU platforms, the processing speed often cannot meet the processing requirements of large-scale data.

[0005] 2. Poor hardware compatibility: Existing systems mostly rely on foreign GPU platforms, but lack hardware support and are unable to meet the growing domestic hardware demand.

[0006] With the support research of domestic DCU hardware platform, base recognition systems configured on DCU have been developed one after another. The execution of such base recognition systems has three steps. (1) First, read the current signal measured by the sequencer from the file in Fast5 format, then convert the current signal into a base sequence through the base recognition algorithm, and finally output the base sequence into a BAM file. These three steps are: Figure 1 (a) is executed by the reading unit (Reader), base recognition unit (Base-caller) and output unit (Writer). The single-threaded execution mode will cause the DCU to wait for the input unit and the output unit to complete the IO operation, making the DCU idle, reducing the throughput of base recognition, and the processing speed has not been improved. Considering multi-threaded base recognition is difficult for the current signal sequence, because the length of the current signal sequence measured by the sequencer varies greatly, and multiple current signal sequences cannot be recognized in parallel at the same time. In addition, the computational complexity of base recognition is related to the length of the current signal sequence, and the difference in current signal length will also cause the problem of unbalanced load on multiple DCUs. Summary of the invention

[0007] The purpose of the present invention is to provide a base identifier and a base identification method based on a DCU hardware platform that support domestic DCU to address all or part of the above-mentioned problems, so as to significantly improve the throughput of base identification tasks while being compatible with domestic DCU.

[0008] The technical solution adopted by the present invention is as follows:

[0009] A base identifier based on a DCU hardware platform, the base identifier comprising an input unit, a base recognition unit and an output unit;

[0010] The base recognition unit divides the current signal sequence input by the input unit into signal blocks of the same length in sequence, packages the signal blocks of each batch size into a batch and gives it to the identifier for base recognition, and after all signal blocks of each current signal sequence are recognized, passes the base sequence recognized for the current signal sequence to the output unit; the identifier performs the base recognition process on the DCU.

[0011] Furthermore, the base recognition unit divides the current signal sequence read by the input unit into signal blocks of the same length using the configured input working thread, and puts each divided signal block into the block input asynchronous queue in turn for reading by the packaging link.

[0012] Furthermore, after dividing each current signal sequence, the input working thread puts the current signal sequence into a working read segment set for reading in the link of determining whether all signal blocks of the current signal sequence have been identified.

[0013] Furthermore, the base recognition unit uses the configured read segment management thread to read the current signal sequence from the working read segment set, and marks the information blocks that have been identified in the identifier; when all information blocks of the read current signal sequence are identified and marked, it is determined that the identification of all signal blocks of the current signal sequence is completed.

[0014] Furthermore, when all information blocks of the read current signal sequence are identified, the current signal sequence is deleted from the working read segment set.

[0015] Furthermore, the base recognition unit utilizes the configured base recognition work thread to obtain signal blocks from the block input asynchronous queue for packaging. The base recognition work thread puts each packaged batch into the input queue of the identifier, and uses a blocking mechanism to wait for the identifier to complete base recognition of the batch, and then puts the information blocks of the batch into the completed operation block queue for reading in the link of determining whether all signal blocks of the current signal sequence have been recognized.

[0016] Furthermore, the base recognition unit is configured with two base recognition work threads, and the two base recognition work threads use a ping-pong mechanism to put the packaged batches into the input queue of the recognizer.

[0017] Furthermore, the identifier performs a base recognition process using a configured base recognition model, wherein the base recognition model includes a sequentially stacked input layer, multiple convolutional layers, multiple long short-term memory network layers, a linear layer, and a conditional random field decoder.

[0018] Furthermore, the identifier uses the configured memory management kit to encapsulate a support tensor on the DCU video memory, and during the base recognition process, the tensor views created by each operation are alternately mapped to the two ends of the support tensor; the minimum space of the support tensor is the maximum value of the sum of the sizes of two tensor views that need to exist simultaneously in all operations.

[0019] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0020] The base identifier based on the DCU hardware platform proposed in the present invention solves two problems caused by the inconsistent length of the read segments of the current signal sequence of the sequencer, namely, the different base recognition calculation amounts of each current signal sequence (or referred to as a read segment) may lead to the problem of unbalanced load between multiple DCUs, and the problem of being unable to directly package the batch size of the current signal sequence into a batch as the input matrix of the identifier. The base identifier proposed in the present invention does not use the current signal sequence as the basic unit of base recognition, but cuts the current signal sequence into signal blocks of consistent length, and uses the signal block as the basic unit of base recognition. Each signal block is independent of each other and has the same length, and the signal blocks of batch size can be packaged into an input matrix for simultaneous recognition, thereby greatly improving the throughput of base recognition. It has been proved in practice that in a single-card DCU environment, the throughput of the base identifier designed by the present invention reaches 1.08E+6Samples / s. In a dual-card environment, the throughput of the base identifier is 1.99 times that of a single-card environment. At the same time, the computing performance of the base identifier on the domestic DCU hardware platform is excellent, and the processing speed reaches 17.99 times that of the CPU benchmark.

[0021] In addition, the identifier performs base recognition in units of each batch packaged by the base recognition work thread, and the amount of computation for each batch is comparable, so the recognition speeds of different DCUs are comparable, the amount of running data of multiple DCUs will not differ too much, and the amount of tasks is relatively balanced. Preferably, each identifier corresponds to two base recognition work threads for its packaged input matrices, and there are at most two input matrices that need to be base recognized in the input queue of the identifier. This ensures that the amount of running data of multiple DCUs differs by at most two input matrices, and the amount of tasks on multiple DCUs is load balanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The present invention will now be described by way of example with reference to the accompanying drawings, in which:

[0023] Figure 1 This is a diagram of the base identifier operation architecture based on the DCU hardware platform.

[0024] Figure 2 This is the architecture diagram of the base recognition model.

[0025] Figure 3 It is the DCU memory tensor view. DETAILED DESCRIPTION

[0026] All features disclosed in this specification, or steps in all methods or processes disclosed, except mutually exclusive features and / or steps, can be combined in any manner.

[0027] Any feature disclosed in this specification (including any additional claims and abstract), unless otherwise stated, may be replaced by other equivalent or alternative features having similar purposes. That is, unless otherwise stated, each feature is only an example of a series of equivalent or similar features.

[0028] The key points of the present invention are:

[0029] Key point 1: Efficient multi-threaded operation framework; by executing data reading, base identification and data writing operations in parallel, the whole process is accelerated;

[0030] Key point 2: Cross-platform support: In addition to supporting the DCU hardware platform, the base caller (DCUCaller) can also run efficiently on other platforms such as NVIDIA GPU, and exhibit excellent computing performance on these platforms;

[0031] Key point 3: High throughput and accuracy: Through efficient computing core and optimized algorithm design, DCUCaller can maintain high accuracy of base recognition tasks while ensuring high throughput;

[0032] Example 1

[0033] The base recognizer of this embodiment still comprises Figure 1 (a) The reading unit (Reader), base recognition unit (Base-caller) and output unit (Writer), where the input unit and the output unit are executed by the CPU, and the calculation of the base recognition unit is completed by the Haiguang DCU.

[0034] The function of the base recognition unit is to run the base recognition model to execute the recognition library configured on the DCU to perform base recognition on the input current signal sequence. In this embodiment, the recognition library supports input data in matrix form. In some specific embodiments, the input matrix format of the recognition library is [N, C, T], where N is the batch size, C is 1, indicating a single current signal, and T indicates the length of each current signal (i.e., each signal block) in the input matrix. In the absence of special requirements, the recognition library that supports matrix input data can be applied in the present invention. The base recognition unit needs to convert the current signal sequence read by the input unit into the above format, that is, to divide the current signal sequence input by the input unit into signal blocks of the same length (i.e., length T).

[0035] In addition, the current base identifier uses the current signal sequence measured by the sequencer as the basic unit of base recognition, and the length of the current signal sequence measured by the sequencer is quite different, and there is a problem that N current signal sequences cannot be directly packaged into a batch. In this embodiment, since the base recognition unit has divided the current signal sequence into signal blocks of the same length, the signal blocks of each batch size (i.e., N) can be packaged into a batch for the identifier to perform base recognition. The identifier performs the base recognition process on the DCU, and uses the configured base recognition model to execute the customized recognition library on the DCU to identify the input matrix. Each current signal sequence may not be exactly divided into N signal blocks, so it is not necessarily possible to identify a current signal sequence in one batch. Only after all signal blocks of each current signal sequence are identified, the base sequence identified by the current signal sequence is passed to the output unit.

[0036] like Figure 1 As shown in (b), for the base recognition unit, some threads are designed to independently execute corresponding base recognition steps.

[0037] The base recognition unit uses the configured input worker thread (input_worker) to divide the current signal sequence read by the input unit into signal blocks of the same length, and puts each signal block into the block input asynchronous queue (chunks_in_queue) in turn for subsequent batch packaging thread reading.

[0038] In addition, after dividing each current signal sequence, the base recognition unit also puts the current signal sequence into a working read segment set (working_read_set) for subsequent reading by a thread to check whether the current signal sequence has been recognized.

[0039] For the packaging link, the base recognition unit uses the configured base recognition work thread (basecall_worker) to obtain signal blocks from the input asynchronous queue. After the number of signal blocks obtained reaches the batch size, they are packaged into a batch and sent to the identifier (caller) for identification. Specifically, the base recognition work thread puts each packaged batch into the input queue (input_queue) of the identifier, and the identifier obtains the input matrix to be identified (i.e., the packaged batch) from the input queue. After sending each batch into the input queue of the identifier, the base recognition work thread uses a blocking mechanism to wait for the identifier to complete the base recognition of the batch, and then puts all the signal blocks that have been identified into the completed operation block queue (processed_chunks_queue) for subsequent verification of whether the current signal sequence has been identified and read by the thread.

[0040] The base recognition unit uses the configured read segment management thread (read_manager) to obtain the signal block that has completed the recognition operation from the completed operation block queue, find the current signal sequence to which the obtained signal block belongs, and mark the signal block at the corresponding position as having completed base recognition. When it is recognized that all signal blocks of the current signal sequence are marked as completed, it is determined that all signal blocks of the obtained current signal sequence have been recognized, and then the current signal sequence can be deleted from the working read segment set, and the base recognition result of the current signal sequence (i.e., the recognized base sequence) is passed to the next node output unit in the pipeline.

[0041] In order to make full use of DCU resources in a multi-DCU system, each DCU corresponds to a base identifier. The base recognition work thread will block and wait for the identifier to complete the operation on a batch of signal blocks. Therefore, two base recognition work threads are configured for each identifier (corresponding to each base recognition unit). The two base recognition work threads use a ping-pong mechanism to put packaged batches into the input queue of the identifier, that is, when one of the base recognition work threads is blocked waiting for the identifier to complete the recognition operation, the other base recognition work thread can package the input signal blocks, and then put a batch of signal blocks into the input queue of the identifier for the next batch of recognition by the identifier. This ping-pong mechanism can ensure that there are always input matrices that need to be processed in the input queue of the identifier, thereby improving the resource utilization of the DCU.

[0042] As mentioned above, the recognizer uses the configured base recognition model to perform the base recognition process. The Caller polls the input queue to see if there is an input matrix, and executes the base recognition algorithm on the DCU to convert the input matrix into a base sequence output. Figure 2As shown, in the present embodiment, the base recognition model includes an input layer (input) stacked in sequence, multiple convolutional layers (conv), multiple long short-term memory network layers (LSTM), a linear layer (linear) and a conditional random field decoder (CRF, conditional random field). In addition, it is found through benchmark testing that the best paradigm for the base recognition model is a 5-layer LSTM and a conditional random field decoder. The present embodiment proposes a specific base recognition model based on this paradigm. On the basis of this paradigm, the base recognition model of the present embodiment adds 3 layers of CNN (Convolutional Neural Networks, convolutional neural network) at the front end to play a role in reducing dimension and extracting features, and uses a linear layer at the 5-layer LSTM back end to enable the model to characterize higher-level features. As for the recognition library (i.e., base recognition algorithm) specifically executed, it is not limited in the present embodiment, as long as it can support an input matrix of [N, C, T] size.

[0043] In addition, considering that the data transfer between each operator (i.e., each operation) in the base recognition process is realized by input tensors and output tensors, the entire calculation process involves the application and release of a large number of input tensors and output tensors, and improper handling will lead to memory leakage. Moreover, frequent application and release of video memory will generate a large amount of video memory fragmentation in the DCU, resulting in a decrease in the processable batch size and a reduction in the throughput of base recognition. To address the above problem, this embodiment proposes an internal management suite to manage the input tensors and output tensors in the calculation process.

[0044] The input matrix is ​​passed through the base recognition algorithm to obtain the base sequence. Each operation in the recognition process has an input tensor and an output tensor. If the current step is an in-place operation, the input tensor and the output tensor are the same matrix, otherwise the input tensor and the output tensor need to exist in the DCU video memory space at the same time. Figure 3As shown in the figure, the memory management kit encapsulates a backing tensor on the DCU video memory, from which each operation in the base recognition process can create a tensor view. These tensor views created in each operation are alternately mapped to the front end or back end (i.e., both ends) of the backing tensor. For example, tensor view 1 (Tensor 1) is an input tensor of a non-in-place operation, and tensor view 2 (Tensor 2) is the output tensor of the operation. The memory management kit maps these two tensor views to the front end and back end of the backing tensor respectively. After the operation is completed, the memory of the input tensor (Tensor 1) can be reused as the next tensor view. Tensor view 2 will be used as the input tensor for the next operation. In the in-place operation step, the current tensor view (Tensor 2) is used as both the input tensor and the output tensor, and the temporary buffer (tmp buf) is used to support temporary storage of the in-place operation. The tensor view created in this case will not be used as the input tensor for the next operation, so it does not need to be retained. The creation of the tensor view of the output tensor (Tensor 3) of the next operation will create a new tensor view directly from this end of the temporary buffer, reusing the temporary buffer, and so on.

[0045] The memory management kit creates tensor views alternately at both ends of the supported tensor, and the minimum required space of the supported tensor view is the maximum sum of the sizes of the two tensor views that need to exist simultaneously in all operations (steps). In this way, the minimum required space to support the tensor view can be calculated to minimize the total amount of DCU video memory required.

[0046] Example 2

[0047] This embodiment proposes a base recognition method based on the base recognizer proposed in Example 1. The method uses the base recognizer of Example 1 to perform base recognition on a continuous current signal sequence detected by a sequencer.

[0048] Example 3

[0049] This embodiment proposes a computer program product, which exists in the form of a compiled computer program. The computer program is stored in a computer-readable storage medium, and the base identifier of Embodiment 1 can be obtained by compiling and running the computer program, and the product obtained after compiling the computer program is the computer program product of this embodiment.

[0050] The present invention is not limited to the above-mentioned specific embodiments, but extends to any new features or any new combination disclosed in this specification, as well as any new method or process steps or any new combination disclosed.

Claims

1. A base identifier based on a DCU hardware platform, the base identifier comprising an input unit, a base recognition unit and an output unit; It is characterized in that The base recognition unit divides the current signal sequence input by the input unit into signal blocks of the same length in sequence, packages the signal blocks of each batch size into a batch and gives it to the identifier for base recognition, and after all signal blocks of each current signal sequence are recognized, passes the base sequence recognized for the current signal sequence to the output unit; the identifier performs the base recognition process on the DCU.

2. The base recognizer based on the DCU hardware platform as claimed in claim 1, It is characterized in that The base recognition unit divides the current signal sequence read by the input unit into signal blocks with the same length using the configured input working thread, and puts each divided signal block into the block input asynchronous queue in turn for reading by the packaging link.

3. The base recognizer based on the DCU hardware platform as claimed in claim 2, It is characterized in that After dividing each current signal sequence, the input working thread puts the current signal sequence into a working read segment set for reading in the link of determining whether all signal blocks of the current signal sequence have been identified.

4. The base recognizer based on the DCU hardware platform as claimed in claim 3, It is characterized in that The base recognition unit uses the configured read segment management thread to read the current signal sequence from the working read segment set, and marks the information blocks that have been recognized in the identifier; when all information blocks of the read current signal sequence are recognized to be marked, it is determined that the recognition of all signal blocks of the current signal sequence is completed.

5. The base recognizer based on the DCU hardware platform as claimed in claim 4, It is characterized in that When all information blocks of the read current signal sequence are identified, the current signal sequence is deleted from the working read segment set.

6. The base recognizer based on the DCU hardware platform as claimed in claim 2, It is characterized in that The base recognition unit utilizes the configured base recognition work thread to obtain signal blocks from the block input asynchronous queue for packaging. The base recognition work thread puts each packaged batch into the input queue of the identifier, and uses a blocking mechanism to wait for the identifier to complete the base recognition of the batch, and then puts the information blocks of the batch into the completed operation block queue for reading in the link of determining whether all signal blocks of the current signal sequence have been recognized.

7. The base recognizer based on the DCU hardware platform as claimed in claim 6, It is characterized in that The base recognition unit is configured with two base recognition work threads, which use a ping-pong mechanism to put packaged batches into the input queue of the recognizer.

8. A base caller based on a DCU hardware platform as claimed in any one of claims 1 to 7, It is characterized in that The identifier performs a base recognition process using a configured base recognition model, which includes a sequentially stacked input layer, multiple convolutional layers, multiple long short-term memory network layers, a linear layer, and a conditional random field decoder.

9. The base recognizer based on the DCU hardware platform as claimed in claim 8, It is characterized in that The identifier uses the configured memory management kit to encapsulate a support tensor on the DCU video memory. During the base recognition process, the tensor views created by each operation are alternately mapped to the two ends of the support tensor; the minimum space of the support tensor is the maximum value of the sum of the sizes of the two tensor views that need to exist simultaneously in all operations.

10. A method for base recognition using the base recognizer according to any one of claims 1 to 9.