Video memory management method, device, equipment and medium

By encapsulating the memory allocation and deallocation events of GPGPU tasks into event functions, the problem of low efficiency in GPGPU memory management is solved, and efficient memory utilization and task execution are achieved.

CN115981858BActive Publication Date: 2026-06-26KUNLUNXIN TECHNOLOGY (BEIJING) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
KUNLUNXIN TECHNOLOGY (BEIJING) CO LTD
Filing Date
2022-12-27
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, GPGPU memory management is inefficient, and frequent memory allocation and deallocation operations can easily lead to task errors or memory leaks, and the hardware utilization rate is low.

Method used

By encapsulating the memory allocation and deallocation events in the target task's run queue into event functions, calculating the starting address and size of the memory space, and automatically allocating memory space when issuing subtasks to the processing unit, automatic memory allocation and deallocation are achieved.

Benefits of technology

It improves the execution efficiency of GPGPU tasks, reduces memory leaks, enhances hardware utilization, and avoids erroneous operations caused by manual confirmation of memory release timing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115981858B_ABST
    Figure CN115981858B_ABST
Patent Text Reader

Abstract

The present disclosure provides a video memory management method and device, equipment and medium, relates to the technical field of computers, and particularly to the field of artificial intelligence and intelligent chips. The implementation scheme is as follows: an operation queue of a target task is obtained; for each group of video memory management events, the group of video memory management events and all events between the group of video memory management events in the operation queue are encapsulated as an event function; for each event function in a plurality of event functions corresponding to a plurality of groups of video memory management events, first information of a video memory space corresponding to the event function is determined; and a plurality of sub-tasks are sequentially issued to a processing unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to the fields of artificial intelligence and smart chips, specifically to a memory management method, apparatus, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] General-Purpose computing on graphics processing units (GPGPUs), as general-purpose AI application acceleration chips, are the main providers of computing power in the AI ​​era and form the cornerstone of AI infrastructure. Efficiently utilizing GPGPUs to unleash their full performance helps address the ever-increasing computing power demands of the AI ​​era. Video memory (VRAM) is a crucial component of GPGPUs, storing input / output data and intermediate data for AI applications. How to use and manage VRAM is vital to maximizing GPGPU performance.

