Method, system and equipment for determining short-range force by non-common-key particles

By using the method of combining CPU and FPGA modules in molecular dynamics simulation systems, particle data preprocessing and parallel calculation of short-range forces are solved, and the problem that CPU and GPU in the existing technology is difficult to meet the computing power requirements, achieving more efficient computing performance and reduce delay.

CN118917072AActive Publication Date: 2024-11-08XIDIAN UNIV

Patent Information

Application Number
CN202410960379.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-17
Publication Date
2024-11-08
Estimated Expiration
2044-07-17

AI Technical Summary

Technical Problem

In the prior art, CPUs and GPUs are difficult to meet the computing power requirements in molecular dynamics simulation calculations, especially when computing power for short-range forces of non-common bond particles, the calculation performance and delay are insufficient.

Method used

The system that combines CPU and FPGA modules is used to perform particle data preprocessing and interpolation table configuration through XDMA module and HBM module, filter target particle pairs, and calculate short-range forces in parallel in FPGA, using HBM's high bandwidth storage resources. Optimize the calculation process.

Benefits of technology

It improves computing efficiency, reduces overall computing delay, fully explores parallel and pipeline capabilities, and improves the computing efficiency of molecular dynamics simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917072A_ABST
    Figure CN118917072A_ABST
Patent Text Reader

Abstract

The invention provides a method, a system and equipment for determining a non-common-key particle to a short-range force, the method, the system and the equipment are applied to a molecular dynamics simulation system, the simulation system comprises a CPU and an FPGA module, and the FPGA module comprises an RL subsystem, an XDMA module and an HBM module; the advantages of high access bandwidth and high storage capacity brought by HBM resources in the FPGA are fully utilized, optimization design is conducted on the calculation process of the RL acting force, the number of assembly lines of parallel calculation force is increased, and the method is suitable for the simulation requirement of a larger-scale data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of simulation technology, and in particular to a method, system and device for determining short-range forces of non-co-bonded particles. Background Art

[0002] In molecular dynamics (MD) simulation calculations, matter is regarded as a basic unit composed of particles. By simulating the evolution of these basic units over time, the dynamic properties of matter can be explored, thereby helping people to better understand and predict the behavior and properties of matter. As an important tool for modern scientific research, MD simulation plays an important role in the fields of materials, physics, chemistry, biology and environment. Molecular dynamics simulation is a molecular simulation method based on Newtonian mechanics to study molecular systems. It is usually based on the calculation of potential energy between particles, and potential energy can be simply regarded as two-body potential, three-body potential, four-body potential, van der Waals effect and electrostatic effect. The application range of MD simulation is very wide. From complex material science problems to the structure and function research of biomacromolecules, to the study of chemical reaction kinetics, MD simulation can provide valuable information.

[0003] OpenMM is a molecular dynamics simulation toolkit with a special focus on extensibility. It allows users to easily add new features, including forces with new functional forms, new integration algorithms, and new simulation protocols. These features are automatically applicable to CPUs and GPUs, but the computing power supported by CPUs and GPUs cannot well meet the computing power requirements of MD simulations. Summary of the invention

[0004] In order to solve the above problems existing in the prior art, the present invention provides a method, system and device for determining the short-range force of non-co-bonded particles. Specifically, it includes:

[0005] In a first aspect, the present invention provides a method for determining short-range forces of non-co-bonded particles, which is applied to a molecular dynamics simulation system, wherein the simulation system comprises: a CPU and an FPGA module, wherein the FPGA module comprises an RL subsystem, an XDMA module, and an HBM module;

[0006] The CPU preprocesses the particle data set to be subjected to molecular dynamics simulation to obtain preprocessed data, and stores the preprocessed data in the HBM module through the XDMA module;

[0007] The CPU configures the predetermined interpolation table and coefficient table into the RL subsystem;

[0008] The CPU forms an exclusion information data table based on the information of each co-bonded particle pair in the pre-processed data, and stores it in the HBM module through the XDMA module;

[0009] The CPU sends a simulation start message to the RL subsystem through the XDMA module;

[0010] The RL subsystem responds to the simulation start message, reads the particle information and pre-processed data in the exclusion information data table from the HBM, and selects the target particle pair according to the read information;

[0011] The RL subsystem calculates the short-range force based on the selected target particle pairs, interpolation table, and coefficient table, and generates an interrupt message to the CPU after the calculation is completed;

[0012] In response to the interrupt message, the CPU retrieves the proximity force data from the FPGA, completes the integral operation of the velocity and coordinate position based on the proximity force data, and updates the particle information in the FPGA based on the operation result to perform the next iteration until the predetermined iteration termination condition is met.

[0013] In a second aspect, the present invention further provides a non-co-bond force determination system, comprising: a CPU and an FPGA module, the FPGA module comprising an RL subsystem, an XDMA module, and an HBM module;

[0014] The CPU is used to preprocess the particle data set to be subjected to molecular dynamics simulation, obtain preprocessed data, and store the preprocessed data in the HBM module through the XDMA module;

[0015] The CPU is also used to configure the predetermined interpolation table and coefficient table into the RL subsystem;

[0016] The CPU is also used to form an exclusion information data table according to the information of each co-bonded particle pair in the pre-processed data, and store it in the HBM module through the XDMA module;

[0017] The CPU is also used to send simulation start messages to the RL subsystem through the XDMA module;

[0018] The RL subsystem is used to read the particle information and pre-processed data in the exclusion information data table from the HBM in response to the simulation start message, and screen out the target particle pair according to the read information;

[0019] The RL subsystem is also used to calculate the short-range force based on the selected target particle pairs and the interpolation table and coefficient table, and generate an interrupt message to the CPU after the calculation is completed;

