WO2018233299A1 - 调度处理器的方法、装置、设备及介质 - Google Patents

调度处理器的方法、装置、设备及介质 Download PDF

Info

Publication number
WO2018233299A1
WO2018233299A1 PCT/CN2018/076009 CN2018076009W WO2018233299A1 WO 2018233299 A1 WO2018233299 A1 WO 2018233299A1 CN 2018076009 W CN2018076009 W CN 2018076009W WO 2018233299 A1 WO2018233299 A1 WO 2018233299A1
Authority
WO
WIPO (PCT)
Prior art keywords
resource
processor
server
resource request
usage rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/076009
Other languages
English (en)
French (fr)
Inventor
王健宗
张懿
郭卉
肖京
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2018233299A1 publication Critical patent/WO2018233299A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load

Definitions

  • the present application belongs to the field of software, and in particular, to a method, device, device and medium for scheduling a processor.
  • the processor of the graphics card is called a graphics processing unit (GPU), and it is connected to the central processing unit (Central).
  • the Processing Unit (CPU) is similar, except that the GPU was originally designed to perform complex mathematical and geometric calculations.
  • the graphics processor has been more and more fully utilized, and the GPU can complete the work of some CPUs, which can reduce the dependence of the computer on the CPU.
  • the CPU was responsible for all operations, while the GPU was only responsible for the final display work, so when dealing with complex graphics data, many computer systems using weaker CPUs began to slow down.
  • a computer system that uses a CPU with a strong performance may also have a large amount of CPU resources.
  • the graphics data processing part that would consume a lot of valuable resources of the CPU is all handed over to the GPU for processing, thereby reducing the burden on the CPU, and utilizing its own features, the graphics data processing efficiency is faster. Thereby improving system performance.
  • the prior art performs an increasingly fine division of CPU and GPU, that is, assigns specific tasks to the GPU processing according to preset rules to share the pressure of the CPU.
  • preset rules often lag behind the actual usage scenarios, so when a new usage scenario occurs, the GPU often cannot share the CPU pressure in time.
  • the embodiment of the present application provides a method, an apparatus, a device, and a medium for scheduling a processor, so as to solve the problem that the GPU cannot flexibly share the CPU pressure in the prior art.
  • a first aspect of the embodiments of the present application provides a method for scheduling a processor, including:
  • the resource request is used to request an operation resource, and the operation resource is provided by a central processing unit and a graphics processor;
  • the usage rate of the computing resource is obtained, and the central processing and/or image processor processing resource request is allocated according to the condition that the usage rate is satisfied by using a preset resource allocator.
  • a second aspect of the embodiments of the present application provides an apparatus for scheduling a processor, including:
  • the receiving module is configured to receive a resource request, and the resource request is used to request a computing resource, where the computing resource is provided by a central processing unit and a graphics processor.
  • the obtaining module is configured to obtain the usage rate of the computing resource, and allocate a central processing and/or an image processor to process the resource request according to a condition that the usage rate is satisfied by using a preset resource allocator.
  • a third aspect of an embodiment of the present application provides an apparatus for scheduling a processor, including a memory and a processor, wherein the memory stores computer readable instructions executable on the processor, the processor executing the The following steps are implemented when the computer readable instructions are described:
  • the resource request is used to request an operation resource, and the operation resource is provided by a central processing unit and a graphics processor;
  • the usage rate of the computing resource is obtained, and the central processing and/or image processor processing resource request is allocated according to the condition that the usage rate is satisfied by using a preset resource allocator.
  • a fourth aspect of the embodiments of the present application provides a computer readable storage medium storing computer readable instructions that, when executed by a processor, implement the following steps:
  • the resource request is used to request an operation resource, and the operation resource is provided by a central processing unit and a graphics processor;
  • the usage rate of the computing resource is obtained, and the central processing and/or image processor processing resource request is allocated according to the condition that the usage rate is satisfied by using a preset resource allocator.
  • the embodiment of the present application flexibly allocates resource requests by using the CPU and the GPU. Compared with the fixed division of labor in the prior art, the existing computing resources can be more fully utilized to improve the processing speed, and further, The GPU shares the computational pressure of the CPU to ensure stable operation of the system.
  • FIG. 1 is a flowchart of a method for scheduling a processor according to an embodiment of the present application
  • FIG. 2 is a flowchart of a method for allocating resource requests according to an embodiment of the present application
  • FIG. 3 is a flowchart of a method for allocating resource requests according to a preferred embodiment of the present application
  • Figure 4 is a schematic view of the preferred embodiment shown in Figure 3;
  • FIG. 5 is a flowchart of another method for allocating resource requests according to a preferred embodiment of the present application.
  • Figure 6 is a schematic view of the preferred embodiment shown in Figure 5;
  • FIG. 7 is a structural block diagram of an apparatus for scheduling a processor according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an apparatus for scheduling a processor according to an embodiment of the present application.
  • FIG. 1 is a flowchart of a method for scheduling a processor according to an embodiment of the present application. As shown in FIG. 1 , the method includes steps S110 and S120.
  • Step S110 Receive a resource request, where the resource request is used to request an operation resource, and the operation resource is provided by a central processing unit and a graphics processor.
  • the resource request can be an HTTP request (Hypertext Transfer Protocol HyperText)
  • HTTP Hypertext Transfer Protocol HyperText
  • the transfer protocol is abbreviated as HTTP, which is a request message from the client to the server.
  • the HTTP request may refer to a request sent by the client to the server when the computing resource is required.
  • the computing resource is a hardware resource with computing power.
  • the computing resource may be an arithmetic logic unit (Arithmetic Logic) Unit, referred to as ALU).
  • ALU arithmetic logic unit
  • the CPU and GPU perform various arithmetic operations through the ALU.
  • Step S120 Acquire a usage rate of the computing resource, and allocate a central processing and/or an image processor processing resource request according to a condition that the usage rate is satisfied by using a preset resource allocator.
  • the usage rate of computing resources is also the usage ratio of computing resources, which is generally expressed as a percentage, for example, the current computing resource usage rate is 50%.
  • the number of CPUs is much smaller than the number of GPUs.
  • the CPU generally has a complicated structure and can be used for complex operations. Therefore, it can handle both simple operations and the operation of the entire system.
  • the GPU structure is simple and can only be used for general purposes. With simple operations, multiple GPUs can be used in parallel.
  • CPU and GPU are very different because of their different design goals, they are targeted at two different application scenarios.
  • CPUs need to be very versatile to handle a variety of different data types, while at the same time logically judging, will introduce a large number of branch jumps and interrupt processing. These make the internal structure of the CPU extremely complicated.
  • the GPU is faced with a highly unified, non-dependent large-scale data and a pure computing environment that does not need to be interrupted.
  • the resource request generally requests a simple operation. If the number of resource requests is too large and the resource requests are not properly allocated, resulting in occupying a large CPU computing resource, the operation of the entire system will be affected accordingly.
  • the GPU uses a large number of computing units and an ultra-long pipeline, but only very simple control logic and saves Cache. Unlike CPUs that excel at logic control and general-purpose data manipulation, GPUs excel at large-scale concurrent computations, so GPUs are much faster than CPUs for requirements such as voiceprint feature extraction.
  • FIG. 2 is a flowchart of a method for allocating resource requests according to an embodiment of the present application.
  • the method is a preferred implementation manner of step S110. As shown in FIG. 2, the method includes steps S210 and S220.
  • Step S210 acquiring a graphics processor usage rate.
  • API Application Programming Interface
  • Step S220 if the graphics processor usage rate is lower than the preset value, the graphics processor processing resource request is preferentially allocated.
  • the number of GPUs is more and the CPU plays a larger role in the overall operation of the system than the GPU, in order to share the pressure of the CPU and let the CPU be more invested in the overall operation of the system, it can be prioritized when allocating resource requests.
  • the resource request is allocated to the GPU, and the preset value may be set according to different situations, for example, set to 70%-90%.
  • the operation of allocating resource requests may be accomplished by a load balancing policy.
  • the Nginx load balancing server may be utilized to allocate central processing units and/or image processors to process resource requests.
  • Nginx can directly support Rails framework and PHP programs to serve externally, and can also support external services as an HTTP proxy server.
  • Nginx can be written in C language, and system resource overhead is much better than Perlbal.
  • the embodiment of the present application allocates resource requests according to the usage rate of the GPU. Compared with the fixed division of labor in the prior art, the existing computing resources can be more fully utilized to improve the processing speed, and further, the CPU is shared by the GPU. The calculation pressure ensures the stable operation of the system.
  • FIG. 3 is a flowchart of a method for allocating resources according to a preferred embodiment of the present application. As shown in FIG. 3, the method includes steps S310 to S330.
  • Step S310 deploying a first server for receiving a resource request allocated to the graphics processor, and a second server for receiving a resource request allocated to the central processing unit.
  • multiple servers may be deployed on the hardware device, and after the resources of one server are used up, the next server is run, so that the computing resources can be used more reasonably.
  • the first server and the second server deployed in this step may be two virtual servers.
  • a virtual server is a technology that saves the cost of the server hardware. It can logically divide one or all of the service contents of one server hardware into multiple service units, and externally represent multiple servers, so that the server hardware resources can be fully utilized.
  • the virtual server may be a server program such as tomcat, jboss, or weblogic.
  • the first server corresponds to the GPU
  • the second server corresponds to the CPU
  • the Nginx is used as the load balancing server to allocate requests for each server according to the configuration.
  • step S320 the weight of the first server is set to be higher than that of the second server.
  • the GPU version of the server sets a higher weight, so that the resource request can be preferentially assigned to the server.
  • Step S330 after receiving the resource request, perform resource request allocation according to the weight and the usage rate.
  • the resource request can be allocated to the server with a larger value by multiplying the weight of each server by the proportion of the remaining resources of the corresponding processor.
  • the weight of the first server is 0.7
  • the usage rate of the GPU is 30%
  • the weight of the second server is 0.3
  • the usage rate of the CPU is 25%.
  • a server is assigned to the GPU.
  • the thread pool usage rate may also be considered, and the scheduling scheme is finally determined by the above two usage rates.
  • the task execution mode is performed in the manner of slice polling to maximize the utilization of the CPU; if assigned to the GPU, a single exclusive session holding mode is adopted, that is, The GPU will be monopolized by the current user before the task ends. This is because the GPU core thread needs to be scheduled by the CPU thread. If the exclusive mode is not used, it will cause task conflict and reduce system efficiency.
  • Nginx performs event distribution, and assigns an HTTP request to a server corresponding to the GPU or a server corresponding to the CPU, and the server passes init.
  • Py performs the initialization module, in which the server corresponding to the CPU can directly initialize the unified service model (UBM model); the server corresponding to the GPU needs to start the spring container first, and then load the specified GPU, and then initialize the UBM model.
  • the server corresponding to the GPU uses the resources in the UBM pool (thread pool) of the GPU through the get/set; the CPU uses the resources in the UBM pool of the CPU through the get.
  • Each server can only process a certain number of maxprocess requests (maximum number of connection requests) at the same time, which is equal to the number of GPUs and CPUs. If the resource request exceeds maxprocess, it will be placed in the Nginx request queue for redistribution.
  • the preferred embodiment hands over the allocation to Nginx with a small core load.
  • FIG. 5 is a flowchart of another resource allocation request provided by a preferred embodiment of the present application. As shown in FIG. 5, the method includes step S510 and step S520.
  • Step S510 deploying multiple servers, the server corresponding to a preset number of graphics processors and a central processing unit. If the usage rate of the graphics processor is lower than a preset value, the graphics processor is preferentially allocated to process resource requests, and the maximum setting of each server is set.
  • the computing resource value, the maximum computing resource value is equal to the sum of the computing resources of the central processing unit in the server and the computing resources of the graphics processor.
  • each server instead of separately managing the GPU and the CPU, each server includes a certain CPU and GPU computing resources, and after a server reaches a certain load, the next server is used.
  • Step S520 The server is used in a preset order, and when the resource request allocated to the current server is greater than the maximum computing resource value, the resource request exceeding the maximum computing resource value is allocated to the next server.
  • the preset order may be to number multiple servers, for example, server1, server2, server3...
  • the resource request is greater than the maximum computing resource value, ie maxprocess, the resource request is assigned to the next server.
  • FIG. 6 is a schematic diagram of the preferred embodiment shown in FIG. 5.
  • nginx performs event distribution, assigns an HTTP request to a server, and the server initializes the module through init.py, specifically, Start the spring container, load the specified GPU, then initialize the UBM model, then initialize the UBM of the CPU and put it into the spring container.
  • the resource in the UBM pool of the GPU is used by the get/set to determine whether the computing resource of the GPU is obtained. If the computing resource of the GPU is obtained, the resource is returned; if the computing resource of the GPU is not obtained, Get CPU computing resources. If the resource request is greater than maxprocess, the resource request is placed in the request queue of nginx and allocated in the next server.
  • the GPU/CPU option is given to the server, the GPU is fully utilized, and the code maintenance is simple. Different servers in the deployment only need to simply configure the GPU parameters.
  • FIG. 7 is a structural block diagram of an apparatus for scheduling a processor according to an embodiment of the present application. As shown in FIG. 7, the device includes a receiving module 710 and an obtaining module 720.
  • the receiving module 710 is configured to receive a resource request, and the resource request is used to request a computing resource, where the computing resource is provided by a central processing unit and a graphics processor.
  • the obtaining module 720 is configured to acquire a usage rate of the computing resource, and allocate a central processing and/or an image processor processing resource request according to a condition that the usage rate is satisfied by using a preset resource allocator.
  • the obtaining module comprises: an obtaining sub-module, configured to acquire a graphics processor usage rate; and an allocation sub-module, configured to preferentially allocate the graphics processor to process the resource request when the graphics processor usage rate is lower than a preset value.
  • the obtaining module is further configured to: use the Nginx load balancing server to allocate a central processing unit and/or an image processor to process the resource request.
  • the obtaining module comprises: a first deployment submodule, configured to deploy the first server and the second server, the first server is configured to receive a resource request allocated to the graphics processor, and the second server is configured to receive and allocate to the central processor a resource request; a first setting sub-module, configured to set a first server with a higher weight than the second server; and a sending sub-module, configured to perform resource request allocation according to the weight and the usage rate after receiving the resource request.
  • a first deployment submodule configured to deploy the first server and the second server, the first server is configured to receive a resource request allocated to the graphics processor, and the second server is configured to receive and allocate to the central processor a resource request
  • a first setting sub-module configured to set a first server with a higher weight than the second server
  • a sending sub-module configured to perform resource request allocation according to the weight and the usage rate after receiving the resource request.
  • the obtaining module comprises: a second deployment sub-module, configured to deploy a plurality of servers, where the server corresponds to a preset number of graphics processors and a central processing unit, and if the graphics processor usage rate is lower than a preset value, the graphics are preferentially allocated.
  • the processor processes the resource request
  • the second setting sub-module is configured to set a maximum computing resource value of each server, where the maximum computing resource value is equal to the sum of the computing resources of the central processing unit and the computing resources of the graphics processor in the server;
  • the module is configured to use multiple servers in a preset order, and allocate a resource request exceeding the maximum computing resource value to the next server when the resource request allocated to the current server is greater than the maximum computing resource value of the server.
  • the embodiment of the present application flexibly allocates resource requests by using the CPU and the GPU. Compared with the fixed division of labor in the prior art, the existing computing resources can be more fully utilized to improve the processing speed, and further, The GPU shares the computational pressure of the CPU to ensure stable operation of the system.
  • FIG. 8 is a schematic diagram of an apparatus for scheduling a processor according to an embodiment of the present application.
  • the apparatus 8 of the scheduling processor of this embodiment includes a processor 80 and a memory 81 in which computer readable instructions 82, such as schedules, executable on the processor 80 are stored.
  • the processor 80 executes the computer readable instructions 82 to implement the steps in the method embodiments of the various scheduling processors described above, such as steps 101 through 102 shown in FIG.
  • the processor 80 when executing the computer readable instructions 82, implements the functions of the various modules/units in the various apparatus embodiments described above, such as the functions of the modules 710 through 720 shown in FIG.
  • the computer readable instructions 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80, To complete this application.
  • the one or more modules/units may be a series of computer readable instruction segments capable of performing a particular function for describing the execution of the computer readable instructions 82 in the device 8 of the scheduling processor. .
  • the device 8 of the scheduling processor may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the devices of the scheduling processor may include, but are not limited to, a processor 80, a memory 81. It will be understood by those skilled in the art that FIG. 8 is merely an example of the device 8 that schedules the processor, does not constitute a limitation on the device 8 of the scheduling processor, may include more or less components than illustrated, or may combine certain Components, or different components, such as the devices of the scheduling processor, may also include input and output devices, network access devices, buses, and the like.
  • the so-called processor 80 can be a central processing unit (Central Processing Unit, CPU), can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 81 may be an internal storage unit of the device 8 of the dispatch processor, such as a hard disk or memory of the device 8 of the dispatch processor.
  • the memory 81 may also be an external storage device of the device 8 of the scheduling processor, such as a plug-in hard disk equipped on the device 8 of the scheduling processor, a smart memory card (SMC), and a secure digital device. (Secure Digital, SD) card, flash card, etc.
  • SMC smart memory card
  • secure digital device Secure Digital, SD
  • the memory 81 may also include both an internal storage unit of the device 8 of the scheduling processor and an external storage device.
  • the memory 81 is used to store the computer readable instructions and other programs and data required by the device that schedules the processor.
  • the memory 81 can also be used to temporarily store data that has been output or is about to be output.
  • each functional unit and module in the foregoing system may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware.
  • Formal implementation can also be implemented in the form of software functional units.
  • the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application.
  • the disclosed device/terminal device and method may be implemented in other manners.
  • the device/terminal device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units.
  • components may be combined or integrated into another system, or some features may be omitted or not performed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated modules/units if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium.
  • the present application implements all or part of the processes in the foregoing embodiments, and may also be implemented by computer readable instructions, which may be stored in a computer readable storage medium.
  • the computer readable instructions when executed by a processor, may implement the steps of the various method embodiments described above.
  • the computer readable instructions comprise computer readable instruction code, which may be in the form of source code, an object code form, an executable file or some intermediate form or the like.
  • the computer readable storage medium may include any entity or device capable of carrying the computer readable instruction code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read only memory (Read-Only Memory) , ROM), random access memory (Random Access Memory, RAM), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable The storage medium does not include an electrical carrier signal and a telecommunication signal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multi Processors (AREA)
  • Stored Programmes (AREA)