[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention

[0004] This disclosure provides a video memory management method, apparatus, electronic device, computer-readable storage medium, and computer program product.

[0005] According to one aspect of this disclosure, a video memory management method is provided for managing a video memory pool used to run a target task, the target task including a series of subtasks. The method includes: obtaining a run queue of the target task, the run queue including multiple sets of video memory management events and multiple task dispatch events corresponding to the multiple subtasks, each set of video memory management events including corresponding video memory allocation events and video memory release events; for each set of video memory management events, encapsulating the set of video memory management events and all events in the run queue located between the set of video memory management events into an event function; for each of the multiple event functions corresponding to the multiple sets of video memory management events, determining first information of the video memory space corresponding to the event function, wherein the video memory space is a part of the video memory pool and is used to execute events contained in the event function that do not belong to other events. The function includes at least one subtask, where the first information includes the starting address of the video memory and the size of the video memory. The starting address of the video memory is determined based on the first information of the associated event function of the event function and the relationship between the associated event function and the event function. The relationship between the associated event function and the event function includes the lifecycle of the associated event function being directly nested within the lifecycle of the event function, or the lifecycle of the event function starting in response to the end of the lifecycle of the associated event function. The starting address of the video memory corresponding to the first event function among a plurality of event functions is the starting address of the video memory pool. The size of the video memory is determined based on the size of the variables involved in at least one subtask. The function also includes the sequential distribution of the plurality of subtasks to the processing unit, wherein each subtask includes the first information of the corresponding video memory space of the subtask, so that the processing unit allocates the corresponding video memory space in the video memory pool based on the first information to execute the subtask.

[0006] According to another aspect of this disclosure, a video memory management device is provided for managing a video memory pool used to run a target task, the target task including a plurality of serially executed subtasks. The device includes: an acquisition unit configured to acquire a run queue of the target task, the run queue including multiple sets of video memory management events and multiple task dispatch events corresponding to the multiple subtasks, each set of video memory management events including corresponding video memory allocation events and video memory release events; an encapsulation unit configured to, for each set of video memory management events, encapsulate the set of video memory management events and all events in the run queue located between the set of video memory management events into an event function; and a determination unit configured to, for each of the multiple event functions corresponding to the multiple sets of video memory management events, determine first information about the video memory space corresponding to that event function, wherein the video memory space is a portion of the video memory pool and is used to execute the events contained in the event function. And it is not a subtask belonging to any other event function. The first information includes the starting address of the video memory and the size of the video memory. The starting address of the video memory is determined based on the first information of the associated event function of the event function and the relationship between the associated event function and the event function. The relationship between the associated event function and the event function includes the lifecycle of the associated event function being directly nested within the lifecycle of the event function, or the lifecycle of the event function starting in response to the end of the lifecycle of the associated event function. The starting address of the video memory corresponding to the first event function among the multiple event functions is the starting address of the video memory pool. The size of the video memory is determined based on the size of the variables involved in at least one subtask. The processing unit is configured to sequentially send multiple subtasks to the processing unit. Each subtask among the multiple subtasks includes the first information of the corresponding video memory space of the subtask, so that the processing unit allocates the corresponding video memory space in the video memory pool based on the first information to execute the subtask.

[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned video memory management method.

[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to perform the above-described video memory management method.

[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program, wherein the computer program implements the above-described video memory management method when executed by a processor.

[0010] According to one or more embodiments of this disclosure, it is possible to automatically allocate and release video memory space based on pre-calculated video memory information on the host side, without explicit operation, by the processing unit itself.

[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0012] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0013] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein may be implemented according to embodiments of the present disclosure is shown;

[0014] Figure 2 A flowchart of a video memory management method according to an embodiment of the present disclosure is shown;

[0015] Figure 3 A schematic diagram of the run queue of a target task according to an exemplary embodiment of the present disclosure is shown;

[0016] Figure 4 A schematic diagram of a video memory space calculation process according to an exemplary embodiment of the present disclosure is shown;

[0017] Figure 5 A flowchart of a memory pool adaptive adjustment method according to an embodiment of the present disclosure is shown;

[0018] Figure 6 A flowchart of a memory pool adaptive adjustment method according to an embodiment of the present disclosure is shown;

[0019] Figure 7 A structural block diagram of a video memory management device according to an exemplary embodiment of the present disclosure is shown;

[0020] Figure 8 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation

[0021] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0022] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.

[0023] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.

[0024] In current GPGPUs, memory usage is generally implemented through two interfaces in the runtime library: memory allocation and memory deallocation. If we use GPGPU to represent a particular GPGPU architecture, these two interfaces are typically represented as `gpgpuMalloc()` and `gpgpuFree()`. GPGPU task assignment is also implemented through an interface in the runtime library, represented as `gpgpuRun()`. Therefore, during the execution of an AI application, there are two execution queues: the first is the execution queue consisting of host-side calls to interfaces for memory allocation, memory deallocation, and GPGPU task assignment; the second is the execution queue for tasks on the GPGPU side.

[0025] When the host calls the memory release interface to release a block of video memory, the runtime library must ensure that the GPGPU task using that memory is already completed. Typically, this will block the current host-side run queue, preventing the issuance of any more GPGPU tasks until all previous GPGPU tasks have finished. During this blocking period, GPGPU hardware utilization is low, resulting in a decrease in overall efficiency.

[0026] In related technologies, a memory pool manager can be used to manage the allocation and release of video memory required by the program during execution, thereby reducing calls to gpgpuFree(). However, this approach lacks a gpgpuFree() blocking mechanism, requiring manual confirmation of whether the tasks in the video memory have been completed to determine the optimal time to release the memory. When memory allocation and release are very frequent, it is extremely easy to cause incorrect release timing, leading to GPGPU task errors or memory leaks due to forgetting to release memory.

[0027] According to embodiments of this disclosure, a video memory management method is provided. This method encapsulates all events in the target task's execution queue into a function based on each group of video memory allocation and deallocation events. Then, the starting address and size of the video memory space corresponding to each function are calculated. When subtasks are sequentially distributed to the processing unit, the corresponding video memory space information for each subtask is sent to the processing unit. This allows the processing unit to automatically allocate video memory space for the next task after completing the previous task. Thus, without explicit operation, the processing unit can automatically allocate and deallocate video memory space based on pre-calculated video memory information from the host side.

[0028] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0029] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.

[0030] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of the above-described memory management methods.

[0031] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105, and / or 106 under a Software as a Service (SaaS) model.

[0032] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.

[0033] Users can initiate a target task using client devices 101, 102, 103, 104, 105, and / or 106. The client devices can provide an interface that allows users to interact with them. The client devices can also output information to the user through this interface. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.

[0034] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing various applications, such as various internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.

[0035] Network 110 can be any type of network well known to those skilled in the art, and can use any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.) to support data communication. By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0036] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0037] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0038] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105 and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105 and / or 106.

[0039] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.

[0040] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.

[0041] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be of different types, such as key-value stores, object stores, or regular stores supported by a file system.

[0042] Figure 1 The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.

[0043] Figure 2 A flowchart of a video memory management method 200 according to an embodiment of the present disclosure is shown.

[0044] According to embodiments of this disclosure, method 200 can be used to manage a video memory pool for running a target task, which may include multiple subtasks in sequence, and as... Figure 2 As shown, method 200 includes:

[0045] Step S201: Obtain the run queue of the target task. The run queue includes multiple sets of video memory management events and multiple task dispatch events corresponding to multiple subtasks. Each set of video memory management events includes a corresponding video memory allocation event and a video memory release event.