[0020] The CPU is also used to respond to the interrupt message, retrieve the short-range force data from the FPGA, complete the integral operation of the speed and coordinate position according to the short-range force data, and update the particle information in the FPGA according to the operation result to perform the next iteration until the predetermined iteration termination condition is met.

[0021] In a third aspect, the present invention further provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0022] Memory, used to store computer programs;

[0023] The processor is used to implement any method provided in the first aspect when executing a program stored in the memory.

[0024] In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, any one of the methods provided in the first aspect is implemented.

[0025] In a fifth aspect, the present invention provides a program product, which includes computer program instructions, and when the computer program instructions are executed, they can implement any of the methods provided in the first aspect.

[0026] Beneficial effects of the present invention:

[0027] The method, system and device for determining the short-range force of non-co-bonded particle pairs provided by the present invention pre-process a particle data set to be subjected to molecular dynamics simulation by a CPU to obtain pre-processed data, and store the pre-processed data in an HBM module through an XDMA module; the CPU configures a predetermined interpolation table and a coefficient table into an RL subsystem; the CPU forms an exclusion information data table according to information of each co-bonded particle pair in the pre-processed data, and stores the table in the HBM module through the XDMA module; the CPU sends a simulation start message to the RL subsystem through the XDMA module; the RL subsystem responds to the simulation start message and reads the data from the HBM. The particle information and preprocessed data in the exclusion information data table are obtained, and the target particle pairs are screened out according to the read information; the RL subsystem calculates the short-range force according to the screened target particle pairs and the interpolation table and coefficient table, and generates an interrupt message to the CPU after the calculation is completed; the CPU responds to the interrupt message, retrieves the short-range force data from the FPGA, and completes the integral operation of the speed and coordinate position according to the short-range force data, and updates the particle information in the FPGA according to the operation result for the next iteration, until the predetermined iteration termination condition is met, fully exploring the parallel and pipeline capabilities in the calculation process, and realizing the improvement of computing efficiency and the reduction of overall computing latency.

[0028] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A schematic flow chart of a method for determining short-range forces of non-co-bonded particle pairs provided by the present invention;

[0030] Figure 2 A data cell topology result diagram provided by the present invention;

[0031] Figure 3 A data unit structure diagram of an exclusion particle pair provided by the present invention;

[0032] Figure 4 A schematic diagram of a storage structure of an interpolation table provided by the present invention;

[0033] Figure 5 A schematic diagram of a storage structure of a coefficient table provided by the present invention;

[0034] Figure 6 A schematic diagram of the internal architecture of an FPGA provided by the present invention;

[0035] Figure 7 A block diagram of a short-range force calculation unit provided by the present invention;

[0036] Figure 8 A block diagram of a short-range force storage structure corresponding to a storage entry and a partial summation unit generated according to a particle sequence number provided by the present invention;

[0037] Fig. 9 A storage structure block diagram of the short-range force corresponding to a short-range force calculation result storage control unit provided by the present invention;

[0038] Fig.10 A storage structure block diagram of the cell completion progress corresponding to a proximity force calculation progress supervision unit provided by the present invention. DETAILED DESCRIPTION

[0039] The present invention is further described in detail below with reference to specific embodiments, but the embodiments of the present invention are not limited thereto.

[0040] For the molecular dynamics acceleration system, considering the boundary conditions, the simulated system generally uses a cubic simulation box. The new force of each particle in the molecular dynamics simulation comes from the superposition of multiple forces. Generally, the forces are divided into co-bond forces and non-co-bond forces. Co-bond forces include bond forces, angular forces, dihedral angle forces, and off-plane angle forces. Non-co-bond forces include Lennard-Jones (LJ) forces and electrostatic forces (Coulomb, CL). For the calculation of the above forces or energies, the industry has formed some relatively common algorithms. In the function library implementation provided by openMM, support is provided for conventional algorithms. The calculation of electrostatic force uses the PME (Particle Mesh Ewald) algorithm, which is an optimized upgrade of the EwaldSummation algorithm. The Ewald algorithm divides the energy of electrostatic force into three parts: direct space sum, reciprocal space sum, and self-energy term. In the direct space sum, the energy terms of all particle pairs exceeding the cutoff distance will be recorded as zero. The calculation of the reciprocal space sum uses the FFT algorithm, which can reduce the computational complexity. The self-energy term is a calibration term that cancels out the interaction of each introduced artificial anti-charge with itself. Therefore, the expression for direct space energy calculation can be converted into the calculation formula for the force as follows (error compensation coefficients are not shown):

[0041]

[0042] Among them, q i represents the charge of type a particle, q j represents the charge of type b particle, r ji represents the actual distance scalar between particle j and particle i, Represents the actual distance vector between particle j and particle i.

[0043] In the calculation of electrostatic force, the calculation in direct space decays rapidly due to the increase in distance, so the cutoff distance can be used to simplify the calculation, which is the same as the calculation form of LJ force, so it is combined together as a (Range-Limited, RL) short-range force for calculation. The reciprocal space and calculation of electrostatic force are calculated separately as long-range forces. For the implementation of the above algorithm, the existing technology can be implemented by software code running on the CPU, or it can be implemented by software code running on the GPU, but the computing power supported by the CPU and GPU cannot well meet the computing power requirements of MD simulation.

[0044] To solve this problem, the present invention provides a method for determining the short-range force of non-co-bonded particles based on actual application needs and in combination with the development framework of openMM. The method is mainly implemented around the FPGA design of LJ force and Coulomb force.

[0045] Figure 1 A flow chart of a method for determining short-range forces of non-co-bonded particles provided by the present invention is applied to a molecular dynamics simulation system, wherein the simulation system comprises: a CPU and an FPGA module, wherein the FPGA module comprises an RL subsystem, an XDMA module, and an HBM module.

