CN108874532A - Memory allocation method and equipment - Google Patents

Memory allocation method and equipment Download PDF

Info

Publication number
CN108874532A
CN108874532A CN201710403524.9A CN201710403524A CN108874532A CN 108874532 A CN108874532 A CN 108874532A CN 201710403524 A CN201710403524 A CN 201710403524A CN 108874532 A CN108874532 A CN 108874532A
Authority
CN
China
Prior art keywords
request
memory
memory block
initial address
blocks
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710403524.9A
Other languages
Chinese (zh)
Other versions
CN108874532B (en
Inventor
贾开
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Megvii Technology Co Ltd
Beijing Maigewei Technology Co Ltd
Original Assignee
Beijing Megvii Technology Co Ltd
Beijing Maigewei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Megvii Technology Co Ltd, Beijing Maigewei Technology Co Ltd filed Critical Beijing Megvii Technology Co Ltd
Priority to CN201710403524.9A priority Critical patent/CN108874532B/en
Publication of CN108874532A publication Critical patent/CN108874532A/en
Application granted granted Critical
Publication of CN108874532B publication Critical patent/CN108874532B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System (AREA)

Abstract

A kind of memory allocation method and equipment, this method include the opposite core position relationship calculated between conflict request;And the optimal solution of Memory Allocation is calculated according to opposite core position relationship.Available one of this method preferably Memory Distribution Map, and the cost of allocation plan is small, the speed of service is fast.

Description

Memory allocation method and equipment
Technical field
Embodiment of the disclosure is related to the field artificial intelligence (AI), and in particular to a kind of memory allocation method and equipment.
Background technique
Deep learning is greatly promoted the development of artificial intelligence, and the training system of depth model is based on mostly at present The engine that data flow diagram calculates, therefore relevant optimization just becomes particularly important.The characteristics of data flow diagram be back end almost It is all large-scale tensor, since training process generally requires calculating gradient, data flow diagram includes positive calculates and two mistakes of derivation Journey, number of nodes is numerous, therefore the optimization of memory is with regard to particularly important.
Summary of the invention
Embodiment of the disclosure provides a kind of memory allocation method, including:Calculate the opposite core position between conflict request Relationship;And the optimal solution of Memory Allocation is calculated according to the opposite core position relationship.
For example, the conflict request is in same time requirement in the memory allocation method that the embodiment of the present disclosure provides The memory address of occupancy has the request of overlapping.
For example, in the memory allocation method that the embodiment of the present disclosure provides, the opposite memory calculated between conflict request Positional relationship, including:Each request is converted into a distribution event and a release event, and temporally to described every A distribution event and each release event sequence, and obtain the corresponding memory size of each event;Initialization is current Allocated memory set of blocks, current free memory set of blocks and memory block relativeness chained list;It handles described each described Distribution event and each release event;The phase is obtained according to the distribution event and the processing result of the release event To memory positional relationship.
For example, in the memory allocation method that the embodiment of the present disclosure provides, the currently allocated memory block of the initialization Set, current free memory set of blocks and memory block relativeness chained list, including:Currently allocated memory set of blocks is set For empty set;It is empty set that current free memory set of blocks, which is arranged,;For each request, the memory block relativeness chain is set First low request of the initial address of the initial address of memory block memory block more corresponding than the request is empty, memory block in table Initial address first request higher than the initial address of the corresponding memory block of the request be sky.
For example, in the memory allocation method that the embodiment of the present disclosure provides, the processing each distribution event and every A release event, including:For distributing event, if the current free memory set of blocks is empty set, work as described The memory block of the corresponding memory size of the distribution event is added in preceding free memory set of blocks to the current free memory block In set;If the current free memory set of blocks is not empty set, found in the current free memory set of blocks not small In the corresponding memory size of the distribution event the smallest one section of contiguous memory block as free memory block, if there is no this The size modification of maximum memory block in current free memory set of blocks is in the distribution event is corresponding by the memory block of sample Deposit size and as the free memory block;The free memory block is moved from the current free memory set of blocks It removes, if the size of the free memory block is greater than the corresponding memory size of the distribution event, by the free memory block The corresponding memory block of difference of size memory size corresponding with the distribution event be inserted into the current free memory block collection In conjunction;Under the conditions of searching initial address of the initial address less than the free memory block in currently allocated memory set of blocks The starting of the initial address memory block more corresponding than the request of memory block is arranged in highest memory block with highest initial address First low request of address corresponds to the highest memory block, if searched less than the highest memory block, memory is arranged First request that the initial address of the initial address of block memory block more corresponding than the request is low is sky;Currently allocated Lookup initial address is greater than under the conditions of the initial address of the free memory block with minimum initial address in memory set of blocks First high request of the initial address of the initial address memory block more corresponding than the request of memory block is arranged in minimum memory block Corresponding to the minimum memory block, if searched less than the minimum memory block, it is arranged described in the initial address ratio of memory block First request for requesting the initial address of corresponding memory block high is sky;It is for release event, the release event is corresponding Memory block removed from the currently allocated internal storage set, and will be described in the corresponding memory block of the release event be added Current free memory set of blocks;If there is memory block corresponding with the release event in the current free memory set of blocks The continuous memory block in address, then by its memory merged block corresponding with the release event.
For example, in the memory allocation method that the embodiment of the present disclosure provides, according to the distribution event and the release thing The processing result of part obtains the opposite core position relationship, including:For each request, pair of the request is initialized The initial address for the memory block answered is more than or equal to each end address for requesting corresponding memory block in the first request set;By institute Low first of initial address for stating the first request set memory block more corresponding than the request with the initial address of memory block asks The union of sets collection asked is as updated first request set;The maximum end address of the corresponding memory block of the request is small In the initial address for being equal to memory block first request higher than the initial address of the corresponding memory block of the request set with The union of sets collection of the request is as the second request set.
For example, being calculated in the memory allocation method that the embodiment of the present disclosure provides according to the opposite core position relationship Optimal solution, including:Initialize the initial address of the corresponding memory block of each request;For each request, if institute The initial address for stating the corresponding memory block of request is more than or equal to each knot for requesting corresponding memory block in the first request set Beam address, then the initial address that the corresponding memory block of the request is arranged is zero;For each request, if there is described The initial address of the corresponding memory block of request is less than each end for requesting corresponding memory block in first request set Address then calculates each request in all first request sets the initial address of its corresponding memory block.
For example, in the memory allocation method that the embodiment of the present disclosure provides, in all first request sets Each request calculate the initial address of its corresponding memory block, including:It calculates every in all first request sets The starting memory address of the sum of a initial address for requesting corresponding memory block and length as the request.
Embodiment of the disclosure also provides a kind of equipment for Memory Allocation, including:One or more processors;One Or multiple memories;And the computer program instructions of storage in the memory, in the computer program instructions by institute Following steps are executed when stating processor operation:Calculate the opposite core position relationship between conflict request;And according to described opposite The optimal solution of core position relationship calculating Memory Allocation.
For example, the conflict request is in same a period of time in the equipment for Memory Allocation that the embodiment of the present disclosure provides Between require the memory address occupied to have the request of overlapping.
For example, in the equipment for Memory Allocation that the embodiment of the present disclosure provides, the phase calculated between conflict request To memory positional relationship, including:Each request is converted into a distribution event and a release event, and temporally right Each distribution event and each release event sequence, and obtain the corresponding memory size of each event;Initially Change currently allocated memory set of blocks, current free memory set of blocks and memory block relativeness chained list;It handles described every A distribution event and each release event;It is obtained according to the distribution event and the processing result of the release event The opposite core position relationship.
For example, the initialization is currently allocated in the equipment for Memory Allocation that the embodiment of the present disclosure provides Memory set of blocks, current free memory set of blocks and memory block relativeness chained list, including:Currently allocated memory is set Set of blocks is empty set;It is empty set that current free memory set of blocks, which is arranged,;For each request, it is opposite that the memory block is set In relationship chained list first request lower than the initial address of the corresponding memory block of the request of the initial address of memory block for it is empty, First request that the initial address of the initial address of memory block memory block more corresponding than the request is high is sky.
For example, in the equipment for Memory Allocation that the embodiment of the present disclosure provides, processing each distribution thing Part and each release event, including:For distributing event, if the current free memory set of blocks is empty set, The memory block of the corresponding memory size of the distribution event is added in the current free memory set of blocks to described current vacant In memory set of blocks;If the current free memory set of blocks is not empty set, sought in the current free memory set of blocks The smallest one section of contiguous memory block not less than the corresponding memory size of the distribution event is looked for as free memory block, if not There are such memory blocks, are the distribution event pair by the size modification of maximum memory block in current free memory set of blocks The memory size answered and as the free memory block;By the free memory block from the current free memory set of blocks Middle removal will be in the free time if the size of the free memory block is greater than the corresponding memory size of the distribution event The corresponding memory block of difference of the size of counterfoil memory size corresponding with the distribution event is inserted into the current free memory In set of blocks;The initial address item that initial address is less than the free memory block is searched in currently allocated memory set of blocks With the highest memory block of highest initial address under part, the initial address memory block more corresponding than the request of memory block is set First low request of initial address corresponds to the highest memory block, if searched less than the highest memory block, is arranged First request that the initial address of the initial address of memory block memory block more corresponding than the request is low is sky;Divide currently Lookup initial address has minimum starting point under the conditions of being greater than the initial address of the free memory block in the memory set of blocks matched High first of the initial address of the initial address of memory block memory block more corresponding than the request is arranged in the minimum memory block of location Request corresponds to the minimum memory block, if searched less than the minimum memory block, the initial address ratio of memory block is arranged First high request of the initial address for requesting corresponding memory block is sky;For release event, by the release event Corresponding memory block is removed from the currently allocated internal storage set, and the corresponding memory block of the release event is added The current free memory set of blocks;If existed in corresponding with the release event in the current free memory set of blocks The continuous memory block of block addresses, then by its memory merged block corresponding with the release event.
For example, in the equipment for Memory Allocation that the embodiment of the present disclosure provides, according to the distribution event and described The processing result of release event obtains the opposite core position relationship, including:For each request, asked described in initialization The initial address for the corresponding memory block asked is with being more than or equal in the first request set the end of the corresponding memory block of each request Location;By the initial address of first request set memory block more corresponding than the request with the initial address of memory block it is low The union of sets collection of one request is as updated first request set;The maximum of the corresponding memory block of the request is terminated First high request of the initial address of address memory block more corresponding than the request less than or equal to the initial address of memory block Set and the union of sets collection of the request are as the second request set.
For example, being closed in the equipment for Memory Allocation that the embodiment of the present disclosure provides according to the opposite core position System calculates optimal solution, including:Initialize the initial address of the corresponding memory block of each request;For each request, If the initial address of the corresponding memory block of the request is each more than or equal in the first request set to request corresponding memory The end address of block, then the initial address that the corresponding memory block of the request is arranged is zero;For each request, if deposited It is less than the corresponding memory block of each request in first request set in the initial address of the corresponding memory block of the request End address, then the starting point of its corresponding memory block is calculated for each request in all first request sets Location.
For example, in the equipment for Memory Allocation that the embodiment of the present disclosure provides, for all first requests Each request in set calculates the initial address of its corresponding memory block, including:Calculate all first request sets In the corresponding memory block of each request starting memory address as the request of initial address and the sum of length.
Embodiment of the disclosure also provides a kind of equipment for Memory Allocation, including:Opposite core position computing device, It is configured as calculating the opposite core position relationship between conflict request;And Memory Allocation optimal solution computing device, it is configured as The optimal solution of Memory Allocation is calculated according to the opposite core position relationship.
For example, the opposite core position calculates dress in the equipment for Memory Allocation that the embodiment of the present disclosure provides Set including:Sorting module is configured as each request being converted to a distribution event and a release event, and on time Between sort to each distribution event and each release event, and obtain the corresponding memory size of each event; First initialization module is configured as initializing currently allocated memory set of blocks, current free memory set of blocks and interior Counterfoil relativeness chained list;Processing module is configured as handling each distribution event and each release event; And opposite core position Relation acquisition module, it is configured as the processing result according to the distribution event and the release event Obtain the opposite core position relationship.
For example, the Memory Allocation optimal solution calculates in the equipment for Memory Allocation that the embodiment of the present disclosure provides Device includes:Second initialization module is configured as initializing the initial address of the corresponding memory block of each request;And Memory block initial address computing module is configured as each request, if the corresponding memory block of the request Initial address is more than or equal to each end address for requesting corresponding memory block in the first request set, then the request pair is arranged The initial address for the memory block answered is zero;For each request, if there is of the corresponding memory block of the request Beginning address is less than the end address of the corresponding memory block of each request in first request set, then for all described the Each request in one request set calculates the initial address of its corresponding memory block.
For example, memory allocation method and available one of the equipment preferably Memory Allocation side of embodiment of the present disclosure offer Case, and the cost of allocation plan is small, the speed of service is fast.
Detailed description of the invention
It, below will be in embodiment or description of Related Art in order to illustrate more clearly of the technical solution of the embodiment of the present disclosure Required attached drawing is briefly described, it should be apparent that, the accompanying drawings in the following description merely relates to some of the disclosure Embodiment, not to the limitation of the disclosure.
Fig. 1 is a kind of flow chart for memory allocation method that the embodiment of the present disclosure provides;
Fig. 2 is the schematic diagram for two Memory Allocations request that the embodiment of the present disclosure provides;
Fig. 3 is the flow chart for realizing the method for step S100 in Fig. 1 that the embodiment of the present disclosure provides;
Fig. 4 is the flow chart for realizing the method for step S120 in Fig. 3 that the embodiment of the present disclosure provides;
Fig. 5 A and Fig. 5 B are the flow charts for realizing the method for step S130 in Fig. 3 that the embodiment of the present disclosure provides;
Fig. 6 is the flow chart for realizing the method for step S140 in Fig. 3 that the embodiment of the present disclosure provides;
Fig. 7 is the flow chart for realizing the method for step S200 in Fig. 1 that the embodiment of the present disclosure provides;
Fig. 8 is a kind of one of the schematic diagram of equipment for Memory Allocation that the embodiment of the present disclosure provides;And
Fig. 9 is the two of the schematic diagram of the equipment for a kind of Memory Allocation that the embodiment of the present disclosure provides.
Specific embodiment
Below in conjunction with attached drawing, the technical solution in the embodiment of the present disclosure is clearly and completely described with reference to attached The non-limiting example embodiment for showing in figure and being described in detail in the following description, the example that the disclosure is more fully described below are implemented Example and their various features and Advantageous details.It should be noted that feature shown in figure is not required to be drawn to scale.This The open description that known materials, component and technology is omitted, to not make the example embodiment of the disclosure fuzzy.It is given Example be only intended to be conducive to understand the implementation of disclosure example embodiment, and further enable those skilled in the art real Apply example embodiment.Thus, these examples are understood not to the limitation to the range of embodiment of the disclosure.
Unless otherwise specifically defined, the technical term or scientific term that the disclosure uses should be disclosure fields The ordinary meaning that the interior personage with general technical ability is understood." first ", " second " used in the disclosure and similar word Language is not offered as any sequence, quantity or importance, and is used only to distinguish different component parts.In addition, in the disclosure In each embodiment, same or similar reference label indicates same or similar component.
A kind of method of internal memory optimization is that dependency analysis is carried out in data flow diagram, and the existing dynamic memory of dry run Allocation algorithm, but this method does not make full use of the global static information of data flow diagram, is unable to reach optimal effectiveness.It is another Kind of Memory Optimize Method is using the higher graph coloring class algorithm of complexity, but since to be too high to processing extensive for complexity Data flow diagram.
Embodiment of the disclosure provides a kind of memory allocation method, calculating after giving a data flow diagram topological sorting After memory size needed for sequence and each back end, according to method available one of embodiment of the present disclosure offer Preferably Memory Distribution Map.
For example, if defining the generation of (actual memory dosage/sequence of calculation bottleneck memory size -1) as allocation plan Valence, then the cost for the method that the embodiment of the present disclosure provides is generally within 0.1, when most of within 0.01, than general The half left and right of dynamic allocation method cost, and the speed of service is fast.
Embodiment of the disclosure provides a kind of memory allocation method, as shown in Figure 1, this method comprises the following steps.
Step S100:Calculate the opposite core position relationship between conflict request;And
Step S200:The optimal solution of Memory Allocation is calculated according to opposite core position relationship.
For example, conflict request is occupied in same time requirement in the memory allocation method that the embodiment of the present disclosure provides Memory address have the request of overlapping.
For example, in the memory allocation method that the embodiment of the present disclosure provides, data flow diagram topological sorting, for example, it is N number of Memory Allocation request can be expressed as N number of triple:(s_i, t_i, z_i), wherein (s_i, t_i) is i-th of request respectively Distribution and release moment, z_i are the memory size of its request, 0≤i<N.For each request i, memory address a_i is originated, Meet a_i >=0, and for request i, j of any time conflict, space does not conflict;It is final to wish to originate memory address and ask The maximum value max { a_i+z_i } of the sum of the memory size asked is small as far as possible.
For example, in the disclosure, for two requests i, j, if the two has coincidence in time, the referred to as time is rushed It is prominent, i.e. s_i<T_j and s_j<t_i;Two requests i, j are claimed if the two has coincidence on space (memory address) For Steric clashes, i.e. a_i<A_j+z_j and a_j<a_i+z_i.For example, a reasonable allocation plan requires the punching of institute's having time The no Steric clashes of prominent request.
For example, Fig. 2 is the schematic diagram for two Memory Allocations request that the embodiment of the present disclosure provides, the abscissa generation in Fig. 2 Table time, ordinate represent memory address, and two in Fig. 2 box represents two Memory Allocation requests, the two Memory Allocations Request having time conflict does not have Steric clashes still.For example, when two existing time conflicts of distribution request have Steric clashes again, In the coordinate system of Fig. 2, two boxes will have overlapping region (being not shown in the situation map 2).
For example, in the disclosure, memory address is a nonnegative integer, and memory address is since 0.Memory block is one section of company Continuous memory can be defined by its initial address and length.
For example, the problem of internal memory optimization can be converted into request i and j for time conflict, determine that i's and j is relatively interior The problem of depositing positional relationship makes it not have Steric clashes.After the relationship determines, memory is calculated according to opposite core position relationship The optimal solution of distribution.
For example, as shown in figure 3, calculating conflict request in the example for the memory allocation method that the embodiment of the present disclosure provides Between opposite core position relationship (i.e. step S100 in Fig. 1) include the following steps.
Step S110:Each request is converted into a distribution event and a release event, temporally to each distribution Event and the sequence of each release event, and obtain the corresponding memory size of each event;
Step S120:Initialize currently allocated memory set of blocks, current free memory set of blocks and memory block phase To relationship chained list;
Step S130:Handle each distribution event and each release event;And
Step S140:Opposite core position relationship is obtained according to distribution event and the processing result of release event.
For example, in step s 110, N number of request can be converted into N number of distribution event and N number of release event, and on time Between sort.Each request can generate two events, a distribution event and a release event, a shared 2N event.Each Event is indicated with a binary group (e_j, m_j), wherein 0≤j<2N, 0≤m_j<N, m_j indicate request belonging to the event Number, e_j indicates the type of the event, and value is alloc or free, indicates that j-th of event is used for e_j=alloc Distribute the m_j request, with e_j=free indicate j-th of event for discharge the m_j request;It is interior corresponding to the event Depositing size is its affiliated memory size requested, i.e. z_ { m_j }.
For example, as shown in figure 4, initialization is worked as in an example of the memory allocation method that the embodiment of the present disclosure provides Preceding allocated memory set of blocks, current free memory set of blocks and memory block relativeness chained list (i.e. step in Fig. 3 S120), include the following steps.
Step S121:It is empty set that currently allocated memory set of blocks, which is arranged,;
Step S122:It is empty set that current free memory set of blocks, which is arranged,;And
Step S123:For each request, the initial address of memory block in memory block relativeness chained list is set than request First low request of the initial address of corresponding memory block is empty, memory block initial address than requesting corresponding memory block First high request of initial address is sky.
For example, counter i=0 can be set first;Currently allocated memory set of blocks(Indicate empty set);When Preceding free memory set of blocksMemory block relativeness chained list prev_i=NULL, next_i=NULL are respectively indicated to I request (0≤i<N for), first lower than it and high request of memory initial address, NULL then indicate that it is when distributing Memory address was minimum at that time or highest request.
For example, as fig. 5 a and fig. 5b, in an example of the memory allocation method that the embodiment of the present disclosure provides, place Each distribution event and each release event (i.e. step S130 in Fig. 3) are managed, is included the following steps.
As shown in Figure 5A, for distributing event:
Step S131:If current free memory set of blocks is empty set, it is added and divides in current free memory set of blocks Memory block with the corresponding memory size of event is into current free memory set of blocks;
Step S132:If current free memory set of blocks is not empty set, found not in current free memory set of blocks The smallest one section of contiguous memory block of memory size corresponding less than distribution event is as free memory block, if there is no in this way Memory block, by the size modification of maximum memory block in current free memory set of blocks be the corresponding memory size of distribution event And as free memory block;
Step S133:Free memory block is removed from current free memory set of blocks, if the size of free memory block Memory size corresponding greater than distribution event, then it is the difference of the size of free memory block memory size corresponding with distribution event is right The memory block answered is inserted into current free memory set of blocks;
Step S134:The starting point that initial address is less than free memory block is searched in currently allocated memory set of blocks With the highest memory block of highest initial address under the conditions of location, the initial address of memory block is set than requesting corresponding memory block First low request of initial address corresponds to highest memory block, if searched less than highest memory block, memory block is arranged Initial address first request lower than requesting the initial address of corresponding memory block is sky;
Step S135:The starting point that initial address is greater than free memory block is searched in currently allocated memory set of blocks With the minimum memory block of minimum initial address under the conditions of location, the initial address of memory block is set than requesting corresponding memory block First high request of initial address corresponds to minimum memory block, if searched less than minimum memory block, memory block is arranged Initial address first request higher than requesting the initial address of corresponding memory block is sky.
As shown in Figure 5 B, for release event:
Step S136:The corresponding memory block of release event is removed from currently allocated internal storage set, and will release Current free memory set of blocks is added in the corresponding memory block of event;
Step S137:If it is continuous to there is block address memory corresponding with release event in current free memory set of blocks Memory block, then by its memory merged block corresponding with release event.
For example, if current free memory set of blocks V is sky, it is corresponding that the distribution event is newly added for distributing event Memory size be z_ { m_i } one section of memory block into current free memory set of blocks V.In current free memory set of blocks V The middle the smallest continuous one section of memory block found not less than z_ { m_i } is as free memory block;If there is no such memory Block then takes maximum memory block in current free memory set of blocks V, and is z_ { m_i } by its size modification.Upper one is indicated with c The free memory block found in step removes c from current free memory set of blocks V.If c > z_ { m_i }, by c-z_ { m_i } is inserted into current free memory set of blocks V.It is small that initial address ratio c is inquired in currently allocated memory set of blocks U Initial address highest block a and the big initial address lowest block b of initial address ratio c, if there is no being then accordingly denoted as NULL enables prev_ { m_i }=a, next_ { m_i }=b, i.e., the initial address of setting memory block is than requesting corresponding memory block First low request of initial address corresponds to highest memory block, if searched less than highest memory block, memory block is arranged Initial address first request lower than requesting the initial address of corresponding memory block is sky, and the initial address ratio of memory block is arranged First request for requesting the initial address of corresponding memory block high corresponds to minimum memory block, if searched less than minimum memory Block, then it is sky that first request higher than requesting the initial address of corresponding memory block of the initial address of memory block, which is arranged,.
For example, for release event, by the corresponding memory block of release event m_i from currently allocated memory set of blocks U Middle removal, and current free memory set of blocks V is added;If had in current free memory set of blocks V continuously interior with its address Counterfoil, then by its memory merged block corresponding with release event.
For example, counter i=i+1 is arranged, until i=2N after being disposed for a distribution or release event.Also It is to say, each distribution event and each release event (such as N number of distribution event can be handled by way of counter progression With N number of release event).
For example, as shown in fig. 6, the embodiment of the present disclosure provide memory allocation method an example in, according to distribution Event and the processing result of release event obtain opposite core position relationship (i.e. step S140 in Fig. 3), include the following steps.
Step S141:For each request, the initial address of the corresponding memory block of initialization requests is more than or equal to first Each end address for requesting corresponding memory block in request set;
Step S142:By the initial address of the first request set memory block more corresponding than request with the initial address of memory block The union of sets collection of first low request is as updated first request set;And
Step S143:The initial address ratio that the maximum end address for requesting corresponding memory block is less than or equal to memory block is asked The set for first request for asking the initial address of corresponding memory block high collects with the union of sets collection of request as the second request It closes.
For example, in step s 141, to 0≤i<N, initialization output resultIndicate the starting point of final i Location needs the maximum end address not less than all requests in below_i.
For example, in step S142, to 0≤i<N is enabled below_i=below_i ∪ { prev_i }, i.e., by the first request Gather first low union of sets collection requested of the initial address of memory block more corresponding than request with the initial address of memory block As updated first request set.
For example, in step S143, to 0≤i<N enables below_ { next_i }=below_ { next_i } ∪ { i }, i.e., will The maximum end address of corresponding memory block is requested to be less than or equal to the initial address of memory block than requesting rising for corresponding memory block The set of first high request of beginning address and the union of sets collection of request are as the second request set.
For example, as shown in fig. 7, the embodiment of the present disclosure provide memory allocation method an example in, according to opposite Core position relationship calculates optimal solution (i.e. step S200 in Fig. 1), includes the following steps.
Step S210:Initialize the initial address of the corresponding memory block of each request;
Step S220:For each request, asked if the initial address of the corresponding memory block of request is more than or equal to first The end address for seeking the corresponding memory block of each request in set, then be arranged that request the initial address of corresponding memory block be zero; And
Step S230:For each request, asked if there is the initial address of the corresponding memory block of request less than first Each end address for requesting corresponding memory block in set is asked, then for each request meter in the first all request sets Calculate the initial address of its corresponding memory block.
For example, in an example of the memory allocation method that the embodiment of the present disclosure provides, for the first all requests Each request in set calculates the initial address of its corresponding memory block, including:It calculates in the first all request sets The starting memory address of the sum of each initial address for requesting corresponding memory block and length as request.
For example, calculated below_i in the step s 100, that is, the opposite core position relationship between the request that conflicts. Optimal solution is calculated in order to solve opposite core position relationship, for 0≤i<N initializes a_i=NULL;If a_i is not NULL, then without calculating;IfThen a_i=0;Otherwise, for all j ∈ below_i, recursive resolve a_j, And enable a_i=max { a_j+z_j | j ∈ below_i }.To all 0≤i<N solves a_i.A_i is exactly the first all request collection Each request in conjunction calculates the initial address of its corresponding memory block.
For example, balance can be used by calculating the operation of currently allocated memory set of blocks U, current free memory set of blocks V Binary search tree and linear linked list are realized.For example, the levels of complexity calculated in step S200 is O (n), therefore total answer Miscellaneous degree rank is O (n log n).Therefore, the embodiment of the present disclosure provide memory allocation method can efficient process it is large-scale Data flow diagram.
Illustratively, the memory allocation method of the embodiment of the present disclosure is for depth model (referring to deep neural network model) Trained memory allocation method.In this way, the training speed of depth model can be effectively improved.
Embodiment of the disclosure also provides a kind of equipment for Memory Allocation, as shown in figure 8, Memory Allocation equipment 800 Including:One or more processors 801;One or more memories 802;And it is stored in the computer journey in memory 802 Sequence instruction, executes following steps when computer program instructions are run by processor 801:Calculate the opposite memory between conflict request Positional relationship;And the optimal solution of Memory Allocation is calculated according to opposite core position relationship.
For example, processor 801 can be central processing unit (CPU) or there is data-handling capacity and/or instruction to hold The processing unit of the other forms of row ability, the CPU for example can be single or multiple core CPU etc., such as can be based on X86 frame Structure or ARM framework etc., such as can be parallel computation mode or serial computing mode etc., embodiment of the disclosure is without being limited thereto.
For example, memory 802 may include one or more computer program products, computer program product may include Various forms of computer readable storage mediums, such as volatile memory and/or nonvolatile memory.Volatile memory It such as may include random access memory (RAM) and/or cache memory (cache) etc..Nonvolatile memory example It such as may include read-only memory (ROM), hard disk, flash memory.It can store one or more on computer readable storage medium A computer program instructions and can also store the program instruction operation when required data or the program instruction operation When the data that generate, processor 801 can run program instruction, with the function realized in the embodiment of the present disclosure and (realized by processor) Energy and/or other desired functions.
For example, conflict request was wanted in the same time in the equipment for Memory Allocation that the embodiment of the present disclosure provides The memory address of occupancy is asked to have the request of overlapping.
For example, being calculated relatively interior between conflicting request in the equipment for Memory Allocation that the embodiment of the present disclosure provides Positional relationship is deposited, including:Each request is converted into a distribution event and a release event, and temporally to each distribution Event and the sequence of each release event, and obtain the corresponding memory size of each event;Initialize currently allocated memory block Set, current free memory set of blocks and memory block relativeness chained list;Handle each distribution event and each release event; Opposite core position relationship is obtained according to distribution event and the processing result of release event.
For example, initializing currently allocated memory in the equipment for Memory Allocation that the embodiment of the present disclosure provides Set of blocks, current free memory set of blocks and memory block relativeness chained list, including:Currently allocated memory block collection is set It is combined into empty set;It is empty set that current free memory set of blocks, which is arranged,;For each request, it is arranged interior in memory block relativeness chained list First request lower than requesting the initial address of corresponding memory block of the initial address of counterfoil is empty, memory block initial address First request higher than requesting the initial address of corresponding memory block is sky.
For example, the embodiment of the present disclosure provide the equipment for Memory Allocation in, handle each distribution event and each Release event, including:For distributing event, if current free memory set of blocks is empty set, in current free memory block collection The memory block of the corresponding memory size of distribution event is added in conjunction into current free memory set of blocks;If current free memory Set of blocks is not empty set, is found in current free memory set of blocks the smallest not less than the corresponding memory size of distribution event One section of contiguous memory block is as free memory block, if there is no such memory block, by current free memory set of blocks most The size modification of big memory block is for the corresponding memory size of distribution event and as free memory block;By free memory block It is removed from current free memory set of blocks, if the size of free memory block is greater than the corresponding memory size of distribution event, The corresponding memory block of difference of the size of free memory block memory size corresponding with distribution event is inserted into current free memory In set of blocks;Under the conditions of searching initial address of the initial address less than free memory block in currently allocated memory set of blocks Initial address of the initial address of memory block than requesting corresponding memory block is arranged in highest memory block with highest initial address First low request corresponds to highest memory block, if searched less than highest memory block, the initial address of memory block is arranged First request lower than requesting the initial address of corresponding memory block is sky;It is searched in currently allocated memory set of blocks Initial address is greater than the minimum memory block with minimum initial address under the conditions of the initial address of free memory block, and memory block is arranged Initial address first request higher than requesting the initial address of corresponding memory block correspond to minimum memory block, if searched Less than minimum memory block, then first higher than requesting the initial address of corresponding memory block of the initial address of memory block is set and is asked It asks as sky;For release event, the corresponding memory block of release event is removed from currently allocated internal storage set, and will released It puts the corresponding memory block of event and current free memory set of blocks is added;If existed in current free memory set of blocks and release thing The continuous memory block of the corresponding block address memory of part, then by its memory merged block corresponding with release event.
For example, in the equipment for Memory Allocation that the embodiment of the present disclosure provides, according to distribution event and release event Processing result obtain opposite core position relationship, including:For each request, the corresponding memory block of initialization requests is risen Beginning address is more than or equal to each end address for requesting corresponding memory block in the first request set;By the first request set with it is interior The union of sets collection of the initial address of counterfoil first request lower than requesting the initial address of corresponding memory block is as update The first request set afterwards;The initial address ratio that the maximum end address for requesting corresponding memory block is less than or equal to memory block is asked The set for first request for asking the initial address of corresponding memory block high collects with the union of sets collection of request as the second request It closes.
For example, in the equipment for Memory Allocation that the embodiment of the present disclosure provides, according to opposite core position relationship meter Optimal solution is calculated, including:Initialize the initial address of the corresponding memory block of each request;For each request, if pair of request The initial address for the memory block answered is more than or equal to each end address for requesting corresponding memory block in the first request set, then sets Setting and requesting the initial address of corresponding memory block is zero;For each request, if there is of the corresponding memory block of request Beginning address each end address for requesting corresponding memory block less than in the first request set then collects the first all requests Each request in conjunction calculates the initial address of its corresponding memory block.
For example, in the equipment for Memory Allocation that the embodiment of the present disclosure provides, for the first all request sets In each request calculate the initial address of its corresponding memory block, including:Calculate all each of the first request sets Request the sum of initial address and length of corresponding memory block as the starting memory address of request.
Embodiment of the disclosure also provides a kind of equipment for Memory Allocation, as shown in figure 9, the equipment of Memory Allocation 900 include:Opposite core position computing device 910 and Memory Allocation optimal solution computing device 920.Opposite core position calculates dress 910 are set to be configured as calculating the opposite core position relationship between conflict request;Memory Allocation optimal solution computing device 920 is configured For the optimal solution for calculating Memory Allocation according to opposite core position relationship.
For example, in the equipment 900 for Memory Allocation that the embodiment of the present disclosure provides, opposite core position computing device 910 include:Sorting module 911, the first initialization module 912, processing module 913 and opposite core position Relation acquisition module 914.Sorting module 911 is configured as each request being converted to a distribution event and a release event, and temporally right Each distribution event and the sequence of each release event, and obtain the corresponding memory size of each event;First initialization module 912 It is configured as initializing currently allocated memory set of blocks, current free memory set of blocks and memory block relativeness chain Table;Processing module 913 is configured as handling each distribution event and each release event;Opposite core position Relation acquisition module 914 are configured as obtaining opposite core position relationship according to distribution event and the processing result of release event.
For example, sorting module 911, the first initialization module 912, processing mould in opposite core position computing device 910 Block 913 and opposite core position Relation acquisition module 914 can be realized by processor 801 shown in fig. 8 and memory 802.
For example, in the equipment for Memory Allocation that the embodiment of the present disclosure provides, Memory Allocation optimal solution computing device 920 include:Second initialization module 921 and memory block initial address computing module 922.Second initialization module 921 is configured For the initial address for initializing the corresponding memory block of each request;Memory block initial address computing module 922 be configured as Each request, if the initial address of the corresponding memory block of request is more than or equal in the first request set, each request is corresponding The end address of memory block, then be arranged that request the initial address of corresponding memory block be zero;For each request, if there is asking The initial address for the corresponding memory block asked each end address for requesting corresponding memory block less than in the first request set, then The initial address of its corresponding memory block is calculated for each request in the first all request sets.
For example, the second initialization module 921 and memory block initial address meter in Memory Allocation optimal solution computing device 920 Calculating module 922 can also be realized by processor 801 shown in fig. 8 and memory 802.
For example, memory allocation method and available one of the equipment preferably Memory Allocation side of embodiment of the present disclosure offer Case, and the cost of allocation plan is small, the speed of service is fast.
Illustratively, the Memory Allocation equipment of the embodiment of the present disclosure is the Memory Allocation equipment for depth model training.
Although above having used general explanation and specific embodiment, detailed description has been made to the disclosure, On the basis of the embodiment of the present disclosure, it can be made some modifications or improvements, this is apparent to those skilled in the art 's.Therefore, these modifications or improvements on the basis of without departing from disclosure spirit, it is claimed to belong to the disclosure Range.

Claims (19)

1. a kind of memory allocation method, including:
Calculate the opposite core position relationship between conflict request;And
The optimal solution of Memory Allocation is calculated according to the opposite core position relationship.
2. memory allocation method according to claim 1, wherein the conflict request is occupied in same time requirement Memory address has the request of overlapping.
3. memory allocation method according to claim 1 or 2, wherein the opposite memory bits calculated between conflict request Relationship is set, including:
Each request is converted into a distribution event and a release event, and temporally to each distribution event It sorts with each release event, and obtains the corresponding memory size of each event;
Initialize currently allocated memory set of blocks, current free memory set of blocks and memory block relativeness chained list;
Handle each distribution event and each release event;And
The opposite core position relationship is obtained according to the distribution event and the processing result of the release event.
4. memory allocation method according to claim 3, wherein the currently allocated memory set of blocks of the initialization, Current free memory set of blocks and memory block relativeness chained list, including:
It is empty set that currently allocated memory set of blocks, which is arranged,;
It is empty set that current free memory set of blocks, which is arranged,;And
For each request, the initial address of memory block in the memory block relativeness chained list is set than the request pair First low request of the initial address for the memory block answered is empty, memory block initial address memory block more corresponding than the request High first request of initial address be sky.
5. memory allocation method according to claim 3, wherein the processing each distribution event and each described Release event, including:
For distributing event,
If the current free memory set of blocks is empty set, the distribution is added in the current free memory set of blocks The memory block of the corresponding memory size of event is into the current free memory set of blocks;
If the current free memory set of blocks is not empty set, is found in the current free memory set of blocks and be not less than institute The smallest one section of contiguous memory block of the corresponding memory size of distribution event is stated as free memory block, if there is no such The size modification of maximum memory block in current free memory set of blocks is that the corresponding memory of the distribution event is big by memory block It is small and as the free memory block;
The free memory block is removed from the current free memory set of blocks, if the size of the free memory block is big In the corresponding memory size of the distribution event, then by the size of free memory block memory corresponding with the distribution event The corresponding memory block of difference of size is inserted into the current free memory set of blocks;
Under the conditions of searching initial address of the initial address less than the free memory block in currently allocated memory set of blocks The starting of the initial address memory block more corresponding than the request of memory block is arranged in highest memory block with highest initial address First low request of address corresponds to the highest memory block, if searched less than the highest memory block, memory is arranged First request that the initial address of the initial address of block memory block more corresponding than the request is low is sky;
Under the conditions of searching initial address of the initial address greater than the free memory block in currently allocated memory set of blocks The starting of the initial address memory block more corresponding than the request of memory block is arranged in minimum memory block with minimum initial address First high request of address corresponds to the minimum memory block, if searched less than the minimum memory block, memory is arranged First request that the initial address of the initial address of block memory block more corresponding than the request is high is sky;
For release event,
The corresponding memory block of the release event is removed from the currently allocated internal storage set, and by the release thing The current free memory set of blocks is added in the corresponding memory block of part;
If there is the continuous memory of block address memory corresponding with the release event in the current free memory set of blocks Block, then by its memory merged block corresponding with the release event.
6. memory allocation method according to claim 3, wherein according to the place of the distribution event and the release event It manages result and obtains the opposite core position relationship, including:
For each request, the initial address for initializing the corresponding memory block of the request is more than or equal to the first request collection Each end address for requesting corresponding memory block in conjunction;
The initial address of first request set memory block more corresponding than the request with the initial address of memory block is low The union of sets collection of first request is as updated first request set;And
The maximum end address of the corresponding memory block of the request is less than or equal to the initial address of memory block than the request pair The set of first high request of the initial address for the memory block answered and the union of sets collection of the request collect as the second request It closes.
7. memory allocation method according to claim 1 or 2, wherein calculated most according to the opposite core position relationship Excellent solution, including:
Initialize the initial address of the corresponding memory block of each request;
For each request, if the initial address of the corresponding memory block of the request is more than or equal to the first request set In the corresponding memory block of each request end address, then the initial address that the corresponding memory block of the request is arranged is zero;With And
For each request, it is less than first request if there is the initial address of the corresponding memory block of the request Each end address for requesting corresponding memory block in set, then for each request in all first request sets Calculate the initial address of its corresponding memory block.
8. memory allocation method according to claim 7, wherein for all each of first request sets Request calculates the initial address of its corresponding memory block, including:
Calculate the sum of initial address and length of the corresponding memory block of each request in all first request sets work For the starting memory address of the request.
9. a kind of equipment for Memory Allocation, including:
One or more processors;
One or more memories;And
The computer program instructions of storage in the memory, when the computer program instructions are run by the processor Execute following steps:
Calculate the opposite core position relationship between conflict request;And
The optimal solution of Memory Allocation is calculated according to the opposite core position relationship.
10. the equipment according to claim 9 for Memory Allocation, wherein the conflict request was wanted in the same time The memory address of occupancy is asked to have the request of overlapping.
11. the equipment according to claim 9 or 10 for Memory Allocation, wherein the phase calculated between conflict request To memory positional relationship, including:
Each request is converted into a distribution event and a release event, and temporally to each distribution event It sorts with each release event, and obtains the corresponding memory size of each event;
Initialize currently allocated memory set of blocks, current free memory set of blocks and memory block relativeness chained list;
Handle each distribution event and each release event;And
The opposite core position relationship is obtained according to the distribution event and the processing result of the release event.
12. the equipment according to claim 11 for Memory Allocation, wherein the currently allocated memory of the initialization Set of blocks, current free memory set of blocks and memory block relativeness chained list, including:
It is empty set that currently allocated memory set of blocks, which is arranged,;
It is empty set that current free memory set of blocks, which is arranged,;And
For each request, the initial address of memory block in the memory block relativeness chained list is set than the request pair First low request of the initial address for the memory block answered is empty, memory block initial address memory block more corresponding than the request High first request of initial address be sky.
13. the equipment according to claim 11 for Memory Allocation, wherein the processing each distribution event and Each release event, including:
For distributing event,
If the current free memory set of blocks is empty set, the distribution is added in the current free memory set of blocks The memory block of the corresponding memory size of event is into the current free memory set of blocks;
If the current free memory set of blocks is not empty set, is found in the current free memory set of blocks and be not less than institute The smallest one section of contiguous memory block of the corresponding memory size of distribution event is stated as free memory block, if there is no such The size modification of maximum memory block in current free memory set of blocks is that the corresponding memory of the distribution event is big by memory block It is small and as the free memory block;
The free memory block is removed from the current free memory set of blocks, if the size of the free memory block is big In the corresponding memory size of the distribution event, then by the size of free memory block memory corresponding with the distribution event The corresponding memory block of difference of size is inserted into the current free memory set of blocks;
Under the conditions of searching initial address of the initial address less than the free memory block in currently allocated memory set of blocks The starting of the initial address memory block more corresponding than the request of memory block is arranged in highest memory block with highest initial address First low request of address corresponds to the highest memory block, if searched less than the highest memory block, memory is arranged First request that the initial address of the initial address of block memory block more corresponding than the request is low is sky;
Under the conditions of searching initial address of the initial address greater than the free memory block in currently allocated memory set of blocks The starting of the initial address memory block more corresponding than the request of memory block is arranged in minimum memory block with minimum initial address First high request of address corresponds to the minimum memory block, if searched less than the minimum memory block, memory is arranged First request that the initial address of the initial address of block memory block more corresponding than the request is high is sky;
For release event,
The corresponding memory block of the release event is removed from the currently allocated internal storage set, and by the release thing The current free memory set of blocks is added in the corresponding memory block of part;
If there is the continuous memory of block address memory corresponding with the release event in the current free memory set of blocks Block, then by its memory merged block corresponding with the release event.
14. the equipment according to claim 11 for Memory Allocation, wherein according to the distribution event and the release The processing result of event obtains the opposite core position relationship, including:
For each request, the initial address for initializing the corresponding memory block of the request is more than or equal to the first request collection Each end address for requesting corresponding memory block in conjunction;
The initial address of first request set memory block more corresponding than the request with the initial address of memory block is low The union of sets collection of first request is as updated first request set;And
The maximum end address of the corresponding memory block of the request is less than or equal to the initial address of memory block than the request pair The set of first high request of the initial address for the memory block answered and the union of sets collection of the request collect as the second request It closes.
15. the equipment according to claim 9 or 10 for Memory Allocation, wherein closed according to the opposite core position System calculates optimal solution, including:
Initialize the initial address of the corresponding memory block of each request;
For each request, if the initial address of the corresponding memory block of the request is more than or equal to the first request set In the corresponding memory block of each request end address, then the initial address that the corresponding memory block of the request is arranged is zero;With And
For each request, it is less than first request if there is the initial address of the corresponding memory block of the request Each end address for requesting corresponding memory block in set, then for each request in all first request sets Calculate the initial address of its corresponding memory block.
16. the equipment according to claim 15 for Memory Allocation, wherein for all first request sets In each request calculate the initial address of its corresponding memory block, including:
Calculate the sum of initial address and length of the corresponding memory block of each request in all first request sets work For the starting memory address of the request.
17. a kind of equipment for Memory Allocation, including:
Opposite core position computing device is configured as calculating the opposite core position relationship between conflict request;And
Memory Allocation optimal solution computing device is configured as calculating the optimal of Memory Allocation according to the opposite core position relationship Solution.
18. the equipment according to claim 17 for Memory Allocation, wherein the opposite core position computing device packet It includes:
Sorting module is configured as each request being converted to a distribution event and a release event, and temporally To each distribution event and each release event sequence, and obtain the corresponding memory size of each event;
First initialization module, be configured as initializing currently allocated memory set of blocks, current free memory set of blocks with And memory block relativeness chained list;
Processing module is configured as handling each distribution event and each release event;And
Opposite core position Relation acquisition module, is configured as the processing result according to the distribution event and the release event Obtain the opposite core position relationship.
19. the equipment according to claim 17 for Memory Allocation, wherein the Memory Allocation optimal solution computing device Including:
Second initialization module is configured as initializing the initial address of the corresponding memory block of each request;And
Memory block initial address computing module is configured as each request, if the corresponding memory of the request The initial address of block is more than or equal to each end address for requesting corresponding memory block in the first request set, then asks described in setting The initial address for seeking corresponding memory block is zero;For each request, if there is the corresponding memory block of the request Initial address be less than the end address of the corresponding memory block of each request in first request set, then for all institutes State the initial address that each request in the first request set calculates its corresponding memory block.
CN201710403524.9A 2017-06-01 2017-06-01 Memory allocation method and device Active CN108874532B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710403524.9A CN108874532B (en) 2017-06-01 2017-06-01 Memory allocation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710403524.9A CN108874532B (en) 2017-06-01 2017-06-01 Memory allocation method and device

Publications (2)

Publication Number Publication Date
CN108874532A true CN108874532A (en) 2018-11-23
CN108874532B CN108874532B (en) 2020-11-06

Family

ID=64320821

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710403524.9A Active CN108874532B (en) 2017-06-01 2017-06-01 Memory allocation method and device

Country Status (1)

Country Link
CN (1) CN108874532B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020156259A1 (en) * 2019-01-28 2020-08-06 Oppo广东移动通信有限公司 Memory management method and device, mobile terminal, and storage medium
WO2021093507A1 (en) * 2019-11-11 2021-05-20 上海肇观电子科技有限公司 Method and device for pre-allocating memory, and circuit, electronic device and medium
WO2021232183A1 (en) * 2020-05-18 2021-11-25 华为技术有限公司 Memory arrangement optimization method and apparatus
EP4155946A4 (en) * 2020-05-18 2024-01-10 Cambricon (Xi'an) Semiconductor Co., Ltd. Method and device for allocating storage addresses for data in memory
US12026604B2 (en) 2019-11-11 2024-07-02 NextVPU (Shanghai) Co., Ltd. Memory pre-allocation for forward calculation in a neural network

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1963788A (en) * 2005-11-08 2007-05-16 中兴通讯股份有限公司 A managing method for EMS memory
CN101266575A (en) * 2007-03-13 2008-09-17 中兴通讯股份有限公司 Method for enhancing memory pool utilization ratio
CN101853210A (en) * 2010-05-25 2010-10-06 惠州华阳通用电子有限公司 Memory management method and device
CN101872324A (en) * 2010-06-23 2010-10-27 北京中星微电子有限公司 System testing method and device
CN102043659A (en) * 2010-12-08 2011-05-04 上海交通大学 Compiling device for eliminating memory access conflict and implementation method thereof
CN102866954A (en) * 2012-08-31 2013-01-09 华为技术有限公司 Method and device for allocating internal memory
CN105302737A (en) * 2015-11-24 2016-02-03 浪潮(北京)电子信息产业有限公司 Memory allocation management method and memory allocation management system
US9417881B2 (en) * 2012-01-30 2016-08-16 Nvidia Corporation Parallel dynamic memory allocation using a lock-free pop-only FIFO

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1963788A (en) * 2005-11-08 2007-05-16 中兴通讯股份有限公司 A managing method for EMS memory
CN101266575A (en) * 2007-03-13 2008-09-17 中兴通讯股份有限公司 Method for enhancing memory pool utilization ratio
CN101853210A (en) * 2010-05-25 2010-10-06 惠州华阳通用电子有限公司 Memory management method and device
CN101872324A (en) * 2010-06-23 2010-10-27 北京中星微电子有限公司 System testing method and device
CN102043659A (en) * 2010-12-08 2011-05-04 上海交通大学 Compiling device for eliminating memory access conflict and implementation method thereof
US9417881B2 (en) * 2012-01-30 2016-08-16 Nvidia Corporation Parallel dynamic memory allocation using a lock-free pop-only FIFO
CN102866954A (en) * 2012-08-31 2013-01-09 华为技术有限公司 Method and device for allocating internal memory
CN105302737A (en) * 2015-11-24 2016-02-03 浪潮(北京)电子信息产业有限公司 Memory allocation management method and memory allocation management system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SSSXIA_DOBEST: "内存分配", 《HTTPS://BLOG.CSDN.NET/HUYUE091714213/ARTICLE/DETAILS/17719541》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020156259A1 (en) * 2019-01-28 2020-08-06 Oppo广东移动通信有限公司 Memory management method and device, mobile terminal, and storage medium
WO2021093507A1 (en) * 2019-11-11 2021-05-20 上海肇观电子科技有限公司 Method and device for pre-allocating memory, and circuit, electronic device and medium
US12026604B2 (en) 2019-11-11 2024-07-02 NextVPU (Shanghai) Co., Ltd. Memory pre-allocation for forward calculation in a neural network
WO2021232183A1 (en) * 2020-05-18 2021-11-25 华为技术有限公司 Memory arrangement optimization method and apparatus
EP4155946A4 (en) * 2020-05-18 2024-01-10 Cambricon (Xi'an) Semiconductor Co., Ltd. Method and device for allocating storage addresses for data in memory

Also Published As

Publication number Publication date
CN108874532B (en) 2020-11-06

Similar Documents

Publication Publication Date Title
CN108874532A (en) Memory allocation method and equipment
JP7072054B2 (en) Methods and equipment for sorting cargo
US5325466A (en) System for extracting knowledge of typicality and exceptionality from a database of case records
WO2018095065A1 (en) Method and apparatus for allocating data object, and electronic device
Pulgar-Rubio et al. MEFASD-BD: multi-objective evolutionary fuzzy algorithm for subgroup discovery in big data environments-a mapreduce solution
CN109241093A (en) A kind of method of data query, relevant apparatus and Database Systems
CN110069502A (en) Data balancing partition method and computer storage medium based on Spark framework
US20210209270A1 (en) Distributed tensor network contraction scheme with splitting based on dynamic ordering
CN103279505B (en) A kind of based on semantic mass data processing method
CN111966495B (en) Data processing method and device
CN113537497A (en) Gradient lifting decision tree model construction optimization method based on dynamic sampling
CN108921324A (en) Platform area short-term load forecasting method based on distribution transforming cluster
CN117785490B (en) Training architecture, method, system and server of graph neural network model
Qian et al. Active learning solution on distributed edge computing
CN111626311A (en) Heterogeneous graph data processing method and device
CN108182243B (en) Spark-based distributed evolutionary algorithm island model parallelization method
CN108388769A (en) Protein Functional Module Identification Method Based on Edge-Driven Label Propagation Algorithm
CN112035234A (en) Distributed batch job distribution method and device
CN108596390B (en) Method for solving vehicle path problem
CN110175172A (en) Very big two points of groups parallel enumerating method based on sparse bipartite graph
CN109522102A (en) A kind of multitask external memory ideograph processing method based on I/O scheduling
CN112948087A (en) Task scheduling method and system based on topological sorting
Le et al. Dynamic estimation and Grid partitioning approach for Multi-Objective Optimization Problems in medical cloud federations
CN113887929A (en) KM algorithm-based order dispatching method, device, equipment and medium
Gavagsaz Weighted spatial skyline queries with distributed dominance tests

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant