Data loading method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202611127701.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-27
AI Technical Summary
[0003]然而,在传统的方法中,权重数据的位置是随意加载的,如随意加载在GPGPU中的可访问区域
[0031]本发明提供的数据加载方法、装置、设备及存储介质,方法包括:确定各个待使用权重数据的归属类型,归属类型用于表示待使用权重数据供单计算节点访问还是多计算节点访问,根据待使用权重数据的归属类型,确定待使用权重数据的加载位置并进行数据加载,加载位置包括近存内存和非近存内存,根据待使用权重数据的特点,也就是归属类型,合理确定待使用权重数据的加载位置,以充分利用存储资源,以充分发挥近存内存的优势。
Smart Images

Figure CN122985655A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a data loading method, apparatus, device, and storage medium. Background Technology
[0002] With the rapid development of artificial intelligence technology, large-scale model inference has become a core computing task in many fields. During large-scale model inference, the model's weight data is usually stored in the form of large-scale matrices and subjected to intensive matrix operations in computing units.
[0003] However, in traditional methods, the weight data is loaded arbitrarily, such as into any accessible region of the GPGPU. This data loading method fails to consider the characteristics of the weight data to be used, resulting in insufficient utilization of storage resources and failing to leverage the advantages of near-memory memory. Summary of the Invention
[0004] This invention provides a data loading method, apparatus, device, and storage medium for determining the loading location based on the type of weighted data to be used, thereby making reasonable use of storage resources and giving full play to the advantages of near-memory memory.
[0005] In a first aspect, the present invention provides a data loading method, comprising:
[0006] Determine the ownership type of each weight data to be used; the ownership type indicates whether the weight data to be used is accessible to a single computing node or multiple computing nodes.
[0007] Based on the type of the weight data to be used, determine the loading location of the weight data to be used and load the data; the loading location includes near memory and non-near memory.
[0008] Optionally, the loading location of the weight data to be used can be determined based on its ownership type, including:
[0009] When the access type of the weight data to be used is a single computing node access type, determine the access frequency of the weight data to be used, and determine the loading location of the weight data to be used based on the access frequency.
[0010] When the type of the weight data to be used is the multi-computing node access type, the loading location of the weight data to be used is determined to be non-near memory.
[0011] Optionally, the loading location of the weight data to be used can be determined based on the access frequency, including:
[0012] When the access frequency is greater than or equal to the preset frequency, the loading location is determined based on the storage capacity occupied by the weight data to be used and the corresponding storage capacity of the nearby memory.
[0013] When the access frequency is less than the preset frequency, the loading location of the weight data to be used is determined to be non-near memory.
[0014] Optionally, the method also includes:
[0015] For any weight data to be used, the corresponding near memory region is divided according to the storage capacity occupied by the weight data to be used; the near memory region is divided into a dedicated fixed area and a temporary shared area;
[0016] Accordingly, the loading location is determined based on the storage capacity occupied by the weighted data to be used and the corresponding storage capacity of the nearby memory, including:
[0017] When the storage capacity occupied by the weight data to be used is greater than the storage capacity of the corresponding fixed area of the nearby memory, the loading location of the first part of the weight data to be used is determined to be the corresponding fixed area of the nearby memory, and the loading location of the second part of the weight data to be used is the temporary shared area of the adjacent nearby memory.
[0018] Optionally, the corresponding near-memory memory region can be divided according to the storage capacity occupied by the weighted data to be used, including:
[0019] When the storage capacity occupied by the weight data to be used is greater than or equal to the storage capacity of the corresponding near memory, the corresponding near memory is configured with only a dedicated fixed area.
[0020] When the storage capacity occupied by the weight data to be used is less than the storage capacity of the corresponding near memory, the corresponding near memory is configured with a dedicated fixed area and a temporary shared area.
[0021] Optionally, the method also includes:
[0022] The loading location of the weight data to be used is sent to the computing node. The computing node is used to obtain the weight data to be used based on the loading location and to perform computing tasks based on the weight data to be used.
[0023] In a second aspect, the present invention provides a data loading device, comprising:
[0024] The first determination module is used to determine the ownership type of each weight data to be used; the ownership type is used to indicate whether the weight data to be used is accessible by a single computing node or by multiple computing nodes.
[0025] The second determining module is used to determine the loading location of the weight data to be used and to load the data based on the type of the weight data to be used.
[0026] Thirdly, the present invention provides an electronic device, comprising: at least one processor and a memory;
[0027] The memory stores the instructions that the computer executes;
[0028] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the method as described in the first aspect.
[0029] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method of the first aspect.
[0030] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method of the first aspect.
[0031] The present invention provides a data loading method, apparatus, device, and storage medium. The method includes: determining the ownership type of each weight data to be used, wherein the ownership type indicates whether the weight data to be used is accessible by a single computing node or multiple computing nodes; determining the loading location of the weight data to be used and loading the data according to the ownership type of the weight data to be used, wherein the loading location includes near-memory memory and non-near-memory memory; and rationally determining the loading location of the weight data to be used according to the characteristics of the weight data to be used, i.e., the ownership type, so as to make full use of storage resources and give full play to the advantages of near-memory memory. Attached Figure Description
[0032] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0033] Figure 1 A flowchart illustrating a data loading method provided in an embodiment of the present invention;
[0034] Figure 2 A flowchart illustrating another data loading method provided in an embodiment of the present invention;
[0035] Figure 3 This is a schematic diagram of the structure of a data loading device provided in an embodiment of the present invention;
[0036] Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention.
[0037] The accompanying drawings have illustrated specific embodiments of the invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the invention in any way, but rather to illustrate the concept of the invention to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention.
[0039] Figure 1 This is a flowchart illustrating a data loading method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes:
[0040] Step S101: Determine the ownership type of each weight data to be used; the ownership type is used to indicate whether the weight data to be used is accessible to a single computing node or multiple computing nodes.
[0041] Optionally, the attribution type is a classification identifier used to define the access permission scope of the weight data to be used. This classification identifier is used to distinguish whether the weight data to be used can only be accessed and used independently by a single computing node, or can be accessed and used jointly by multiple computing nodes.
[0042] Optionally, after completing the matching and allocation of computation tasks and weight data to be used, the type of each weight data to be used can be determined. Optionally, this can be determined based on the access object corresponding to a certain weight data to be used, based on whether the weight data to be used is private data that can only be accessed and used independently by a single computing node, or public data that can be accessed and shared collaboratively by multiple computing nodes, thus completing the type classification of the weight data to be used.
[0043] Optionally, before step S101, the computation tasks can be divided into various computation nodes, and the weight data to be used corresponding to each computation task can be determined.
[0044] Optionally, a computing node is the basic computing unit that undertakes distributed computing tasks. It has independent data processing and computation execution capabilities and serves as the specific execution carrier for the computing tasks. The weight data to be used consists of weight-type parameter data that needs to be called and participate in the computation during the execution of the corresponding computing tasks by each computing node. It is the core data basis supporting the completion of the computing tasks.
[0045] Optionally, the computational tasks can be partitioned first. Since there are multiple computational tasks, each task can be assigned to a different computational node. For example, based on the computational requirements of each task and the load distribution rules of each computational node, each computational task can be assigned to its corresponding computational node one by one.
[0046] Optionally, based on the computing tasks undertaken by each computing node, the weight data to be used that each computing node needs to call during the execution of the operation is accurately determined, and the computing nodes and the weight data to be used are matched one-to-one.
[0047] Step S102: Determine the loading location of the weight data to be used according to its ownership type and load the data; the loading location includes near memory and non-near memory.
[0048] Optionally, the loading location is the storage loading area for the weight data to be used, which is mainly divided into two categories: local memory and non-local memory. Local memory is the local memory area that the corresponding computing node can read quickly and has lower access latency, while non-local memory is a remote memory area that is not local to a single computing node and can be shared and accessed by multiple computing nodes.
[0049] After determining the type of each set of weight data to be used, the loading location for each set of weight data is determined and the data loading operation is completed. Optionally, for weight data to be used that is only accessible to a single computing node, it is loaded into the local memory of the corresponding computing node to reduce data read latency and improve the computing efficiency of a single computing node; for weight data to be used that can be accessed by multiple computing nodes, it can be loaded into non-local memory to meet the shared access needs of multiple computing nodes.
[0050] Based on the type of the weight data to be used, the data loading location is determined differently, which can specifically adapt to the access and usage requirements of different weight data to be used, effectively solving the problem of underutilization of memory resources caused by a uniform data loading method. The above-mentioned differentiated loading mode enables efficient use of near-memory memory to improve efficiency during large model inference calculations, reduces the power consumption overhead caused by the transmission of weight data to be used on the bus, and balances the high efficiency of independent operation of a single computing node with the stability of collaborative operation of multiple computing nodes.
[0051] Optionally, the weight data to be used mentioned above is already trained data. Optionally, the loaded data is not limited to the weight data to be used; it can also be other data that needs to be frequently accessed and remains unchanged during the large model inference calculation process, besides the weight data to be used. Optionally, the loaded weight data to be used can be released when the model is unloaded.
[0052] The data loading method provided by this invention includes: determining the ownership type of each weight data to be used, wherein the ownership type indicates whether the weight data to be used is accessible by a single computing node or multiple computing nodes; determining the loading location of the weight data to be used and loading the data according to the ownership type of the weight data to be used, wherein the loading location includes near memory and non-near memory; and reasonably determining the loading location of the weight data to be used according to the characteristics of the weight data to be used, i.e., the ownership type, so as to make full use of storage resources and give full play to the advantages of near memory.
[0053] Figure 2 This is a flowchart illustrating another data loading method provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method includes: determining the loading location of the weight data to be used based on its ownership type, including:
[0054] When the access type of the weight data to be used is a single computing node access type, determine the access frequency of the weight data to be used, and determine the loading location of the weight data to be used based on the access frequency.
[0055] When the type of the weight data to be used is the multi-computing node access type, the loading location of the weight data to be used is determined to be non-near memory.
[0056] Optionally, the access frequency is the number of times a single computing node calls and reads the corresponding weight data to be used during the execution of a computing task. It is used to characterize the usage density of the weight data to be used and is the core basis for determining the loading location of the weight data to be used by subdividing the access types of a single computing node.
[0057] Optionally, based on determining the loading location according to the type of weight data to be used, an access frequency determination mechanism can be added for weight data to be used with a single computing node access type to achieve more refined loading location matching.
[0058] Optionally, when the type of weight data to be used is determined to be a single compute node access type, the access frequency of the weight data to be used during the execution of the corresponding compute node task can be statistically determined. Based on the data usage density reflected by the access frequency, the final loading location of the weight data to be used can be accurately matched and determined. Specifically, the loading location can be determined as near-memory memory or non-near-memory memory based on the access frequency.
[0059] When the type of weight data to be used is determined to be accessed by multiple computing nodes, there is no need to perform statistical determination of access frequency. The loading location of the weight data to be used is directly determined to be non-near memory, thereby providing a unified data sharing and calling channel for multiple computing nodes and avoiding resource redundancy caused by multiple nodes repeatedly loading data.
[0060] After determining the loading location of all weight data to be used, the loading operation of all weight data to be used is completed according to the determined location. This provides accurate and efficient data storage and retrieval support for independent computing on each computing node and collaborative computing on multiple computing nodes, further optimizes the data loading strategy, and improves the overall system performance and resource allocation accuracy.
[0061] Optionally, the loading location of the weight data to be used can be determined based on the access frequency, including:
[0062] When the access frequency is greater than or equal to the preset frequency, the loading location is determined based on the storage capacity occupied by the weight data to be used and the corresponding storage capacity of the nearby memory.
[0063] When the access frequency is less than the preset frequency, the loading location of the weight data to be used is determined to be non-near memory.
[0064] Optionally, the preset frequency is a frequency threshold standard pre-configured by the system, used to distinguish between high-frequency and low-frequency usage scenarios of weight data to be used on a single node. It serves as the boundary condition for triggering different loading location determination logic. The data storage capacity is the memory space occupied by the weight data itself, and the local memory storage capacity is the effective storage space available for storing weight data in the local local memory of the corresponding computing node. These two capacity parameters are used together to accurately determine the appropriate loading area for high-frequency weight data.
[0065] Optionally, if the access frequency of the weight data to be used is greater than or equal to a preset frequency, it indicates that the weight data to be used is high-frequency data. In this case, the storage capacity occupied by the weight data to be used and the storage capacity of the corresponding near-memory memory of the computing node are further obtained. By comparing the matching relationship of the two capacity parameters, the final loading location of the high-frequency weight data is reasonably determined, ensuring the efficient access characteristics of high-frequency data while adapting to the storage capacity of local memory. Optionally, its final loading location may include the near-memory memory corresponding to its own computing node, and may also include the near-memory memory corresponding to adjacent computing nodes.
[0066] Optionally, if the access frequency of the weight data to be used is less than the preset frequency, it means that the weight data to be used is low-frequency data. In this case, it is not necessary to occupy local high-speed memory resources. The loading location of the weight data to be used can be directly determined as non-near memory, which effectively saves the near memory space of the computing node and prioritizes the use of high-speed storage resources for high-frequency computing data.
[0067] Optionally, when the type of weight data to be used is determined to be a multi-computing node access type, there is no need to perform access frequency statistics and capacity comparison. The loading location of this type of weight data to be used is directly determined to be non-near memory, thereby providing a unified data sharing and calling channel for multiple computing nodes and avoiding resource redundancy and data calling conflicts caused by multiple nodes repeatedly loading data.
[0068] The above method realizes multi-dimensional adaptive loading configuration based on data ownership type, access frequency, and storage capacity occupied. It not only ensures the running efficiency of high-frequency computing tasks, but also greatly improves the fine utilization of memory resources in distributed systems, effectively optimizing the overall running stability and resource allocation rationality of computing tasks.
[0069] Optionally, the method also includes:
[0070] For any weight data to be used, the corresponding near memory region is divided according to the storage capacity occupied by the weight data to be used; the near memory region is divided into a dedicated fixed area and a temporary shared area;
[0071] Accordingly, the loading location is determined based on the storage capacity occupied by the weighted data to be used and the corresponding storage capacity of the nearby memory, including:
[0072] When the storage capacity occupied by the weight data to be used is greater than the storage capacity of the corresponding fixed area of the nearby memory, the loading location of the first part of the weight data to be used is determined to be the corresponding fixed area of the nearby memory, and the loading location of the second part of the weight data to be used is the temporary shared area of the adjacent nearby memory.
[0073] Optionally, the dedicated fixed area is a fixed storage region pre-allocated based on the storage capacity of the near-memory memory. This area is exclusively used by the corresponding computing node to stably store frequently used weight data, ensuring the stability and efficiency of data access. The temporary shared area is a dynamically allocated storage region allocated from the near-memory memory, capable of temporarily holding some of the weight data to be used by other computing nodes, realizing flexible utilization of the near-memory memory space.
[0074] Optionally, the first part is the portion of the weight data to be used whose size matches the storage capacity of the dedicated fixed area in the nearest memory and can be stored in the dedicated fixed area. The second part is the remaining portion of the weight data to be used that exceeds the storage capacity of the dedicated fixed area and needs to be stored in the temporary shared area of the nearest memory corresponding to the adjacent computing nodes.
[0075] Optionally, for any weight data to be used, the local memory space of the corresponding computing node is pre-divided into two functional areas: a dedicated fixed area and a temporary shared area, based on the storage capacity occupied by the weight data. When it is determined that the weight data belongs to a single computing node access type, the access frequency of the weight data during the task execution cycle is first determined, and the access frequency is compared with the system preset frequency to distinguish the data usage characteristics. If the access frequency of the weight data is greater than or equal to the preset frequency, it indicates that the weight data is high-frequency used data. At this time, the storage capacity occupied by the weight data and the storage capacity of the local memory of the corresponding computing node are further obtained, and matched with the capacity specifications of the pre-divided dedicated fixed area and temporary shared area. When it is detected that the storage capacity occupied by the weight data is greater than the storage capacity of the dedicated fixed area of the corresponding local memory, the weight data is partitioned and loaded. The first part of the weight data is loaded into the dedicated fixed area of the corresponding local memory, and the second part exceeding the capacity of the dedicated fixed area is loaded into the temporary shared area of the adjacent local memory.
[0076] By combining a dedicated fixed area with a temporary shared area, large-capacity, high-frequency data can be loaded locally. This fully utilizes the high-speed access advantage of nearby memory and effectively solves the problem of insufficient capacity of a single fixed area, which prevents the complete storage of high-frequency data.
[0077] If the access frequency of the weight data is less than the preset frequency, it means that the weight data is low-frequency data and does not need to occupy the precious local high-speed memory resources. The loading location of the weight data to be used is directly determined as non-near memory, which effectively saves the near memory space of a single node and prioritizes the use of high-speed storage resources for high-frequency computing data.
[0078] By using local memory partitioning and data block loading, the limitation of single local memory capacity on high-frequency data storage is broken, maximizing the local storage coverage of high-frequency data. At the same time, the reasonable allocation of various memory resources can ensure the running efficiency of high-frequency computing tasks and effectively optimize the overall running stability and resource allocation of computing tasks.
[0079] Optionally, the corresponding near-memory memory region can be divided according to the storage capacity occupied by the weighted data to be used, including:
[0080] When the storage capacity occupied by the weight data to be used is greater than or equal to the storage capacity of the corresponding near memory, the corresponding near memory is configured with only a dedicated fixed area.
[0081] When the storage capacity occupied by the weight data to be used is less than the storage capacity of the corresponding near memory, the corresponding near memory is configured with a dedicated fixed area and a temporary shared area.
[0082] Optionally, the near-memory partitioning rule is based on the relationship between the storage capacity occupied by the weighted data to be used and the total storage capacity of the corresponding near-memory. It is an adaptive rule for determining the type of near-memory region and is the core basis for realizing differentiated partitioning configuration of near-memory.
[0083] Optionally, for any weight data to be used, the dynamic partitioning configuration of the near-memory will be completed based on the comparison between the actual storage capacity occupied by the weight data and the overall storage capacity of the near-memory of the corresponding computing node. The specific partitioning logic is as follows: When the storage capacity occupied by the weight data to be used is greater than or equal to the overall storage capacity of the corresponding near-memory, it is determined that the current near-memory can only meet the storage requirements of that weight data, and there is no extra storage space available for dynamic allocation. Therefore, a dedicated fixed area is configured only for the corresponding near-memory. When the storage capacity occupied by the weight data to be used is less than the overall storage capacity of the corresponding near-memory, it is determined that the current near-memory has surplus storage space. In this case, a dedicated fixed area and a temporary shared area are configured for the corresponding near-memory. The dedicated fixed area stores its own weight data to be used, while the temporary shared area forms a flexibly allocate supplementary storage space to provide space support for the weight data to be used by other computing nodes.
[0084] Optionally, after completing the adaptive partitioning configuration of the near-memory memory, the process of determining the loading location of weight data continues. When it is determined that the weight data to be used belongs to the single compute node access type, the access frequency of the weight data within the task execution cycle is first determined, and the access frequency is compared with the system preset frequency to distinguish the data usage characteristics. If the access frequency of the weight data is greater than or equal to the preset frequency, it indicates that the weight data is high-frequency data. At this time, the capacity matching judgment is performed in conjunction with the near-memory memory area that has been dynamically partitioned. When the storage capacity occupied by the weight data to be used is greater than the storage capacity of the dedicated fixed area of the corresponding near-memory memory, the high-frequency weight data to be used is partitioned and loaded. The first part of the weight data to be used is loaded into the dedicated fixed area of the corresponding near-memory memory, and the second part of the remaining data exceeding the capacity of the dedicated fixed area is loaded into the temporary shared area of the adjacent near-memory memory. The local loading of large-capacity high-frequency data is completed by the cooperation of fixed area and temporary area, making full use of the surplus space resources of near-memory memory and solving the problem of insufficient capacity of a single fixed area.
[0085] Optionally, if the access frequency of the weight data to be used is less than the preset frequency, it indicates that the weight data to be used is low-frequency data and does not need to occupy valuable local high-speed memory resources. The loading location of the weight data to be used is directly determined to be non-near-memory memory, effectively saving near-memory memory space and prioritizing high-speed storage resources for high-frequency computing data. When it is determined that the weight data to be used belongs to the multi-computing node access type, there is no need to perform access frequency statistics, capacity comparison, and partition matching judgment. The loading location of this type of shared weight data is directly determined to be non-near-memory memory, thereby providing a unified data sharing and calling channel for multiple computing nodes and avoiding resource redundancy and data calling conflicts caused by multiple nodes repeatedly loading data.
[0086] By setting up dedicated fixed areas and temporary shared areas, the local memory corresponding to a computing node can be used not only by itself but also by adjacent computing nodes, so as to make reasonable use of the local memory capacity and achieve fast data access.
[0087] Optionally, the method also includes:
[0088] The loading location of the weight data to be used is sent to the computing node. The computing node is used to obtain the weight data to be used based on the loading location and to perform computing tasks based on the weight data to be used.
[0089] Optionally, a load location push command can be sent to the computing node to enable the computing node to determine the load location of the weight data to be used. For example, the load location push command is an interactive command generated after determining the load location of the weight data to be used, which is used to inform the computing node of the specific storage area of the weight data to be used, providing the computing node with the instruction basis for accurately reading the data and executing computing tasks.
[0090] Optionally, after accurately determining the loading location of the weight data to be used and deploying it in partitions, the final loading location information corresponding to each weight data to be used can be uniformly pushed down to the corresponding computing nodes. After receiving the loading location information, each computing node can accurately locate the corresponding weight data to be used in near-memory or non-near-memory based on the loading location information, complete the rapid reading and acquisition of weight data, and finally, based on the acquired complete weight data to be used, independently execute its assigned computing tasks to complete the entire distributed scheduling and operation process of the weight data to be used.
[0091] This method achieves precise linkage between the scheduling configuration of weighted data to be used and the data reading and task execution on the computing node by loading location push, avoiding the increased time consumption and resource waste caused by the computing node blindly searching for data, and improving data scheduling efficiency and task running stability.
[0092] Figure 3 This is a schematic diagram of the structure of a data storage device provided in an embodiment of the present invention, such as... Figure 3 As shown, the device includes:
[0093] The first determining module 301 is used to determine the attribution type of each weight data to be used; the attribution type is used to indicate whether the weight data to be used is accessible by a single computing node or by multiple computing nodes.
[0094] The second determining module 302 is used to determine the loading location of the weight data to be used and load the data according to the type of the weight data to be used; the loading location includes near memory and non-near memory.
[0095] Optionally, when the second determining module 302 determines the loading location of the weight data to be used based on the type of the weight data to be used, it is specifically used for:
[0096] When the access type of the weight data to be used is a single computing node access type, determine the access frequency of the weight data to be used, and determine the loading location of the weight data to be used based on the access frequency.
[0097] When the type of the weight data to be used is the multi-computing node access type, the loading location of the weight data to be used is determined to be non-near memory.
[0098] Optionally, when determining the loading location of the weight data to be used based on the access frequency, the second determining module 302 is specifically used for:
[0099] When the access frequency is greater than or equal to the preset frequency, the loading location is determined based on the storage capacity occupied by the weight data to be used and the corresponding storage capacity of the nearby memory.
[0100] When the access frequency is less than the preset frequency, the loading location of the weight data to be used is determined to be non-near memory.
[0101] Optionally, the device further includes: a region division module, used for:
[0102] For any weight data to be used, the corresponding near memory region is divided according to the storage capacity occupied by the weight data to be used; the near memory region is divided into a dedicated fixed area and a temporary shared area;
[0103] Accordingly, when determining the loading location based on the storage capacity occupied by the weight data to be used and the corresponding storage capacity of the nearby memory, the second determining module 302 is specifically used for:
[0104] When the storage capacity occupied by the weight data to be used is greater than the storage capacity of the corresponding fixed area of the nearby memory, the loading location of the first part of the weight data to be used is determined to be the corresponding fixed area of the nearby memory, and the loading location of the second part of the weight data to be used is the temporary shared area of the adjacent nearby memory.
[0105] Optionally, when the region partitioning module partitions the corresponding near-memory memory regions based on the storage capacity occupied by the weighted data to be used, it is specifically used for:
[0106] When the storage capacity occupied by the weight data to be used is greater than or equal to the storage capacity of the corresponding near memory, the corresponding near memory is configured with only a dedicated fixed area.
[0107] When the storage capacity occupied by the weight data to be used is less than the storage capacity of the corresponding near memory, the corresponding near memory is configured with a dedicated fixed area and a temporary shared area.
[0108] Optionally, the device further includes: a transmitting module, used for:
[0109] The loading location of the weight data to be used is sent to the computing node. The computing node is used to obtain the weight data to be used based on the loading location and to perform computing tasks based on the weight data to be used.
[0110] The data loading device provided in this embodiment of the invention can achieve the above-mentioned... Figure 1 The data loading method of the embodiment shown is similar in principle and technical effect, and will not be described again here.
[0111] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention includes: at least one processor 401, and may further include a memory 402. The processor 401 and the memory 402 are connected via a bus 403.
[0112] In a specific implementation, at least one processor 401 executes computer execution instructions stored in memory 402, causing at least one processor 401 to execute the configured method.
[0113] The specific implementation process of processor 401 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0114] In the above Figure 4In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0115] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage.
[0116] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0117] This invention also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described in the above embodiments.
[0118] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the above method embodiments.
[0119] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0120] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0121] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0122] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0123] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods of the various embodiments of this application.
[0124] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A data loading method, characterized in that, include: Determine the category to which each weight data to be used belongs; The attribution type is used to indicate whether the weight data to be used is accessible to a single computing node or multiple computing nodes. Based on the type of the weight data to be used, determine the loading location of the weight data to be used and load the data; the loading location includes near memory and non-near memory.
2. The method according to claim 1, characterized in that, Determining the loading location of the weight data to be used based on its ownership type includes: When the attribute type of the weight data to be used is a single computing node access type, the access frequency of the weight data to be used is determined, and the loading location of the weight data to be used is determined based on the access frequency. When the type of the weight data to be used is the multi-computing node access type, the loading location of the weight data to be used is determined to be non-near memory.
3. The method according to claim 2, characterized in that, Determining the loading location of the weight data to be used based on the access frequency includes: When the access frequency is greater than or equal to the preset frequency, the loading position is determined according to the storage capacity occupied by the weight data to be used and the corresponding storage capacity of the nearby memory. When the access frequency is less than the preset frequency, the loading location of the weight data to be used is determined to be the non-near memory.
4. The method according to claim 3, characterized in that, The method further includes: For any weight data to be used, the corresponding near memory region is divided according to the storage capacity occupied by the weight data to be used; the near memory region is divided into a dedicated fixed area and a temporary shared area; Accordingly, the loading location is determined based on the storage capacity occupied by the weighted data to be used and the corresponding storage capacity of the nearby memory, including: When the storage capacity occupied by the weight data to be used is greater than the storage capacity of the corresponding dedicated fixed area of the nearby memory, the loading location of the first part of the weight data to be used is determined to be the dedicated fixed area of the corresponding nearby memory, and the loading location of the second part of the weight data to be used is the temporary shared area of the adjacent nearby memory.
5. The method according to claim 4, characterized in that, The corresponding near-memory memory regions are divided according to the storage capacity occupied by the weighted data to be used, including: When the storage capacity occupied by the weight data to be used is greater than or equal to the storage capacity of the corresponding near memory, the corresponding near memory is configured with only a dedicated fixed area. When the storage capacity occupied by the weight data to be used is less than the storage capacity of the corresponding near memory, the corresponding near memory is configured with a dedicated fixed area and a temporary shared area.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: The loading location of the weight data to be used is sent to the computing node, which is used to obtain the weight data to be used according to the loading location and perform computing tasks according to the weight data to be used.
7. A data storage device, characterized in that, include: The first determining module is used to determine the type of each weight data to be used; The attribution type is used to indicate whether the weight data to be used is accessible to a single computing node or multiple computing nodes. The second determining module is used to determine the loading location of the weight data to be used and load the data according to the ownership type of the weight data to be used; the loading location includes near memory and non-near memory.
8. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.