[0046] Specifically, the RL subsystem is connected to the XDMA module and the HBM module. XDMA is a DMA subsystem that supports the PCIe interface and supports the CPU to access the AXI-Lite interface of the RL subsystem and the AXI-MM interface of the HBM through this module. The RL subsystem accesses the storage resources of the HBM through multiple AXI-MM interfaces to achieve high-bandwidth data transmission. The CPU implements the input of MD simulation initialization data through XDMA and starts the simulation process.

[0047] The prior art is mainly implemented by software of CPU or GPU. Although CPU and GPU also have powerful computing power, as general computing chips, there is no special optimization when processing the computing tasks of MD simulation, and the computing efficiency is not as good as the specially designed FPGA chip. In the present invention, FPGA is used as a special accelerator of CPU, and the RL force (short-range force) calculation process of simulated particle pairs is all written to FPGA for implementation, which improves the operation speed and saves simulation time. Compared with the serial working mode of CPU code, the core calculation process is modularized in FPGA, and the parallel computing power is maximized directly through the stacking of modules. In addition, although CPU can also realize thread parallelism based on multi-core processor, it still encounters bandwidth bottleneck in the process of memory access. In this scheme, FPGA has large-capacity HBM storage resources, and the access bandwidth is much higher than ordinary DDR memory. By reasonably allocating data table storage space, parallel computing modules can make full use of HBM to provide high-speed access bandwidth to realize the calculation process of RL force.

[0048] See also Figure 1 The present invention provides a method for determining the short-range force of a non-co-bonded particle pair, comprising:

[0049] S101 . The CPU preprocesses a particle data set to be subjected to molecular dynamics simulation to obtain preprocessed data, and stores the preprocessed data in an HBM module through an XDMA module.

[0050] In a possible implementation, the CPU preprocesses a particle data set to be subjected to molecular dynamics simulation to obtain preprocessed data, and stores the preprocessed data in the HBM module through the XDMA module, including:

[0051] The CPU divides the three-dimensional space where the particle data set is located into several data cells, and based on the coordinate information of each particle, determines the particle information contained in each data cell and the position information of the adjacent data cells, and stores the corresponding information in the HBM module in the form of a preset data table through the XDMA module.

[0052] Specifically, the CPU preprocesses the particle data set of the MD simulation, and the preprocessed data will include the following: Figure 2 The information shown in the figure, where the cell number is obtained after segmenting the original data, each particle will be assigned to a unique cell, and the particle information will be bound to the cell number to form the basic information of the particle to be processed. Other information in the data entry is obtained from the original data file. The side length of each data cell is determined based on the size of the truncation distance. The simulation data set exists in a certain rectangular space, so the number of data cells after CPU preprocessing is also determined. Each data cell contains the particle information to which it belongs and the location information of the neighboring data cells, forming a data table stored in the HBM. Figure 2 The data cell topology is the content of a data cell. The first row is the data cell information index row, including the cell number, cell length, number of particles in the cell, offset address of particle information in the cell, and check bit. The second to fifth rows (fixed length is 4 rows) are the serial numbers of neighbor cells and the offset addresses in HBM. The information is grouped into 8 bytes, arranged continuously, and the end of the row is filled with padding data to fill the entire row. Starting from the sixth row, the serial numbers of the particles contained in the cell (determined by the number of particles, no fixed length), are arranged continuously, and the end of the row is filled with padding data to fill the entire row. The particle information in the cell is filled from the position specified by the offset address of the particle information in the cell, and each particle occupies a row of storage space. The length of the data cell is created according to the maximum number of particles after the preprocessing is completed, and an appropriate margin is left. Based on the size of the simulation data space, fixed-size data cells are divided and arranged continuously in the HBM. Using the serial number of the data cell, the starting position of the data cell can be directly located. Excluding paired combinations of particle information, directly forming Figure 3 The number of excluded particles and their storage addresses are configured to the relevant modules through registers.

[0053] During the data preprocessing process, the particle type items were merged and the size of the coefficient table was compressed, creating conditions for improving parallel computing power.

[0054] S102. The CPU configures a predetermined interpolation table and coefficient table into the RL subsystem.

[0055] Exemplarily, the CPU completes the determination of the interpolation table and the coefficient table in advance according to the following process.

[0056] The calculation formula of RL force (see below) uses the -14th, -8th and -3rd powers of the actual distance scalar between particles. If the square of the actual distance scalar between particles is used as input, the power of the actual distance scalar between particles is reduced to -7, -4 and -3 / 2. Therefore, we make interpolation functions of the above three functions, reduce them to low-order univariate polynomials, and then substitute the square of the actual distance scalar between particles to calculate the original function value, thereby simplifying the calculation process and reducing the consumption of DSP resources. The generation of interpolation function should not only reduce the calculation complexity, but also ensure that the calculation accuracy meets the design requirements. We use F(x) = x -7 Taking the function as an example, the generation process of the interpolation function is introduced. The F(x) function is monotonically decreasing in the range of x greater than 0, and is very steep in the interval of x(0,1]. The value range of F(x) required by the design is between x[0.1,144]. We know that the more interpolation points there are and the smaller the intervals, the higher the calculation accuracy. However, the more piecewise functions are formed between the interpolation points, the larger the capacity of the coefficient table is required. In addition, the higher the order of the interpolation function, the stronger the ability to track the changes in the function curve, the higher the accuracy, and the more computing and storage resources consumed. Therefore, we need to make a compromise based on the actual situation. We use Python programming to compare and analyze the order of the interpolation function and the number and distribution of interpolation points. When the relative error is better than one thousandth, the second-order polynomial can meet the design requirements. Numpy's polynomial function library provides The coefficient solving function for polynomial fitting can directly specify the required order for solving, and the fitting results of Legendre and other orthogonal polynomials are almost the same. The calculation result we finally chose is: divide the x interval into 8 segments, namely 1-[0.1,0.2], 2-[0.2,0.4], 3-[0.4,0.8], 4-[0.8,1.6], 5-[1.6,3.2], 6-[3.2,6.4], 7-[6.4,16], 8-[16,144]. The first 6 segments are each divided into 16 small segments, the seventh segment is divided into 32 small segments, and the eighth segment is divided into 128 small segments, totaling 256 interpolation functions. Each interpolation function requires 3 coefficients, represented by single-precision floating point numbers. The interpolation table of each function can be fully stored using 4KB of BRAM. The interpolation table participates Figure 4 .