[0046] Step S202: For each group of video memory management events, encapsulate the group of video memory management events and all events in the run queue located between the group of video memory management events into an event function;

[0047] Step S203: For each of the multiple event functions corresponding to multiple sets of video memory management events, determine the first information of the video memory space corresponding to that event function. The video memory space is a part of the video memory pool and is used to execute at least one subtask contained in the event function that does not belong to other event functions. The first information includes the starting address of the video memory and the video memory size. The starting address of the video memory is determined based on the first information corresponding to the associated event function of the event function and the relationship between the associated event function and the event function. The relationship between the associated event function and the event function includes the lifetime of the associated event function directly nesting the lifetime of the event function, or the lifetime of the event function starting in response to the end of the lifetime of the associated event function. The starting address of the video memory corresponding to the first event function among the multiple event functions is the starting address of the video memory pool. The video memory size is determined based on the size of the variables involved in at least one subtask.

[0048] Step S204: The multiple subtasks are sequentially sent to the processing unit. Each subtask includes first information about the corresponding video memory space of the subtask, so that the processing unit allocates the corresponding video memory space in the video memory pool based on the first information to execute the subtask.

[0049] According to one or more embodiments of this disclosure, by encapsulating all events in the target task's execution queue into a function based on each group of memory allocation and deallocation events, the starting address and size of the memory space corresponding to each function are then calculated. When subtasks are sequentially distributed to the processing unit, the corresponding memory space information of each subtask is sent to the processing unit, enabling the processing unit to automatically allocate memory space for the next task based on this information after the previous task is completed. Thus, it is possible to achieve automatic memory allocation and deallocation based on pre-calculated memory information from the host side, without explicit operation, by having the processing unit itself automatically allocate and deallocate memory space.

[0050] In some embodiments, the processing unit described above may be a GPGPU, a graphics processing unit (GPU), or a central processing unit (CPU) integrating multiple forms of GPGPUs, and there is no limitation herein.

[0051] In some embodiments, video memory may be high-speed memory on a GPU or GPGPU, which can be used to perform target tasks such as deep learning tasks.

[0052] In some embodiments, the target task can first be initialized to obtain the target task's run queue. The target task's run queue may include multiple sets of memory allocation events and memory release events, as well as task assignment events corresponding to each subtask, and these events can be queued in the run queue according to a certain order.

[0053] Figure 3 A schematic diagram of the run queue of a target task according to an exemplary embodiment of the present disclosure is shown.

[0054] In some exemplary embodiments, such as Figure 3 As shown, the target task corresponding to this run queue includes four subtasks (task1, task2, task3, and task4). The run queue contains multiple events arranged sequentially, including three sets of memory management events: the memory allocation event `gpgpuMalloc()` and the memory release event `gpgpuFree()`, as well as the task dispatch events `gpgpuRun()` corresponding to each of the four subtasks. In related technologies, the events in the run queue can correspond to calls to the corresponding interfaces in the runtime library.

[0055] like Figure 3 As shown, multiple sets of video memory management events do not necessarily correspond one-to-one with each subtask. For example, for task1 and task3, these two subtasks used the same video memory space successively.

[0056] In some embodiments, each group of video memory management events and all events in between can be encapsulated into a single event function. (See also...) Figure 3 Based on the memory allocation event gpgpuMalloc(ptr1) and the memory release event gpgpuFree(ptr1), the two events, along with all events in the queue between these two events, can be encapsulated into the function Func1. Similarly, the memory allocation event gpgpuMalloc(ptr2), the memory release event gpgpuFree(ptr2), and the events in between can be encapsulated into the function Func2, and the memory allocation event gpgpuMalloc(ptr3), the memory release event gpgpuFree(ptr3), and the events in between can be encapsulated into the function Func3.

[0057] Understandably, the lifetime of the video memory space corresponding to each event function corresponds to the lifetime of each event function. Based on this, the starting address and size of the video memory space corresponding to each subtask can be determined based on the multiple event functions in the run queue and the relationships between any two of these event functions.

[0058] In some embodiments, during the target task initialization phase, a video memory pool for executing the target task can be requested from the processing unit first. The video memory pool has starting address information and video memory size information.

[0059] In some embodiments, after obtaining the relevant information of the video memory pool, the starting address information and video memory size information of the video memory space corresponding to each event function can be obtained based on the above-mentioned multiple event functions.

[0060] In some embodiments, the video memory size corresponding to each event function can be determined based on the required space size of variables involved in at least one subtask included in the event function but not belonging to other event functions.

