Graphic processor operation control method and control device
By monitoring the graphics processor's operating status and optimizing the video memory data reading mode, the problem of high GPU power consumption was solved, achieving a balance between low-power standby and efficient data processing.
Patent Information
- Application Number
- CN202411186985.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-27
- Publication Date
- 2024-11-08
AI Technical Summary
In the field of artificial intelligence, when using large, well-trained models for intelligent data processing, graphics processing units (GPUs) suffer from high power consumption.
By monitoring the current operating data of the graphics processor, it can be controlled to enter a low-power standby state when there are no data processing tasks, and switch to a high-power working state when needed. At the same time, the data reading mode of the video memory is optimized to reduce data acquisition latency and power consumption.
It reduces the overall power consumption of the graphics processor, improves data processing efficiency and user experience, and meets the processing needs of sudden data inference tasks.
Smart Images

Figure CN118917993A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and more specifically to a graphics processor operation control method and control device. Background Art
[0002] In the field of artificial intelligence, using trained large models to realize intelligent data business processing has become a common means in the industry. Artificial intelligence reasoning is based on trained large models to complete a series of image recognition, text recognition, speech recognition and other technical reasoning calculations. The execution of this reasoning calculation will depend on the corresponding resource information, such as the resources provided by the GPU (Graphics Processing Unit) device, which will cause problems such as high power consumption of the GPU in this process. Summary of the invention
[0003] In view of this, this application provides the following technical solutions:
[0004] A graphics processor operation control method, comprising:
[0005] According to current operation data of the graphics processor, controlling the graphics processor to be in a first operation state;
[0006] Controlling the video memory of the graphics processor to enter a target data reading mode;
[0007] In response to receiving a data reasoning task corresponding to the target data, controlling the graphics processor to enter a second operating state for executing the data reasoning task;
[0008] The power consumption of the graphics processor in the first operating state is less than the power consumption of the graphics processor in the second operating state.
[0009] Optionally, controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0010] If the target data is data to be inferred of a target model running in the graphics processor, determining a target reading mode of the target data based on a data inference requirement of the target model;
[0011] Controlling the video memory of the graphics processor to read the target data in the target reading mode;
[0012] The target reading mode includes at least a first reading mode and a second reading mode, wherein the first reading mode represents reading the target data from the memory of the electronic device where the graphics processor is located; and the second reading mode represents reading the target data from an external device connected to the graphics processor.
[0013] Optionally, controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0014] Determine a data storage state corresponding to a video memory of the graphics processor;
[0015] Determining a target data writing mode based on a data storage state corresponding to the video memory;
[0016] The video memory of the graphics processor is controlled to enter a target data reading mode, so that the video memory writes the target data into a storage area corresponding to the video memory in the target data writing mode.
[0017] Optionally, determining the target data writing mode based on the data storage state corresponding to the video memory includes:
[0018] If the graphics processor runs a target model, determining a data modality of the target model;
[0019] Determining a data storage state of a sub-storage area of the video memory corresponding to each of the data modes based on a data storage state corresponding to the video memory;
[0020] Based on the data modality and a data storage state of a sub-storage area corresponding to the data modality, a target data writing mode corresponding to the data modality is determined.
[0021] Optionally, controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0022] Determining a target storage area corresponding to a video memory of the graphics processor based on a processing requirement of the graphics processor;
[0023] Controlling the video memory of the graphics processor to enter a target data reading mode;
[0024] The video memory is controlled to store the target data in the target storage area.
[0025] Optionally, controlling the graphics processor to be in the first operating state according to current operating data of the graphics processor includes:
[0026] In a case where the graphics processor cluster includes at least two graphics processors, according to current running data of each graphics processor, each graphics processor in the corresponding first graphics processor subset is controlled to be in a first running state; the current running data of each graphics processor in the first graphics processor subset meets a first condition for entering the first running state;
[0027] The step of controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0028] Controlling the video memory of each graphics processor in the first graphics processor subset to enter a target data reading mode.
[0029] Optionally, in response to receiving a data reasoning task corresponding to the target data, controlling the graphics processor to enter a second operating state for executing the data reasoning task includes:
[0030] In response to receiving a data inference task corresponding to target data, determining a target graphics processor based on processing parameters of each of the graphics processors in the first graphics processor set;
[0031] The target graphics processor is controlled to enter a second running state for executing the data reasoning task.
[0032] Optionally, determining the target graphics processor based on the processing parameters of each of the graphics processors in the first graphics processor set includes:
[0033] Determine, based on the processing parameters of each of the graphics processors in the first graphics processor set, a computing power parameter of each of the graphics processors and a power consumption parameter for the same processing task;
[0034] A target graphics processor is determined based on the computing power parameter of each graphics processor and the power consumption parameter.
[0035] Optionally, controlling the graphics processor to enter a second operating state for executing the data inference task includes:
[0036] When a first application and a second application are running on the graphics processor, and the data inference task is for the first application, controlling the graphics processor to suspend a task process of a current processing task of the second application;
[0037] Controlling the graphics processor to enter a second operating state for executing the data inference task;
[0038] After the data reasoning task for the first application is completed, the graphics processor is controlled to resume execution of the task process of the current processing task of the second application.
[0039] A control device is communicatively connected to a graphics processor, and comprises:
[0040] A storage module, used to store the application and the data generated by the operation of the application;
[0041] A control module is used to execute the application program to achieve:
[0042] According to current running data of a graphics processor, the graphics processor is controlled to be in a first running state; a video memory of the graphics processor is controlled to enter a target data reading mode; in response to receiving a data inference task corresponding to the target data, the graphics processor is controlled to enter a second running state for executing the data inference task; wherein the power consumption of the graphics processor in the first running state is less than the power consumption of the graphics processor in the second running state. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0044] Figure 1 A flowchart of a graphics processor operation control method provided in an embodiment of the present application;
[0045] Figure 2 A schematic diagram of an application scenario of a graphics processor cluster provided in an embodiment of the present application;
[0046] Figure 3 A schematic diagram of the structure of a control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] The terms "first" and "second" etc. in this application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0049] The embodiment of the present application provides a method for controlling the operation of a graphics processor, which is applied to a graphics processor (Graphics Processing Unit, GPU). The GPU can be applied to the fields of deep learning, machine learning and artificial intelligence to realize data reasoning of large models. However, the GPU will have a problem of high power consumption during the data reasoning process. In order to solve this problem, the embodiment of the present application provides a method for controlling the operation of the GPU. For details, see Figure 1 , is a flow chart of a method for controlling the operation of a graphics processor provided in an embodiment of the present application. The method for controlling the operation of a graphics processor can be applied to a control device in an electronic device. The control device can be hardware independent of a graphics processor or a logic module in a GPU, which is not limited in the embodiment of the present application. Correspondingly, the method can include the following steps:
[0050] S101. Controlling a graphics processor to be in a first operating state according to current operating data of the graphics processor.
[0051] A graphics processor GPU usually includes at least one processing unit, which can perform a large number of computing tasks in parallel, such as graphics rendering and parallel computing. If the processing unit of the GPU is turned on and performs corresponding data processing, the graphics processor will be in a higher power consumption state. Therefore, the operation data of the graphics processor can be monitored to obtain its current processing mode. Specifically, the processing unit of the graphics processor can be monitored to determine whether its corresponding processing unit is performing a data processing task, or whether the data processing task currently performed by the processing unit has real-time requirements. If the data processing task does not have real-time requirements, it means that the processing task is postponed and will not respond to the processing result of the data processing task. If the current processing unit is not performing a data processing task, the graphics processor can be controlled to be in the first operating state, that is, the processing unit of the graphics processor is in a low-power standby state, which can meet the current needs of the graphics processor and reduce the operating power consumption of the graphics processor.
[0052] S102: Control the video memory of the graphics processor to enter a target data reading mode.
[0053] The video memory of the graphics processor is the memory of the graphics processor, which is used to store graphics data and intermediate calculation results, and can also be used for temporary storage of data, data processing codes called by the graphics processor, etc. Since the graphics processor is in a low power consumption state in the first operating state, wherein the processing unit of the graphics processor can be in a low power consumption standby state, in order to cope with sudden data processing needs, such as the sudden data reasoning needs of the large model run by the graphics processor, the video memory of the graphics processor can be controlled to enter the target data reading mode, so that when the graphics processor is required to perform data reasoning tasks, the data in the video memory can be directly called and processed, which can reduce the delay of data acquisition, improve the processing efficiency of dealing with sudden data reasoning tasks, and user experience effect. Among them, the target data can refer to the data that needs to be processed corresponding to the target model currently running by the graphics processor, which can be determined according to the data mode of the target model, such as video data, audio data, text data, etc. These data can be first stored in the video memory of the graphics processor to meet subsequent processing needs. Correspondingly, the reading mode of the target data can be determined according to the application scenario of the current image processor, such as directly reading data from the memory space of the electronic device to the video memory, or reading the target data through an external device and storing it in the video memory.
[0054] S103: In response to receiving a data inference task corresponding to the target data, control the graphics processor to enter a second operating state for executing the data processing task.
[0055] When the graphics processor is in the first operating state, such as when the processing unit of the graphics processor is in a low-power standby state, if a data inference task corresponding to the target data is received, it is necessary to start the processing unit of the graphics processor to perform the data inference task, and at this time the graphics processor will be controlled to enter the second operating state, that is, the processing unit is started to perform the data processing task. The power consumption of the graphics processor in the second operating state will be greater than the power consumption of the graphics processor in the first operating state.
[0056] The graphics processor operation control method provided in the embodiment of the present application can control the graphics processor to be in a first low-power operation state according to the current operation data of the graphics processor, that is, when the graphics processor has no corresponding data reasoning task, and retain the normal data reading of the graphics processor's video memory in this state, that is, control the video memory to enter a target data reading mode, and at the same time control the processing unit of the graphics processor to be in a low-power state, and only control the graphics processor to be in a second high-power operation state when it is necessary to execute a data reasoning task. In this second operation state, the processing unit of the graphics processor can be controlled to enter a working mode to execute the data reasoning task, and because the video memory stores the relevant target data in the first operation state, the processing unit can directly execute the data reasoning task based on the target data in the video memory, without waiting for the data to be imported into the video memory, thereby reducing data latency, reducing the overall power consumption of the graphics processor, and improving the user experience.
[0057] The following describes the implementation of the graphics processor operation control method according to the embodiment of the present application in conjunction with specific application scenarios.
[0058] In one implementation of the embodiments of the present application, controlling the video memory of the graphics processor to enter a target data reading mode includes: if the target data is data to be inferred of a target model running in the graphics processor, determining a target reading mode for the target data based on data inference requirements of the target model; and controlling the video memory of the graphics processor to read the target data in the target reading mode.
[0059] Among them, the target model running in the graphics processor can be an artificial intelligence model, such as an intention recognition model, which can perform intention recognition and understanding based on the user's behavior to obtain the intention recognition result, and the target data applied by the intention recognition model can be user behavior data, etc. Different target models have different corresponding model structures and model processing requirements. Therefore, the target reading mode of the graphics processor's video memory reading the target data can be determined according to the data reasoning requirements of the target model to ensure that the video memory can quickly and accurately read the corresponding target data. Specifically, the control device that executes the graphics processor operation control method can be a separate hardware or an internal logic module of the graphics processor during low-power processing. When the control device generates an instruction for controlling the video memory to enter the target data reading mode, the corresponding target reading mode information can be added to the instruction, so that when the video memory receives the instruction, it can read the corresponding target data based on the target reading mode. Specifically, the target reading mode includes at least a first reading mode and a second reading mode. The first reading mode represents reading the target data from the memory of the electronic device where the graphics processor is located. The second reading mode represents reading the target data from an external device connected to the graphics processor. For example, in the first reading mode, the video memory can use DMA (Direct Memory Access) technology to directly access and transfer data to the memory without going through the CPU, which can reduce the burden on the CPU and improve data transmission efficiency. When the graphics processor performs large model reasoning, the DMA technology is used to allow the video memory to directly read the target data from the memory space, and a large amount of data can be transferred to the graphics processor at one time or in batches, meeting the large model data processing requirements, and the DMA data transmission method can be performed in a low power state, which helps to save energy. The second reading mode can be implemented using GPU Direct technology, which allows the graphics processor GPU to interact with various types of external devices (such as network interfaces, storage devices, etc.), that is, allowing network devices to directly store data into the video memory of the graphics processor, so as to achieve the purpose of the graphics processor's video memory reading the corresponding target data on the external device. The second data reading mode can reduce the access of the processor in the electronic device, thereby reducing the energy consumption of the system. Specifically, the mapping relationship between the data inference requirements of different models and the corresponding data reading modes can be stored in the control device. When the control device needs to generate a data reading instruction corresponding to the video memory, it can determine the target reading mode corresponding to the video memory based on the mapping relationship, and encapsulate the information of the target reading mode into the control instruction that controls the video memory to read the target data, so as to ensure that the video memory can read the data in the first state and improve its data reading efficiency and accuracy.
[0060] In one implementation of the embodiment of the present application, controlling the video memory of the graphics processor to enter the target data reading mode includes:
[0061] Determine a data storage state corresponding to a video memory of a graphics processor; determine a target data write mode based on the data storage state corresponding to the video memory; and control the video memory of the graphics processor to enter a target data read mode so that the video memory writes the target data to a storage area corresponding to the video memory in the target data write mode.
[0062] The data storage state corresponding to the video memory of the graphics processor can characterize the state of the data currently stored in the video memory, such as the storage time of the data currently stored in the video memory, the data storage amount, and the current free storage space of the video memory. The write mode of the target data to be stored in the video memory can be determined according to the data storage state corresponding to the video memory. The write mode can include a direct storage mode, that is, the target data is directly stored in the video memory. The write mode can also include a data update mode and a data overwrite mode. Correspondingly, it can also be a data full overwrite mode or a data partial overwrite mode, that is, it is determined whether to overwrite the original data in the video memory when the target data is stored in the video memory. In this way, while writing the target data to the video memory, it can also ensure that the storage space of the target data is maximized and avoid waste of storage space. Specifically, when the control device executes the graphics processor operation control method, the configuration conditions of the pre-set data write mode can be stored in the control device. When the graphics processor is in the first operating state, the write mode of the current target data is determined according to the data write mode stored therein. The writing mode of the target data can also be called the updating mode of the existing data in the video memory, so that according to the writing mode, it is determined whether the original data in the current video memory is partially overwritten, completely overwritten, or overwritten according to a specific overwriting strategy after the target data is read. For example, the target data can be stored in the video memory according to the FIFO (First Input First Output) data writing mode, that is, the target data will overwrite the oldest data in the video memory, or the data with low frequency or utilization in the video memory can be overwritten according to simple statistical information. When the data written to the graphics processor video memory is too much or is about to exceed the capacity of its storage area, the data in the existing video memory will be eliminated by using the data overwriting mode with the latest acquired target data according to the determination strategy of the data writing mode exemplified above, thereby ensuring the writing of the latest target data.
[0063] Specifically, in one implementation, determining the target data writing mode based on the data storage state corresponding to the video memory includes:
[0064] If the graphics processor runs the target model, determine the data mode of the target model; determine the data storage state of the video memory sub-area corresponding to each data mode based on the data storage state corresponding to the video memory; determine the target data writing mode corresponding to the data mode based on the data mode and the data storage state of the sub-storage area capable of the data mode.
[0065] The target model that the graphics processor runs is different, and the data type that needs to be obtained is also different. If the target model is a multimodal data model, it can process and analyze data from different data sources and different types. For example, the model can process data of types such as text, image, audio and video. In order to facilitate the call and processing of data in the video memory, the data of the corresponding mode can be stored in different sub-storage areas in the video memory. For example, text data is stored in the first sub-storage area of the video memory, audio data is stored in the second sub-storage area, and image data is stored in the third sub-storage area. According to the data storage state of each sub-storage area, the data storage capacity of the sub-storage area and the time sequence of data storage can be obtained. Therefore, according to the data mode and the data storage state of the corresponding sub-storage area, the target data writing mode corresponding to the data mode can be determined to ensure that the data of different data modes is accurately written to the video memory. Among them, the target data writing mode can include an update mode for the original data in the video memory when the data is written to the video memory. Further, according to different data modes, the data reading mode and data storage mode corresponding to each data mode can be determined.
[0066] For example, if the target model is a user intention recognition model for real-time capture of environmental multimodal information of the user's environment applied to the user terminal, the captured environmental multimodal information may include the user's voice input information, video information collected by the camera, and image information. According to the different modes of multimodal data processing of the target model, a storage area corresponding to each data modality and a data update strategy can be set in the video memory. For example, the video memory can be controlled to store the read audio information in area 1 of the video memory, and the retention time of the data is set to 30 seconds, that is, each time new audio data is obtained, the audio data obtained in the previous 30 seconds can be overwritten, and the corresponding data reading mode can be based on DMA to directly copy the audio data from the memory. The image data or video data can be stored in area 2 of the video memory, and the data can be read in a 5 frame / second manner, and nearly 1 minute of video or image data can be retained in the video memory. The GPU Direct technology can be used to directly obtain these video or image data from the peripheral device. It should be noted that this is only an exemplary description, and the data reading and writing strategies for the video memory can be adjusted and reset according to the needs of the large model to ensure that the real-time needs of the large model are met.
[0067] In one implementation of the embodiment of the present application, controlling the video memory of the graphics processor to enter a target data reading mode includes: determining a target storage area corresponding to the video memory of the graphics processor based on processing requirements of the graphics processor; controlling the video memory of the graphics processor to enter a target data reading mode; and controlling the video memory to store the target data in the target storage area.
[0068] In order to accurately store the target data read from the video memory into the video memory, the target storage area for storing the target data can be determined in the video memory according to the processing requirements of the graphics processor. The storage space of the target storage area matches the large model reasoning capability corresponding to the graphics processor, and can be less than or equal to the storage space of the actual video memory. Further, in the embodiment of the present application, the target storage area can be the storage area corresponding to the original video memory, or it can be the storage area obtained after updating the storage area of the original video memory, if the original video memory area is expanded or adjusted. The processing requirements of the graphics processor can be based on the working mode for CXL content. Compute Express Link (CXL) is a new high-speed interconnect technology designed to provide high-speed, low-latency connections for CPUs, GPUs, FPGAs, and other accelerators and storage devices. CXL supports multiple protocols, allowing different hardware devices to share memory resources and communicate efficiently. If the video memory of the current graphics processor is a shared storage space with other devices based on CXL technology, the storage area corresponding to the video memory can be updated according to the current salary storage mode to obtain the target storage area, that is, the change and expansion of the storage area of the video memory is displayed. Furthermore, a more specific video memory working mode can be adopted, that is, data is only written to a part of the storage area in the video memory, rather than starting the full amount, to avoid wasting the storage resources of the video memory. Furthermore, if the video memory of the graphics processor is in a shared storage mode, data can be written to a specific storage area, and when the written data exceeds the maximum capacity, the storage area of the video memory can be updated according to a preset storage area update policy.
[0069] In a cluster environment with multiple graphics processors, the graphics processor operation control method of the embodiment of the present application can also be used to reduce the power consumption of the graphics processor cluster and meet the processing requirements of the corresponding data reasoning tasks.
[0070] In one implementation of the embodiment of the present application, controlling the graphics processor to be in a first operating state according to current operating data of the graphics processor includes:
[0071] When the graphics processor cluster includes at least two graphics processors, each graphics processor in the corresponding first graphics processor subset is controlled to be in a first operating state according to current operating data of each graphics processor; the current operating data of each graphics processor in the first graphics processor subset meets a first condition for entering the first operating state.
[0072] The step of controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0073] The video memory of each graphics processor in the first graphics processor subset is controlled to enter a target data reading mode.
[0074] Furthermore, in response to receiving a data reasoning task corresponding to the target data, controlling the image processor to enter a second operating state for executing the data reasoning task includes: in response to receiving the data reasoning task corresponding to the target data, determining the target graphics processor based on processing parameters of each graphics processor in the first graphics processor set; and controlling the target graphics processor to enter a second operating state for executing the data reasoning task.
[0075] Specifically, determining the target graphics processor based on the processing parameters of each graphics processor in the first graphics processor set includes: determining the computing power parameters of each graphics processor and the power consumption parameters for the same processing task based on the processing parameters of each graphics processor in the first graphics processor set; determining the target graphics processor based on the computing power parameters of each of the graphics processors and the power consumption parameters.
[0076] In a graphics processor cluster including at least two graphics processors, a graphics processor that meets a first condition is determined based on the current running data of each graphics processor, such as a graphics processor without a data processing task or a graphics processor that does not run a data processing task with real-time requirements, and such graphics processors are determined as a first graphics processor subset. Each graphics processor in the first graphics processor subset is controlled to enter a first low-power running state, and the video memory of these graphics processors can be controlled to update the same target data. Then, when a data reasoning task corresponding to the target data is received, a target graphics processor for executing the data reasoning task can be determined based on the processing parameters of these graphics processors. The processing parameters may include the operation parameters, power consumption parameters, and transmission parameters of the graphics processor. For example, the computing power parameters of the graphics processor are determined based on the operation parameters, that is, its reasoning capability is determined, and the power consumption parameters for the same processing task are determined at the same time, so as to determine a graphics processor with relatively strong reasoning capability and low power consumption as the target graphics processor. In this way, the data reasoning requirements can be guaranteed and the power consumption of the graphics processor cluster can be minimized.
[0077] See also Figure 2 , is a schematic diagram of an application scenario of a graphics processor cluster provided in an embodiment of the present application. The graphics processor cluster includes a first graphics processor 201, a second graphics processor 202, a third graphics processor 203 and a fourth graphics processor 204. The control device 200 is connected to each graphics processor in the graphics processor cluster respectively, and can obtain the operation data of each graphics processor, and can generate corresponding control instructions, so that the corresponding graphics processor enters the corresponding operation state based on the control instruction. If the control device detects that the first graphics processor 201, the second graphics processor 202 and the third graphics processor 203 are not performing processing tasks, the three graphics processors can be controlled to enter a low power consumption state, and a data reading instruction is generated and sent to the video memory of the three graphics processors, so that the video memory can read the target data in a corresponding data reading method. Then, after receiving the data reasoning task, according to the processing parameters of the three graphics processors, it is determined that the third graphics processor has the strongest reasoning ability and relatively low processing power consumption, and then the data reasoning task is sent to the third graphics processor, that is, the processing unit of the third graphics processor is controlled to start so that it performs the data reasoning task.
[0078] In one implementation of the embodiment of the present application, controlling the graphics processor to enter a second operating state for performing data reasoning includes:
[0079] When the graphics processor is running a first application and a second application, and a data reasoning task is for the first application, the graphics processor is controlled to suspend the task process of the current processing task of the second application; the graphics processor is controlled to enter a second running state for executing the data reasoning task; after the data reasoning task for the first application is completed, the graphics processor is controlled to resume the execution of the task process of the current processing task of the second application.
[0080] The graphics processor operation control method provided in the embodiment of the present application can be applied to the scene where the graphics processor runs multiple applications, and can ensure the operation requirements of each application during the control process. For example, the model running on the first application is a model that needs to update the video memory data in real time and has sudden data reasoning requirements; the model running on the second application is a common model that does not require real-time data reasoning. While controlling the graphics processor to enter the corresponding operation mode and reducing the power consumption of the graphics processor, an additional virtual mode can be added. The virtual mode refers to a mode that enables each application to perceive the independent use of all resources of the graphics processor (including the mode of independently occupying the graphics processor video memory resources). When the graphics processor is running, when there is no data reasoning task, the first application can control the first application to read data to the video memory normally and update the video memory as needed in the low power consumption mode, and set the video memory to the low power consumption data reading mode. The second application can call the reasoning capability of the graphics processor in normal mode, and the graphics card perceived by the second application is in virtual mode, that is, it perceives the independent application graphics card resources. For the first application, it can be set to standby mode, and for the second application, it can be set to normal working mode, that is, different applications in the graphics processor can be set to different operation modes. When the first application has a burst data inference task, the graphics card switches the working mode from standby mode to working mode for the first application, and enters the application process or county suspension mode for the second application. At this time, the data inference task of the first application is completed, and then the graphics card standby mode corresponding to the first application is re-entered to resume the task process of the second application. With this processing mode, only a small amount of changes to the graphics card application and driver are required on the operating system, and the application is completely unaware, which improves the experience effect.
[0081] In another embodiment of the present application, a control device is also provided. Figure 3 The control device 30 includes a storage module 301 and a control module 302, and the control device 30 is connected to the graphics processor for communication, wherein:
[0082] Storage module 301, used to store the application and the data generated by the running of the application;
[0083] The control module 302 is used to execute the application program to achieve:
[0084] According to current operation data of the graphics processor, the graphics processor is controlled to be in a first operation state; the video memory of the graphics processor is controlled to enter a target data reading mode; in response to receiving a data reasoning task corresponding to the target data, the graphics processor is controlled to enter a second operation state for executing the data reasoning task; wherein the power consumption of the graphics processor in the first operation state is less than the power consumption of the graphics processor in the second operation state;
[0085] Optionally, controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0086] If the target data is data to be inferred of a target model running in the graphics processor, determining a target reading mode of the target data based on a data inference requirement of the target model;
[0087] Controlling the video memory of the graphics processor to read the target data in the target reading mode;
[0088] The target reading mode includes at least a first reading mode and a second reading mode, wherein the first reading mode represents reading the target data from the memory of the electronic device where the graphics processor is located; and the second reading mode represents reading the target data from an external device connected to the graphics processor.
[0089] Optionally, controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0090] Determine a data storage state corresponding to a video memory of the graphics processor;
[0091] Determining a target data writing mode based on a data storage state corresponding to the video memory;
[0092] The video memory of the graphics processor is controlled to enter a target data reading mode, so that the video memory writes the target data into a storage area corresponding to the video memory in the target data writing mode.
[0093] Optionally, determining the target data writing mode based on the data storage state corresponding to the video memory includes:
[0094] If the graphics processor runs a target model, determining a data modality of the target model;
[0095] Determining a data storage state of a sub-storage area of the video memory corresponding to each of the data modes based on a data storage state corresponding to the video memory;
[0096] Based on the data modality and a data storage state of a sub-storage area corresponding to the data modality, a target data writing mode corresponding to the data modality is determined.
[0097] Optionally, controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0098] Determining a target storage area corresponding to a video memory of the graphics processor based on a processing requirement of the graphics processor;
[0099] Controlling the video memory of the graphics processor to enter a target data reading mode;
[0100] The video memory is controlled to store the target data in the target storage area.
[0101] Optionally, controlling the graphics processor to be in the first operating state according to current operating data of the graphics processor includes:
[0102] In a case where the graphics processor cluster includes at least two graphics processors, according to current running data of each graphics processor, each graphics processor in the corresponding first graphics processor subset is controlled to be in a first running state; the current running data of each graphics processor in the first graphics processor subset meets a first condition for entering the first running state;
[0103] The step of controlling the video memory of the graphics processor to enter a target data reading mode includes:
[0104] Controlling the video memory of each graphics processor in the first graphics processor subset to enter a target data reading mode.
[0105] Optionally, in response to receiving a data reasoning task corresponding to the target data, controlling the graphics processor to enter a second operating state for executing the data reasoning task includes:
[0106] In response to receiving a data inference task corresponding to target data, determining a target graphics processor based on processing parameters of each of the graphics processors in the first graphics processor set;
[0107] The target graphics processor is controlled to enter a second running state for executing the data reasoning task.
[0108] Optionally, determining the target graphics processor based on the processing parameters of each of the graphics processors in the first graphics processor set includes:
[0109] Determine, based on the processing parameters of each of the graphics processors in the first graphics processor set, a computing power parameter of each of the graphics processors and a power consumption parameter for the same processing task;
[0110] A target graphics processor is determined based on the computing power parameter of each graphics processor and the power consumption parameter.
[0111] Optionally, controlling the graphics processor to enter a second operating state for executing the data inference task includes:
[0112] When a first application and a second application are running on the graphics processor, and the data inference task is for the first application, controlling the graphics processor to suspend a task process of a current processing task of the second application;
[0113] Controlling the graphics processor to enter a second operating state for executing the data inference task;
[0114] After the data reasoning task for the first application is completed, the graphics processor is controlled to resume execution of the task process of the current processing task of the second application.
[0115] It should be noted that the specific implementation of the control device in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0116] In another embodiment of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the graphics processor operation control method as described in any one of the above items is implemented.
[0117] It should be noted that the specific implementation of the processor in this embodiment can refer to the corresponding content in the previous text and will not be described in detail here.
[0118] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0119] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0120] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0121] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A graphics processor operation control method, comprising: According to current operation data of the graphics processor, controlling the graphics processor to be in a first operation state; Controlling the video memory of the graphics processor to enter a target data reading mode; In response to receiving a data reasoning task corresponding to the target data, controlling the graphics processor to enter a second operating state for executing the data reasoning task; The power consumption of the graphics processor in the first operating state is less than the power consumption of the graphics processor in the second operating state.
2. The method according to claim 1, wherein the step of controlling the video memory of the graphics processor to enter a target data reading mode comprises: If the target data is data to be inferred of a target model running in the graphics processor, determining a target reading mode of the target data based on a data inference requirement of the target model; Controlling the video memory of the graphics processor to read the target data in the target reading mode; The target reading mode includes at least a first reading mode and a second reading mode, wherein the first reading mode represents reading the target data from the memory of the electronic device where the graphics processor is located; and the second reading mode represents reading the target data from an external device connected to the graphics processor.
3. The method according to claim 1, wherein controlling the video memory of the graphics processor to enter a target data reading mode comprises: Determine a data storage state corresponding to a video memory of the graphics processor; Determining a target data writing mode based on a data storage state corresponding to the video memory; The video memory of the graphics processor is controlled to enter a target data reading mode, so that the video memory writes the target data into a storage area corresponding to the video memory in the target data writing mode.
4. The method according to claim 3, wherein determining the target data writing mode based on the data storage state corresponding to the video memory comprises: If the graphics processor runs a target model, determining a data modality of the target model; Determining a data storage state of a sub-storage area of the video memory corresponding to each of the data modes based on a data storage state corresponding to the video memory; Based on the data modality and a data storage state of a sub-storage area corresponding to the data modality, a target data writing mode corresponding to the data modality is determined.
5. The method according to claim 1, wherein controlling the video memory of the graphics processor to enter a target data reading mode comprises: Determining a target storage area corresponding to a video memory of the graphics processor based on a processing requirement of the graphics processor; Controlling the video memory of the graphics processor to enter a target data reading mode; The video memory is controlled to store the target data in the target storage area.
6. The method according to claim 1, wherein controlling the graphics processor to be in the first operating state according to current operating data of the graphics processor comprises: In a case where the graphics processor cluster includes at least two graphics processors, according to current running data of each graphics processor, each graphics processor in the corresponding first graphics processor subset is controlled to be in a first running state; the current running data of each graphics processor in the first graphics processor subset meets a first condition for entering the first running state; The step of controlling the video memory of the graphics processor to enter a target data reading mode includes: Controlling the video memory of each graphics processor in the first graphics processor subset to enter a target data reading mode.
7. The method according to claim 6, wherein in response to receiving a data reasoning task corresponding to target data, controlling the graphics processor to enter a second operating state for executing the data reasoning task comprises: In response to receiving a data inference task corresponding to target data, determining a target graphics processor based on processing parameters of each of the graphics processors in the first graphics processor set; The target graphics processor is controlled to enter a second running state for executing the data reasoning task.
8. The method according to claim 6, wherein determining the target graphics processor based on the processing parameters of each of the graphics processors in the first graphics processor set comprises: Determine, based on the processing parameters of each of the graphics processors in the first graphics processor set, a computing power parameter of each of the graphics processors and a power consumption parameter for the same processing task; A target graphics processor is determined based on the computing power parameter of each graphics processor and the power consumption parameter.
9. The method according to claim 1, wherein controlling the graphics processor to enter a second operating state for executing the data reasoning task comprises: When a first application and a second application are running on the graphics processor, and the data inference task is for the first application, controlling the graphics processor to suspend a task process of a current processing task of the second application; Controlling the graphics processor to enter a second operating state for executing the data inference task; After the data reasoning task for the first application is completed, the graphics processor is controlled to resume execution of the task process of the current processing task of the second application.
10. A control device, the control device being communicatively connected to a graphics processor, the control device comprising: A storage module, used to store the application and the data generated by the operation of the application; A control module is used to execute the application program to achieve: According to current running data of a graphics processor, the graphics processor is controlled to be in a first running state; a video memory of the graphics processor is controlled to enter a target data reading mode; in response to receiving a data inference task corresponding to the target data, the graphics processor is controlled to enter a second running state for executing the data inference task; wherein the power consumption of the graphics processor in the first running state is less than the power consumption of the graphics processor in the second running state.