[0057] The calculation of RL force also requires the coefficient table of Aab and Bab, which needs to be combined in pairs according to the type of particles. If there are N independent particle types, the length of the table is N. 2After analyzing the simulation data set, there are no more than 32 independent particle types, so the depth of the coefficient table does not exceed 1024 items. The coefficients are represented by single-precision floating point numbers, and the coefficient table can be stored in 8KB of BRAM. Figure 5 .

[0058] The above two tables are written into the storage space of FPGA by CPU before simulation operation. When reading interpolation table and coefficient table, FPGA supports multi-channel table lookup interface to ensure no queue for table lookup operation, that is, multiple copies of storage space are copied internally according to the number of ports for parallel table lookup, and each port has an independent table lookup channel, which can be looked up immediately.

[0059] The present invention reduces the use of BRAM, optimizes the design of the force calculation unit, and improves the parallelism of the operation by optimizing the design of the interpolation table and the coefficient table. In the calculation process of the RL force, the design of the interpolation table is optimized, and the scale of the interpolation table is reduced while ensuring the accuracy.

[0060] S103. The CPU forms an exclusion information data table according to the information of each co-bonded particle pair in the pre-processed data, and stores it in the HBM module through the XDMA module.

[0061] The information of particle pairs that need to be excluded mainly comes from the existing co-bonded particle pairs. The CPU combines the information of the two bonded particles to form an exclusion information data table and stores it in the HBM.

[0062] S104. The CPU sends a simulation start message to the RL subsystem through the XDMA module.

[0063] S105 , the RL subsystem responds to the simulation start message, reads the particle information and pre-processed data in the exclusion information data table from the HBM, and selects the target particle pairs according to the read information.

[0064] In a possible implementation, the RL subsystem selects target particle pairs according to the read information, including:

[0065] The RL subsystem takes each data cell as a main data cell, takes out the particle information of the main data cell and the particle information of the first N related data cells, takes out a particle A from the main data cell, takes out a particle from each of the N neighboring cells corresponding to the main data cell, forms a particle pair with particle A to calculate the distance, and obtains N first distance calculation results; takes out another particle B from the main data cell, forms a particle pair with particle A in the main data cell to calculate the distance, and obtains a second distance calculation result; compares the square values ​​of each of the N first distance calculation results and the square value of a second distance calculation result with the square value of a preset cutoff distance, and determines the particle pair with a square value less than the preset cutoff distance as the target particle pair.

[0066] For details, see Figure 6 ,The RL subsystem includes a unit for pre-fetching particle data, a unit for pre-fetching excluded particle information, and a unit for calculating the distance of particle pairs and screening the particle pairs to be processed.

[0067] In response to the simulation start message, the RL subsystem reads the particle information and preprocessed data in the exclusion information data table from the HBM, and selects the target particle pairs according to the read information, including:

[0068] The pre-fetch particle data unit responds to the simulation start message, reads the pre-processed data from the HBM, and transmits the acquired data to the unit for calculating the particle pair distance and screening the particle pairs to be processed; the pre-fetch exclusion particle information unit responds to the simulation start message, reads the particle information in the exclusion information data table from the HBM, and transmits the acquired data to the unit for calculating the particle pair distance and screening the particle pairs to be processed; the unit for calculating the particle pair distance and screening the particle pairs to be processed uses each data cell in the received data as a main data cell, takes out the particle information of the main data cell and the particles of the first N related data cells; Information, take out a particle A from the main data cell, take out a particle from each of the N neighboring cells corresponding to the main data cell, and calculate the distance with particle A to form a particle pair, and obtain N first distance calculation results; take out another particle B from the main data cell, and calculate the distance with particle A in the main data cell to form a particle pair, and obtain a second distance calculation result; compare the square value of each N first distance calculation result and the square value of a second distance calculation result with the square value of the preset cutoff distance, and determine the particle pair with a square value less than the preset cutoff distance as the target particle pair.

[0069] Optional, N is 13.

[0070] For example, the particle pair information to be calculated includes the three-dimensional coordinates of the two particles, and the square of the distance between the particles (i.e., the square of the actual distance scalar between the particles) is equal to the sum of the squares of the differences in the three-dimensional coordinates, expressed as R 2 =(x1-x2) 2 +(y1-y2) 2 +(z1-z2) 2 , where (x1, y1, z1) and (x2, y2, z2) represent the coordinates of different particles, and R represents the actual distance scalar between particles. The particle coordinates are represented by single-precision floating point numbers, and R 2 Single-precision floating-point numbers are also used for storage. The calculation formula is implemented using floating-point operation IP provided by FPGA manufacturers, and auxiliary circuits form a calculation pipeline. Each clock can calculate the square of the distance of a group of particles. 2 The range of values ​​in the simulation box is limited, and it is more convenient to use integers when comparing distances and looking up coefficients. 2 Amplify the data by a certain multiple, and then take the integer part to screen the particle pairs. 2 Particle pairs with a square distance less than the cutoff distance are selected as input for subsequent calculations, otherwise they are ignored. Since the distance between the centers of adjacent cell spaces is greater than or equal to the cutoff distance, there is a certain probability distribution for the selected available particle pairs. In order to maximize the computing power, we use multiple calculation and screening modules to work in parallel, and the three-port simultaneous output mode. The related table lookup operations are also allowed to look up the table simultaneously according to the number of output ports.