[0061] In some embodiments, when the event function contains only one subtask (e.g. Figure 3 In the function Func3, which contains only the subtask task4, the video memory size corresponding to the event function can be determined based on the total space required by each variable involved in the subtask.

[0062] In some embodiments, when the event function contains multiple subtasks (e.g.) Figure 3 In the function Func1, there are subtasks task1 and task3. The space required for the variables corresponding to each subtask can be determined separately. The video memory size corresponding to the event function can be determined based on the space required for the variable with the largest value or based on the sum of the space required for multiple subtasks.

[0063] In some embodiments, the video memory space corresponding to an event function can be determined based on the starting address of the available space in the video memory pool at the beginning of the lifetime of each event function and the video memory size corresponding to that event function.

[0064] Specifically, for the first event function among multiple event functions, its corresponding available memory address is the starting address of the video memory pool. For other event functions appearing in the run queue, their corresponding video memory addresses need to be determined based on the first information of the associated event functions and the relationship between the associated event functions and the event function.

[0065] In some embodiments, an associated event function of an event function can be an event function that is directly nested within the event function. In this case, the relationship between the associated event function and the event function is the lifetime of the associated event function and the lifetime of the directly nested event function. For example... Figure 3 As shown, for the event function Func2, its associated event function is the event function Func1, which is directly nested within the event function Func2.

[0066] According to some embodiments, for each of the multiple event functions corresponding to multiple sets of video memory management events, the relationship between the associated event function and the event function is that the lifecycle of the associated event function is directly nested within the lifecycle of the event function, and the video memory starting address of the event function is the sum of the video memory starting address of the associated event function and the video memory size.

[0067] Therefore, based on the first information of each event function and its associated event functions, the starting address and size of the video memory space corresponding to each subtask in each event function can be accurately determined.

[0068] Figure 4 A schematic diagram of a video memory space calculation process according to an exemplary embodiment of the present disclosure is shown.

[0069] In some exemplary embodiments, such as Figure 4 As shown, after determining the first information of the video memory space corresponding to event function Func1, it is equivalent to allocating video memory space 401 in the video memory pool. At this time, when determining the first information of the video memory space for event function Func2, since the lifecycle of event function Func1 has not yet ended, that is, when executing the subtask contained in event function Func2, another video memory space needs to be requested. Therefore, the starting address of the available space corresponding to the video memory space of event function Func2 can be obtained by adding the space size to the starting address of the video memory space of event function Func1, and this starting address of the available space can be used as the starting address of the video memory space 402 of event function Func2.

[0070] Based on the above method, the first information of the video memory space used to execute subtasks task1, task2 and task3 can be obtained respectively. Among them, the video memory space used to execute subtasks task1 and task3 is the video memory space 401 corresponding to the event function Func1, and the video memory space used to execute subtasks task2 is the video memory space 402 corresponding to the event function Func2.

[0071] In some embodiments, the associated event function of an event function can be the preceding event function of the event function. In this case, the relationship between the associated event function and the event function is that the lifecycle of the event function begins in response to the end of the lifecycle of the associated event function. Figure 3 As shown, for the event function Func3, its associated event function is the event function Func1.

[0072] According to some embodiments, for each of the multiple event functions corresponding to multiple sets of video memory management events, the relationship between the associated event function and the event function is such that the lifetime of the event function begins when the lifetime of the associated event function ends, and the video memory starting address of the event function is the video memory starting address of the associated event function.

[0073] Therefore, based on the first information of each event function and its associated event functions, the starting address and size of the video memory space corresponding to each subtask in each event function can be accurately determined.

[0074] In some exemplary embodiments, such as Figure 4 As shown, when determining the first information of the video memory space for event function Func3, since the lifecycle of event function Func1 has ended—that is, when executing the subtask contained in event function Func3—the video memory space corresponding to event function Func1 has been released, and the corresponding available space starting address has been restored to the starting address of the video memory space corresponding to event function Func1. Therefore, the starting address of the available space corresponding to the video memory space of event function Func3 is the starting address of the video memory space of event function Func1, and this available space starting address can be used as the starting address of the video memory space 403 corresponding to event function Func3. This video memory space 403 is also the video memory space used to execute subtask task4.

[0075] In some embodiments, after determining the starting address and size of the video memory space corresponding to each subtask, the starting address and size of the video memory space corresponding to the subtask can be sent to the processing unit when the subtask is issued. The processing unit can then allocate video memory space for each subtask based on the above information and execute the subtask. For example, for subtask task2, a new video memory space can be requested for it based on its corresponding starting address and size, without waiting for the completion of subtask task1. When subtask task3 is received, since it uses the same video memory space as task1, it can directly use the same video memory space to continue executing task3 after task1 is completed. When subtask task4 is received, since it uses video memory space that overlaps with the video memory space of task3 and even task2, the processing unit can allocate the corresponding video memory space based on the starting address and size of the video memory space corresponding to subtask task4 after task2 and task3 are completed.

[0076] Therefore, without explicit operation, the processing unit itself can automatically allocate and release video memory space based on the pre-calculated video memory information on the host side.

[0077] In some embodiments, after all subtasks of the target task have been executed, the video memory release interface can be called to release the video memory pool used to execute the target task.

[0078] In some embodiments, the initially requested memory pool space may be too large or too small. When the memory pool space is too large, the utilization rate of the memory will be reduced; while when the memory pool space is too small, it will not be able to support the normal operation of the target task.

[0079] According to some embodiments, the above-described video memory management method may further include: during the initialization phase of the target task, requesting video memory space of a preset video memory size from the processing unit as a video memory pool; during the process of sequentially sending multiple subtasks to the processing unit, receiving feedback from the processing unit on the actual total video memory space requirement of at least one first subtask currently being executed; and in response to the actual total video memory space requirement being greater than the preset video memory size, requesting temporary video memory space from the processing unit to support the execution of at least one first subtask.

[0080] In some embodiments, once the processing unit receives a subtask and its associated first information, it can immediately allocate video memory space and begin executing the subtask. At this time, the processing unit can obtain the total actual video memory space requirement of all subtasks running in the video memory pool and can feed it back to the host side. When the total actual video memory space requirement is greater than the video memory size of the video memory pool, the host side can request a temporary video memory space from the processing unit to support the normal operation of at least one current subtask.

[0081] Therefore, by statistically analyzing the memory requirements of currently executing tasks, when the memory requirements of the current task exceed the existing memory pool space, a temporary memory space can be requested from the shared memory pool, thereby enabling the normal execution of the current subtask under the aforementioned circumstances.

[0082] Figure 5 A flowchart of a memory pool adaptive adjustment method 500 according to an embodiment of the present disclosure is shown.

[0083] According to some embodiments, such as Figure 5 As shown, method 500 may include:

[0084] Step S501: In response to the fact that the actual total demand for video memory space is greater than the preset video memory size, pause the issuance of the next subtask;

[0085] Step S502: Request the processing unit to release the video memory pool, so that the processing unit releases the video memory pool after executing at least one first subtask; and

[0086] Step S503: Based on the total actual video memory space requirement, re-apply for a video memory pool from the processing unit, wherein the size of the re-applied video memory pool is greater than or equal to the total actual video memory space requirement.

[0087] In some embodiments, when the total actual video memory requirement exceeds the video memory pool size, since subsequent subtasks may face the risk of insufficient video memory to support task execution, the issuance of subsequent subtasks can be paused first. Simultaneously, the calculation of the initial video memory information corresponding to each subtask can be stopped. At the same time, a video memory release interface can be invoked to request the release of video memory space from the processing unit, and a video memory request interface can be invoked to determine the size of the newly requested video memory pool based on the total actual video memory requirement and re-request the video memory pool for executing the target task from the processing unit. Upon receiving the request, the processing unit automatically releases the video memory pool after executing all current subtasks and reallocates the video memory pool for the target task based on the newly determined video memory pool size.

[0088] Therefore, by statistically analyzing the memory space requirements of currently executing tasks, when the memory space requirements of the current task exceed the existing memory pool space, an application can be made to release the existing memory pool and reapply for a new memory pool based on actual needs, so as to achieve adaptive adjustment of the memory pool space size.

[0089] Figure 6 A flowchart of a memory pool adaptive adjustment method 600 according to an embodiment of the present disclosure is shown.

[0090] According to some embodiments, such as Figure 6 As shown, method 600 may include:

[0091] Step S601: In response to the number of times the first feedback information is detected being greater than a preset number, the next subtask is paused. The first feedback information includes the difference between the preset video memory size and the actual total video memory space requirement being greater than a first preset threshold.

[0092] Step S602: Request the processing unit to release the video memory pool, so that the processing unit releases the video memory pool after completing at least one subtask being executed; and

[0093] Step S603: Based on the actual total video memory space requirement, re-apply for a video memory pool from the processing unit, wherein the first video memory size of the re-applied video memory pool is greater than or equal to the first total video memory requirement, and the difference between the first video memory size and the first total video memory requirement is less than a second preset threshold, wherein the first total video memory requirement is determined based on at least one actual total video memory space requirement corresponding to at least one of the multiple continuously detected first feedback information.

[0094] Therefore, when multiple subtasks are issued in succession, if the actual video memory space requirements are all much smaller than the current video memory pool space, the video memory space can be released after the current task is completed, and a new video memory pool can be requested based on the smaller requirement, thereby achieving adaptive adjustment of the video memory pool space.

[0095] In some embodiments, when multiple subtasks are issued consecutively, and the total actual memory space requirement reported by the processing unit is less than the memory size of the memory pool, and the difference between them is greater than a certain preset threshold, it can be determined that the target task may be using the current memory pool with low memory space utilization.

[0096] Therefore, the issuance of subsequent subtasks can be paused first, and the initial information of the video memory space corresponding to each subtask can be stopped. Simultaneously, the video memory release interface can be called to request the release of the video memory pool from the processing unit, and the video memory allocation interface can be called to determine the size of the newly allocated video memory pool based on the actual total video memory space requirement and re-allocate the video memory pool for executing the target task from the processing unit. Upon receiving the request, the processing unit automatically releases the video memory pool after executing all current subtasks and reallocates the video memory pool for the target task based on the newly determined size.

[0097] In some embodiments, the size of the re-allocated memory pool can be based on at least one previously received total actual memory space requirement. For example, the size of the re-allocated memory pool can be determined based on the most recently acquired total actual memory space requirement, which can be larger than the total actual memory space requirement, but the difference between the two does not exceed a preset threshold; alternatively, the size of the re-allocated memory pool can be determined based on the average of at least one total actual memory space requirement, which can be larger than the average, but the difference between the two does not exceed a preset threshold. It is understood that those skilled in the art can determine the method for redetermining the memory pool size according to actual needs, and no limitations are imposed here.

[0098] Therefore, by statistically analyzing the memory space requirements of currently executing tasks, when the memory space requirements of the current task exceed the existing memory pool space, an application can be made to release the existing memory pool and reapply for a new memory pool based on actual needs, so as to achieve adaptive adjustment of the memory pool space size.

[0099] According to another aspect of this disclosure, a video memory management device is provided. Figure 7 A structural block diagram of a video memory management device 700 according to an exemplary embodiment of the present disclosure is shown. The device 700 can be used to manage a video memory pool for running a target task, the target task including a plurality of serial subtasks, such as... Figure 7 As shown, the device 700 includes:

[0100] The acquisition unit 710 is configured to acquire the run queue of the target task. The run queue includes multiple sets of video memory management events and multiple task dispatch events corresponding to multiple subtasks. Each set of video memory management events includes a corresponding video memory allocation event and a video memory release event.

[0101] The encapsulation unit 720 is configured to encapsulate each set of memory management events and all events in the run queue located between the set of memory management events into an event function;

[0102] The determining unit 730 is configured to determine first information about the video memory space corresponding to each of a plurality of event functions corresponding to a plurality of sets of video memory management events. The video memory space is a portion of the video memory pool and is used to execute at least one subtask contained in the event function and not belonging to other event functions. The first information includes the starting address of the video memory and the video memory size. The starting address of the video memory is determined based on the first information corresponding to the associated event function of the event function and the relationship between the associated event function and the event function. The relationship between the associated event function and the event function includes the lifetime of the associated event function directly nesting the lifetime of the event function, or the lifetime of the event function starting in response to the end of the lifetime of the associated event function. The starting address of the video memory corresponding to the first event function among the plurality of event functions is the starting address of the video memory pool. The video memory size is determined based on the size of variables involved in at least one subtask.

[0103] The dispatch unit 740 is configured to dispatch multiple subtasks sequentially to the processing unit, wherein each subtask includes first information of the corresponding video memory space of the subtask, so that the processing unit allocates the corresponding video memory space in the video memory pool based on the first information to execute the subtask.

[0104] The operation of units 710-740 of the video memory management device 700 is similar to the operation of steps S201-S204 in method 200, and will not be described in detail here.

[0105] According to some embodiments, for each of the multiple event functions corresponding to multiple sets of video memory management events, the relationship between the associated event function and the event function is that the lifecycle of the associated event function is directly nested within the lifecycle of the event function, and the video memory starting address of the event function is the sum of the video memory starting address of the associated event function and the video memory size.

[0106] According to some embodiments, for each of the multiple event functions corresponding to multiple sets of video memory management events, the relationship between the associated event function and the event function is such that the lifetime of the event function begins when the lifetime of the associated event function ends, and the video memory starting address of the event function is the video memory starting address of the associated event function.

[0107] According to some embodiments, the above-mentioned video memory management device may further include: a first requesting unit configured to request video memory space of a preset video memory size from the processing unit during the initialization phase of the target task, as a video memory pool; a receiving unit configured to receive the total actual video memory space requirement of at least one first subtask being executed, fed back by the processing unit, during the process of sequentially sending multiple subtasks to the processing unit; and a second requesting unit configured to request temporary video memory space from the processing unit in response to the total actual video memory space requirement being greater than the preset video memory size, to support the execution of at least one first subtask.

[0108] According to some embodiments, the above-mentioned video memory management device may further include: a first blocking unit configured to suspend the issuance of the next subtask in response to the total actual video memory space requirement being greater than a preset video memory size; a third requesting unit configured to request the release of the video memory pool from the processing unit so that the processing unit releases the video memory pool after executing at least one first subtask; and a fourth requesting unit configured to re-request the video memory pool from the processing unit based on the total actual video memory space requirement, wherein the video memory size of the re-requested video memory pool is greater than or equal to the total actual video memory space requirement.

[0109] According to some embodiments, the above-mentioned video memory management device may further include: a second blocking unit configured to pause issuing the next subtask in response to the number of times a first feedback information is continuously detected being greater than a preset number, wherein the first feedback information includes a difference between a preset video memory size and the actual total video memory space requirement being greater than a first preset threshold; a fifth request unit configured to request the release of the video memory pool from the processing unit so that the processing unit releases the video memory pool after completing the execution of at least one subtask currently being executed; and a sixth request unit configured to re-request the video memory pool from the processing unit based on the actual total video memory space requirement, wherein the first video memory size of the re-requested video memory pool is greater than or equal to the first total video memory requirement, and the difference between the first video memory size and the first total video memory requirement is less than a second preset threshold, wherein the first total video memory requirement is determined based on at least one actual total video memory space requirement corresponding to at least one of the multiple first feedback information detected continuously.

[0110] According to embodiments of this disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.

[0111] refer to Figure 8 The present invention describes a structural block diagram of an electronic device 800 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0112] like Figure 8 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0113] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, output unit 807, storage unit 808, and communication unit 809. Input unit 806 can be any type of device capable of inputting information to electronic device 800. Input unit 806 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device, and can include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 807 can be any type of device capable of presenting information, and can include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 808 can include, but is not limited to, disk and optical disk. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and can include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0114] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as method 200. For example, in some embodiments, method 200 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform method 200 by any other suitable means (e.g., by means of firmware).

