A general sparse computing adaptation method and system for multi-source heterogeneous data
By parsing multi-source heterogeneous data into a generalized coordinate sequence in a unified format and constructing a unified sparse batch structure, combined with a hardware performance evaluation mechanism, the computation path is dynamically selected, solving the efficiency and accuracy problems of sparse computation of multi-source heterogeneous data, and achieving software and hardware decoupling and stability.
Patent Information
- Application Number
- CN202610652179.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-13
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2046-05-13
AI Technical Summary
Existing technologies struggle to effectively handle sparse computation on multi-source heterogeneous data, resulting in low utilization of computing resources and memory bandwidth, high adaptation costs across modalities and hardware platforms, and an inability to detect changes in the sparsity of input data during runtime.
By acquiring heterogeneous data from multiple sources, parsing it into a generalized coordinate sequence in a unified format, constructing a unified sparse batch structure, and reconstructing dense operator nodes into dynamic routing nodes with dual-path execution capabilities, the optimal computation path is dynamically selected in conjunction with a hardware performance evaluation mechanism.
It achieves hardware and software decoupling, reduces invalid computation and GPU memory usage, ensures the stability and compatibility of the algorithm, dynamically selects the optimal computation path, and improves the efficiency and accuracy of sparse computation adaptation.
Smart Images