[0071] S106, the RL subsystem calculates the short-range force according to the selected target particle pairs, the interpolation table, and the coefficient table, and generates an interrupt message after the calculation is completed and sends it to the CPU.

[0072] In one possible implementation, the calculation formula of RL short-range force is expressed as:

[0073]

[0074] in, represents the short-range force between particles j and i, r ji represents the unit distance vector between particle j and particle i, r ji represents the actual distance scalar between particle j and particle i, Represents r ji The negative cubic power of Represents r ji to the negative 8th power, Represents r ji negative 14th power, q a represents the charge of type a particle, q b represents the charge of type b particles, εab represents the dielectric constant between type a particles and type b particles, σ ab represents the distance between type A particles and type B particles where the energy is zero, Represents σ ab to the 12th power, Represents σ ab to the sixth power.

[0075] The input of the proximity force calculation unit is all the parameters required by the calculation formula, and the output is the three components of the force. A set of calculation parameters can be input in each clock cycle, and after internal pipeline processing, a set of settlement results can be output in each clock. Figure 7 This is the implementation block diagram of the short-range force calculation unit, where ΔX=x1-x2ΔY=y1-y2ΔZ=z1-z2 (when the particle has a boundary surround mirror, the side length of the simulation box needs to be subtracted).

[0076] Optional, see Figure 6 The RL subsystem includes a parameter query and queuing unit for particle pairs to be calculated, a proximity force calculation unit, a storage entry and partial summation unit generated according to the particle sequence number, a particle pair force cache queuing control unit, a particle pair force cache dequeuing control unit, a proximity force accumulation unit, a proximity force calculation result storage control unit, a proximity force calculation progress supervision unit and a proximity force calculation interpolation table and coefficient table unit.

[0077] The RL subsystem calculates the proximity force according to the interpolation table and coefficient table stored in the interpolation table and coefficient table unit for the screened target particle pairs and the proximity force calculation, and generates an interrupt message to be sent to the CPU after the calculation is completed, including: the parameter query and queue entry unit of the particle pair to be calculated queries the interpolation table and coefficient table according to the screened target particle pairs to obtain parameter information for the proximity force and information of each particle, stores the parameter information, and transmits the parameter information to the proximity force calculation unit, and transmits the information of each particle to the proximity force calculation progress supervision unit; the proximity force calculation unit performs proximity force calculation based on the obtained parameter information, obtains the calculation result of the three-dimensional coordinate axis decomposition of the proximity force based on the particle pair, and transmits the calculation result to the storage entry and partial summation unit generated according to the particle sequence number and the proximity force calculation progress supervision unit; the proximity force meter After the calculation progress monitoring unit increases the corresponding cell completion progress counter by one in response to the received data, it checks whether the value of the counter reaches the preset value. If so, it controls the short-range force accumulation unit to obtain the short-range force of each particle from the HBM through the particle pair force cache dequeue control unit, and determines the short-range force accumulation of each particle according to the co-bond particle pair corresponding to each particle, and stores the accumulated result in the HBM after passing through the short-range force calculation result storage control unit; generates storage entries and partial summation units according to the particle sequence number, respectively accumulates the short-range forces of the first 13 neighbor data cells corresponding to each data cell and caches them, and caches the data of the first 13 neighbor data cells corresponding to each data cell into the HBM according to the particle sequence number through the particle pair force cache enqueue control unit. Exemplarily, the storage structure block diagram of the cell completion progress corresponding to the short-range force calculation progress monitoring unit is shown in the figure below. Figure 8 shown.

[0078] Specifically, the calculation results of the particle force (short-range force) received by the storage entry and the partial summation unit are the forces between the same particle and different particles in a main unit cell within a continuous clock cycle. Therefore, this part of the force can be summed up first and then cached, thereby reducing the amount of cached data. However, this part of the calculation result is also the data required by other particles when calculating the force, and it needs to be cached and read when calculating the sum of the forces of other particles. Therefore, the force is accumulated based on the source particle number, and then the accumulated result is cached in the force cache area where the source particle is located. All force results are stored in the force cache area where the host particle is located based on the host particle number. The RL force cache is stored continuously according to the particle number. The force cache area of ​​each particle is the same size, and the storage structure is as follows: Fig. 9As shown in the figure. The first line is the cache information index, including type flag, particle number, maximum cache capacity, number of valid data and check bit, etc. The second line starts with the cached force vector data, each set of data occupies 16 bytes and is stored continuously. There are three types of cached force vector data: the first is the data of partial cumulative sum, the second is the force data calculated by the opposite particle in the particle pair, and the third is the force data of the excluded particle. The maximum number of cached force data in each cache is reserved according to twice the maximum number of cell particles obtained when preprocessing the data. The number of valid data is initially zero and increases by one each time data is added. The check bit is used to check whether the data in the cache information index line is wrong, which is the parity check value of the first 16 bytes. The initialization of the RL force cache area can be implemented by software or FPGA logic to restore the information index line of each particle force cache area to the initial value. The number of valid data is zero. Each time data is added, the data addition position is calculated according to the number of valid data, and the number of valid data and the value of the check bit are updated.