[0115] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0116] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0117] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0118] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0119] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0120] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0121] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0122] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.

Claims

1. A video memory management method for managing a video memory pool used to run a target task, the target task comprising a plurality of serially executed subtasks, the method comprising: Obtain the run queue of the target task. The run queue includes multiple sets of video memory management events and multiple task dispatch events corresponding to the multiple sub-tasks. Each set of video memory management events includes a corresponding video memory allocation event and a video memory release event. For each group of video memory management events, the group of video memory management events and all events in the run queue located between the group of video memory management events are encapsulated into an event function; First information regarding the video memory space corresponding to each of the multiple event functions corresponding to the multiple sets of video memory management events is determined. This first information includes the starting address of the video memory and the video memory size. The video memory space corresponding to each event function is a portion of the video memory pool and is used to execute at least one subtask contained within that event function that does not belong to other event functions. The starting address of the video memory corresponding to the first event function is the starting address of the video memory pool. The starting address of the video memory corresponding to each event function other than the first event function is based on the association of that event function other than the first event function. The first information corresponding to the event function and the relationship between the associated event function and the event function other than the first event function among the plurality of event functions are determined. The associated event function of the event function other than the first event function among the plurality of event functions includes event functions whose life cycle is directly nested within the life cycle of the event function other than the first event function among the plurality of event functions, or event functions whose life cycle has ended before the start of the life cycle of the event function other than the first event function among the plurality of event functions. The video memory size corresponding to each event function among the plurality of event functions is determined based on the size of the variables involved in the at least one subtask contained in the event function among the plurality of event functions. as well as Each of the plurality of subtasks and the first information of the video memory space for executing the subtask are sequentially sent to the processing unit, so that the processing unit allocates the corresponding video memory space in the video memory pool based on the first information of the video memory space for executing the subtask and executes the subtask.