Figure CN122240990B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of multi-source data computing, and in particular to a general sparse computing adaptation method and system for multi-source heterogeneous data. Background Technology
[0002] Currently, with the rapid development of artificial intelligence technology, deep learning models have been widely applied in various fields such as computer vision, natural language processing, and recommender systems. In practical applications, input data exhibits high heterogeneity due to its diverse sources. Examples include 3D point cloud data generated by LiDAR in the field of autonomous driving, graph neural network (GNN) data in social networks or biochemistry, and attention matrices generated when large language models (LLMs) process long sequences. A common characteristic of these data is their extremely high sparsity, meaning they contain a large amount of zero-valued or invalid background information.
[0003] In related technologies, general-purpose high-performance computing hardware (such as GPUs and TPUs) is typically architecturally optimized for dense matrix multiplication. To process the aforementioned sparse and heterogeneous data on these general-purpose hardware devices, two common approaches are used: The first is zero-padding. This approach forces sparse data into a regular dense matrix format. While it can directly utilize existing dense operator libraries (such as cuBLAS), it leads to a large number of invalid zero-value multiplications and wasted memory space. Especially when processing point clouds or large image data with extremely high sparsity (e.g., sparsity exceeding 90%), the utilization of computing resources and memory bandwidth is low, severely limiting the inference speed of the model. The second approach is specialized sparse kernels. This approach develops dedicated sparse computing kernels for specific data structures (such as CSR and COO formats). However, this approach has the following significant drawbacks in practical applications: different modalities of data (graphs, text, point clouds) rely on different sparse storage formats, and the underlying instruction sets of different hardware vendors (NVIDIA, AMD, etc.) differ. Dedicated operators are difficult to adapt universally across modalities and hardware platforms, resulting in high development and maintenance costs. Existing solutions mostly employ static compilation or configuration, which cannot detect changes in the sparsity of the input data at runtime (i.e., data drift). In the critical sparsity range, the overhead of format conversion and index construction may exceed the benefits of sparse computation itself, leading to "negative optimization."
[0004] Therefore, there is an urgent need for a general sparse computing adaptation method that can uniformly represent multi-source heterogeneous data, dynamically select the optimal computing path based on hardware performance, and simultaneously take into account both inference acceleration and training accuracy. Summary of the Invention
[0005] The purpose of this application is to provide a general sparse computing adaptation method and system for multi-source heterogeneous data, which can effectively improve the efficiency and accuracy of the sparse computing adaptation process.
[0006] To achieve the above objectives, this application provides the following solution: In a first aspect, this application provides a general sparse computation adaptation method for multi-source heterogeneous data, comprising: acquiring multi-source heterogeneous data; parsing the multi-source heterogeneous data to obtain a generalized coordinate sequence in a unified format, wherein the generalized coordinate sequence includes position indices and feature values; filtering a set of valid positions from the generalized coordinate sequence using initially preset sparsification parameters to construct a unified sparse batch structure; parsing the computation graph of the target neural network and identifying at least one dense operator node; reconstructing the dense operator node into a dynamic routing node with dual-path execution capability, wherein the dynamic routing node includes parallel... The system sets up an original dense operator path and a sparse computing kernel path that supports the unified sparse batch structure. The sparse computing kernel path is configured with a data format adaptation mechanism. The sparsity index of the unified sparse batch structure is monitored in real time, and the estimated comprehensive performance under the sparse computing kernel path is evaluated in combination with the data dimension and a pre-built hardware performance evaluation mechanism to obtain the evaluation result. Based on the evaluation result, the execution path is dynamically selected, and the data stream is scheduled to the corresponding computing unit for execution. The estimated comprehensive performance includes at least the sum of the estimated execution time of the sparse computing kernel and the estimated conversion time of the data format adaptation mechanism.
[0007] Secondly, this application provides a general sparse computation adaptation system for multi-source heterogeneous data. The system includes: a unified mapping module for acquiring multi-source heterogeneous data, parsing the data to obtain a generalized coordinate sequence in a unified format, the generalized coordinate sequence containing position indices and feature values; a batch construction module for filtering a set of valid positions from the generalized coordinate sequence using initially preset sparsification parameters to construct a unified sparse batch structure; and a graph adaptation engine for parsing the computation graph of the target neural network and identifying at least one dense operator node, reconstructing the dense operator node into a dynamic routing node with dual-path execution capability; the dynamic routing... The system comprises nodes including parallel raw dense operator paths and sparse computing kernel paths supporting the unified sparse batch structure; the sparse computing kernel paths are configured with a data format adaptation mechanism; a routing control module is used to monitor the sparsity index of the unified sparse batch structure in real time, and, in conjunction with data dimension and hardware performance evaluation mechanisms, evaluate the estimated comprehensive performance under the sparse computing kernel paths to obtain evaluation results, dynamically select execution paths based on the evaluation results, and also generate routing control instructions to schedule data streams to corresponding computing units; the estimated comprehensive performance includes at least the sum of the estimated execution time of the sparse computing kernel and the estimated conversion time of the data format adaptation mechanism.
[0008] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application provides a general sparse computation adaptation method and system for multi-source heterogeneous data. By using a generalized coordinate sequence and a unified sparse batch structure, it shields the underlying storage differences of different modalities such as point clouds, graph data, and text, achieving hardware-software decoupling. Combined with a sparse computation kernel, it effectively reduces invalid computation caused by zero-padding and lowers memory usage. Through a dual-path design and dynamic routing strategy, it ensures that when the sparsity gain is unclear or negative, the system can seamlessly revert to standard dense computation, avoiding performance degradation and guaranteeing algorithm stability and backward compatibility. A hardware performance evaluation mechanism combined with a hysteresis buffer is introduced, which can dynamically switch between sparse and dense paths based on real-time sparsity and hardware characteristics, selecting the optimal computation path in real time, achieving dynamic, hardware-aware performance maximization. This application can effectively improve the efficiency and accuracy of the sparse computation adaptation process. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a flowchart of a general sparse computation adaptation method for multi-source heterogeneous data in Embodiment 1 of this application.
[0011] Figure 2 This is a flowchart of the general sparse computing adaptation method for multi-source heterogeneous data in Embodiment 1 of this application.
[0012] Figure 3 This is a schematic diagram of the data processing flow for multi-source heterogeneous data in Embodiment 1 of this application.
[0013] Figure 4 This is a logical diagram of the hardware-aware dynamic routing and computational path selection mechanism in Embodiment 1 of this application.
[0014] Figure 5 This is a schematic diagram of the transfer training mode and accuracy compensation process in Embodiment 1 of this application.
[0015] Figure 6 This is a schematic diagram of a general sparse computing adaptation system for multi-source heterogeneous data in Embodiment 2 of this application.
[0016] Figure 7 This is a schematic diagram of the electronic device in Embodiment 3 of this application. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0019] like Figure 1 and Figure 2 As shown in the embodiments of this application, a general sparse computing adaptation method for multi-source heterogeneous data is provided. This method includes: S1. Obtain multi-source heterogeneous data, parse the multi-source heterogeneous data, and obtain a generalized coordinate sequence in a unified format. The generalized coordinate sequence contains position index and feature value.
[0020] S2. Select the set of valid positions from the generalized coordinate sequence using the initially preset sparsification parameters to construct a unified sparse batch structure.
[0021] S3. Analyze the computation graph of the target neural network and identify at least one dense operator node. Reconstruct the dense operator node into a dynamic routing node with dual-path execution capability. The dynamic routing node includes the original dense operator path set in parallel and the sparse computation kernel path that supports a unified sparse batch structure. The sparse computation kernel path is configured with a data format adaptation mechanism.
[0022] S4. Monitor the sparsity index of the unified sparse batch structure in real time, and combine the data dimension and the pre-built hardware performance evaluation mechanism to evaluate the estimated comprehensive performance under the sparse computing kernel path to obtain the evaluation result. Based on the evaluation result, dynamically select the execution path and schedule the data stream to the corresponding computing unit for execution. The estimated comprehensive performance includes at least the sum of the estimated execution time of the sparse computing kernel and the estimated conversion time of the data format adaptation mechanism.
[0023] This application provides a general sparse computation adaptation method for multi-source heterogeneous data. By using a generalized coordinate sequence and a unified sparse batch structure, it shields the underlying storage differences of different modalities such as point clouds, graph data, and text, achieving hardware-software decoupling. Combined with a sparse computation kernel, it effectively reduces invalid computation caused by zero-padding and lowers memory usage. Through a dual-path design and dynamic routing strategy, it ensures that when the sparsity gain is unclear or negative, the system can seamlessly revert to standard dense computation, avoiding performance degradation and guaranteeing algorithm stability and backward compatibility. A hardware performance evaluation mechanism combined with a hysteresis buffer is introduced, which can dynamically switch between sparse and dense paths based on real-time sparsity and hardware characteristics, selecting the optimal computation path in real time, achieving dynamic, hardware-aware performance maximization. This application can effectively improve the efficiency and accuracy of the sparse computation adaptation process.
[0024] In some embodiments, the execution path is dynamically selected based on the evaluation results, and the data stream is scheduled to the corresponding computing unit for execution, specifically including: When the estimated overall performance of the sparse computing kernel path is better than that of the original dense operator path, the data flow is scheduled to be executed on the sparse computing kernel path; otherwise, the data flow is scheduled to be executed on the original dense operator path; wherein the estimated overall performance includes at least the estimated performance gain and the data format adaptation overhead.
[0025] The hardware performance evaluation mechanism is based on a pre-built multidimensional lookup table or regression model. The multidimensional lookup table or regression model is constructed by pre-executing benchmark tests on the target hardware platform, traversing different combinations of input data dimensions and sparsity, and determining the critical point when the throughput of sparse operators is equal to that of dense operators.
[0026] When executing dynamic routing nodes, a hysteresis buffer based on critical points is applied. When the actual sparsity continuously crosses the boundary of the hysteresis buffer, a switching of the computation path is triggered.
[0027] like Figure 2 The diagram shown is a flowchart of a general sparse computing adaptation method for multi-source heterogeneous data in an embodiment of this application. The steps in this method can be summarized as: unified mapping of heterogeneous data, construction of sparse batch data, dynamic adaptation of operator graph, and hardware-aware dynamic routing.
[0028] like Figure 3 As shown, specifically regarding step S1, the unified mapping of heterogeneous data, in practical applications, the data sources are diverse. This step utilizes a configured discrete mapping protocol to parse input data with varying physical storage formats into a "generalized coordinate sequence." Multi-source heterogeneous data includes: 3D point clouds, graph neural network data, and sparse text attention data (such as large language model attention matrix data). The specific processing and parsing procedures for different types of data are as follows: 1. For 3D point cloud data (such as LiDAR scan data): Discretization is performed using a voxel grid. Assume the point cloud spatial extent is... voxel size is Then for any point Generalized coordinate index Generated through hash function mapping: .
[0029] This generates a sequence containing [Hash coordinate index, reflection intensity]. Represents the spatial coordinates of a three-dimensional point cloud.
[0030] 2. For Graph Neural Network (GNN) data: The generalized coordinate sequence represents the node IDs and the connectivity relationships in the adjacency matrix. The coordinates of the non-zero elements in the adjacency matrix are... Directly used as two-dimensional generalized coordinates, the corresponding eigenvalues are the edge weights. .
[0031] 3. For Large Language Models (LLM): For the Transformer's self-attention mechanism, when processing long input sequences, an attention score matrix is generated. This matrix theoretically contains the correlation strength between all input tokens. Sparse filtering is performed based on a threshold, retaining only token pairs whose attention scores are greater than a preset threshold (e.g., 0.01). As a generalized coordinate system, where... and These represent the position indices of the query and key terms in the self-attention computation, respectively, thus achieving a sparse representation of long sequence attention. Through this mapping, regardless of whether the original data is in CSR format, COO format, or an unstructured list, it is transformed into a unified intermediate representation (IR), whose logical structure is as follows: The coordinate tensor and A combination of feature tensors.
[0032] 4. Mass spectrometry data for the field of biochemistry: Mass spectrometry data are typically represented as a two-dimensional sequence of mass-to-charge ratio (m / z) and relative abundance (intensity), exhibiting extremely high sparsity in practical detection. A configured discrete mapping protocol is used to discretize (or bin) the continuous mass-to-charge ratio. Assume a preset mass-to-charge ratio resolution of... For any data point Its generalized coordinate index Generated through formula mapping: Thus, the original one-dimensional mass spectrum sequence is mapped to a generalized coordinate sequence containing [discrete mass-to-charge ratio coordinate index, abundance eigenvalue].
[0033] After obtaining the generalized coordinate sequence in a unified format, this method further includes the following steps: maintaining a sliding calibration window containing historical input samples; performing background statistics on the numerical sequence within the sliding calibration window, and dynamically calculating and updating the sparsification parameters using quantile statistics or robust noise estimation methods. The sparsification parameters include at least a sparsity truncation threshold and a block partitioning size to adapt to real-time drift in the input data distribution.
[0034] In step S2, the unified sparse batch structure includes at least a spatial index, non-zero values, and batch mapping relationships. When constructing the unified sparse batch structure, this method also includes: constructing a sparse-aware mask based on structured association information, which includes at least the time series relationship, spatial neighborhood relationship, semantic similarity relationship, or spectral adjacency relationship of the input data; and attaching a sparse-aware mask to the unified sparse batch structure to constrain the subsequent sparse computation kernel to perform interactive computation only within the effective neighborhood, thereby avoiding interference from invalid background features.
[0035] Specifically, in step S2, a set of valid locations is selected from the generalized coordinate sequence based on the sparsity parameter. To adapt to the drift in data distribution, this embodiment incorporates an adaptive calibration step before the construction step: the system maintains a sliding calibration window (e.g., containing the most recent 50 frames of samples) and calculates the background noise threshold using quantile statistics. For example, if statistics show that 95% of voxel intensities are below 0.1, the sparsity truncation threshold is dynamically adjusted to 0.1 to filter out invalid background.
[0036] This step also introduces a Top-K fidelity mechanism: while using a threshold to filter low-response features, it forcibly retains a preset number of generalized coordinate positions or data blocks with the highest activity, for example, forcibly retaining the most active (Activation) data. Each feature point is used to prevent the loss of crucial small target information in extremely sparse situations (such as long-distance target detection). This ensures that even with extremely sparse signal input, a minimum number of feature tokens are retained.
[0037] The final unified sparse batch structure is implemented in memory using the following three compact arrays: 1. Coordinates (coordinate array): dimensions are... , a spatial index for storing valid points.
[0038] 2. Features (feature array): Dimensions are... Store the corresponding feature vector.
[0039] 3. Batch_Map: Records the starting offset of each sample in the sparse array, used for index recovery during parallel computing.
[0040] In step S3, the system automatically parses the computation graph of the target neural network (such as a PyTorch or TensorFlow model). The specific process is as follows: The system iterates through all nodes in the computation graph, matching node types. When a dense operator node (such as Conv2d, Linear, MatMul) is identified, its input data attributes are checked. If the node is identified as a target node that can be sparsely optimized, the system does not directly remove the original node, but instead reconstructs and encapsulates it into a "Dynamic Routing Block" with dual-path execution capabilities. This Dynamic Routing Block logically contains two parallel computational branches, as follows: Dense Fallback Path: The original dense operators and their parameters are fully preserved. This allows for direct processing of dense data when the data sparsity is low or the sparsity gain is negative, ensuring the stability and compatibility of the computation. Sparse Acceleration Path: Instantiate sparse computation kernels that are functionally equivalent to the original operators (e.g., SubmanifoldSparseConv corresponding to Conv2d) to provide computational acceleration when the data is highly sparse.
[0041] Only in the sparse computing acceleration path, the system automatically inserts a data format adaptation mechanism at the input and output of the sparse computing kernel (i.e., the Scatter operation is used to disperse and fill the uniform sparse batch structure into the format required by the kernel, and the Gather operation is used for aggregation and extraction after computation) to ensure the connectivity of the data flow with the main network when entering and leaving the sparse kernel, while the dense path remains in a straight-through state without additional format conversion overhead.
[0042] To further clarify the full-process operation mechanism of the aforementioned general sparse adaptation method in specific models for those skilled in the art, the following explanation uses a typical one-dimensional deep convolutional neural network (1D-CNN) architecture used for mass spectrum peak classification and biomarker identification in the fields of biomedicine and chemical analysis as an example: In traditional processing workflows, to enable deep learning hardware to process mass spectrometry data, it is usually necessary to forcibly pad the entire spectrum with zeros to align dimensions, resulting in significant waste of GPU memory. However, in the general system provided in this application: First, after the system receives the raw spectrum output from the high-throughput mass spectrometer, the unified mapping module and the batch construction module work together to filter out baseline noise and apply a Top-K fidelity mechanism to retain trace substance characteristics, constructing a unified sparse batch structure containing effective mass-to-charge ratio coordinates and abundance features. Subsequently, the graph adaptation engine parses the computational graph of the target mass spectrometry analysis model and locates the standard one-dimensional dense convolutional layer (1D DenseConvolution) in its backbone network. The system reconstructs these into dynamic routing nodes, where one path maintains the original one-dimensional dense convolution, and the other path dynamically mounts a sparse one-dimensional convolution kernel (Sparse 1D Conv) that supports this sparse batch structure. Finally, during forward inference, due to the significant differences in mass spectral peak densities among different detection samples, the routing control module monitors the sparsity of the current spectral band in real time. If a dense peak cluster spectral band is encountered, the evaluation and decision format conversion cost is higher than dense computation. The system then smoothly schedules the data stream to the dense convolution path, effectively avoiding the "computational negative benefit" problem caused by existing single sparsification strategies when processing locally dense mass spectral signals, thus ensuring the ultimate performance and accuracy of large-scale mass spectrometry detection.
[0043] like Figure 4 The diagram illustrates the hardware-aware dynamic routing process in this embodiment. In step S4, the unified sparse batch structure obtained earlier is used as input data, and sparsity monitoring is performed in real time. The system monitors the sparsity of the data in real time and executes the following logic: It calculates the sum of the estimated execution time of the sparse computing kernel and the estimated conversion time of the data format adaptation mechanism as the first cost; it calculates the estimated execution time of the original dense operator as the second cost; it compares the first cost with the second cost. If the first cost is less than the second cost, the estimated comprehensive performance of the sparse computing kernel path is better than that of the original dense operator path, and the data flow is scheduled to be executed on the sparse computing kernel path; otherwise, the data flow is scheduled to be executed on the original dense operator path. The specific process is as follows: Cost Modeling Process: Utilizing a pre-built hardware performance characteristic table (LUT). This table uses [input dimension, sparsity] as the lookup key and [operator latency] as the storage value. For example, for Matrix multiplication: When the real-time sparsity is 95%, the time taken to look up the sparse kernel is... Format conversion takes time The first cost totals 0.7ms; The corresponding dense operator time consumption (Second cost); at this time It is better to determine sparse paths.
[0044] Hysteresis Decision Process: To prevent performance jitter caused by frequent switching near the critical point, this application introduces a hysteresis buffer. Two thresholds are set (e.g., sparsity of 80% and 85%).
[0045] State A (currently a dense path): Switch to a sparse path only when the real-time sparsity continues to rise and exceeds 85%; State B (currently a sparse path): Switch back to a dense path only when the real-time sparsity continues to fall and is below 80%.
[0046] Execution process: The routing controller generates control signals based on the above evaluation results and schedules the data stream to the corresponding computing unit for execution.
[0047] like Figure 5 As shown, in addition to model deployment and inference, the method in this embodiment also supports a model transfer training mode. In the transfer training mode, based on the unified sparse batch structure and the dynamic routing node, the following steps are performed: During training, the sparsity truncation threshold is dynamically adjusted based on the number of training steps, and the sparsity of the model input data is gradually increased according to a preset strategy. During backpropagation, the corresponding sparse or dense gradient operator is automatically matched based on the computation path selected by the dynamic routing node in forward propagation, and the model parameters are updated. Accuracy compensation is performed in transfer learning mode using the following steps: A dense reference model is constructed and runs under a dense computation path. The dense reference model has the same network structure as the current model and its parameters are frozen. The output features of the dense reference model are used as supervision signals to calculate the difference loss between the dense reference model and the output features of the current model under the sparse computation path. This difference loss is then added to the total loss function to guide the current model in updating its parameters, compensating for the information loss introduced by the sparsity operation. The specific training process is as follows: 1. Sparsity Scheduling: In the early stages of training, before the model parameters have converged, introducing high sparsity too early may lead to feature loss. Therefore, this embodiment adopts a progressive strategy: at the beginning of training, a low sparsity truncation threshold is set (to retain more information); as the number of training steps increases, the threshold is gradually increased to approximate the true sparsity during inference. This is similar to the idea of "course learning".
[0048] 2. Precision Compensation Based on Knowledge Distillation: To compensate for the slight precision loss caused by sparsity, the system constructs a dense reference model (Teacher Model). This model has the same structure but all parameters are frozen, and it always runs in dense mode. During training, the total loss function is calculated: .
[0049] in, The main loss of the task (such as cross-entropy). This is the feature difference loss between sparse and dense outputs (such as MSE Loss). This is the balance coefficient; This represents the feature representation output by the dense reference model under dense computational paths. In other words, for the same input sample, without sparsity truncation, or always operating on a dense path, it represents the intermediate or final features output by the frozen Teacher Model. It is equivalent to reference features under "complete information conditions" and is used as a supervisory signal. This represents the corresponding feature representation output by the current sparsed model under the sparse computation path. In other words, it's the intermediate or final feature obtained by the current model after the input data has passed through a unified sparse batch structure, a sparse computation kernel path, and dynamic routing nodes. It is the output of the Student Model and needs to approximate Feature_dense as closely as possible. This is used when calculating the total loss. Then, backpropagation and parameter updates are performed. In this way, the sparse model is forced to "mimic" the behavior of the dense model, thereby achieving accuracy compensation.
[0050] The method in this application, through a generalized coordinate sequence and a unified sparse batch structure, shields the underlying storage differences of different modalities such as point clouds, graph data, and text, achieving hardware-software decoupling. Combined with a sparse computation kernel, it effectively avoids invalid computations caused by zero-padding, significantly reducing GPU memory usage. A hardware performance evaluation mechanism incorporating a hysteresis buffer is introduced, which dynamically switches between sparse and dense paths based on real-time sparsity and hardware characteristics, effectively avoiding negative optimization problems caused by format conversion overhead in critical sparsity scenarios. Through adaptive calibration steps and a Top-K fidelity mechanism, it can perceive and adapt to the distribution drift of input data in real time, ensuring that key features are preserved and computational stability is maintained even under extreme data conditions (such as high noise or extreme sparseness). By combining a transfer learning training mode with a precision compensation scheme of sparse scheduling and knowledge distillation, it solves the problem of convergence difficulties in direct training under sparse architectures, enabling developers to perform end-to-end fine-tuning and deployment of sparse models. Based on this, the method in this application has the beneficial effects of high efficiency, high precision, low GPU memory usage, robustness, and strong applicability.
[0051] Example 2 like Figure 6 As shown in the figure, this application provides a general sparse computing adaptation system for multi-source heterogeneous data. The system includes: a unified mapping module, a batch construction module, a graph adaptation engine, and a routing control module.
[0052] The unified mapping module acquires multi-source heterogeneous data, parses it to obtain a generalized coordinate sequence in a unified format, which includes position indices and feature values. The batch construction module filters valid position sets from the generalized coordinate sequence using initially preset sparsity parameters to construct a unified sparse batch structure. The graph adaptation engine parses the computation graph of the target neural network and identifies at least one dense operator node, reconstructing it into a dynamic routing node with dual-path execution capability. The dynamic routing node includes parallel-configured original dense operator paths and sparse computation kernel paths supporting the unified sparse batch structure; the sparse computation kernel paths are configured with a data format adaptation mechanism. The routing control module is used to monitor the sparsity index of the unified sparse batch structure in real time, and evaluate the estimated comprehensive performance under the sparse computing kernel path by combining data dimensions and hardware performance evaluation mechanisms to obtain evaluation results. Based on the evaluation results, it dynamically selects the execution path and is also used to generate routing control instructions to schedule the data stream to the corresponding computing unit. The estimated comprehensive performance includes at least the sum of the estimated execution time of the sparse computing kernel and the estimated conversion time of the data format adaptation mechanism.
[0053] For example, the unified mapping module is configured to interface with different data sources and execute the aforementioned discrete mapping protocol parsing. The batch construction module is the core of memory management, configured to allocate contiguous memory to store non-zero elements and perform Top-K filtering and adaptive calibration. The graph adaptation engine, as a compiler front-end component, is configured to parse the computation graph structure, perform dynamic routing node construction (reconstruction), establish sparse and dense parallel dual computation paths, and insert adaptation operators at the input / output ends of the sparse path. The routing controller, as a runtime component, has a built-in hardware performance lookup table (LUT), enabling it to complete path decisions with lower overhead (microseconds) and drive data flow scheduling.
[0054] Example 3 like Figure 7 As shown, this application provides an electronic device including a memory (RAM, ROM) and a processor (such as a CPU, GPU or dedicated AI accelerator card), a bus interface and a communication interface. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0055] Specifically, the processor is responsible for executing the aforementioned dynamic routing logic and operator scheduling. The memory stores pre-defined hardware performance characteristic tables (Benchmark Data) and a pre-compiled sparse operator library. When processing large-scale graph data or point clouds, the electronic device utilizes DMA (Direct Memory Access) technology to quickly transfer uniform sparse batch structure data between memory and the processor cache, reducing CPU involvement and improving efficiency and reducing computational resource consumption.
[0056] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0057] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0058] Example 4 To further illustrate the technical solution of this application, based on the above embodiments, this embodiment takes the processing of mass spectrometry data in the fields of biomedicine or chemical analysis as an example to elaborate in detail the specific execution process of the general sparse computation adaptation method for multi-source heterogeneous data. Mass spectrometry data is usually represented as a two-dimensional spectrum of mass-to-charge ratio (m / z) and relative abundance (intensity). Since a large number of mass-to-charge ratio positions have only weak baseline noise or zero abundance, this type of data exhibits extremely high sparsity in actual detection.
[0059] Specifically, the general sparse computation adaptation process for mass spectrometry data includes: In step S1, raw mass spectrometry data is acquired, and the continuous mass-to-charge ratio (m / z) is discretized (or gridded) using a configured discrete mapping protocol. Based on a preset mass-to-charge ratio resolution, the mass-to-charge ratio values are mapped to discrete coordinate indices, thereby resolving the one-dimensional mass spectrometry sequence into a generalized coordinate sequence containing discrete mass-to-charge ratio coordinate indices and abundance eigenvalues. This step effectively unifies the differences in underlying data formats produced by different mass spectrometry instruments.
[0060] During step S2, the system maintains a sliding calibration window containing historical mass spectrometry samples, performs background statistics on the baseline noise within the sliding calibration window, and dynamically calculates and updates the sparse cutoff threshold to filter out invalid background noise. Simultaneously, the Top-K fidelity mechanism is applied to forcibly retain a preset number of feature peaks with the highest activity (i.e., abundance) when filtering low-response features. Furthermore, a sparse sensing mask is constructed based on the spatial neighborhood relationships of isotope peak clusters, and the filtered mass spectrometry peaks are packaged into a unified sparse batch structure. This process ensures that key feature information of trace elements is not lost in extremely sparse samples.
[0061] During step S3, the computational graph of the target neural network (e.g., a 1D-CNN or Transformer model) used for mass spectrometry data analysis is parsed. When dense operator nodes processing the full-spectrum graph are identified, these dense operator nodes are reconstructed into dynamic routing nodes with dual-path execution capabilities. These dynamic routing nodes include the original dense operator paths configured in parallel, and sparse computational kernel paths (such as sparse 1D convolution or sparse attention mechanism paths) instantiated for sparse mass spectrometry peaks. Data format adaptation mechanisms for format conversion are inserted at the input and output of these sparse computational kernel paths.
[0062] During step S4, in the inference phase of the mass spectrometry model, the sparsity index of the unified sparse batch structure of the current input mass spectrometry sample is monitored in real time. Combining the data dimension and a pre-built hardware performance evaluation mechanism, the estimated overall performance under the sparse computation kernel path is evaluated. If the current sample sparsity is extremely high, and the sum of the estimated execution time of the sparse computation kernel and the conversion time of the data format adaptation mechanism (first cost) is better than the time required to execute the full-spectrum zero-padding dense convolution (second cost), then the routing control module generates an instruction to schedule the mass spectrometry data stream to the sparse computation kernel path for execution. Conversely, if the local spectral peak clusters are dense, resulting in a negative sparsity gain, then it is scheduled to the original dense operator path for execution. Furthermore, combined with the set hysteresis buffer, frequent switching of computation paths can be effectively prevented when processing consecutive mass spectrometry frames with critical sparsity.
[0063] Through the above embodiments, when processing high-throughput, high-dimensional mass spectrometry analysis tasks, this application does not require forcibly padding sparse mass spectrometry data with zeros to restore it to a huge dense tensor, which greatly saves the memory space and improves the computational throughput. At the same time, relying on the dynamic routing architecture and fidelity mechanism, the algorithm achieves efficient and stable execution while ensuring the accuracy of trace substance feature extraction.
[0064] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0065] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0066] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0067] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0068] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A general sparse computation adaptation method for multi-source heterogeneous data, characterized in that, The general sparse computation adaptation method for multi-source heterogeneous data includes: Acquire multi-source heterogeneous data, parse the multi-source heterogeneous data, and obtain a generalized coordinate sequence in a unified format, wherein the generalized coordinate sequence includes position index and feature value; The set of valid positions is selected from the generalized coordinate sequence by using initially preset sparsification parameters to construct a unified sparse batch structure; the sparsification parameters include at least a sparsity truncation threshold and a block partitioning size; the unified sparse batch structure includes at least a spatial index, non-zero values, and a batch mapping relationship. The computation graph of the target neural network is analyzed and at least one dense operator node is identified. The dense operator node is reconstructed into a dynamic routing node with dual-path execution capability. The dynamic routing node includes the original dense operator path set in parallel and the sparse computation kernel path supporting the unified sparse batch structure. The sparse computation kernel path is configured with a data format adaptation mechanism. The sparsity index of the unified sparse batch structure is monitored in real time, and the estimated comprehensive performance under the sparse computing kernel path is evaluated in combination with the data dimension and the pre-built hardware performance evaluation mechanism to obtain the evaluation result. Based on the evaluation result, the execution path is dynamically selected and the data stream is scheduled to the corresponding computing unit for execution. The estimated comprehensive performance includes at least the sum of the estimated execution time of the sparse computing kernel and the estimated conversion time of the data format adaptation mechanism.
2. The general sparse computation adaptation method for multi-source heterogeneous data according to claim 1, characterized in that, The step of dynamically selecting the execution path based on the evaluation results and scheduling the data stream to the corresponding computing unit for execution specifically includes: When the estimated overall performance of the sparse computing kernel path is better than that of the original dense operator path, the data flow is scheduled to be executed on the sparse computing kernel path; otherwise, the data flow is scheduled to be executed on the original dense operator path. The hardware performance evaluation mechanism is based on a pre-built multidimensional lookup table or regression model. The multidimensional lookup table or regression model is constructed by pre-executing benchmark tests on the target hardware platform, traversing different combinations of input data dimensions and sparsity, and determining the critical point when the throughput of sparse operators is equal to that of dense operators. When executing the dynamic routing node, a hysteresis buffer set based on the critical point is applied. When the actual sparsity continuously crosses the boundary of the hysteresis buffer, a switching of the computation path is triggered.
3. The general sparse computation adaptation method for multi-source heterogeneous data according to claim 2, characterized in that, The evaluation of the estimated overall performance under the sparse computing kernel path to obtain the evaluation results includes: The sum of the estimated execution time of the sparse computing kernel and the estimated conversion time of the data format adaptation mechanism is calculated as the first cost; The estimated execution time of the original dense operator is calculated as a second cost; Comparing the first cost with the second cost, if the first cost is less than the second cost, then the estimated overall performance of the sparse computing kernel path is better than that of the original dense operator path, and the data flow is scheduled to be executed on the sparse computing kernel path; otherwise, the data flow is scheduled to be executed on the original dense operator path.
4. The general sparse computation adaptation method for multi-source heterogeneous data according to claim 1, characterized in that, After obtaining a generalized coordinate sequence in a unified format, the method further includes: Maintain a sliding calibration window that includes historical input samples; Background statistics are performed on the numerical sequence within the sliding calibration window, and the sparsification parameters are dynamically calculated and updated using quantile statistics or robust noise estimation methods. The sparsification parameter is used to adapt to the real-time drift of the input data distribution.
5. The general sparse computation adaptation method for multi-source heterogeneous data according to claim 1, characterized in that, When constructing a unified sparse batch structure, the method further includes: Sparse perceptual masks are constructed based on structured association information, which includes at least the time-series relationships, spatial neighborhood relationships, semantic similarity relationships, or spectral adjacency relationships of the input data. The sparse-aware mask is added to the unified sparse batch structure to constrain the subsequent sparse computation kernel to perform interactive computation only within the effective neighborhood, thereby avoiding interference from invalid background features.
6. The general sparse computation adaptation method for multi-source heterogeneous data according to claim 4, characterized in that, The method further includes: in transfer learning mode, based on the unified sparse batch structure and the dynamic routing node, performing the following steps: During training, the sparsity truncation threshold is dynamically adjusted according to the number of training steps, and the sparsity of the model input data is gradually increased according to a preset strategy. During backpropagation, the corresponding sparse gradient operator or dense gradient operator is automatically matched and the model parameters are updated based on the computation path selected by the dynamic routing node in forward propagation.
7. The general sparse computation adaptation method for multi-source heterogeneous data according to claim 6, characterized in that, The transfer training mode also includes: Construct a dense reference model that runs on a dense computing path. The dense reference model has the same network structure as the current model and its parameters are frozen. Using the output features of the dense reference model as a supervision signal, the difference loss between the output features of the model and the current sparse computation path is calculated. The difference loss is added to the total loss function to guide the current model in updating its parameters, thereby compensating for the information loss introduced by the sparsification operation.
8. The general sparse computation adaptation method for multi-source heterogeneous data according to any one of claims 1-7, characterized in that, When constructing the unified sparse batch structure, the method further includes: In addition to using thresholds to filter valid locations, a preset number of generalized coordinate locations or data blocks with the highest activity are forcibly retained to ensure that even with extremely sparse signal input, the minimum number of feature tokens can be retained.
9. The general sparse computation adaptation method for multi-source heterogeneous data according to any one of claims 1-7, characterized in that, The multi-source heterogeneous data includes at least one of the following: 3D point cloud data, graph neural network data, large language model attention matrix data, and mass spectrometry data.
10. A general sparse computing adaptation system for multi-source heterogeneous data, characterized in that, The system includes: A unified mapping module is used to acquire multi-source heterogeneous data, parse the multi-source heterogeneous data, and obtain a generalized coordinate sequence in a unified format, wherein the generalized coordinate sequence includes position index and feature value; A batch construction module is used to filter a set of valid positions from the generalized coordinate sequence using initially preset sparsification parameters to construct a unified sparse batch structure; the sparsification parameters include at least a sparsity truncation threshold and a block partitioning size; the unified sparse batch structure includes at least a spatial index, non-zero values, and batch mapping relationships. A graph adaptation engine is used to parse the computation graph of the target neural network and identify at least one dense operator node, and reconstruct the dense operator node into a dynamic routing node with dual-path execution capability; the dynamic routing node includes the original dense operator path set in parallel and the sparse computation kernel path supporting the unified sparse batch structure; the sparse computation kernel path is configured with a data format adaptation mechanism. The routing control module is used to monitor the sparsity index of the unified sparse batch structure in real time, and evaluate the estimated comprehensive performance under the sparse computing kernel path by combining data dimensions and hardware performance evaluation mechanisms to obtain evaluation results. Based on the evaluation results, it dynamically selects the execution path and is also used to generate routing control instructions to schedule the data stream to the corresponding computing unit. The estimated comprehensive performance includes at least the sum of the estimated execution time of the sparse computing kernel and the estimated conversion time of the data format adaptation mechanism.
Citation Information
Patent Citations
Machine learning model compiling optimization method and device and computing equipment cluster
CN119903900A
Model fine tuning method and system based on feedback and enhancement
CN120562523A