Abstract

一种调度处理器的方法、装置、调度处理器的设备及介质,适用于软件领域,该方法包括:接收资源请求,资源请求用于请求运算资源,运算资源由中央处理器和图形处理器提供(S110);获取运算资源的使用率,利用预设的资源分配器,根据使用率满足的条件,分配中央处理和/或图像处理器处理资源请求(S120)。该方法及装置通过CPU和GPU的使用率进行资源请求的分配,相比于现有技术中各自的固定分工,可以更充分地利用已有的运算资源,提高处理速度,进一步地,通过GPU分担CPU的运算压力,保证了系统的稳定运转。

Description

调度处理器的方法、装置、设备及介质
本申请要求于2017年06月22日提交中国专利局、申请号为201710481998.5 、发明名称为“调度处理器的方法及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于软件领域,尤其涉及一种调度处理器的方法、装置、设备及介质。
背景技术
显卡的处理器称为图形处理器(Graphics Processing Unit,简称为GPU),其与中央处理器(Central Processing Unit,简称为CPU)类似,只不过GPU最初是专为执行复杂的数学和几何计算而设计的。
随着计算机技术的发展,图形处理器得到了越来越充分的利用,通过GPU完成部分CPU的工作,可以减少计算机对CPU的依赖。例如,在以前的很多应用中,CPU是负责所有运算的,而GPU则只是负责最后的显示工作,因此一旦出现处理复杂图形数据的时候,很多使用性能较弱的CPU的电脑系统就开始缓慢无比,而使用性能较强的CPU的电脑系统也会出现CPU资源被大量占用的情况。而在GPU开始参与运算之后,原本会消耗CPU大量宝贵资源的图形数据处理部分就全部交给GPU进行处理,从而降低了CPU的负担,并且利用自身的特长,使得图形数据处理的效率更快,从而提升系统性能。
现有技术对CPU和GPU进行了越来越精细的分工,即依照预设规则,将特定的任务分配给GPU处理,以分担CPU的压力。但是上述预设规则往往滞后于实际使用场景,因此当出现新的使用场景时,GPU往往无法及时分担CPU的压力。
针对现有技术中GPU无法灵活地分担CPU压力的问题,目前业界没有理想的解决方式。
技术问题
有鉴于此,本申请实施例提供了一种调度处理器的方法、装置、设备及介质,以解决现有技术中GPU无法灵活地分担CPU压力的问题。
技术解决方案
本申请实施例的第一方面提供了一种调度处理器的方法,包括:
接收资源请求,资源请求用于请求运算资源,运算资源由中央处理器和图形处理器提供;
获取运算资源的使用率,利用预设的资源分配器,根据使用率满足的条件,分配中央处理和/或图像处理器处理资源请求。
本申请实施例的第二方面提供了一种调度处理器的装置,包括:
接收模块,用于接收资源请求,资源请求用于请求运算资源,运算资源由中央处理器和图形处理器提供。
获取模块,用于获取运算资源的使用率,利用预设的资源分配器,根据使用率满足的条件,分配中央处理和/或图像处理器处理资源请求。
本申请实施例的第三方面提供了一种调度处理器的设备,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
接收资源请求,资源请求用于请求运算资源,运算资源由中央处理器和图形处理器提供;
获取运算资源的使用率,利用预设的资源分配器,根据使用率满足的条件,分配中央处理和/或图像处理器处理资源请求。
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如下步骤:
接收资源请求,资源请求用于请求运算资源,运算资源由中央处理器和图形处理器提供;
获取运算资源的使用率,利用预设的资源分配器,根据使用率满足的条件,分配中央处理和/或图像处理器处理资源请求。
有益效果
本申请实施例灵活地通过CPU和GPU的使用率进行资源请求的分配,相比于现有技术中各自的固定分工,可以更充分地利用已有的运算资源,提高处理速度,进一步地,通过GPU分担CPU的运算压力,保证了系统的稳定运转。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例提供的调度处理器的方法的流程图;
图2是本申请实施例提供的分配资源请求方法的流程图;
图3是本申请优选实施例提供的一种分配资源请求方法的流程图;
图4是图3所示优选实施例的示意图;
图5是本申请优选实施例提供的另一种分配资源请求方法的流程图;
图6是图5所示优选实施例的示意图;
图7是本申请实施例提供的调度处理器的装置的结构框图;
图8是本申请实施例提供的调度处理器的设备的示意图。
本发明的实施方式
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1是本申请实施例提供的调度处理器的方法的流程图,如图1所示,该方法包括步骤S110和步骤S120。
步骤S110,接收资源请求,资源请求用于请求运算资源,运算资源由中央处理器和图形处理器提供。
资源请求可以是HTTP请求(超文本传输协议HyperText Transfer Protocol简称为HTTP),即是从客户端到服务器端的请求消息,本申请实施例中HTTP请求可以指客户端需要运算资源时向服务器发出的请求。
运算资源是具有运算能力的硬件资源,在本实施例中,运算资源可以是算术逻辑单元(Arithmetic Logic Unit,简称为ALU)。CPU和GPU通过ALU完成各种运算操作。
步骤S120,获取运算资源的使用率,利用预设的资源分配器,根据使用率满足的条件,分配中央处理和/或图像处理器处理资源请求。
运算资源的使用率也就是运算资源的使用比例,一般用百分数表示,例如当前运算资源的使用率为50%。
一般而言,在一台设备中,由于硬件的空间和成本的限制,所以CPU和GPU中的ALU数量也是有限的,因此在资源请求数量过多时,CPU和GPU将承受较大的运算压力。
具体地,CPU数量是远小于GPU数量的,CPU一般结构较复杂,可以用来进行复杂运算,因此既可以处理简单运算,也可以负责维持整个系统的运转;GPU结构简单,一般只能用于进行简单运算,多个GPU可以并行使用。
CPU和GPU之所以大不相同,是由于其设计目标的不同,它们分别针对了两种不同的应用场景。CPU需要很强的通用性来处理各种不同的数据类型,同时又要逻辑判断,会引入大量的分支跳转和中断的处理。这些都使得CPU的内部结构异常复杂。而GPU面对的则是类型高度统一的、相互无依赖的大规模数据和不需要被打断的纯净的计算环境。
资源请求一般请求的是简单运算,如果资源请求数量过多,且没有对资源请求进行合理分配,导致占用较大CPU的运算资源时,整个系统的运转都会相应地受到影响。
GPU采用了数量众多的计算单元和超长的流水线,但只有非常简单的控制逻辑并省去了Cache。与CPU擅长逻辑控制和通用类型数据运算不同,GPU擅长的是大规模并发计算,因此对于例如声纹特征提取的需求,GPU的计算速度远优于CPU。
在一种优选实现方式中,为了避免CPU压力过大,同时为了更充分地利用GPU的运算资源,当GPU使用率不高时,可以优先使用GPU处理资源请求。图2是本申请实施例提供的分配资源请求方法的流程图,该方法是步骤S110的一种优选实现方式,如图2所示,该方法包括步骤S210和步骤S220。
步骤S210,获取图形处理器使用率。
通过java、C语言和Linux等均有对应的获取CPU和GPU使用率的方式,例如调用对应的应用程序编程接口(Application Programming Interface,简称为API)等。
步骤S220,若图形处理器使用率低于预设值,则优先分配图形处理器处理资源请求。
由于GPU的数量更多,且CPU在系统整体运转中起到的作用比GPU更大,因此,为了分担CPU的压力,让CPU更多地投入到系统整体运转中,可以在分配资源请求时优先考虑分配给GPU处理。例如,当GPU的使用率低于预设值的时候,将资源请求分配给GPU,预设值可以根据不同的情况来进行相应设置,例如设为70%-90%。
分配资源请求这一操作可以通过负载均衡策略完成,作为一种优选的实现方式,可以利用Nginx负载均衡服务器分配中央处理器和/或图像处理器处理资源请求。
Nginx既可以在内部直接支持Rails框架和PHP程序对外进行服务,也可以支持作为HTTP代理服务器对外进行服务。Nginx可以采用C语言进行编写,系统资源开销比Perlbal要好很多。
本申请实施例根据GPU的使用率进行资源请求的分配,相比于现有技术中各自的固定分工,可以更充分地利用已有的运算资源,提高处理速度,进一步地,通过GPU分担CPU的运算压力,保证了系统的稳定运转。
图3是本申请优选实施例提供的一种分配资源请求方法的流程图,如图3所示,该方法包括步骤S310至步骤S330。
步骤S310,部署第一服务器和第二服务器,第一服务器用于接收分配给图形处理器的资源请求,第二服务器用于接收分配给中央处理器的资源请求。
本申请实施例中,可以在硬件设备上部署多个服务器,在一个服务器的资源被用完之后,再运行下一个服务器,这样可以更加合理地使用运算资源。本步骤中部署的第一服务器和第二服务器可以是2个虚拟服务器(server)。
虚拟服务器是节省服务器硬件成本的一种技术,可以将一台服务器硬件的某项或者全部服务内容逻辑划分为多个服务单位,对外表现为多个服务器,从而可以充分利用服务器硬件资源。
当单个服务器无法满足使用需求,或者单个服务器能够达到这个要求的成本太高时,可以使用虚拟服务器来达到运用需求。
多个虚拟服务器,可以通过软件架设在同一个服务器硬件上,而每个虚拟服务器又可以提供服务器的所有功能,因此降低了运行成本。
具体地,虚拟服务器可以是tomcat、jboss或weblogic等服务器程序。第一服务器对应GPU,第二服务器对应CPU,用Nginx作为负载均衡服务器为每个server按配置分配请求。
步骤S320,设置第一服务器的权重高于第二服务器。
即GPU版本的server设置较高的权重,从而可以优先给该server分配资源请求。
步骤S330,在接收到资源请求之后,根据权重和使用率进行资源请求分配。
本申请实施例可以用各服务器的权重乘以对应处理器的剩余资源的占比,将资源请求分配给数值较大的服务器。例如第一服务器的权重是0.7,GPU的使用率30%,第二服务器的权重是0.3,CPU的使用率是25%,那么第一服务器中权重与剩余资源的乘积为0.7*(1-30%)=0.49,第二服务器中权重与剩余资源的乘积为0.3*(1-25%)=0.225,由于第一服务器中权重与剩余资源的乘积更大,因此此时将资源请求分配给第一服务器,即分配给GPU。
进一步地,在分配资源请求时,除了考虑处理器使用率之外,还可以考虑线程池使用率,通过上述这两个使用率最终决定调度方案。
在分配资源请求之后,如果分配给CPU,则采用切片轮询的方式进行任务执行方式,使CPU的利用率达到最大;如果分配给GPU,则采用了单颗独占的会话保持方式,即,在任务结束之前,GPU会被当前用户独占。这是因为GPU核心线程需要由CPU线程进行调度,若不采用独占方式,就会造成任务冲突,降低系统效率。
图4是图3所示优选实施例的示意图,如图4所示,在收到HTTP请求以后,Nginx进行事件分发,将HTTP请求分配给GPU对应的server或CPU对应的server,server通过init.py进行初始化模块,其中CPU对应的server可以直接初始化统一业务模型(UBM模型);而GPU对应的server需要先启动spring容器,加载指定GPU之后,再初始化UBM模型。完成初始化后,GPU对应的server通过get/set使用GPU的UBM池(线程池)中的资源;CPU通过get使用CPU的UBM池中的资源。每个server同一时间只能处理一定数量maxprocess(最大连接请求数)的请求,分别等于GPU和CPU的个数,资源请求如果超出maxprocess,则会放入Nginx请求队列重新分配。
本优选实施例把分配权交给Nginx,核心负载较小。
图5是本申请优选实施例提供的另一种分配资源请求的流程图,如图5所示,该方法包括步骤S510和步骤S520。
步骤S510,部署多个服务器,服务器对应预设数量的图形处理器和中央处理器,若图形处理器使用率低于预设值,则优先分配图形处理器处理资源请求,设置每个服务器的最大运算资源值,最大运算资源值等于该服务器中中央处理器的运算资源与图形处理器的运算资源之和。
本优选实施例中,不是对GPU和CPU分开管理,而是每个server都包括一定的CPU和GPU运算资源,在一个server达到一定负荷之后,再使用下一个server。
步骤S520,按预设顺序使用服务器,在给当前服务器分配的资源请求大于最大运算资源值时,将超出最大运算资源值的资源请求分配至下一个服务器。
预设顺序可以是对多个server进行编号,例如server1,server2,server3…当资源请求大于最大运算资源值,即maxprocess时,将资源请求分配给下一个server。
图6是图5所示优选实施例的示意图,如图5所示,在收到HTTP请求以后,nginx进行事件分发,将HTTP请求分配server,server通过init.py进行初始化模块,具体地,先启动spring容器,加载指定GPU之后,再初始化UBM模型,然后初始化CPU的UBM,并放入spring容器中。在每个server中,通过get/set使用GPU的UBM池中的资源,判断是否获取到GPU的运算资源,如果获取到GPU的运算资源,则返回该资源;如果没有获取到GPU的运算资源,在获取CPU运算资源。如果资源请求大于maxprocess,则将资源请求放入nginx的请求队列,在下一个server中进行分配。
本优选实施例将GPU/CPU的选择权交给了Server,GPU利用充分,并且代码维护简单,部署时不同的server只需要简单的配置GPU参数即可。
本申请实施例还提供了一种调度处理器的装置,图7是本申请实施例提供的调度处理器的装置的结构框图,如图7所示,该装置包括接收模块710和获取模块720。
接收模块710用于接收资源请求,资源请求用于请求运算资源,运算资源由中央处理器和图形处理器提供。
获取模块720用于获取运算资源的使用率,利用预设的资源分配器,根据使用率满足的条件,分配中央处理和/或图像处理器处理资源请求。
优选地,获取模块包括:获取子模块,用于获取图形处理器使用率;分配子模块,用于在图形处理器使用率低于预设值时,优先分配图形处理器处理资源请求。
优选地,获取模块还用于:利用Nginx负载均衡服务器分配中央处理器和/或图像处理器处理资源请求。
优选地,获取模块包括:第一部署子模块,用于部署第一服务器和第二服务器,第一服务器用于接收分配给图形处理器的资源请求,第二服务器用于接收分配给中央处理器的资源请求;第一设置子模块,用于设置第一服务器的权重高于第二服务器;发送子模块,用于在接收到资源请求之后,根据权重和使用率进行资源请求分配。
优选地,获取模块包括:第二部署子模块,用于部署多个服务器,服务器对应预设数量的图形处理器和中央处理器,若图形处理器使用率低于预设值,则优先分配图形处理器处理资源请求,第二设置子模块,用于设置每个服务器的最大运算资源值,最大运算资源值等于该服务器中中央处理器的运算资源与图形处理器的运算资源之和;使用子模块,用于按预设顺序使用多个服务器,在给当前服务器分配的资源请求大于该服务器的最大运算资源值时,将超出最大运算资源值的资源请求分配至下一个服务器。
本申请实施例灵活地通过CPU和GPU的使用率进行资源请求的分配,相比于现有技术中各自的固定分工,可以更充分地利用已有的运算资源,提高处理速度,进一步地,通过GPU分担CPU的运算压力,保证了系统的稳定运转。
图8是本申请一实施例提供的调度处理器的设备的示意图。如图8所示,该实施例的调度处理器的设备8包括:处理器80以及存储器81,所述存储器81中存储有可在所述处理器80上运行的计算机可读指令82,例如调度处理器的程序。所述处理器80执行所述计算机可读指令82时实现上述各个调度处理器的方法实施例中的步骤,例如图1所示的步骤101至102。或者,所述处理器80执行所述计算机可读指令82时实现上述各装置实施例中各模块/单元的功能,例如图5所示模块710至720的功能。
示例性的,所述计算机可读指令82可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器81中,并由所述处理器80执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令段,该指令段用于描述所述计算机可读指令82在所述调度处理器的设备8中的执行过程。
所述调度处理器的设备8可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述调度处理器的设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是调度处理器的设备8的示例,并不构成对调度处理器的设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述调度处理器的设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器80可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器81可以是所述调度处理器的设备8的内部存储单元,例如调度处理器的设备8的硬盘或内存。所述存储器81也可以是所述调度处理器的设备8的外部存储设备,例如所述调度处理器的设备8上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述调度处理器的设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储所述计算机可读指令以及所述调度处理器的设备所需的其他程序和数据。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
在本申请所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读存储介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读存储介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读存储介质不包括电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种调度处理器的方法,其特征在于,包括:
    接收资源请求,所述资源请求用于请求运算资源,所述运算资源由中央处理器和图形处理器提供;
    获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求。
  2. 如权利要求1所述的调度处理器的方法,其特征在于,所述利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    获取图形处理器使用率;
    若所述图形处理器使用率低于预设值,则优先分配所述图形处理器处理所述资源请求。
  3. 如权利要求1所述的调度处理器的方法,其特征在于,所述利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    利用Nginx负载均衡服务器分配所述中央处理器和/或所述图像处理器处理所述资源请求。
  4. 如权利要求1所述的调度处理器的方法,其特征在于,所述获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    部署第一服务器和第二服务器,所述第一服务器用于接收分配给所述图形处理器的所述资源请求,所述第二服务器用于接收分配给所述中央处理器的所述资源请求;
    设置所述第一服务器的权重高于所述第二服务器;
    在接收到所述资源请求之后,根据所述权重和所述使用率进行资源请求分配。
  5. 如权利要求1所述的调度处理器的方法,其特征在于,所述获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    部署多个服务器,所述服务器对应预设数量的所述图形处理器和所述中央处理器,若所述图形处理器使用率低于预设值,则优先分配所述图形处理器处理所述资源请求;
    设置每个所述服务器的最大运算资源值,所述最大运算资源值等于该服务器中所述中央处理器的运算资源与所述图形处理器的运算资源之和;
    按预设顺序使用所述多个服务器,在给当前服务器分配的资源请求大于该服务器的所述最大运算资源值时,将超出所述最大运算资源值的所述资源请求分配至下一个服务器。
  6. 一种调度处理器的装置,其特征在于,包括:
    接收模块,用于接收资源请求,资源请求用于请求运算资源,运算资源由中央处理器和图形处理器提供。
    获取模块,用于获取运算资源的使用率,利用预设的资源分配器,根据使用率满足的条件,分配中央处理和/或图像处理器处理资源请求。
  7. 根据权利要求6所述的调度处理器的装置,其特征在于,所述获取模块包括:
    获取子模块,用于获取图形处理器使用率;
    分配子模块,用于在图形处理器使用率低于预设值时,优先分配图形处理器处理资源请求。
  8. 根据权利要求6所述的调度处理器的装置,其特征在于,所述获取模块还用于:利用Nginx负载均衡服务器分配中央处理器和/或图像处理器处理资源请求。
  9. 根据权利要求6所述的调度处理器的装置,其特征在于,所述获取模块包括:
    第一部署子模块,用于部署第一服务器和第二服务器,第一服务器用于接收分配给图形处理器的资源请求,第二服务器用于接收分配给中央处理器的资源请求;
    第一设置子模块,用于设置第一服务器的权重高于第二服务器;发送子模块,用于在接收到资源请求之后,根据权重和使用率进行资源请求分配。
  10. 根据权利要求6所述的调度处理器的装置,其特征在于,所述获取模块包括:
    第二部署子模块,用于部署多个服务器,服务器对应预设数量的图形处理器和中央处理器,若图形处理器使用率低于预设值,则优先分配图形处理器处理资源请求;
    第二设置子模块,用于设置每个服务器的最大运算资源值,最大运算资源值等于该服务器中中央处理器的运算资源与图形处理器的运算资源之和;
    使用子模块,用于按预设顺序使用多个服务器,在给当前服务器分配的资源请求大于该服务器的最大运算资源值时,将超出最大运算资源值的资源请求分配至下一个服务器。
  11. 一种调度处理器的设备,其特征在于,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
    接收资源请求,所述资源请求用于请求运算资源,所述运算资源由中央处理器和图形处理器提供;
    获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求。
  12. 根据权利要求11所述的调度处理器的设备,其特征在于,所述利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    获取图形处理器使用率;
    若所述图形处理器使用率低于预设值,则优先分配所述图形处理器处理所述资源请求。
  13. 根据权利要求11所述的调度处理器的设备,其特征在于,所述利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    利用Nginx负载均衡服务器分配所述中央处理器和/或所述图像处理器处理所述资源请求。
  14. 根据权利要求11所述的调度处理器的设备,其特征在于,所述获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    部署第一服务器和第二服务器,所述第一服务器用于接收分配给所述图形处理器的所述资源请求,所述第二服务器用于接收分配给所述中央处理器的所述资源请求;
    设置所述第一服务器的权重高于所述第二服务器;
    在接收到所述资源请求之后,根据所述权重和所述使用率进行资源请求分配。
  15. 根据权利要求11所述的调度处理器的设备,其特征在于,所述获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    部署多个服务器,所述服务器对应预设数量的所述图形处理器和所述中央处理器,若所述图形处理器使用率低于预设值,则优先分配所述图形处理器处理所述资源请求;
    设置每个所述服务器的最大运算资源值,所述最大运算资源值等于该服务器中所述中央处理器的运算资源与所述图形处理器的运算资源之和;
    按预设顺序使用所述多个服务器,在给当前服务器分配的资源请求大于该服务器的所述最大运算资源值时,将超出所述最大运算资源值的所述资源请求分配至下一个服务器。
  16. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:
    接收资源请求,所述资源请求用于请求运算资源,所述运算资源由中央处理器和图形处理器提供;
    获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    获取图形处理器使用率;
    若所述图形处理器使用率低于预设值,则优先分配所述图形处理器处理所述资源请求。
  18. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    利用Nginx负载均衡服务器分配所述中央处理器和/或所述图像处理器处理所述资源请求。
  19. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    部署第一服务器和第二服务器,所述第一服务器用于接收分配给所述图形处理器的所述资源请求,所述第二服务器用于接收分配给所述中央处理器的所述资源请求;
    设置所述第一服务器的权重高于所述第二服务器;
    在接收到所述资源请求之后,根据所述权重和所述使用率进行资源请求分配。
  20. 根据权利要求19所述的计算机可读存储介质,其特征在于,所述获取所述运算资源的使用率,利用预设的资源分配器,根据所述使用率满足的条件,分配所述中央处理和/或所述图像处理器处理所述资源请求,包括:
    部署多个服务器,所述服务器对应预设数量的所述图形处理器和所述中央处理器,若所述图形处理器使用率低于预设值,则优先分配所述图形处理器处理所述资源请求;
    设置每个所述服务器的最大运算资源值,所述最大运算资源值等于该服务器中所述中央处理器的运算资源与所述图形处理器的运算资源之和;
    按预设顺序使用所述多个服务器,在给当前服务器分配的资源请求大于该服务器的所述最大运算资源值时,将超出所述最大运算资源值的所述资源请求分配至下一个服务器。