2. The method according to claim 1, wherein, For each of the multiple event functions corresponding to the multiple sets of video memory management events, the relationship between the associated event function and the event function is that the lifecycle of the associated event function is directly nested within the lifecycle of the event function, and the starting address of the video memory of the event function is the sum of the starting address of the video memory of the associated event function and the size of the video memory.

3. The method according to claim 1, wherein, For each of the multiple event functions corresponding to the multiple sets of video memory management events, the relationship between the associated event function and the event function is such that the life cycle of the event function begins when the life cycle of the associated event function ends, and the starting address of the video memory of the event function is the starting address of the video memory of the associated event function.

4. The method according to any one of claims 1-3, further comprising: During the initialization phase of the target task, a video memory space of a preset size is requested from the processing unit to serve as the video memory pool. During the process of sequentially sending the multiple subtasks to the processing unit, the actual total video memory space requirement of at least one first subtask currently being executed is received from the processing unit. as well as In response to the total actual video memory requirement exceeding the preset video memory size, temporary video memory space is requested from the processing unit to support the execution of the at least one first subtask.

5. The method according to claim 4, further comprising: In response to the actual total video memory space requirement exceeding the preset video memory size, the issuance of the next subtask is paused; The processor requests the release of the video memory pool so that the processor can release the video memory pool after completing the execution of the at least one first subtask. as well as Based on the total actual video memory space requirement, a new video memory pool is requested from the processing unit, wherein the size of the new video memory pool is greater than or equal to the total actual video memory space requirement.

