Method and system for dynamic optimization of floating point data text output based on multiprocessor system
Through the method of adaptive grouping and normalized mantissa processing, the redundancy problem of floating-point data text output in multi-processor systems is solved, efficient text output and storage optimization are achieved, and the programming process is simplified.
Patent Information
- Application Number
- CN202511013082.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-07-23
AI Technical Summary
In multi-processor systems, redundant exponential symbol storage exists when outputting floating-point data textually. This results in low text output efficiency and an inability to fully utilize the parallel computing advantages of multiple processors. This is especially difficult to achieve in large-scale numerical simulation applications, as it makes it difficult to meet the dual requirements of data readability and output efficiency.
Adopting an adaptive grouping strategy, the GPU parallel computing power is used to extract the common exponent base and normalize the mantissa, constructing a two-level index structure to reduce redundant storage and improve text output efficiency.
It significantly reduces the redundant storage of floating-point data text output, improves I/O efficiency and data access performance, simplifies the programming process, and improves the overall running efficiency of the program.
Smart Images

Figure CN120523759B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a floating point data text output dynamic optimization method and system based on a multi-processor system, belonging to the field of electronic information technology. Background Art
[0002] With the development of new technologies, multi-processor systems are rapidly evolving, demonstrating even greater performance. CPUs and GPUs have played a key role in this process. The CPU has evolved from single-core to multi-core, and then to many-core, making multi-threaded parallel processing even more important. Simultaneously, the application of GPUs is also expanding. Beyond traditional graphics processing, their powerful floating-point computing capabilities have made them increasingly mainstream in mathematical computing. To adapt to this shift, GPU-specific programming languages and development tools are constantly emerging. As coprocessors for CPUs, GPUs are capable of handling highly parallel and high-density computing tasks. By integrating hundreds or even thousands of processing cores on a single chip, their computing efficiency far exceeds that of traditional CPUs in terms of cost and power consumption. Therefore, in the field of high-performance computing, which pursues both computing power and efficiency, GPU application is becoming increasingly widespread and has become a significant development trend. To fully leverage the advantages of multi-core and many-core computing, hardware upgrades alone are not enough; application software must also undergo corresponding revolutionary improvements. In the field of high-performance parallel computing, a common approach is to expand GPUs based on multi-core CPU architectures to form multi-processor systems and design corresponding software solutions to achieve efficient collaborative computing between the CPU and GPU.
[0003] However, when it comes to floating-point data text output, the traditional serial writing method and fixed-format output still have significant performance bottlenecks. This output method not only fails to fully utilize the parallel computing advantages of multiple processors, but also generates a large amount of redundant exponential symbol storage, resulting in inefficient text content output. At the same time, existing optimization solutions such as binary storage will destroy text readability, making it difficult to meet the dual requirements of scientific computing for data readability and output efficiency. This contradiction is particularly prominent in large-scale numerical simulation applications, and there is an urgent need for an innovative solution that can maintain text readability while significantly improving output efficiency. Summary of the Invention
[0004] In view of the shortcomings of the prior art, the present invention provides a method and system for dynamically optimizing floating-point data text output based on a multi-processor system;
[0005] The method of the present invention improves the exponential format writing mode of floating-point data by designing a new grouping strategy, extracts redundant content, and reduces the number of characters, thereby improving I / O efficiency.
[0006] The technical problem to be solved by the present invention is: in a multi-processor system, after migrating large-scale computing tasks to the GPU, the program can significantly improve computing efficiency through the parallel processing capabilities of the GPU. However, as the computing tasks accelerate, the bottleneck of the program often shifts from computing to I / O operations, especially when writing the calculation results to files. At this time, the program needs to output a large amount of floating-point data in text format, and floating-point numbers are usually represented in a fixed exponential format in the text. This representation method leads to redundant exponential symbol storage, which not only reduces the efficiency of text output, but also increases the size of the file. These problems may eventually lead to a decrease in the overall operating efficiency of the program.
[0007] In a multi-processor system, computing tasks are usually the bottleneck, but as the program is continuously optimized, the bottleneck gradually shifts to the I / O output link. The traditional batch transmission optimization method only transfers data in batches to text, without optimizing and reducing the characters, resulting in low text output efficiency. To solve this problem, the present invention proposes an innovative optimization method that aims to reduce the redundant exponential symbol storage generated by floating-point data during text output, thereby improving text output efficiency. In order to facilitate developers to efficiently implement this optimization strategy, the present invention also designs an easy-to-call automation interface - RFDR (Resolve Floating-point Data Redundancy). This interface can help programmers quickly integrate application optimization strategies, greatly simplifying the optimization process, and thus improving text output efficiency.
[0008] The technical solution of the present invention is:
[0009] The invention relates to a dynamic optimization method for floating-point data text output based on a multi-processor system, comprising:
[0010] Read float array;
[0011] Execute adaptive grouping strategies, including dynamically adjusting grouping methods based on differences in the number of rows and columns in the text output. When the difference in the number of rows and columns is large, prioritize the smaller one for grouping. Otherwise, select the most appropriate grouping strategy by calculating indicators in multiple dimensions, including the variance of row and column data indices and spatial continuity assessment.
[0012] Extracting a common exponent base and normalizing the mantissa; including: utilizing the parallel computing capability of the GPU to extract the common exponent base of each grouped data and save it; then, normalizing the mantissa of the data based on the obtained common exponent base;
[0013] Build a two-level index; extract all common index bases by traversing the array, merge the same common index bases and count the frequencies;
[0014] Text output.
[0015] According to the preferred embodiment of the present invention, an adaptive grouping strategy is executed, specifically comprising:
[0016] Definition: R represents the number of rows (Rows), C represents the number of columns (Columns), and T represents the threshold for row-column differences. Then the normalized difference of the row-column ratio is calculated as:
[0017] ;
[0018] The result range of NormalizedDiff is ;
[0019] If NormalizedDiff is not less than T, it means that the difference between the number of rows and columns is large, and the smaller number of rows and columns is selected as the group; if the number of rows is less than the number of columns, group by rows, and each row of data is treated as an independent group, and the number of rows is the number of groups; if the number of rows is greater than or equal to the number of columns, group by columns, and each column of data is treated as an independent group, and the number of columns is the number of groups; otherwise, enter multi-dimensional analysis;
[0020] The variance Var of the row and column data index is expressed as:
[0021] ;
[0022] Among them, N represents the total number of data in the current group. Represents the exponential part of the i-th data, Indicates the mean of the data index in the current group;
[0023] The spatial continuity evaluation Cont is expressed as:
[0024] ;
[0025] in, yes and Pearson correlation coefficient, Represents the exponential part of the i+1th data;
[0026] The weighted comprehensive score TotalScore of multi-dimensional analysis is expressed as:
[0027] ;
[0028] Compare the weighted comprehensive scores TotalScore of the multi-dimensional analysis and select the one with the smaller weighted comprehensive score TotalScore as the basis for grouping.
[0029] Further preferably, for two variables X and Y, their Pearson correlation coefficient is The calculation formula is:
[0030] ;
[0031] in, are the elements in variable X, is the average value of all elements in variable X, are the elements in variable Y, is the average value of all elements in variable Y, is the number of elements in variable X or variable Y.
[0032] More preferably, the one with the smaller weighted comprehensive score TotalScore of the multi-dimensional analysis is selected as the grouping basis; including:
[0033] If the sum of the weighted comprehensive scores of each row is less than the sum of the weighted comprehensive scores of each column, select Group by Rows; that is, treat the data of each row as an independent group; otherwise, select Group by Columns; that is, treat the data of each column as an independent group.
[0034] Preferably, according to the present invention, extracting a common exponent base and normalizing the mantissa specifically includes:
[0035] Analyze the data of each group, extract the exponent value of each floating-point number, and based on these exponent values, select the largest exponent in the group as the public exponent base; and save the public exponent base in the global memory array;
[0036] Normalize the floating-point numbers in the grouped data; adjust all floating-point data in the group according to the common exponent base, retain only the mantissa, and remove the part related to the common exponent base.
[0037] Preferably, according to the present invention, a two-level index is constructed, comprising:
[0038] The two-level index includes a first-level data structure and a second-level data structure; the first-level data structure is an index table entry, including a public exponential base, the starting position of the public exponential base in the lookup table, and the corresponding number of elements; the public exponential bases of each group are stored in the index table in ascending order; the second-level data structure is a main data structure, including an index table, a lookup table, an actual exponential value array, the total number of elements, and the number of unique exponential bases; the lookup table is used to store the group number corresponding to each public exponential base, and the actual exponential value array is used to store the public exponential base extracted from each group. The total number of elements refers to the number of all exponential bases, and the number of unique exponential bases refers to the number of unique public exponential bases.
[0039] In addition, the look-up table sequentially reads the common index bases stored in the index table, traverses the actual index value array, and sequentially stores the corresponding group numbers in the look-up table; each time a group number corresponding to a common index base is stored in the look-up table, the last storage position is recorded, so as to calculate the starting position of the group number of the next common index base in the look-up table and store it in the first-level data structure.
[0040] According to the application, preferably, the text output comprises:
[0041] Firstly, the grouping result is outputted;
[0042] Secondly, each unique common index base and the group number in which it appears after the induction and arrangement of all the common index bases extracted from each group are outputted;
[0043] Finally, the data after the normalization of the mantissa of each floating-point array is outputted.
[0044] According to the application, preferably, the floating-point data text output dynamic optimization method based on the multi-processor system is realized through the automatic interface RFDR.
[0045] A computer device comprises a memory and a processor, the memory stores a computer program, and the processor realizes the steps of the floating-point data text output dynamic optimization method based on the multi-processor system when executing the computer program.
[0046] A computer readable storage medium stores a computer program, and the computer program realizes the steps of the floating-point data text output dynamic optimization method based on the multi-processor system when executed by a processor.
[0047] A floating-point data text output dynamic optimization system based on a multi-processor system comprises:
[0048] A reading module is configured to read the floating-point array;
[0049] An adaptive grouping strategy execution module is configured to dynamically adjust the grouping mode according to the difference between the number of rows and columns of the text output; when the difference between the number of rows and columns is large, the smaller one is preferentially selected for grouping, otherwise, the most suitable grouping strategy is selected by calculating the indicators of multiple dimensions including the variance of the row and column data index and the spatial continuity evaluation;
[0050] A common index base extraction and normalization module is configured to extract the common index base of the data of each group by using the parallel computing capability of the GPU and save it; then, the mantissa of the data is normalized according to the obtained common index base;
[0051] The two-level index building module is configured to: extract all common index bases by traversing the array, merge the same common index bases and count the frequencies;
[0052] Output module, configured as: text output.
[0053] The beneficial effects of the present invention are:
[0054] 1. This invention proposes a new grouping strategy, which not only avoids the limitation of relying solely on the ratio of the number of rows and columns, but also selects the optimal grouping method according to the actual distribution characteristics of the data, thereby improving the accuracy and efficiency of grouping.
[0055] 2. The present invention reduces storage requirements and redundancy of stored data by extracting a common exponent base and normalizing the mantissa.
[0056] 3. The present invention constructs a two-level index structure to quickly store and search for group numbers corresponding to the public index base. This method can effectively integrate and manage data with the same public index base, improving data access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a flow chart of a method for dynamically optimizing floating-point data text output based on a multi-processor system according to the present invention;
[0058] Figure 2 This is a flow chart of the adaptive grouping strategy;
[0059] Figure 3 This is a schematic diagram of the floating-point data within the processing group;
[0060] Figure 4 Schematic diagram of the mapping relationship between the index table and the lookup table. DETAILED DESCRIPTION
[0061] The present invention will be further defined below with reference to the accompanying drawings and embodiments, but is not limited thereto.
[0062] Explanation of terms:
[0063] A multiprocessor system refers to a computer system architecture that can simultaneously use multiple processors (such as CPUs and GPUs) to perform computing tasks. The goal of a multiprocessor system is to improve the overall performance, processing power, and throughput of the system, especially when performing large computing tasks, by accelerating the computational process through parallel processing.
[0064] Example 1
[0065] Dynamic optimization method for floating point data text output based on multi-processor system, such as Figure 1 Shown, including:
[0066] Read an array of floating-point numbers; specifically, access each floating-point number in the array sequentially or randomly, and perform calculations, storage, transmission, or other operations on it as needed.
[0067] Executes an adaptive grouping strategy, including dynamically adjusting the grouping method based on the difference in the number of rows and columns in the text output. When the difference in the number of rows and columns is large, the smaller one is prioritized for grouping, thereby reducing the number of groups and grouping overhead. Otherwise, the most appropriate grouping strategy is selected by calculating indicators in multiple dimensions, including the variance of row and column data indices and spatial continuity assessment.
[0068] Extracting a common exponent base and normalizing the mantissas: This includes preprocessing the data for each group based on the resulting grouping results. Specifically, the program leverages the parallel computing capabilities of the GPU to extract and store the common exponent base for each grouped data. It then normalizes the mantissas based on the obtained common exponent base, thus avoiding redundant exponent symbol storage.
[0069] Constructing a two-level index: When the number of groups is large enough, the program may extract duplicate exponential bases. To avoid this, the program summarizes and organizes the common exponential bases extracted for each group. This part uses a two-level index structure to achieve shared storage of exponential bases. The program traverses the array to extract all common exponential bases, merges the same common exponential bases, and counts the frequency, thus resolving the redundancy of the same exponential bases across different groups.
[0070] Text output.
[0071] Example 2
[0072] The difference between the method for dynamic optimization of floating-point data text output based on a multi-processor system described in Example 1 is that:
[0073] Execute adaptive grouping strategies; e.g. Figure 2 As shown, specifically including:
[0074] Definition: R represents the number of rows (Rows), C represents the number of columns (Columns), and T represents the threshold for row-column differences. Then the normalized difference of the row-column ratio is calculated as:
[0075] ;
[0076] The result range of NormalizedDiff is ; The closer the value is to 1, the greater the difference between rows and columns, and the closer it is to 0, the similar number of rows and columns.
[0077] If NormalizedDiff is not less than T, it means that the difference between the number of rows and columns is large, and the smaller number of rows and columns is selected as the group; if the number of rows is less than the number of columns, group by rows, and each row of data is treated as an independent group, and the number of rows is the number of groups; if the number of rows is greater than or equal to the number of columns, group by columns, and each column of data is treated as an independent group, and the number of columns is the number of groups; otherwise, it means that the difference between the number of rows and columns is small, and enter multi-dimensional analysis;
[0078] Multidimensional analysis uses a weighted comprehensive score to select the optimal grouping direction based on two indicators: index variance analysis and spatial continuity assessment. Index variance analysis is used to select directions with higher base consistency in the data index within a group, guiding grouping decisions; spatial continuity assessment is used to select directions with greater local continuity in the data index within a group, assisting in optimizing performance.
[0079] The variance Var of the row and column data index is expressed as:
[0080] ;
[0081] Among them, N represents the total number of data in the current group. Represents the exponential part of the i-th data, Indicates the mean of the data index in the current group;
[0082] The spatial continuity evaluation Cont is expressed as:
[0083] ;
[0084] in, yes and The Pearson correlation coefficient is used to judge the correlation between adjacent indices and to quantify local smoothness. Represents the exponential part of the i+1th data;
[0085] The weighted comprehensive score TotalScore of multi-dimensional analysis is expressed as:
[0086] ;
[0087] Compare the weighted comprehensive scores TotalScore of the multi-dimensional analysis and select the one with the smaller weighted comprehensive score TotalScore as the basis for grouping.
[0088] The Pearson correlation coefficient was proposed by statistician Karl Pearson to measure the linear correlation between two continuous variables. For two variables X and Y, the Pearson correlation coefficient is The calculation formula is:
[0089] ;
[0090] The closer the value of Corr(X,Y) is to 1, the more the adjacent points have the same changing trend; the closer it is to 0, the more the adjacent points have no regularity; and the closer it is to -1, the more the adjacent points change in opposite directions. are the elements in variable X, is the average value of all elements in variable X, are the elements in variable Y, is the average value of all elements in variable Y, is the number of elements in variable X or variable Y.
[0091] The grouping basis is based on the smaller TotalScore of the multi-dimensional analysis weighted comprehensive score, including:
[0092] If the sum of the weighted comprehensive scores for each row is less than the sum of the weighted comprehensive scores for each column, group by row is selected; that is, each row's data is treated as a separate group. Otherwise, group by column is selected; that is, each column's data is treated as a separate group. This approach effectively solves the difficulty of grouping when the number of rows and columns is similar. Multidimensional analysis not only avoids the limitations of relying solely on the ratio of the number of rows and columns, but also incorporates the actual distribution characteristics of the data to more accurately select the optimal grouping method. This approach helps improve computational efficiency and storage performance after grouping.
[0093] Extract the public exponent base and normalize the mantissa; e.g. Figure 3 As shown, specifically including:
[0094] When converting floating-point data to text, directly storing the original exponent and mantissa often results in significant redundancy, wasting storage space, especially when processing large datasets. To effectively reduce storage overhead while ensuring numerical accuracy, this paper optimizes storage efficiency by extracting a common exponent base and normalizing the mantissa.
[0095] In floating point representation, floating point data is usually composed of a mantissa part and an exponent part, where the exponent part determines the order of magnitude of the data, and the mantissa part represents the precise value of the data. To reduce redundancy, it is necessary to first calculate the exponent part of each floating point number. The program analyzes the data in each group, extracts the exponent value of each floating point number (the exponent part of the floating point number can be obtained by calculating the logarithm of the floating point number to the base of 10 and rounding), and according to these exponent values, selects the largest exponent in the group as the common exponent base; this operation is realized through the parallel processing capability and atomic operation of the GPU, ensuring efficient determination of the common exponent base and saving the common exponent base in a global memory array (a global memory array is a data area stored on a GPU that can be accessed by all threads, usually used to store data that needs to be shared between different threads);
[0096] Once the common exponent base is determined, the floating point numbers in the data in the group will be normalized; specifically, the program will adjust all floating point data in the group according to the common exponent base, only keeping the mantissa, and removing the part related to the common exponent base. For example, the floating point data 0.1234567890123456, if stored in the file according to the fixed exponent format (such as 1P1E12.6) is 1.234568E-01. Assuming that the common exponent base of the group is -1, the floating point data removes the exponent part, and finally stores as 1.234568, thereby significantly reducing the character length of storage. Through this method, not only the storage requirement is reduced, but also the numerical accuracy is preserved, avoiding information loss.
[0097] Two-level index is constructed; as shown in Figure 4 , including:
[0098] After the above grouping, after extracting the common exponent base of each group and normalizing the mantissa, there is a problem: when the number of groups is too large, the common exponent bases of different groups may be repeated, resulting in redundant data. In order to solve this problem, the present application constructs a two-level index structure to count and summarize the common exponent bases and map them, thereby further reducing the storage space of redundant data.
[0099] The two-level index includes a first-level data structure and a second-level data structure; wherein, the first-level data structure is an index table entry, including a public exponent base, the starting position of the public exponent base in a lookup table (the lookup table is represented by an array in the data structure, and is used to store and quickly find the group number corresponding to the public exponent base), and the corresponding number of elements; the public exponent bases of each group are stored in the index table in ascending order; to facilitate subsequent searches. The second-level data structure is the main data structure, including an index table, a lookup table, an array of actual exponent values, the total number of elements, and the number of unique exponent bases; the lookup table is used to store the group number corresponding to each public exponent base, and the array of actual exponent values is used to store the public exponent bases extracted from each group. The total number of elements refers to the number of all exponent bases, and the number of unique exponent bases refers to the number of public exponent bases that appear only once.
[0100] Furthermore, the lookup table sequentially reads the public exponent bases stored in the index table, traverses the array of actual exponent values, and stores the corresponding group numbers in the lookup table. After each group number corresponding to a public exponent base is stored in the lookup table, the program records the last stored position in order to calculate the starting position of the next public exponent base's group number in the lookup table and store it in the first-level data structure. This mapping between the index table and the lookup table enables rapid lookup of the group number corresponding to the current exponent base and ensures that each identical exponent base is output only once, effectively reducing redundancy.
[0101] Text output; includes:
[0102] First, output the calculated grouping results;
[0103] Secondly, output each unique public exponent base and the group number in which it appears after summarizing all public exponent bases extracted from each group;
[0104] Finally, output the data after normalizing the mantissa of each floating-point array. Ensure that the mantissa of all floating-point numbers is normalized.
[0105] The above-mentioned method for dynamically optimizing floating-point data text output in a multiprocessor system is implemented using the automated interface RFDR. This invention designs and implements the automated interface RFDR, which aims to address the redundancy issue of floating-point data text output in exponential format on multiprocessor systems and improve I / O speed. The implementation of this interface simplifies programming, allowing programmers to directly call it to solve problems. A description of the interface is shown in Table 1:
[0106] Table 1 RLBO interface description;
[0107]
[0108] When using the RFDR interface, the programmer needs to first reference the RFDR module and then call related functions to implement the interface functions. An example of using the RFDR interface is shown in Table 2:
[0109] Table 2: Example of calling the RFDR interface.
[0110]
[0111] Through the implementation of this method, the present invention has been tested on a multi-processor system. Two test programs were used, and the test time was obtained by taking the average of three times.
[0112] Test 1 is a basic test program used to verify the efficiency difference between the inventive method and the original output method. During the I / O process, the program first reads input data from a specified text file and performs the necessary numerical calculations. The calculation results are then output to text files using both the inventive method and the original output method for subsequent comparison and analysis.
[0113] Test 2 is based on I / O time in the classical guidance center orbital program ORBIT. Written by RB White, ORBIT numerically simulates particle trajectories, velocities, and other relevant parameters. This program uses efficient numerical integration methods to dynamically calculate particle trajectories in a gravitational field and predict particle behavior based on initial conditions.
[0114] The testing and verification of our method consisted of two parts: Test 1, using a basic test program, compared the execution time of the original program with that of our method, verifying the performance acceleration effect of our method under different text sizes. Test 2, using the ORBIT program, compared the execution time of the original program with that of our method, verifying the acceleration effect of our method under different particle numbers. The specific experimental results and comparisons are shown in Tables 3 and 4 below.
[0115] Table 3 shows the time of the original program output and the method of the present invention under different text sizes in Test 1, as well as the efficiency improvement of the method of the present invention compared with the original program output.
[0116] Table 3 Comparison of output time under different text sizes in Test 1 (unit: ms);
[0117]
[0118] Table 4 shows the time of the original program output and the method of the present invention under different numbers of particles in Test 2, as well as the efficiency improvement of the method of the present invention compared with the original program output.
[0119] Table 4 Comparison of output time under different particle numbers in test 2 (unit: ms);
[0120]
[0121] Experimental results show that the proposed method exhibits significant advantages in acceleration performance. A series of comparative tests on different particle sizes and text sizes show that the proposed method exhibits performance improvements over the original program output solution.
[0122] Example 3
[0123] A computer device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for dynamic optimization of floating-point data text output based on a multi-processor system described in embodiment 1 or 2 are implemented.
[0124] Example 4
[0125] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for dynamic optimization of floating-point data text output based on a multi-processor system as described in embodiment 1 or 2.
[0126] Example 5
[0127] The floating point data text output dynamic optimization system based on multi-processor system includes:
[0128] The reading module is configured to: read the floating point array;
[0129] The adaptive grouping strategy execution module is configured to dynamically adjust the grouping method based on the difference in the number of rows and columns in the text output. When the difference in the number of rows and columns is large, the smaller one is prioritized for grouping. Otherwise, the most suitable grouping strategy is selected by calculating indicators in multiple dimensions, including the variance of row and column data indices and spatial continuity evaluation.
[0130] The public exponent base extraction and normalization module is configured to: utilize the parallel computing capability of the GPU to extract the public exponent base of each group of data and save it; then, normalize the mantissa of the data based on the obtained public exponent base;
[0131] The two-level index building module is configured to: extract all common index bases by traversing the array, merge the same common index bases and count the frequencies;
[0132] Output module, configured as: text output.
Claims
1. A method for dynamically optimizing floating-point data text output based on a multi-processor system, characterized in that: include: Read float array; Execute adaptive grouping strategies, including dynamically adjusting grouping methods based on differences in the number of rows and columns in the text output. When the difference in the number of rows and columns is large, prioritize the smaller one for grouping. Otherwise, select the most appropriate grouping strategy by calculating indicators in multiple dimensions, including the variance of row and column data indices and spatial continuity assessment. Extracting a common exponent base and normalizing the mantissa; including: utilizing the parallel computing capability of the GPU to extract the common exponent base of each grouped data and save it; then, normalizing the mantissa of the data based on the obtained common exponent base; Build a two-level index; extract all common index bases by traversing the array, merge the same common index bases and count the frequencies; Text output; Execute adaptive grouping strategy; specifically including: Definition: R represents the number of data rows, C represents the number of data columns, and T represents the threshold value of the row-column difference. Then the normalized difference of the row-column ratio is calculated as: The result range of NormalizedDiff is [0,1); If NormalizedDiff is not less than T, it means that the difference between the number of rows and columns is large, and the smaller number of rows and columns is selected as the group; if the number of rows is less than the number of columns, group by rows, and each row of data is treated as an independent group, and the number of rows is the number of groups; if the number of rows is greater than or equal to the number of columns, group by columns, and each column of data is treated as an independent group, and the number of columns is the number of groups; otherwise, enter multi-dimensional analysis; The variance Var of the row and column data index is expressed as: Among them, N represents the total number of data in the current group, Exp i Represents the exponential part of the i-th data, μ Exp Indicates the mean of the data index in the current group; The spatial continuity evaluation Cont is expressed as: Among them, Corr(Exp i ,Exp i+1 ) is Exp i and Exp i+1 Pearson correlation coefficient, Exp i+1 Represents the exponential part of the i+1th data; The weighted comprehensive score TotalScore of multi-dimensional analysis is expressed as: TotalScore=0.7*Var+0.3*Cont#(4); Compare the weighted comprehensive scores TotalScore of the multi-dimensional analysis and select the one with the smaller weighted comprehensive score TotalScore as the basis for grouping.
2. The method for dynamically optimizing floating-point data text output based on a multiprocessor system according to claim 1, wherein: For two variables X and Y, the calculation formula for the Pearson correlation coefficient Corr(X,Y) is: Among them, X i are the elements in variable X, is the average value of all elements in variable X, Y i are the elements in variable Y, is the average of all elements in variable Y, and N is the number of elements in variable X or variable Y.
3. The method for dynamically optimizing floating-point data text output based on a multiprocessor system according to claim 1, wherein: The grouping basis is based on the smaller TotalScore of the multi-dimensional analysis weighted comprehensive score, including: If the sum of the weighted comprehensive scores of each row is less than the sum of the weighted comprehensive scores of each column, select group by row; that is, treat the data of each row as an independent group; otherwise, select group by column; that is, treat the data of each column as an independent group; Extract the public exponent base and normalize the mantissa; specifically include: Analyze the data of each group, extract the exponent value of each floating-point number, and based on these exponent values, select the largest exponent in the group as the public exponent base; and save the public exponent base in the global memory array; Normalize the floating-point numbers in the grouped data; adjust all floating-point data in the group according to the common exponent base, retain only the mantissa, and remove the part related to the common exponent base.
4. The method for dynamically optimizing floating-point data text output based on a multiprocessor system according to claim 1, wherein: Build a two-level index; including: The two-level index includes a first-level data structure and a second-level data structure; the first-level data structure is an index table entry, including a public exponential base, the starting position of the public exponential base in the lookup table, and the corresponding number of elements; the public exponential bases of each group are stored in the index table in ascending order; the second-level data structure is a main data structure, including an index table, a lookup table, an actual exponential value array, the total number of elements, and the number of unique exponential bases; the lookup table is used to store the group number corresponding to each public exponential base, and the actual exponential value array is used to store the public exponential base extracted from each group. The total number of elements refers to the number of all exponential bases, and the number of unique exponential bases refers to the number of unique public exponential bases. In addition, the lookup table reads the public exponent bases stored in the index table in sequence, traverses the actual exponent value array, and stores the corresponding group numbers in the lookup table in sequence; whenever the group number corresponding to a public exponent base is stored in the lookup table, the last storage position is recorded in order to calculate the starting position of the group number of the next public exponent base in the lookup table and store it in the first-level data structure.
5. The method for dynamically optimizing floating-point data text output based on a multiprocessor system according to claim 1, wherein: Text output; includes: First, output the calculated grouping results; Secondly, output each unique public exponent base and the group number in which it appears after summarizing all public exponent bases extracted from each group; Finally, the data after normalization of the mantissa of each floating-point array is output.
6. The method for dynamic optimization of floating-point data text output based on a multiprocessor system according to any one of claims 1 to 5, characterized in that: The above-mentioned floating-point data text output dynamic optimization method based on a multi-processor system is implemented through the automation interface RFDR.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for dynamic optimization of floating-point data text output based on a multi-processor system according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for dynamic optimization of floating-point data text output based on a multi-processor system according to any one of claims 1 to 6 are implemented.
9. A floating point data text output dynamic optimization system based on a multi-processor system, characterized in that: include: The reading module is configured to: read the floating point array; The adaptive grouping strategy execution module is configured to dynamically adjust the grouping method based on the difference in the number of rows and columns in the text output. When the difference in the number of rows and columns is large, the smaller one is prioritized for grouping. Otherwise, the most suitable grouping strategy is selected by calculating indicators in multiple dimensions, including the variance of row and column data indices and spatial continuity evaluation. Specifically, it includes: Definition: R represents the number of data rows, C represents the number of data columns, and T represents the threshold value of the row-column difference. Then the normalized difference of the row-column ratio is calculated as: The result range of NormalizedDiff is [0,1); If NormalizedDiff is not less than T, it means that the difference between the number of rows and columns is large, and the smaller number of rows and columns is selected as the group; if the number of rows is less than the number of columns, group by rows, and each row of data is treated as an independent group, and the number of rows is the number of groups; if the number of rows is greater than or equal to the number of columns, group by columns, and each column of data is treated as an independent group, and the number of columns is the number of groups; otherwise, enter multi-dimensional analysis; The variance Var of the row and column data index is expressed as: Among them, N represents the total number of data in the current group, Exp i Represents the exponential part of the i-th data, μ Exp Indicates the mean of the data index in the current group; The spatial continuity evaluation Cont is expressed as: Among them, Corr(Exp i ,Exp i+1 ) is Exp i and Exp i+1 Pearson correlation coefficient, Exp i+1 Represents the exponential part of the i+1th data; The weighted comprehensive score TotalScore of multi-dimensional analysis is expressed as: TotalScore=0.7*Var+0.3*Cont#(4); Compare the weighted comprehensive scores TotalScore of the multi-dimensional analysis and select the one with the smaller weighted comprehensive score TotalScore as the grouping basis; The public exponent base extraction and normalization module is configured to: utilize the parallel computing capability of the GPU to extract the public exponent base of each group of data and save it; then, normalize the mantissa of the data based on the obtained public exponent base; The two-level index building module is configured to: extract all common index bases by traversing the array, merge the same common index bases and count the frequencies; Output module, configured as: text output.
Citation Information
Patent Citations
Block floating point computations using shared exponents
CN112088354A
Calculation method and calculation device
CN119937981A