PCT/CN2018/076009 2017-06-22 2018-02-09 调度处理器的方法、装置、设备及介质 Ceased WO2018233299A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710481998.5 2017-06-22
CN201710481998.5A CN107688495B (zh) 2017-06-22 2017-06-22 调度处理器的方法及设备

Publications (1)

Publication Number Publication Date
WO2018233299A1 true WO2018233299A1 (zh) 2018-12-27

Family

ID=61152632

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/076009 Ceased WO2018233299A1 (zh) 2017-06-22 2018-02-09 调度处理器的方法、装置、设备及介质

Country Status (2)

Country Link
CN (1) CN107688495B (zh)
WO (1) WO2018233299A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115421915A (zh) * 2022-08-29 2022-12-02 苏州浪潮智能科技有限公司 一种基于cpu和gpu混合分时工作流调度方法及系统

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110389763B (zh) * 2018-04-20 2023-06-16 伊姆西Ip控股有限责任公司 用于调度专用处理资源的方法、设备和计算机可读介质
CN110858161B (zh) * 2018-08-24 2023-05-12 阿里巴巴集团控股有限公司 资源分配方法、装置、系统、设备和介质
CN109561134B (zh) * 2018-10-26 2022-06-10 平安科技(深圳)有限公司 电子装置、分布式集群服务分配方法及存储介质
TWI739235B (zh) * 2019-12-12 2021-09-11 中華電信股份有限公司 一種gpu運算資源指配系統及其方法
CN111897639B (zh) * 2020-07-29 2022-12-27 平安科技(深圳)有限公司 图像增广方法、装置、计算机设备及存储介质
CN112035247A (zh) * 2020-08-12 2020-12-04 博泰车联网(南京)有限公司 一种资源调度方法、车机及计算机存储介质
CN112162864B (zh) * 2020-10-26 2023-06-09 新华三大数据技术有限公司 一种云资源分配方法、装置及存储介质
CN112506637B (zh) * 2020-12-17 2024-12-24 广东省科技基础条件平台中心 图像数据处理方法、装置、计算机设备和存储介质
CN114428665A (zh) * 2022-01-24 2022-05-03 北京百度网讯科技有限公司 数据处理的方法、装置、设备以及存储介质
CN114500398B (zh) * 2022-01-26 2024-05-28 中国农业银行股份有限公司 一种处理器协同加速的方法、装置、设备及介质
CN114640681B (zh) * 2022-03-10 2024-05-17 京东科技信息技术有限公司 一种数据处理方法和系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101447939A (zh) * 2008-12-16 2009-06-03 中国移动通信集团北京有限公司 一种业务分配方法和负载均衡器
CN102958166A (zh) * 2011-08-29 2013-03-06 华为技术有限公司 一种资源分配方法及资源管理平台
CN105988874A (zh) * 2015-02-10 2016-10-05 阿里巴巴集团控股有限公司 资源处理方法及装置
CN106155811A (zh) * 2015-04-28 2016-11-23 阿里巴巴集团控股有限公司 图形处理装置、资源服务装置、资源调度方法和装置
US9576332B1 (en) * 2014-06-02 2017-02-21 VCE IP Holding Company LLC Systems and methods for remote graphics processing unit service

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101467558B1 (ko) * 2007-07-26 2014-12-01 엘지전자 주식회사 그래픽데이터 처리 장치 및 방법
US9479449B2 (en) * 2013-06-03 2016-10-25 Advanced Micro Devices, Inc. Workload partitioning among heterogeneous processing nodes
CN104778080A (zh) * 2014-01-14 2015-07-15 中兴通讯股份有限公司 基于协处理器的作业调度处理方法及装置
CN104102546B (zh) * 2014-07-23 2018-02-02 浪潮(北京)电子信息产业有限公司 一种实现cpu和gpu负载均衡的方法及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101447939A (zh) * 2008-12-16 2009-06-03 中国移动通信集团北京有限公司 一种业务分配方法和负载均衡器
CN102958166A (zh) * 2011-08-29 2013-03-06 华为技术有限公司 一种资源分配方法及资源管理平台
US9576332B1 (en) * 2014-06-02 2017-02-21 VCE IP Holding Company LLC Systems and methods for remote graphics processing unit service
CN105988874A (zh) * 2015-02-10 2016-10-05 阿里巴巴集团控股有限公司 资源处理方法及装置
CN106155811A (zh) * 2015-04-28 2016-11-23 阿里巴巴集团控股有限公司 图形处理装置、资源服务装置、资源调度方法和装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115421915A (zh) * 2022-08-29 2022-12-02 苏州浪潮智能科技有限公司 一种基于cpu和gpu混合分时工作流调度方法及系统