6. The method according to claim 4, further comprising: In response to the number of times the first feedback information is detected being greater than a preset number, the issuance of the next subtask is paused. The first feedback information includes the difference between the preset video memory size and the actual total video memory space requirement being greater than a first preset threshold. The processor requests the release of the video memory pool so that the processor releases the video memory pool after completing at least one subtask being executed. as well as Based on the total actual video memory space requirement, a new video memory pool is requested from the processing unit, wherein the first video memory size of the new video memory pool is greater than or equal to the first total video memory requirement, and the difference between the first video memory size and the first total video memory requirement is less than a second preset threshold, wherein the first total video memory requirement is determined based on at least one actual total video memory space requirement corresponding to at least one of the multiple continuously detected first feedback information.

7. A video memory management device for managing a video memory pool used to run a target task, the target task comprising a plurality of serially executed subtasks, the device comprising: The acquisition unit is configured to acquire the run queue of the target task. The run queue includes multiple sets of video memory management events and multiple task dispatch events corresponding to the multiple sub-tasks. Each set of video memory management events includes a corresponding video memory allocation event and a video memory release event. The encapsulation unit is configured to encapsulate each set of memory management events and all events in the run queue located between the set of memory management events into an event function; The determining unit is configured to determine first information about the video memory space corresponding to each of the plurality of event functions corresponding to the plurality of sets of video memory management events. The first information includes the starting address of the video memory and the video memory size. The video memory space corresponding to each of the plurality of event functions is a portion of the video memory pool and is used to execute at least one subtask contained in that event function that does not belong to other event functions. The starting address of the video memory corresponding to the first event function is the starting address of the video memory pool. The starting address of the video memory corresponding to each event function other than the first event function is based on the starting address of that event function. The first information corresponding to the associated event function of the number and the relationship between the associated event function and the event function other than the first event function among the plurality of event functions are determined. The associated event function of the event function other than the first event function among the plurality of event functions includes event functions whose life cycle is directly nested with the life cycle of the event function other than the first event function among the plurality of event functions, or event functions whose life cycle has ended before the life cycle of the event function other than the first event function among the plurality of event functions begins. The video memory size corresponding to each event function among the plurality of event functions is determined based on the size of the variables involved in the at least one subtask contained in the event function among the plurality of event functions. as well as The sending unit is configured to sequentially send each of the plurality of subtasks and first information about the video memory space for executing the subtask to the processing unit, so that the processing unit allocates the corresponding video memory space in the video memory pool based on the first information about the video memory space for executing the subtask and executes the subtask.