[0079] The proximity force accumulation unit is an accumulator of single-precision floating-point numbers. The three channels support simultaneous accumulation of three vector directions and support sign selection for the accumulated data. The particle pair forces calculated by the neighboring cells need to change the sign bit of the data when calculating. The forces of the excluded co-bonded particle pairs are marked with opposite sign bits, and the forces of the co-bonded particle pairs that are repeatedly calculated are subtracted during the accumulation process. Each proximity force accumulator continuously processes the data accumulation of the same particle, and the particle is replaced for calculation after the calculation is completed. The proximity force calculation progress monitoring unit sends the particle information that can be used for proximity force accumulation to the particle pair force cache dequeue control unit, which reads the particle-related force cache area and provides the accumulated data to the proximity force accumulation unit for calculation. The calculation result of this unit is sent to the proximity force calculation result storage control unit, which writes it to the RL force result cache area. The definition of the result cache area is as follows: Fig.10 As shown. Each row stores the RL force result of a particle. This module only updates the 12 bytes of data in the force vector part, and the rest is filled by software initialization or FPGA logic reading the cell particle information data in the short-range force calculation progress monitoring unit. The short-range force accumulation unit can have multiple parallel modules to speed up the output speed of the calculation results.

[0080] The short-range force calculation progress monitoring unit obtains the serial number of the main cell currently being processed and the serial number of the related neighbor cells from the queue parameter table of the particle pair to be calculated and the queue unit, and updates the completion status of each cell to the corresponding counter. According to whether the counter reaches the expected value, it is judged whether the cell has completed the calculation task of the related neighbor cells. The unit maintains a register list inside, and each cell has a completion progress counter. When the current cell completes the calculation, the counter corresponding to the cell is increased by one. At the same time, the first 13 neighbor cells related to the current cell have also completed the calculation, and the completion counters of these cells are also increased by one. While updating the counter statistics, if the count value reaches 14, it means that the cell has completed the calculation task, and then reads the serial number of the particle from the cell, and then sends the serial number of the particle to the particle pair force cache dequeue control unit, and starts the work of the short-range force accumulation unit. The short-range force calculation progress monitoring unit obtains information about processed particle pairs and particles that have completed calculations from the short-range force calculation unit and the short-range force calculation result storage control unit, monitors the cache usage status and the overall progress of the RL calculation, and when all particles have completed the force accumulation, an interrupt is sent to the CPU to report that this round of force calculation is completed.

[0081] S107. The CPU responds to the interrupt message, retrieves the short-range force data from the FPGA, completes the integral operation of the velocity and coordinate position according to the short-range force data, and updates the particle information in the FPGA according to the operation result to perform the next iteration until the predetermined iteration termination condition is met.

[0082] Furthermore, the units for calculating the distance between particle pairs and screening the particle pairs to be processed, generating storage entries and partial summation units according to the particle serial numbers, the short-range force calculation units, and the short-range force accumulation units can be parallelized by instantiating multiple entities, thereby eliminating the single-point computing bottleneck and improving the overall computing power of the RL module.

[0083] Specifically, to calculate the distance of particle pairs and screen and process the particle pair units, it is necessary to calculate the distance between a large number of particle pairs, and the probability of screening the particle pairs less than the cutoff distance is less than a certain value, such as 12.5%. At least 8 parallel units are maintained to continuously supply data to the subsequent calculation units. Exemplarily, at least 18 parallel units are used, divided into three groups (8, 8, 2), and 2 particles are taken from the main data cell and assigned to the first two groups for calculation with the data in the neighbor data cells. The last two parallel units only calculate the distance between the particle pairs in the main data cell and the distance of the excluded particle pairs. Each particle has 13 neighbor data cells to calculate. Each time a particle is taken from the neighbor cell, paired with the data in the main cell, and output to 8 parallel calculation units. Since the number of particles in each neighbor data cell is different, the 13-select-8 path can reduce the computing power loss caused by the uneven number of particles. The short-range force calculation unit receives the particle pair information to be calculated from the upstream unit and completes the calculation. The particle pairs of the same particle and the neighbor cells are continuously transmitted and calculated, and can be directly summed and stored in the downstream unit. Corresponding to the aforementioned units, the short-range force calculation unit can set up at least 3 parallel calculation units to connect with the upstream unit, where the third channel is to calculate the main data cell particle pairs and the exclusion particle pairs, which do not require summation operations and are directly stored. The particle pair force cache queue control unit and the particle pair force cache dequeue control unit are both multi-port input / output systems that allow docking with multiple computing modules. The short-range force accumulation unit is idle in the early stage of the operation. When the operation reaches the middle and late stages, the number of particles that meet the accumulation conditions increases significantly. The short-range force accumulation unit can be appropriately set to be greater than or equal to 16, thereby further compressing the overall calculation time.

[0084] The method for determining the short-range force of non-co-bonded particle pairs provided by the present invention is applied to a molecular dynamics simulation system, wherein the simulation system comprises: a CPU and an FPGA module, wherein the FPGA module comprises an RL subsystem, an XDMA module, and an HBM module; the CPU pre-processes a particle data set to be subjected to molecular dynamics simulation to obtain pre-processed data, and stores the pre-processed data in the HBM module through the XDMA module; the CPU configures a predetermined interpolation table and a coefficient table into the RL subsystem; the CPU forms an exclusion information data table according to information of each co-bonded particle pair in the pre-processed data, and stores the data in the HBM module through the XDMA module; the CPU sends a simulation start message to the RL subsystem through the XDMA module; the RL subsystem responds to the simulation start message, and reads the particle information and the pre-processed data in the exclusion information data table from the HBM; The RL subsystem calculates the short-range force based on the selected target particle pairs, interpolation tables and coefficient tables, and generates an interrupt message to the CPU after the calculation is completed; the CPU responds to the interrupt message, retrieves the short-range force data from the FPGA, completes the integral operation of the speed and coordinate position based on the short-range force data, and updates the particle information in the FPGA based on the operation results for the next iteration until the predetermined iteration termination condition is met. The short-range force (RL force) calculation framework can be optimized, and the key computing units can be directly increased or decreased based on the computing power requirements to maximize the use of FPGA resources and avoid design compatibility issues. HBM resources are used to cache intermediate calculation data, and the multi-access interface provided by HBM is fully utilized to achieve non-blocking data access. Increasing the simulation data set has almost no effect on the FPGA design module.