Also Published As

Publication number Publication date
CN107688495A (zh) 2018-02-13
CN107688495B (zh) 2020-11-03

Similar Documents

Publication Publication Date Title
WO2018233299A1 (zh) 调度处理器的方法、装置、设备及介质
CN114020470B (zh) 资源分配方法、装置、可读介质及电子设备
US10109030B1 (en) Queue-based GPU virtualization and management system
US10496446B2 (en) Altruistic dependable memory overcommit for virtual machines
CN109726005B (zh) 用于管理资源的方法、服务器系统和计算机可读介质
CN102906726B (zh) 协处理加速方法、装置及系统
CN105045658B (zh) 一种利用多核嵌入式dsp实现动态任务调度分发的方法
CN104536937B (zh) 基于cpu‑gpu异构集群的大数据一体机实现方法
CN103646006B (zh) 一种处理器的调度方法、装置和系统
CN118897736A (zh) 模型推理调度方法、装置和服务器集群
CN104778080A (zh) 基于协处理器的作业调度处理方法及装置
CN108363623A (zh) Gpu资源调度方法、装置、设备及计算机可读存储介质
CN109729113B (zh) 管理专用处理资源的方法、服务器系统和计算机程序产品
US10037225B2 (en) Method and system for scheduling computing
CN114168301B (zh) 线程调度方法、处理器以及电子装置
US20250278318A1 (en) Data processing method and apparatus, electronic device, and computer-readable storage medium
US20200174821A1 (en) System, method and computer program for virtual machine resource allocation
CN106325995B (zh) 一种gpu资源的分配方法及系统
US9471387B2 (en) Scheduling in job execution
CN106325996B (zh) 一种gpu资源的分配方法及系统
US20230063893A1 (en) Simultaneous-multi-threading (smt) aware processor allocation for cloud real-time workloads
CN114637536A (zh) 任务处理方法、计算协处理器、芯片及计算机设备
CN111694672B (zh) 资源分配方法、任务提交方法、装置、电子设备和介质
Orellana et al. FPGA‐Aware Scheduling Strategies at Hypervisor Level in Cloud Environments
CN117149440B (zh) 一种任务调度方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18820714

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18820714

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM1205 DATED 18/03/2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18820714

Country of ref document: EP

Kind code of ref document: A1