8. The apparatus according to claim 7, wherein, For each of the multiple event functions corresponding to the multiple sets of video memory management events, the relationship between the associated event function and the event function is that the lifecycle of the associated event function is directly nested within the lifecycle of the event function, and the starting address of the video memory of the event function is the sum of the starting address of the video memory of the associated event function and the size of the video memory.

9. The apparatus according to claim 7, wherein, For each of the multiple event functions corresponding to the multiple sets of video memory management events, the relationship between the associated event function and the event function is such that the life cycle of the event function begins when the life cycle of the associated event function ends, and the starting address of the video memory of the event function is the starting address of the video memory of the associated event function.

10. The apparatus according to any one of claims 7-9, further comprising: The first application unit is configured to apply to the processing unit for a preset amount of video memory space during the initialization phase of the target task, so as to serve as the video memory pool. The receiving unit is configured to receive, during the process of sequentially sending the plurality of subtasks to the processing unit, the actual total video memory space requirement of at least one first subtask currently being executed, fed back by the processing unit. as well as The second requesting unit is configured to request temporary video memory space from the processing unit in response to the total actual video memory space requirement being greater than the preset video memory size, so as to support the execution of the at least one first subtask.

11. The apparatus of claim 10, further comprising: The first blocking unit is configured to pause issuing the next subtask in response to the actual total video memory space requirement being greater than the preset video memory size. The third requesting unit is configured to request the processing unit to release the video memory pool, so that the processing unit releases the video memory pool after completing the execution of the at least one first subtask; as well as The fourth application unit is configured to re-apply for a memory pool from the processing unit based on the total actual memory space requirement, wherein the memory size of the re-applied memory pool is greater than or equal to the total actual memory space requirement.

12. The apparatus of claim 10, further comprising: The second blocking unit is configured to pause issuing the next subtask in response to the number of times the first feedback information is detected continuously being greater than a preset number. The first feedback information includes the difference between the preset video memory size and the actual total video memory space requirement being greater than a first preset threshold. The fifth requesting unit is configured to request the processing unit to release the video memory pool, so that the processing unit releases the video memory pool after completing at least one subtask being executed. as well as The sixth application unit is configured to reapply for a memory pool from the processing unit based on the total actual memory space requirement, wherein the first memory size of the reapplied memory pool is greater than or equal to the first total memory requirement, and the difference between the first memory size and the first total memory requirement is less than a second preset threshold, wherein the first total memory requirement is determined based on at least one actual total memory space requirement corresponding to at least one of a plurality of continuously detected first feedback information.

13. An electronic device, comprising: At least one processor; as well as A memory that is communicatively connected to the at least one processor; in The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.

15. A computer program product comprising a computer program, wherein, The computer program, when executed by a processor, implements the method of any one of claims 1-6.