[0085] The present invention provides a non-co-bond force determination system, comprising: a CPU and an FPGA module, wherein the FPGA module comprises an RL subsystem, an XDMA module and an HBM module.

[0086] The CPU is used to preprocess the particle data set to be subjected to molecular dynamics simulation, obtain preprocessed data, and store the preprocessed data in the HBM module through the XDMA module;

[0087] The CPU is also used to configure predetermined interpolation tables and coefficient tables into the RL subsystem.

[0088] The CPU is also used to form an exclusion information data table according to the information of each co-bonded particle pair in the pre-processed data, and store it in the HBM module through the XDMA module.

[0089] The CPU is also used to send simulation start messages to the RL subsystem through the XDMA module.

[0090] The RL subsystem is used to respond to the simulation start message, read the particle information and pre-processed data in the exclusion information data table from the HBM, and screen out the target particle pair according to the read information.

[0091] The RL subsystem is also used to calculate the short-range force based on the screened target particle pairs and the interpolation table and coefficient table, and generate an interrupt message to the CPU after the calculation is completed.

[0092] The CPU is also used to respond to the interrupt message, retrieve the short-range force data from the FPGA, complete the integral operation of the speed and coordinate position according to the short-range force data, and update the particle information in the FPGA according to the operation result to perform the next iteration until the predetermined iteration termination condition is met.

[0093] The present invention also provides a structure of an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus.

[0094] Memory, used to store computer programs;

[0095] The processor is used to implement the steps provided in the above method embodiment when executing the program stored in the memory.

[0096] The communication interface is used for communication between the above electronic device and other devices.

[0097] The method provided in the embodiment of the present invention can be applied to electronic devices. Specifically, the electronic device can be: a desktop computer, a portable computer, an intelligent mobile terminal, a server, etc. This is not limited here, and any electronic device that can implement the present invention belongs to the protection scope of the present invention.

[0098] The present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps provided in the above method embodiment are implemented.

[0099] As for the device / electronic device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the specific content and beneficial effects and other related matters can be referred to the partial description of the method embodiment.

[0100] The terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0101] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.

Claims

1. A method for determining the short-range force of non-co-bonded particles, characterized in that: Applied to a molecular dynamics simulation system, the simulation system comprises: a CPU and an FPGA module, the FPGA module comprises an RL subsystem, an XDMA module, and an HBM module; The CPU preprocesses a particle data set to be subjected to molecular dynamics simulation to obtain preprocessed data, and stores the preprocessed data in the HBM module through the XDMA module; The CPU configures a predetermined interpolation table and a coefficient table into the RL subsystem; The CPU forms an exclusion information data table according to the information of each co-bonded particle pair in the pre-processed data, and stores the table in the HBM module through the XDMA module; The CPU sends a simulation start message to the RL subsystem through the XDMA module; The RL subsystem reads the particle information and the preprocessed data in the exclusion information data table from the HBM in response to the simulation start message, and selects target particle pairs according to the read information; The RL subsystem calculates the short-range force according to the selected target particle pairs, the interpolation table, and the coefficient table, and generates an interrupt message after the calculation is completed and sends it to the CPU; In response to the interrupt message, the CPU retrieves the short-range force data from the FPGA, completes the integral operation of the velocity and coordinate position according to the short-range force data, and updates the particle information in the FPGA according to the operation result to perform the next iteration until a predetermined iteration termination condition is met.

2. The method according to claim 1, characterized in that The CPU preprocesses a particle data set to be subjected to molecular dynamics simulation to obtain preprocessed data, and stores the preprocessed data in the HBM module through the XDMA module, including: The CPU divides the three-dimensional space where the particle data set is located into a number of data cells, and based on the coordinate information of each particle, determines the particle information contained in each data cell and the position information of the adjacent data cells, and stores the corresponding information in the HBM module in the form of a preset data table through the XDMA module.

3. The method according to claim 1, characterized in that: The RL subsystem selects target particle pairs according to the read information, including: The RL subsystem uses each data cell as a main data cell, takes out the particle information of the main data cell and the particle information of the first N related data cells, takes out a particle A from the main data cell, takes out a particle from each of the N neighboring cells corresponding to the main data cell, forms a particle pair with the particle A to calculate the distance, and obtains N first distance calculation results; takes out another particle B from the main data cell, forms a particle pair with the particle A in the main data cell to calculate the distance, and obtains a second distance calculation result; compares the square values ​​of the N first distance calculation results and the square value of the second distance calculation result with the square value of the preset cutoff distance, and determines the particle pair with a square value less than the preset cutoff distance as the target particle pair.

4. The method according to claim 1, characterized in that: The calculation formula of the short-range force is expressed as: in, represents the short-range force between particles j and i, r ji represents the unit distance vector between particle j and particle i, r ji represents the actual distance scalar between particle j and particle i, Represents r ji The negative cubic power of Represents r ji to the negative 8th power, Represents r ji negative 14th power, q i represents the charge of particle i, q j represents the charge of particle j, ε ab represents the dielectric constant between type a particles and type b particles, σ ab represents the distance between type A particles and type B particles where the energy is zero, Represents σ ab to the 12th power, Represents σ ab to the sixth power.

5. The method according to claim 1, characterized in that The RL subsystem includes a pre-fetch particle data unit, a pre-fetch exclusion particle information unit, and a unit for calculating particle pair distances and screening particle pairs to be processed; The RL subsystem reads the particle information and the preprocessed data in the exclusion information data table from the HBM in response to the simulation start message, and selects target particle pairs according to the read information, including: The pre-fetch particle data unit reads the pre-processed data from the HBM in response to the simulation start message, and transmits the acquired data to the unit for calculating particle pair distances and screening particle pairs to be processed; The pre-fetch exclusion particle information unit reads the particle information in the exclusion information data table from the HBM in response to the simulation start message, and transmits the acquired data to the unit for calculating particle pair distances and screening particle pairs to be processed; The unit for calculating the distance of particle pairs and screening the particle pairs to be processed uses each data cell in the received data as a main data cell, takes out the particle information of the main data cell and the particle information of the first N related data cells, takes out a particle A from the main data cell, takes out a particle from each of the N neighboring cells corresponding to the main data cell, and forms a particle pair with the particle A to calculate the distance, so as to obtain N first distance calculation results; takes out another particle B from the main data cell, and forms a particle pair with the particle A in the main data cell to calculate the distance, so as to obtain a second distance calculation result; compares the square values ​​of each of the N first distance calculation results and the square value of the second distance calculation result with the square value of the preset cutoff distance, and determines the particle pair with a square value less than the preset cutoff distance as the target particle pair.

6. The method according to claim 1, characterized in that The RL subsystem includes a particle pair parameter query and queuing unit to be calculated, a short-range force calculation unit, a storage entry and partial summation unit generated according to the particle sequence number, a particle pair force cache queuing control unit, a particle pair force cache dequeuing control unit, a short-range force accumulation unit, a short-range force calculation result storage control unit, a short-range force calculation progress supervision unit, and a short-range force calculation interpolation table and coefficient table unit; The RL subsystem calculates the proximity force according to the selected target particle pairs and the interpolation table and coefficient table unit stored in the interpolation table for the proximity force calculation, and the coefficient table, and generates an interrupt message to the CPU after the calculation is completed, including: The to-be-calculated particle pair parameter query and queuing unit queries the interpolation table and the coefficient table according to the screened target particle pairs to obtain parameter information for the short-range force and information of each particle, stores the parameter information, and transmits the parameter information to the short-range force calculation unit, and transmits the information of each particle to the short-range force calculation progress monitoring unit; The short-range force calculation unit performs short-range force calculation based on the obtained parameter information, obtains the calculation result of the three-dimensional coordinate axis decomposition of the short-range force based on the particle pair, and transmits the calculation result to the storage entry generation and partial summation unit according to the particle sequence number and the short-range force calculation progress monitoring unit; The proximity force calculation progress monitoring unit, in response to the received data, adds one to the corresponding cell completion progress counter, and checks whether the value of the counter reaches a preset value. If so, the proximity force accumulation unit is controlled to obtain the proximity force of each particle from the HBM through the particle pair force cache dequeue control unit, and determines to perform proximity force accumulation on each particle according to the co-bonded particle pairs corresponding to each particle, and stores the accumulation result in the HBM after passing through the proximity force calculation result storage control unit; The storage entry and partial summation unit generated according to the particle sequence number respectively accumulates the short-range forces of the first 13 neighboring data cells corresponding to each data cell and caches them, and caches the data of the first 13 neighboring data cells corresponding to each data cell into the HBM according to the particle sequence number through the particle pair force cache queue control unit.

7. A system for determining non-co-bond forces, characterized in that: include: CPU and FPGA module, wherein the FPGA module includes an RL subsystem, an XDMA module, and an HBM module; The CPU is used for preprocessing a particle data set to be subjected to molecular dynamics simulation to obtain preprocessed data, and storing the preprocessed data in the HBM module through the XDMA module; The CPU is further used to configure a predetermined interpolation table and a coefficient table into the RL subsystem; The CPU is further used to form an exclusion information data table according to the information of each co-bonded particle pair in the pre-processed data, and store it in the HBM module through the XDMA module; The CPU is further configured to send a simulation start message to the RL subsystem through the XDMA module; The RL subsystem is used to read the particle information and the preprocessed data in the exclusion information data table from the HBM in response to the simulation start message, and screen out target particle pairs according to the read information; The RL subsystem is further used to calculate the short-range force according to the selected target particle pairs, the interpolation table, and the coefficient table, and generate an interrupt message after the calculation is completed and send it to the CPU; The CPU is also used to respond to the interrupt message, retrieve the short-range force data from the FPGA, complete the integral operation of speed and coordinate position according to the short-range force data, and update the particle information in the FPGA according to the operation result to perform the next iteration until a predetermined iteration termination condition is met.

8. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-6 when executing a program stored in a memory.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

10. A program product, characterized in that The program product comprises computer program instructions, and when the computer program instructions are executed, the method according to any one of claims 1 to 6 can be implemented.

Citation Information

Patent Citations

  • Optimization mapping method of N-body problem short-range action computation on GPU (graphic processing unit) structure

    CN102955686A

  • Molecular dynamics non-covalent bond calculation method and device

    CN118098385A

  • Processing device, processing system, processing method, program, and recording medium

    JP2020064560A

  • Artificial intelligence-driven quantum computing

    US20210374611A1

Cited By

  • Streaming non-bonding force calculation engine for molecular dynamics simulation calculation

    CN120808909A