WO2025190099A1 - 任务调度方法、装置、设备、存储介质和程序产品 - Google Patents

任务调度方法、装置、设备、存储介质和程序产品

Info

Publication number
WO2025190099A1
WO2025190099A1 PCT/CN2025/080171 CN2025080171W WO2025190099A1 WO 2025190099 A1 WO2025190099 A1 WO 2025190099A1 CN 2025080171 W CN2025080171 W CN 2025080171W WO 2025190099 A1 WO2025190099 A1 WO 2025190099A1
Authority
WO
WIPO (PCT)
Prior art keywords
task
scheduler
computing task
priority
computing
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.)
Pending
Application number
PCT/CN2025/080171
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.)
Tencent Technology (Shenzhen) Co Ltd
Original Assignee
Tencent 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 Tencent Technology (Shenzhen) Co Ltd filed Critical Tencent Technology (Shenzhen) Co Ltd
Publication of WO2025190099A1 publication Critical patent/WO2025190099A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00—Arrangements for program control, e.g. control units
    • G06F9/06—Arrangements 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/46—Multiprogramming arrangements
    • G06F9/48—Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806—Task transfer initiation or dispatching
    • G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00—Arrangements for program control, e.g. control units
    • G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
    • G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00—Arrangements for program control, e.g. control units
    • G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
    • G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533—Hypervisors; Virtual machine monitors
    • G06F9/45558—Hypervisor-specific management and integration aspects
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00—Arrangements for program control, e.g. control units
    • G06F9/06—Arrangements 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/46—Multiprogramming arrangements
    • G06F9/48—Program initiating; Program switching, e.g. by interrupt
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00—Arrangements for program control, e.g. control units
    • G06F9/06—Arrangements 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/46—Multiprogramming arrangements
    • G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00—Arrangements for program control, e.g. control units
    • G06F9/06—Arrangements 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/46—Multiprogramming arrangements
    • G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027—Allocation 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/5038—Allocation 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 execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00—Indexing scheme relating to G06F9/00
    • G06F2209/48—Indexing scheme relating to G06F9/48
    • G06F2209/484—Precedence
    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06F—ELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00—Indexing scheme relating to G06F9/00
    • G06F2209/50—Indexing scheme relating to G06F9/50
    • G06F2209/5021—Priority

Definitions

  • the present application relates to the field of cloud servers, and in particular to a task scheduling method, apparatus, device and medium.
  • AI tasks are performed by hardware acceleration processors such as graphics processing units (GPUs) or neural network processing units (NPUs).
  • graphics processing units GPUs
  • NPUs neural network processing units
  • the GPU/NPU's computing time is divided into different time slices.
  • a time-slice-based scheduler runs each task in the order in which they were submitted.
  • a task scheduling method comprising:
  • the first priority is higher than the second priority.
  • a task scheduling device comprising: a first scheduler module and a second scheduler module;
  • the second scheduler module is configured to modify task submission information of a first computing task during a process in which the first scheduler module creates the first computing task, the first computing task having a first priority;
  • the second scheduler module is configured to sense submission of the first computing task during a process in which the first scheduler module submits the first computing task based on the task submission information;
  • a non-volatile computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions are loaded and executed by a processor to implement the task scheduling method described above.
  • a computer program product which includes computer-readable instructions stored in a computer-readable storage medium.
  • a processor of a computer device reads and executes the computer-readable instructions from the computer-readable storage medium to implement the task scheduling method described above.
  • FIG1 is a structural block diagram of a computer device provided in some embodiments of the present application.
  • FIG2 is a flowchart of a task scheduling method provided by some embodiments of the present application.
  • FIG3 is a schematic diagram of the direction of task submission information before and after modification provided in some embodiments of the present application.
  • FIG4 is a flowchart of a task scheduling method provided by some embodiments of the present application.
  • FIG5 is a schematic diagram of the architecture of a cloud computing system provided by some embodiments of the present application.
  • FIG6 is a flowchart of a method for notifying a priority of a computing task provided by some embodiments of the present application.
  • FIG7 is a flowchart of a method for prefetching information for a computing task provided by some embodiments of the present application.
  • FIG8 is a flowchart of a task scheduling method provided by some embodiments of the present application.
  • FIG9 is a flowchart of a method for pausing a second priority task provided by some embodiments of the present application.
  • FIG10 is a flowchart of a method for submitting a native computing task provided by some embodiments of the present application.
  • FIG11 is a flowchart of a method for submitting an online task (a high-priority task or a first-priority task) provided in some embodiments of the present application;
  • FIG12 is a flowchart of a method for submitting an offline task (a low-priority task or a second-priority task) according to some embodiments of the present application;
  • FIG13 is a block diagram of a task scheduling device provided by some embodiments of the present application.
  • FIG14 is a block diagram of a computer device provided in some embodiments of the present application.
  • Kubernetes is an open-source container orchestration engine used to automate the deployment, scaling, and management of containerized applications. Kubernetes is abbreviated as K8s.
  • Containers are a type of sandbox technology whose main purpose is to isolate applications from the outside world and to facilitate the transfer of this sandbox to other host machines.
  • Processor A unit in a computer device that performs computing tasks.
  • Processors can be categorized as at least one of the following: a central processing unit (CPU), an accelerated processing unit (APU), a neural network processing unit (NPU), a deep learning processing unit (DPU), a floating-point processor (FPU), a holographic processing unit (HPU), an intelligence processing unit (IPU), a tensor processing unit (TPU), a vector processing unit (VPU), or an intelligent cloud acceleration processor.
  • CPU central processing unit
  • APU accelerated processing unit
  • NPU neural network processing unit
  • DPU deep learning processing unit
  • FPU floating-point processor
  • HPU holographic processing unit
  • IPU intelligence processing unit
  • TPU tensor processing unit
  • VPU vector processing unit
  • intelligent cloud acceleration processor an intelligent cloud acceleration processor.
  • Hardware acceleration processor A processor other than the CPU that has accelerated computing capabilities for certain types of operations. This processor can be at least one of the aforementioned GPUs, NPUs, DPUs, FPUs, HPUs, IPUs, TPUs, VPUs, and intelligent cloud acceleration processors.
  • the computer device 100 includes a central processing unit 120 , a system memory 140 , and at least one hardware acceleration processor 160 .
  • the central processing unit 120 is used to create and schedule various computing tasks. Different computing tasks can have different priorities.
  • a first scheduler 122 and a second scheduler 124 are running in the central processing unit 120.
  • the schedulers use different scheduling strategies to decide which task should obtain the time slice of computing resources (such as CPU, GPU or NPU) and when to obtain it.
  • the first scheduler 122 is a native task scheduler, such as the task scheduler natively provided in the K8s system;
  • the second scheduler 124 is a custom task scheduler newly added in this application.
  • the first scheduler 122 does not have the ability to schedule computing tasks based on priority
  • the second scheduler 124 has the ability to schedule computing tasks based on priority.
  • the second scheduler 124 can take over the computing tasks submitted by the first scheduler 122 to the operating system, and the second scheduler 124 re-schedules each computing task based on priority.
  • an operating system runs on the computer device 100, and the operating system includes a kernel layer and an application layer.
  • the first scheduler 122 is a scheduler located at the application layer
  • the second scheduler 124 is a scheduler located at the application layer or the kernel layer.
  • System memory 140 is used to provide the memory space required by the CPU 120 during operation.
  • System memory 140 is a type of memory.
  • Memory can also include other forms of memory such as flash memory and hard disk.
  • the second scheduler is a custom scheduler newly added in this embodiment.
  • the second scheduler has the ability to schedule computing tasks according to priority.
  • the second scheduler needs to modify the task submission information of the first computing task.
  • the modified task submission information points to the target storage location specified by the second scheduler.
  • the modified task submission information points to the target storage location in the system memory specified by the second scheduler.
  • the target storage location stores the device control bit of the first computing task.
  • the second scheduler perceives the submission of the first computing task while the first scheduler is submitting the first computing task based on the modified task submission information. In other words, the second scheduler can perceive the submission of the first computing task, the submission of the first computing task, or the submission progress of the first computing task in real time.
  • the second scheduler When the second scheduler senses the submission of the first computing task, it suspends the execution of the second computing task and submits the first computing task to the processor for execution.
  • the second scheduler can sense the submission (or submission or submission progress) of the first computing task. However, the submitted first computing task will not be triggered to run at this time. The first computing task will only be triggered to run when the second scheduler actually submits the first computing task to the processor.
  • the second scheduler can take over the work of the first scheduler without the knowledge of the first scheduler by modifying the task submission information of the first computing task. That is, the second scheduler can take over the work of the first scheduler without changing the working mechanism of the first scheduler.
  • FIG4 shows a flow chart of a task scheduling method according to an exemplary embodiment of the present application.
  • the method includes:
  • Step 320 During the process of the first scheduler creating the first computing task to the operating system, modify the task submission information of the first computing task through the second scheduler;
  • the task submission information is information related to the submission of the first computing task to the processor for execution.
  • the task submission information before modification is allocated by the operating system.
  • the task submission information includes address information, which is used to indicate the storage location when the first computing task is submitted.
  • the storage location stores a device control bit for the first computing task, which is used to control the start or pause of the first computing task.
  • the processor can be a central processing unit or a hardware acceleration processor. This embodiment uses the hardware acceleration processor as an example for illustration.
  • the second scheduler modifies the task submission information of the first computing task, where the task submission information before the modification is the task submission information assigned to the first computing task by the operating system.
  • the process includes the following steps 322 to 326.
  • Step 322 During the process of creating the first computing task by the first scheduler, obtain first address information allocated by the operating system to the first computing task, where the first address information points to a first storage location in the processor;
  • the processor as a hardware acceleration processor as an example, during the initialization process of the first scheduler creating a first computing task to the operating system, memory mapping (mmap) technology is needed to obtain first address information.
  • the first address information is the address information allocated by the operating system to the first computing task, and the first address information points to the first storage location in the hardware acceleration processor.
  • the second scheduler intercepts the first address information, wherein the first address information includes a first address pointer and a first address length.
  • Step 324 Replace the first address information with second address information, where the second address information points to a target storage location in the system memory;
  • the second scheduler applies to the system memory for a memory page as a masquerading memory page for the first computing task.
  • the masquerading memory page has second address information.
  • the second address information includes a second address pointer and a second address length.
  • the second address length is greater than or equal to the first address length.
  • the second scheduler replaces the first address information with the second address information.
  • Step 326 Save the correspondence between the first computing task, the first priority, the first address information, and the second address information, and return the second address information to the first scheduler.
  • the second scheduler applies for a pseudo-memory page, which impersonates the physical page actually allocated by the operating system. This allows the first scheduler to write the first computing task into the pseudo-memory page requested by the second scheduler when submitting the first computing task. Because the first computing task is not actually written to the real physical page, it does not trigger the execution of the first computing task. This allows the second scheduler to smoothly take over the work of the first scheduler without changing the operating mechanism of the first scheduler.
  • the second scheduler further sets write protection permission for the impersonated memory page applied for the first computing task, that is, sets write protection permission for the second address information.
  • first scheduler creates a second computing task with a second priority
  • steps 322 through 326 a similar process to steps 322 through 326 is also executed.
  • the second scheduler modifies the task submission information assigned by the operating system to the second computing task. In other words, regardless of the priority of the computing task, the actual triggering and submission is completed by the second scheduler.
  • the first scheduler may obtain third address information assigned by the operating system for the second computing task.
  • the third address information points to a second storage location in the (hardware accelerated) processor.
  • the mmap technique may be used to obtain the third address information assigned by the operating system for the second computing task.
  • the third address information points to the second storage location.
  • the second scheduler intercepts the third address information.
  • the third address information includes a third address pointer and a third address length.
  • the second scheduler replaces the third address information with fourth address information, which points to a storage location in system memory.
  • the second scheduler requests a pseudo memory page from the system memory.
  • the pseudo memory page has fourth address information.
  • the fourth address information includes a fourth address pointer and a fourth address length.
  • the fourth address length is greater than or equal to the third address length.
  • the second scheduler stores the correspondence between the second computing task, the second priority, the third address information, and the fourth address information, and returns the fourth address information to the first scheduler.
  • Step 340 During the process of the first scheduler submitting the first computing task to the target storage location based on the task submission information, the second scheduler senses the submission of the first computing task;
  • the second scheduler detects information related to the target storage location and is able to detect the submission of the first computing task.
  • Detecting the submission of the first computing task can be understood as: detecting that the first computing task has been submitted by the first scheduler, or detecting the submission progress of the first computing task.
  • the second scheduler senses the submission of the first computing task in at least three ways, and different embodiments may use any one or at least one of the following:
  • Perception method 1 Perception based on system error information; the system error information is triggered when the first scheduler submits the first computing task to the target storage location;
  • Perception method 2 Perception based on target storage location
  • Perception method three based on control channel perception; computing tasks of the first priority correspond to the first submission channel, and computing tasks of the second priority correspond to the second submission channel.
  • Step 342 Obtain system error information through the second scheduler
  • the second scheduler detects a system error message generated in the operating system.
  • the system error message is a memory page fault.
  • Step 344 When the system error information is triggered by the first scheduler failing to write to the target storage location due to write protection permission when submitting the first computing task to the target storage location through task submission information, the second scheduler senses the submission of the first computing task based on the system error information.
  • the target storage location is write-protected
  • the first scheduler attempts to write to the target storage location using the modified task submission information, it will be unable to write due to the write protection, triggering a memory page fault exception. If the system error information detected by the second scheduler is triggered by the above reason, the second scheduler will be aware of the submission of the first computing task.
  • Perception method 1 cleverly utilizes the memory page fault exception mechanism of the operating system.
  • the second scheduler sets write protection permissions for the second address information in advance. Then, when the first scheduler submits the first computing task, a memory page fault exception is triggered due to the write protection permissions, thereby enabling the second scheduler to perceive the submission timing of the first computing task by the first scheduler in real time.
  • Step 360 pausing the execution of the second computing task when the second scheduler senses the submission of the first computing task, and submitting the first computing task to the processor for execution, wherein the second computing task has a second priority;
  • the second scheduler periodically checks the operating mode bit. If the detection result in the periodic detection is that the current operating mode is the first priority mode, the second scheduler pauses the execution of the second computing task and submits the first computing task to the processor for execution.
  • the first priority mode is set by the second scheduler when the second scheduler senses the submission of the first computing task.
  • the real-time detection logic of the first computing task can be decoupled from the actual submission logic of the first computing task, allowing the two logics to run independently, thereby improving the operational reliability of the overall logic.
  • the periodic detection period is freely configurable and can be changed based on business needs, thus having good business applicability.
  • the second scheduler sets the device control bit of the second computing task to a disable state based on the task submission information of the first computing task, so as to start the operation of the first computing task.
  • the second scheduler stores a correspondence between the first computing task, the first priority, the first address information, and the second address information. Based on the first address information, the second scheduler submits the first computing task to the processor for execution.
  • the second scheduler sets the device control bit of the first computing task to an enable state based on the first address information, thereby triggering the execution of the first computing task.
  • the second scheduler Since the second scheduler pre-saves the first address information assigned by the operating system to the first computing task, the second scheduler can actually submit the first computing task to the GPU/NPU for execution according to its own scheduling needs, thereby realizing the scheduling management of the first priority task (that is, the high priority task) by the second scheduler.
  • the second scheduler sets the device control bit of the second computing task to a disabled state based on the task submission information of the second computing task to suspend the running of the second computing task.
  • the second scheduler stores a correspondence between the second computing task, the second priority, the third address information, and the fourth address information. Based on the third address information, the second scheduler sets the device control bit of the second computing task to a disabled state, thereby suspending the execution of the second computing task.
  • the second scheduler Since the second scheduler pre-saves the third address information assigned by the operating system to the second computing task, the second scheduler can actually pause/suspend/start/resume the second computing task according to its own scheduling needs, thereby realizing the scheduling management of the second priority task (that is, the low priority task) by the second scheduler.
  • This application can be applied to servers that include hardware acceleration processors, and can also be applied in containerized scenarios. By configuring different priorities for different containers, different computing tasks (or services) in multiple containers can be scheduled according to different high and low priorities. Computing tasks in the same container have the same priority.
  • online tasks are high-priority or first-priority computing tasks, while offline tasks are low-priority or second-priority computing tasks.
  • online face recognition tasks require fast computation and high real-time performance.
  • Offline content review tasks require processing to be completed within two days and have lower real-time performance requirements.
  • High-priority computing tasks generally require real-time response and low latency, while low-priority computing tasks generally require high throughput and can be completed within a fixed time.
  • the cloud computing system comprises, from bottom to top, an application layer 52 , a native scheduler layer 54 , a custom scheduler layer 56 , a driver layer 58 and a hardware layer 50 .
  • the application layer 52 includes: K8s program and K8s cluster scheduling algorithm.
  • the native scheduler layer 54 includes: a native K8s scheduler, that is, a first scheduler 53.
  • the native first scheduler 53 can create high-priority and low-priority containers (PODs) respectively, run computing tasks of the same priority in the same POD, and run computing tasks of different priorities in different PODs.
  • the native first scheduler 53 is used to create online POD1 and offline POD2 respectively.
  • the computing tasks deployed in the online POD1 are online tasks or online computing tasks or computing tasks of the first priority or computing tasks of high priority, etc.
  • the computing tasks deployed in the offline POD2 are offline tasks or offline computing tasks or computing tasks of the second priority or computing tasks of low priority, etc., etc.
  • the first scheduler 53 can also create an ordinary POD3.
  • the native computing tasks in the ordinary POD are computing tasks without priority, and the submission method of the ordinary POD3 is different from the submission method of the online POD1 and the offline POD2.
  • the custom scheduling layer 56 includes: an xGPU scheduler, that is, a second scheduler 55.
  • the second scheduler 55 is a newly added scheduler in the embodiment of the present application. Regardless of the high or low priority computing tasks, they are handed over to the second scheduler 55 to complete the actual triggering/submission.
  • the second scheduler 55 checks whether the system is currently in an idle state (or low priority mode or first priority mode); if it is in an idle state, it continues to submit the offline POD to the GPU/NPU for operation; if it is not in an idle state, it pauses or suspends the running offline task as needed.
  • the second scheduler 55 When the online POD is triggered to run, the second scheduler 55 will perceive the task submission of the online POD in real time, immediately pause the running offline POD, and allocate multiple subsequent time slices to the online POD until the online POD is finished running. When the computing task in the online POD is completed, the second scheduler 55 will self-loop for x milliseconds (x is a configurable value). If it is found that no other online POD continues to submit within x milliseconds, it will resume the suspended offline POD and complete the switching between the online POD and the offline POD.
  • x is a configurable value
  • the second scheduler 55 needs to perceive the submission time point of the online POD in real time so as to make a decision on the next action in a timely manner.
  • the driver layer 58 includes: GPU/NPU drivers.
  • the hardware layer 50 includes multiple GPUs/NPUs.
  • Figure 5 shows one GPU/NPU as an example.
  • the scheduling processes of different GPUs/NPUs are the same or similar.
  • step 1 the first scheduler submits an offline task
  • step 2 the second scheduler determines whether it is currently in an idle state. If it is currently in an idle state (i.e., first priority mode or high priority mode), the offline task is submitted to the GPU/NPU for execution
  • step 3 the first scheduler submits an online task
  • the second scheduler senses the submission of the online task and switches the idle state to a non-idle state (i.e., second priority mode or low priority mode)
  • step 4 the second scheduler suspends the offline task
  • step 5 the second scheduler submits the online task to the GPU/NPU for execution.
  • 100% computing power preemption can be set for the online task
  • step 6 after the online task is completed, wait until X milliseconds to switch to the idle state
  • step 7 resume the offline task.
  • Aspect 1 High and low priority configuration of POD/computing tasks
  • FIG6 shows a flow chart of a method for notifying a priority of a POD/computing task provided by an exemplary embodiment of the present application.
  • the method is executed by a central processing unit or a first scheduler.
  • the method includes:
  • users can create a POD by specifying configuration information (such as a YAML file), and then start computing tasks within the POD to complete the calculation of the tasks.
  • configuration information such as a YAML file
  • a user sets a priority tag in the configuration information, which indicates the priority level of the current POD.
  • the priority tag has a first value, it is considered a first priority or high priority tag; when the priority tag has a second value, it is considered a second priority or low priority tag.
  • the first value is 1 and the second value is 0; or the first value is 0 and the second value is 1.
  • Step 601 Is POD the first priority?
  • the first scheduler determines whether the POD has the first priority.
  • the first scheduler searches for the priority tag of the POD in the configuration information. If the first priority tag is found, step 602 is executed; if the second priority tag is found instead of the first priority tag, step 603 is executed.
  • Step 602 The first scheduler notifies the second scheduler of the first priority.
  • the first scheduler notifies the second scheduler of the first priority through an application programming interface (API). If the "echo" command is used to check the priority flag of POD "xxx", the priority value is 1, i.e., echo 1>/x/xGPU/xxx/is_online.
  • API application programming interface
  • Step 603 The first scheduler notifies the second scheduler of the second priority.
  • the first scheduler notifies the second scheduler of the second priority through an API. If the "echo" command is used to check the priority flag of POD "xxx", the priority value is 0, that is, echo 0>/x/xGPU/xxx/is_online.
  • Step 604 The second scheduler saves the priority information of the POD.
  • this embodiment sets a priority mark in the configuration information, so that the first scheduler can obtain the priority information of the POD, and then the first scheduler notifies the second scheduler of the priority information of the POD.
  • the second scheduler can save the priority information of the POD to implement the subsequent priority scheduling process.
  • Aspect 2 The second scheduler pre-fetches task submission information of computing tasks.
  • FIG7 shows a flow chart of a method for prefetching information for a computing task according to an exemplary embodiment of the present application.
  • the method is executed by a first scheduler and a second scheduler.
  • the method includes:
  • Step 701 Obtain task submission information of a computing task.
  • a business process within a POD (the process corresponding to a computing task) runs, it first performs a series of system configurations.
  • One of these configuration operations involves mapping a bar space on a Peripheral Component Interconnect (PCI) device (i.e., the GPU/NPU), allowing the computing task to obtain a pointer and length as task submission information.
  • PCI Peripheral Component Interconnect
  • the pointer points to a starting address within the PCI device allocated for the computing task, and the length indicates the length of the address allocated for the computing task.
  • the PCI device refers to a hardware acceleration processor connected to the PCI bus.
  • Step 702 hijacking system calls and analyzing
  • the second scheduler hijacks the mmap system call and analyzes the mmap call result information returned by mmap, which includes: pointer (addr), length (length), device control bit (flag), and the offset value (offset) of the device control bit relative to the address pointed to by the pointer.
  • the pointer points to the starting position of a storage location in the GPU/NPU, and the length indicates the length of the storage location.
  • the device control bit is stored in the storage location and is used to trigger the start/resume/pause/suspend of the computing task. In this embodiment, pause and suspend can be understood as the same meaning.
  • Hijacking is a technical term in the computer field. In this application, it means that the second scheduler intercepts the call result information returned by mmap and modifies it so that the modified call result information points to another storage location.
  • the second scheduler determines whether the pointer in the mmap call result information points to the Bar space of the GPU/NPU.
  • Step 707 Allocate memory pages.
  • the second scheduler replaces the address information (first address information) returned by mmap with the address information (second address information) of the memory page, and then returns the modified mmap mapping result information to the first scheduler in the user state.
  • the priority of the computing task/POD is the first priority
  • the priority of the computing task/POD is the second priority, there is no need to set write protection permissions for the memory page or set a callback function.
  • the second scheduler uses the address information of the system memory pages instead of the address information returned by the operating system, after the first scheduler submits the computing task using the address information of the system memory pages, it only writes the doorbell message (the message with the device control bit enabled) to these memory pages and does not actually trigger the GPU/NPU to run the computing task.
  • Step 709 Complete the mmap operation and return.
  • Aspect 3 Task scheduling management of the second scheduler.
  • FIG8 shows a flowchart of a task scheduling method based on a hardware acceleration processor according to an exemplary embodiment of the present application.
  • the method is executed by a second scheduler.
  • the method includes:
  • Step 801 Initialize the task queue.
  • the task queue is used to store computing tasks that have not yet been completed.
  • the same POD includes at least one computing task.
  • the second scheduler can obtain the task submission information of each computing task and initialize the task queue based on the task submission information.
  • each hardware acceleration processor corresponds to its own kernel thread, that is, there is a one-to-one correspondence between hardware acceleration processors and kernel threads.
  • the kernel thread is a kernel kthread of the Linux kernel.
  • Step 802 Determine whether to stop.
  • the stop condition is a parameter that the kernel kthread needs to set.
  • the stop condition is set to null, that is, the judgment result of step 802 is always no.
  • Step 803 Determine whether timeout has occurred.
  • the timeout condition is a parameter that the kernel kthread needs to set.
  • the timeout period is set to never time out. That is, the judgment result of step 803 is always no.
  • Step 804 Determine whether the idle time of the online task is less than a configured threshold.
  • the online task is a task of the first priority or a high priority task.
  • the idle time is the accumulated time after the latest online task is submitted.
  • step 805 is executed; if the idle time of the online task is greater than or equal to the configured threshold, step 806 is executed.
  • Step 805 Continue to count the idle time of the online task.
  • the idle time of the online task is measured by a timer.
  • the second scheduler resets the timer when a preset condition is met.
  • the preset condition is that the online task is perceived to be submitted.
  • Step 806 Set the current operating mode to the second priority mode.
  • Step 807 Determine whether the current mode is the first priority mode.
  • step 808 If the current operating mode is the first priority mode, execute step 808 ; if the current operating mode is not the second priority mode, execute step 809 .
  • Step 808 Pause (all) offline tasks
  • the current operation mode is the first priority mode
  • all offline tasks in the task queue are suspended.
  • the second priority computing task is an offline task for example.
  • Step 809 Resume the offline task.
  • the second scheduler restores one or more offline tasks in the task queue according to the scheduling policy of the offline tasks.
  • the embodiment of the present application does not limit the scheduling policy of the offline tasks.
  • Step 810 End this round of iteration.
  • the kernel kthread When the kernel kthread is created, it is assigned a time for each iteration check, such as 1ms. In various embodiments, this time can be smaller, such as just one kernel system clock tick. This time can also be larger and can be dynamically adjusted based on business needs.
  • Aspect 4 Suspension (or suspension) of low-priority tasks.
  • FIG9 shows a flowchart of a method for pausing a low-priority task provided by an exemplary embodiment of the present application.
  • This embodiment takes the method executed by the second scheduler, the high-priority task being an online task, and the low-priority task being an offline task as an example.
  • the method includes:
  • Step 901 Determine whether there are any offline PODs that have not been traversed.
  • the second scheduler traverses all offline PODs.
  • the second scheduler determines whether there are any offline PODs that have not been traversed.
  • An offline POD includes at least one offline task.
  • an offline POD refers to a POD with the second priority
  • an offline task refers to a computing task with the second priority.
  • step 902 If there are any offline PODs that have not been traversed, execute step 902; if all offline PODs have been traversed, exit.
  • the second scheduler obtains a POD that has not been traversed yet as the current POD, and determines whether the current POD has any offline tasks that have not been traversed yet.
  • step 903 is executed; if all offline tasks in the current POD have been traversed, the process returns to step 901.
  • Step 903 Obtain task submission information of the offline task.
  • the second scheduler has pre-saved the correspondence between the offline task, the POD where the offline task is located, the priority of the POD, the third address information, and the fourth address information.
  • the third address information points to a storage location (Bar space) in the GPU/NPU, and the fourth address information points to a storage location in the system memory.
  • Step 904 Write the device control bit of the offline task to the disabled state.
  • Aspect 5 High-priority tasks preempt low-priority tasks.
  • the second scheduler When an offline task is running, if an online task is submitted to the GPU/NPU, triggering a doorbell message, the second scheduler needs to implement the following capabilities:
  • FIG10 shows a flowchart of a method for submitting a native computing task provided by an exemplary embodiment of the present application.
  • the method is executed by a first scheduler and includes:
  • Step 1001 Read the task submission information of the native computing task.
  • the first scheduler reads the task submission information of the native computing task to obtain the real address information obtained by mmap during initialization. This real address information points to the address information within the GPU/NPU.
  • Step 1002 triggering a doorbell message based on the task submission information.
  • the device control bit of the native computing task is stored in the storage location indicated by the real address information.
  • the device control bit When the device control bit is set to an enabled state, it indicates that the native computing task is running; when the device control bit is set to a disabled state, it indicates that the native computing task is paused or suspended.
  • Setting the device control bit to the enabled state can be considered as triggering a doorbell message.
  • the first scheduler sets the device control bit to the enabled state through a memory-mapped input/output (MMIO) write operation, thereby triggering the doorbell message corresponding to the native computing task.
  • MMIO memory-mapped input/output
  • the GPU/NPU contains a PCI Bar space mapping task control module.
  • the PCI Bar space mapping task control module runs the native compute task. This task submission process does not require driver involvement, thus achieving better performance.
  • the first scheduler when the first scheduler submits the online task, it will perform an MMIO write operation in the same manner as FIG10 to trigger the doorbell message.
  • FIG11 shows a flowchart of a method for submitting an online task (high-priority task) provided by an exemplary embodiment of the present application. This embodiment is illustrated by taking the method as an example where the method is executed by a first scheduler and a second scheduler, the high-priority task is an online task, and the low-priority task is an offline task.
  • the method includes:
  • Step 1101 Read the task submission information of the online task.
  • the first scheduler reads the task submission information of the task, thereby obtaining the second address information of the impersonated memory page obtained by mmap during initialization.
  • the second address information is modified by the second scheduler and points to a memory page in the system memory.
  • Step 1102 trigger a doorbell message based on the second address information.
  • the write protection permission will cause the triggering system error message to be unable to be written.
  • Step 1103 A system error message is triggered due to write protection permission.
  • This system error message is a memory page fault message. This memory page fault message is triggered because the write permission cannot be written.
  • Step 1104 Analyze system error information.
  • the second scheduler monitors system error information. After detecting a system error message, it analyzes the system error message. For example, if the system error message is a memory page fault message, the address to which the memory page fault message is to be written and the type of the write instruction are determined through analysis.
  • Step 1105 Whether it is a doorbell triggering message
  • the second scheduler determines whether the write operation is to trigger a doorbell message based on the address to which the memory page fault information is to be written and the type of the write instruction.
  • step 1106 is executed; if the doorbell message is not to be triggered, the system error message is ignored and the operating system executes the original process.
  • Step 1106 Call the callback function.
  • vma is the abbreviation of the kernel's user space management data structure (struct vm_area_struct).
  • the callback function is used to set the current operating mode to the first priority mode (ie, high priority mode) when the second scheduler senses that a computing task of the first priority is submitted.
  • Step 1107 Set the idle time of the online task to zero, and set the current operation mode to the first priority mode.
  • This callback function is used to update the current operating mode of the second scheduler. On the one hand, it sets the current operating mode to the first priority mode; on the other hand, it resets the idle time of the first priority task to zero, so as to trigger the second scheduler to perform step 804 and subsequent steps in Figure 8.
  • Step 1108 Write the device control bit of the online task to the enabled state through the first address information.
  • the second scheduler performs an MMIO write operation using the first address information, enabling the device control bit of the online task. This writes the doorbell message for the online task to the actual physical page of the Bar space in the GPU/NPU, completing the doorbell triggering operation in the online task submission process.
  • the GPU/NPU contains a PCI Bar control mapping task control module.
  • the PCI Bar control mapping task control module will run the online task.
  • Aspect 6 submission of low-priority tasks.
  • FIG12 shows a flowchart of a method for submitting an offline task (low priority task) according to an exemplary embodiment of the present application.
  • the method is executed by a first scheduler and includes:
  • Step 1220 Read the task submission information of the offline task.
  • the first scheduler reads the task submission information of the offline computing task, thereby obtaining the fourth address information obtained by mmap during initialization, where the fourth address information points to the spoofed memory page in the system memory.
  • the first scheduler is unaware of the process in which the second scheduler replaces the third address information with the fourth address information. Therefore, the first scheduler will perform the MMIP write operation according to the fourth address information it has saved.
  • Step 1240 Trigger a doorbell message based on the fourth address information.
  • the fourth address information points to a fake memory page in the system memory, rather than an actual memory page in the GPU/NPU, it does not trigger a real doorbell message.
  • the offline task is not actually submitted to the GPU/NPU for execution.
  • the GPU/NPU starts running or resumes running, which is completed by the second scheduler based on the third address information.
  • FIG13 shows a block diagram of a task scheduling device according to an exemplary embodiment of the present application, the device comprising: a first scheduler module 1320 and a second scheduler module 1340;
  • the second scheduler module 1340 is configured to modify task submission information of the first computing task during the process of the first scheduler module 1320 creating the first computing task, the first computing task having a first priority;
  • the second scheduler module 1340 is used to perceive the submission of the first computing task during the process of the first scheduler module 1320 submitting the first computing task based on the modified task submission information; wherein, perceiving the submission of the first computing task can be understood as: perceiving that the first computing task is submitted by the first scheduler module, or perceiving the submission progress of the first computing task.
  • a second scheduler module 1340 is configured to suspend the execution of the second computing task and submit the first computing task to the processor for execution, wherein the second computing task has a second priority;
  • the first priority is higher than the second priority.
  • the task submission information points to a target storage location specified by the second scheduler module 1340 ;
  • the second scheduler module 1340 is configured to sense submission of the first computing task when the first scheduler module 1320 submits the first computing task to the target storage location based on the task submission information.
  • the target storage location specified by the second scheduler module 1340 is set with write protection permissions
  • the second scheduler module 1340 is used to obtain system error information; when the system error information is triggered by the first scheduler module 1320 submitting the first computing task to the target storage location based on the task submission information but failing to write due to write protection permission, the second scheduler module 1340 senses the submission of the first computing task.
  • the second scheduler module 1340 is configured to modify task submission information of the first computing task during the process of the first scheduler module 1320 creating the first computing task to the operating system, where the task submission information before the modification is assigned by the operating system to the first computing task;
  • the modified task submission information is used to submit the first computing task to the target storage location specified by the second scheduler module 1340 .
  • the second scheduler module 1340 is used to obtain the first address information assigned by the operating system to the first computing task during the process of the first scheduler module 1320 creating the first computing task, the first address information pointing to the first storage location in the processor; replace the first address information with the second address information, the second address information pointing to the target storage location in the system memory; save the correspondence between the first computing task, the first priority, the first address information and the second address information, and return the second address information to the first scheduler module 1320.
  • the second scheduler module 1340 is further configured to set write protection permissions for the second address information.
  • the second scheduler module 1340 is further configured to, when the detection result in the periodic detection is that the current operation mode is the first priority mode, suspend the execution of the second computing task and submit the first computing task to the processor for execution;
  • the first priority mode is set by the second scheduler module 1340 when it senses the submission of the first computing task.
  • the second scheduler module 1340 is further configured to set the current task mode to the first priority mode and reset the idle timer of the first priority task to zero upon sensing the submission of the first computing task.
  • the second scheduler module 1340 is also used to set the current task mode to the second priority mode when the idle time corresponding to the idle timer of the first priority task reaches a preset threshold.
  • the low priority mode is used to trigger or resume the operation of the second computing task.
  • the second scheduler module 1340 is further configured to set the device control bit of the second computing task to a disabled state based on the task submission information of the second computing task through the second scheduler to suspend the operation of the second computing task.
  • the second scheduler module 1340 is further configured to notify the second scheduler module 1340 of the first priority of the first computing task and the second priority of the second computing task through the first scheduler module 1320 .
  • FIG14 shows a block diagram of a computer device 1400 provided in an exemplary embodiment of the present application.
  • the computer device includes a processor 1420 and a memory 1440 .
  • At least one computer-readable instruction is stored in the memory 1440.
  • the processor 1420 is configured to execute the at least one computer-readable instruction in the memory 1440 to implement the task scheduling method described above.
  • the processor used to perform computing tasks is processor 1420.
  • the computer device further includes a hardware acceleration processor 1460, which is connected to the processor 1420 via a PCI bus.
  • the processor 1420 is used to execute the task scheduling method, and the hardware acceleration processor 1460 is used to execute the computing task.
  • a chip is further provided.
  • the chip includes a programmable logic circuit and/or program instructions. When the chip runs on a computer device, it is used to implement the task scheduling method described in the above aspects.
  • a computer program product comprising computer-readable instructions stored in a non-volatile computer-readable storage medium.
  • a processor of a computer device reads the computer-readable instructions from the computer-readable storage medium and executes the computer-readable instructions, causing the computer device to perform the task scheduling methods provided in the above-described method embodiments.
  • a non-volatile computer-readable storage medium which stores at least one computer-readable instruction.
  • the computer-readable instruction is loaded and executed by a processor of a computer device, the task scheduling method provided by the above-mentioned method embodiments is implemented.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种任务调度方法,包括:在第一调度器创建第一计算任务的过程中,通过第二调度器修改第一计算任务的任务提交信息,第一计算任务具有第一优先级(220);在第一调度器基于修改后的任务提交信息提交第一计算任务的过程中,通过第二调度器感知第一计算任务的提交(240);通过第二调度器感知到第一计算任务的提交的情况下,暂停第二计算任务的运行,以及提交第一计算任务至处理器运行,第二计算任务具有第二优先级(260);其中,第一优先级高于第二优先级。

Description

任务调度方法、装置、设备、存储介质和程序产品
本申请要求于2024年03月11日提交中国专利局,申请号为202410279265.3,申请名称为“任务调度方法、装置、设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及云服务器领域,特别涉及一种任务调度方法、装置、设备及介质。
背景技术
目前的人工智能(Artificial Intelligence,AI)任务通过图形处理器(Graphics Processing Unit,GPU)或神经网络处理器(Neural Network Processing Unit,NPU)之类的硬件加速处理器来执行。
一些技术中,GPU/NPU的计算时间被划分为不同的时间片。当不同的计算任务被提交至GPU/NPU后,由基于时间片的调度器按照不同的计算任务的提交顺序依次运行各个计算任务。
但是由于不同计算任务对实时性的要求不同,上述调度方法不能满足对实时性要求较高的计算任务的需求,影响了对实时性要求较高的计算任务的服务质量。
发明内容
根据本申请的各种实施例,提供了一种任务调度方法,所述方法包括:
在第一调度器创建第一计算任务的过程中,通过第二调度器修改所述第一计算任务的任务提交信息,所述第一计算任务具有第一优先级;
在所述第一调度器基于所述任务提交信息提交所述第一计算任务的过程中,通过所述第二调度器感知所述第一计算任务的提交;
在通过所述第二调度器感知到所述第一计算任务的提交的情况下,暂停第二计算任务的运行,以及提交所述第一计算任务至处理器运行,所述第二计算任务具有第二优先级;
其中,所述第一优先级高于所述第二优先级。
提供一种任务调度装置,所述装置包括:第一调度器模块和第二调度器模块;
所述第二调度器模块,用于在所述第一调度器模块创建第一计算任务的过程中,修改所述第一计算任务的任务提交信息,所述第一计算任务具有第一优先级;
所述第二调度器模块,用于在所述第一调度器模块基于所述任务提交信息提交所述第一计算任务的过程中,感知所述第一计算任务的提交;
所述第二调度器模块,用于在感知到所述第一计算任务的提交的情况下,暂停第二计算任务的运行,以及提交所述第一计算任务至处理器运行,所述第二计算任务具有第二优先级;
其中,所述第一优先级高于所述第二优先级。
提供一种计算机设备,所述计算机设备包括:处理器、存储器和硬件加速处理器,所述存储器中存储有至少一段计算机可读指令;所述处理器,用于执行所述存储器中的所述至少一段计算机可读指令以实现如上方面所述的任务调度方法。
提供一种非易失性的计算机可读存储介质,所述计算机可读存储介质中存储有计算机可读指令,所述计算机可读指令由处理器加载并执行以实现如上方面所述的任务调度方法。
提供一种计算机程序产品,所述计算机程序产品包括计算机可读指令,所述计算机可读指令存储在计算机可读存储介质中,计算机设备的处理器从所述计算机可读存储介质读取并执行所述计算机可读指令,以实现如上方面所述的任务调度方法。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征、目的和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一些实施例提供的计算机设备的结构框图;
图2是本申请一些实施例提供的任务调度方法的流程图;
图3是本申请一些实施例提供的修改前后的任务提交信息的指向示意图;
图4是本申请一些实施例提供的任务调度方法的流程图;
图5是本申请一些实施例提供的云计算系统的架构示意图;
图6是本申请一些实施例提供的计算任务的优先级通知方法的流程图;
图7是本申请一些实施例提供的计算任务的信息预取方法的流程图;
图8是本申请一些实施例提供的任务调度方法的流程图;
图9是本申请一些实施例提供的第二优先级任务的暂停方法的流程图;
图10是本申请一些实施例提供的原生计算任务的任务提交方法的流程图;
图11是本申请一些实施例提供的在线任务(高优先级任务或第一优先级任务)的任务提交方法的流程图;
图12是本申请一些实施例提供的离线任务(低优先级任务或第二优先级任务)的任务提交方法的流程图;
图13是本申请一些实施例提供的任务调度装置的框图;
图14是本申请一些实施例提供的计算机设备的框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
Kubernetes是一个开源的容器编排引擎,用来对容器化应用进行自动化部署、扩缩和管理。Kubernetes简称为K8s。
容器是一种沙盒技术,主要目的是为了将应用运行在其中,与外界隔离;以及方便这个沙盒可以被转移到其它宿主机器。
处理器:是计算机设备中执行计算任务的单元。处理器可分为中央处理器(Central Processing Unit,CPU)、加速处理器(AcceleratedProcessingUnit,APU)、神经网络处理器(NPU,Neural Processing Unit)、深度学习处理器(DeeplearningProcessingUnit,DPU)、浮点计算器(Floating Processing Unit,FPU)、全息图像处理器(HolographicProcessingUnit,HPU)、智能处理器(Intelligence Processing Unit,IPU)、张量处理器(TensorProcessingUnit,TPU)、矢量处理器(VectorProcessngUnit,VPU)、智能云加速处理器中的至少一种。
硬件加速处理器:是除CPU之外,针对某种运算类型具有加速运算特性的处理器。硬件加速处理器可以是上述GPU、NPU、DPU、FPU、HPU、IPU、TPU、VPU、智能云加速处理器中的至少一种。
图1示出了本申请一个示例性实施例的计算机设备100的框图。该计算机设备100包括:中央处理器120、系统内存140和至少一个硬件加速处理器160。
中央处理器120用于创建和调度各种计算任务。不同的计算任务可以具有不同的优先级。中央处理器120中运行有第一调度器122和第二调度器124。调度器使用不同的调度策略来决定哪个任务应该获得计算资源(如CPU、GPU或NPU)的时间片以及何时获得。其中,第一调度器122是原生的任务调度器,比如K8s系统中原生提供的任务调度器;第二调度器124是本申请新增加的自定义的任务调度器。第一调度器122不具有基于优先级调度计算任务的能力,第二调度器124具有基于优先级调度计算任务的能力。本申请中,在不需要大幅度修改第一调度器122的工作机制的情况下,第二调度器124可以接管第一调度器122向操作系统提交的计算任务,由第二调度器124重新基于优先级高低来调度各个计算任务。可选地,计算机设备100上运行有操作系统,该操作系统包括内核层和应用层。第一调度器122是位于应用层的调度器,第二调度器124是位于应用层或内核层的调度器。
系统内存140,用于提供中央处理器120运行过程中所需的内存空间。系统内存140是存储器的一种。存储器还可以包括闪存、硬盘等其他形式的存储器。
至少一个硬件加速处理器160,用于以硬件加速方式运行各个计算任务。该硬件加速处理器160可以是GPU或NPU。该计算任务可以是与人工智能(Artificial Intelligence,AI)有关的计算任务,例如人脸识别任务、基于自然语言处理的问答任务等。
该计算机设备100可以实现成为云计算中的服务器。服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器。终端可以是智能手机、平板电脑、笔记本电脑、台式计算机、智能音箱、智能手表等,但并不局限于此。终端以及服务器可以通过有线或无线通信方式进行直接或间接地连接,本申请在此不做限制。
本申请实施例提供了一种任务调度方法,能够按照优先级高低来对多个计算任务进行调度。当高优先级的计算任务运行时,允许实时抢占低优先级的计算任务,并完全占用时间片;当高优先级的计算任务空闲时,释放时间片给低优先级的计算任务,从而实现不同优先级的计算任务的混合部署。其中,高优先级的计算任务可简称为高优先级任务,低优先级的计算任务可简称为低优先级任务。
图2示出了本申请一些示例性实施例的任务调度方法的流程图。该方法可以由上述计算机设备100中的中央处理器120执行。比如由中央处理器120中运行的第一调度器和第二调度器来协同执行。该方法包括:
步骤220:在第一调度器创建第一计算任务的过程中,通过第二调度器修改第一计算任务的任务提交信息,第一计算任务具有第一优先级;
第一调度器具有创建计算任务和提交计算任务的能力。创建计算任务的能力是指初始化生成一个计算任务的能力。提交计算任务的能力是指将计算任务提交给处理器运行的能力。该处理器可以是中央处理器,也可以是硬件加速处理器,本实施例中以硬件加速处理器为例。在一些实施例中,第一调度器是硬件加速计算系统的原生调度器,以硬件加速计算系统是K8s为例,第一调度器是K8s提供的原生调度器。第一调度器不具有按照优先级调度计算任务的能力。可选地,第一调度器具有按照时间片调度计算任务的能力。
第一计算任务的任务提交信息是与第一计算任务提交至处理器运行有关的信息。可选地,第一计算任务的任务提交信息包括地址信息,该地址信息用于指示用于控制第一计算任务的控制信息的存储位置。可选地,该存储位置存储有第一计算任务的设备控制位,该设置控制位用于控制第一计算任务的开启或暂停。
第二调度器是本实施例新增的自定义的调度器。第二调度具有按照优先级调度计算任务的能力。可选地,为了避免第一调度器直接将第一计算任务提交至处理器运行,第二调度器需要修改第一计算任务的任务提交信息。修改后的任务提交信息指向第二调度器指定的目标存储位置。可选地,修改后的任务提交信息指向第二调度器指定的系统内存中的目标存储位置。可选地,该目标存储位置存储有第一计算任务的设备控制位。
其中,第一计算任务具有第一优先级。第一优先级高于第二优先级。也即,第一优先级为高优先级,第二优先级为低优先级。在一些实施例中,优先级可能有三个以上,第一优先级和第二优先级可理解为三个以上优先级中的任意两个优先级。
步骤240:在第一调度器基于修改后的任务提交信息提交第一计算任务的过程中,通过第二调度器感知第一计算任务的提交;
由于任务提交信息是被第二调度器修改后的任务提交信息,在第一调度器基于修改后的任务提交信息提交第一计算任务的过程中,通过第二调度器感知第一计算任务的提交。也即,第二调度器能够实时感知到第一计算任务的提交或第一计算任务被提交或第一计算任务的提交进度。
步骤260:在通过第二调度器感知到所述第一计算任务的提交的情况下,暂停第二计算任务的运行,以及提交第一计算任务至处理器运行,第二计算任务具有第二优先级;
在第二调度器感知到第一计算任务的提交时,暂停第二计算任务的运行,以及提交第一计算任务至处理器运行。
其中,第一计算任务具有第一优先级,第二计算任务具有第二优先级,第一优先级高于第二优先级。
综上所述,本实施例提供的方法,由于第一调度器不具有基于优先级来调度计算任务的能力,通过在原生的第一调度器基础上增加第二调度器,第二调度器具有基于优先级调度计算任务的能力。在原生的第一调度器不需要大幅度修改的情况下,通过第二调度器修改第一计算任务的任务提交信息,第一调度器就可以按照原有流程、基于修改后的任务提交信息所指定的目标存储位置,将第一计算任务提交至目标存储位置,此时第二调度器就可以感知到第一计算任务的提交,第二调度器再接管第一计算任务的实际任务提交过程,暂停低优先级的第二计算任务的运行,从而借由第二调度器实现高优先级的计算任务被优先运行,低优先级的计算任务被暂停运行,能够满足对实时性要求较高的计算任务的计算需求,可以提高对实时性要求较高的计算任务的服务质量,也显著提升了对计算机设备的计算资源的利用率,实现资源充分利用,减少资源浪费。
在一个示例中,结合参考图3,修改前的任务提交信息是由操作系统为第一计算任务分配的。修改前的任务提交信息指向操作系统为第一计算任务分配的第一存储位置,比如,该第一存储位置位于硬件加速处理器160中;修改后的任务提交信息指向第二调度器指定的目标存储位置,比如,该目标存储位置位于系统内存140中。
在第一调度器通过修改后的任务提交信息,将第一计算任务提交至目标存储位置的过程中,通过第二调度器可以感知第一计算任务的提交(或被提交或提交进度)。其中,此时被提交的第一计算任务并不会触发运行,在第二调度器将第一计算任务实际提交至处理器时,才会触发运行第一计算任务。
上述过程中,第二调度器通过修改第一计算任务的任务提交信息,能够在第一调度器不知情的情况下,由第二调度器来接管第一调度器的工作,也就是,,能够在不改动第一调度器的工作机制的情况下,由第二调度器来接管第一调度器的工作。
图4示出了本申请一个示例性实施例的任务调度方法的流程图。该方法包括:
步骤320:在第一调度器向操作系统创建第一计算任务的过程中,通过第二调度器修改第一计算任务的任务提交信息;
任务提交信息是与第一计算任务提交至处理器运行有关的信息。修改前的任务提交信息由操作系统来分配。可选地,任务提交信息包括地址信息,该地址信息用于指示第一计算任务提交时的存储位置。可选地,该存储位置存储有第一计算任务的设备控制位,该设置控制位用于控制第一计算任务的开启或暂停。该处理器可以是中央处理器,也可以是硬件加速处理器,本实施例以该处理器是硬件加速处理器来举例说明。
为了避免第一调度器直接将第一计算任务提交至处理器运行,第二调度器会修改第一计算任务的任务提交信息,修改前的任务提交信息是操作系统为第一计算任务分配的。可选地,该过程包括如下步骤322至步骤326。
步骤322:在第一调度器创建第一计算任务的过程中,获取操作系统为第一计算任务分配的第一地址信息,第一地址信息指向处理器中的第一存储位置;
以处理器为硬件加速处理器为例,在第一调度器向操作系统创建第一计算任务的初始化过程中,需要使用内存映射(memory-mapped,mmap)技术来获取第一地址信息,该第一地址信息是操作系统为第一计算任务分配的地址信息,该第一地址信息指向硬件加速处理器中的第一存储位置。
在操作系统向第一调度器返回第一地址信息时,第二调度器截取该第一地址信息。该第一地址信息包括第一地址指针和第一地址长度。
步骤324:将第一地址信息替换为第二地址信息,第二地址信息指向系统内存中的目标存储位置;
第二调度器针对该第一计算任务,向系统内存申请一个内存页作为冒充内存页,该冒充内存页具有第二地址信息。该第二地址信息包括第二地址指针和第二地址长度。可选地,第二地址长度大于或等于第一地址长度。
第二调度器将第一地址信息替换为第二地址信息。
步骤326:保存第一计算任务、第一优先级、第一地址信息和第二地址信息之间的对应关系,以及将第二地址信息返回给第一调度器。
其中,第二调度器通过申请一个冒充内存页,该冒充内存页用于冒充操作系统实际分配到物理页,可以使得第一调度器在提交第一计算任务时,将第一计算任务写入第二调度器申请的冒充内存页中。由于第一计算任务并未实际写入到真实的物理页中,因此不会触发运行第一计算任务。从而在不改变第一调度器的工作机制的情况下,顺利地由第二调度器来接管第一调度器的工作。
可选地,由于第一计算任务的优先级为第一优先级,第二调度器还为针对该第一计算任务申请的冒充内存页,设置写保护权限,也即为第二地址信息设置写保护权限。
需要说明的是,在通过第一调度器创建具有第二优先级的第二计算任务时,也会执行与步骤322至步骤326类似的流程。也即,在第一调度器向操作系统创建第二计算任务的过程中,通过第二调度器修改操作系统为第二计算任务分配的任务提交信息。也就是说,不论高低优先级的计算任务,均通过第二调度器来完成实际的触发和提交。
可选地,在第一调度器创建第二计算任务的过程中,第一调度器可以获取操作系统为第二计算任务分配的第三地址信息,第三地址信息指向(硬件加速)处理器中的第二存储位置。可选地,在第一调度器向操作系统创建第二计算任务的初始化过程中,需要使用mmap技术来获取操作系统为第二计算任务分配的第三地址信息,该第三地址信息指向第二存储位置。在操作系统向第一调度器返回第三地址信息时,第二调度器截取该第三地址信息。该第三地址信息包括第三地址指针和第三地址长度。第二调度器将第三地址信息替换为第四地址信息,第四地址信息指向系统内存中的一个存储位置。第二调度器针对该第二计算任务,向系统内存申请一个冒充内存页,该冒充内存页具有第四地址信息。该第四地址信息包括第四地址指针和第四地址长度。可选地,第四地址长度大于或等于第三地址长度。第二调度器保存第二计算任务、第二优先级、第三地址信息和第四地址信息之间的对应关系,以及将第四地址信息返回给第一调度器。
需要说明的是,对于具有第二优先级的第二计算任务,无需通过第二调度器为针对第二计算任务申请的冒充内存页设置写保护权限,也即无需为第四地址信息设置写保护权限。
步骤340:在第一调度器基于任务提交信息将第一计算任务提交至目标存储位置的过程中,通过第二调度器感知第一计算任务的提交;
由于目标存储位置是第二调度器指定的存储位置,第二调度器对目标存储位置相关的信息进行检测,能够感知第一计算任务的提交。其中,感知第一计算任务的提交,可理解为:感知第一计算任务被第一调度器提交,或,感知第一计算任务的提交进度。
第二调度器感知第一计算任务的提交,至少存在三种感知方式,不同实施例可以使用任意一种或至少一种:
感知方式一:基于系统错误信息感知;该系统错误信息是第一调度器向目标存储位置提交第一计算任务时触发的;
感知方式二:基于目标存储位置感知;
感知方式三:基于控制通道感知;第一优先级的计算任务对应第一提交通道,第二优先级的计算任务对应第二提交通道。
针对感知方式一,可选包括如下步骤:
步骤342:通过第二调度器获取系统错误信息;
第二调度器检测操作系统中生成的系统错误信息。可选地,该系统错误信息是内存缺页异常(page fault)。
步骤344:在系统错误信息是第一调度器通过任务提交信息将第一计算任务提交至目标存储位置时因写保护权限无法写入触发的情况下,通过第二调度器根据系统错误信息感知第一计算任务的提交。
由于目标存储位置被设置了写保护权限,当第一调度器通过修改后的任务提交信息向目标存储位置写入信息时,会因写保护权限无法写入触发内存缺页异常。若第二调度器检测到的系统错误信息是因上述原因触发的,则第二调度器感知到第一计算任务的提交。
感知方式一巧妙地利用了操作系统的内存缺页异常机制,由第二调度器预先为第二地址信息设置写保护权限,然后第一调度器在提交第一计算任务时因写保护权限触发内存缺页异常,从而实现第二调度器实时感知到了第一调度器对第一计算任务的提交时机。
针对感知方式二,第二调度器可以周期性检测目标存储位置内与第一计算任务对应的设备控制位的状态(使能或去使能)。当第一调度器向目标存储位置提交第一计算任务时,会把第一计算任务对应的设备控制位修改为使能状态,使能状态代表运行第一计算任务。若第二调度器监测到第一计算任务对应的设备控制位被修改为第一取值,则感知到第一调度器向目标存储位置提交第一计算任务。
针对感知方式三,可预先为第一优先级的计算任务设计第一提交通道(比如第一提交函数接口),预先为第二优先级的计算任务设计第二提交通道(比如第二提交函数接口),第二调度器可以通过对第一提交通道的监测来感知第一计算任务的提交。
需要说明的是,感知方式二和感知方式三中无需通过第二调度器为第二地址信息指向的目标存储位置设置写保护权限,否则第一调度器无法向目标存储位置写入信息。
步骤360:在通过第二调度器感知到第一计算任务的提交的情况下暂停第二计算任务的运行,以及提交第一计算任务至处理器运行,第二计算任务具有第二优先级;
若此时还存在至少一个第二计算任务未运行完毕,则第二调度器暂停所有的第二计算任务的运行,以及提交第一计算任务至处理器运行。从而实现第一计算任务抢占了第二计算任务的时间片,得到优先运行。
在一些实施例中,第二调度器设置有一个运行模式位(或称运行状态),该运行模式位用于指示第一优先级模式(也称高优先级模式)和第二优先级模式(也称低优先级模式)中的一种。在感知到第一计算任务的提交时,将该运行模式位设置为第一优先级模式;在第一计算任务运行完毕的时长达到预设时长且预设时长内不存在具有第一优先级(或更高优先级)的其它计算任务被提交的情况下,将该运行模式位设置为第二优先级模式。
第二调度器会周期性检测该运行模式位。在周期性检测中的本次检测结果为当前运行模式是第一优先级模式的情况下,通过第二调度器暂停第二计算任务的运行,以及提交第一计算任务至处理器运行。
其中,第一优先级模式是第二调度器在感知到第一计算任务的提交时设置的。
通过设置运行模式位,可以将第一计算任务的实时感知逻辑和第一计算任务的实际提交逻辑解耦,两个逻辑分别独立运行,从而提高整体逻辑的运行可靠性。而且上述周期性检测的周期可以自由配置,可以基于业务需求来实际改变,因此具有较好的业务适用性。
在一些实施例中,在第二调度器感知到第一计算任务的提交时,设置当前任务模式为第一优先级模式,以及复位第一优先级的任务空闲计时器为零。在第一优先级的任务空闲计时器对应的空闲时间达到预设阈值的情况下,设置当前任务模式为第二优先级模式,第二优先级模式用于触发或恢复第二计算任务的运行。
其中,预设阈值可以减少第一优先级模式和第二优先级模式之间的频繁切换,避免离线任务(低优先级任务)刚被恢复时又被挂起,浪费计算资源和增加不必要的耗时。
第一计算任务的提交:
第二调度器基于第一计算任务的任务提交信息,将第二计算任务的设备控制位设置为去使能(disable)状态,以开启第一计算任务的运行。
第二调度器保存有第一计算任务、第一优先级、第一地址信息和第二地址信息之间的对应关系。基于第一地址信息,第二调度器将第一计算任务提交至处理器运行。
可选地,第二调度器基于第一地址信息,将第一计算任务的设备控制位设置为使能(enable)状态,从而触发第一计算任务的运行。
由于第二调度器预先保存有操作系统为第一计算任务分配的第一地址信息,因此第二调度器可以根据自己的调度需求来实际提交第一计算任务至GPU/NPU运行,从而实现了第二调度器对第一优先级任务(也即高优先级任务)的调度管理。
第二计算任务的暂停:
第二调度器基于第二计算任务的任务提交信息,将所述第二计算任务的设备控制位设置为去使能状态,以暂停第二计算任务的运行。
第二调度器保存有第二计算任务、第二优先级、第三地址信息和第四地址信息之间的对应关系。基于第三地址信息,第二调度器将第二计算任务的设备控制位设置为去使能状态,从而暂停第二计算任务的运行。
由于第二调度器预先保存有操作系统为第二计算任务分配的第三地址信息,因此第二调度器可以根据自己的调度需求来实际暂停/挂起/开启/恢复第二计算任务,从而实现了第二调度器对第二优先级任务(也即低优先级任务)的调度管理。
本申请能应用到包括硬件加速处理器的服务器中,也可以应用在容器化的场景下,通过给不同的容器配置不同的优先级,从而实现多个容器中不同的计算任务(或业务)按照不同的高低优先级进行调度。同一个容器中的计算任务具有相同优先级。
在一个示例性的应用场景中,在线任务为高优先级或第一优先级的计算任务,离线任务为低优先级或第二优先级的计算任务。比如,在线的人脸识别任务,要求快速计算完成,对实时性要求较高。离线的内容审核任务,要求2天内处理完成,对实时性要求较低。高优先级的计算任务一般具有实时响应、要求低延迟等特点,低优先级的计算任务一般要求高吞吐量、固定时间内完成即可。
图5示出了本申请一个示例性实施例的云计算系统的架构示意图。该云计算系统由低到高包括:应用层52、原生调度器层54、自定义调度器层56、驱动层58和硬件层50。
应用层52包括:K8s程序、以及K8s集群调度算法。
原生调度器层54包括:原生的K8s调度器,也即第一调度器53。该原生的第一调度器53能够分别创建高优先级和低优先级的容器(POD),同一POD内运行相同优先级的计算任务,不同POD内运行不同优先级的计算任务。比如,通过原生的第一调度器53分别创建在线POD1和离线POD2,在线POD1内部署的计算任务为在线任务或在线计算任务或第一优先级的计算任务或高优先级的计算任务等类似概念,离线POD2内部署的计算任务为离线任务或离线计算任务或第二优先级的计算任务或低优先级的计算任务等类似概念。可选地,该第一调度器53还能创建普通POD3,该普通POD内的原生计算任务是不具有优先级的计算任务,该普通POD3的提交方式与在线POD1和离线POD2的提交方式不同。
自定义调度层56包括:xGPU调度器,也即第二调度器55。第二调度器55是本申请实施例新增加的调度器。不论高低优先级的计算任务,均交给第二调度器55来完成实际的触发/提交。当离线POD触发运行时,第二调度器55检查系统当前是否为空闲(idle)态(或称低优先级模式或第一优先级模式);如果是空闲态,则继续提交离线POD到GPU/NPU运行;如果不是空闲态,则按需暂停或挂起正在运行的离线任务。当在线POD触发运行时,第二调度器55会实时感知该在线POD的任务提交,立即暂停正在运行的离线POD,并把后续的多个时间片均分配给该在线POD,直至该在线POD运行完毕。当该在线POD内的计算任务被运行完毕后,第二调度器55会自循环x毫秒(x为可配置值),发现x毫秒内都没有其它在线POD继续提交的情况下,则重新恢复被暂停的离线POD,完成在线POD和离线POD之间的切换。
其中,第二调度器55需要实时地感知在线POD的提交时间点,以便及时决策下一步行为。
驱动层58包括:GPU/NPU的驱动程序。
硬件层50包括:多个GPU/NPU。图5中示出一个GPU/NPU作为示例。不同GPU/NPU的调度过程相同或类似。
在一个典型的例子中,步骤①:第一调度器提交离线任务;步骤②:第二调度器确定当前是否为空闲状态,若当前是空闲态(也即第一优先级模式或高优先级模式),则将离线任务提交至GPU/NPU中运行;步骤③:第一调度器提交在线任务;第二调度器感知到该在线任务的提交,将空闲态切换为非空闲态(也即第二优先级模式或低优先级模式);步骤④:第二调度器暂停离线任务;步骤⑤:第二调度器将在线任务提交至GPU/NPU中运行,此时可以为在线任务设置100%算力抢占;步骤⑥:在线任务完成后,等到X毫秒后切换为空闲态;步骤⑦:恢复离线任务。
下面采用不同方面来分别介绍上述过程。
方面1:POD/计算任务的高低优先级配置;
图6示出了本申请一个示例性实施例提供的POD/计算任务的优先级通知方法的流程图。该方法由中央处理器或第一调度器执行。该方法包括:
在K8s场景中,用户可以通过指定配置信息(比如yaml文件)的方式完成POD的创建,然后在POD内启动计算任务,以完成计算任务的计算。
在一些实施例中,由用户在配置信息中设置优先级标记,该优先级用于指示当前POD的优先级等级。该优先级标记为第一取值时,视为第一优先级或高优先级标记;该优先级标记为第二取值时,视为第二优先级或低优先级标记。其中,第一取值为1,第二取值为0;或者,第一取值为0,第二取值为1。
步骤601:POD是否为第一优先级.
第一调度器判断POD是否为第一优先级。
第一调度器在配置信息中查找POD的优先级标记。在查找到第一优先级标记的情况下,执行步骤602;在未查找到第一优先级而是查找到第二优先级标记的情况下,执行步骤603。
步骤602:第一调度器向第二调度器通知第一优先级。
可选地,第一调度器通过应用程序接口(Application Programming Interface,API)的形式,向第二调度器通知第一优先级。此时若使用命令“echo”查看POD“xxx”的优先级标记,则该优先级取值为1,即echo 1>/x/xGPU/xxx/is_on line。
步骤603:第一调度器向第二调度器通知第二优先级。
可选地,第一调度器通过API的形式,向第二调度器通知第二优先级。此时若使用命令“echo”查看POD“xxx”的优先级标记,则该优先级取值为0,即echo 0>/x/xGPU/xxx/is_online。
步骤604:第二调度器保存该POD的优先级信息。
综上所述,本实施例通过配置信息中设置优先级标记,可以使得第一调度器获知POD的优先级信息,进而由第一调度器向第二调度器通知该POD的优先级信息,第二调度器可以保存该POD的优先级信息来实现后续的优先级调度过程。
方面2:第二调度器预取计算任务的任务提交信息。
图7示出了本申请一个示例性实施例示出的计算任务的信息预取方法的流程图。该方法由第一调度器和第二调度器执行。该方法包括:
步骤701:获取计算任务的任务提交信息。
POD内的业务进程(计算任务对应的进程)在运行时,会先进行一系列的系统配置。系统配置中的一个配置操作是把外设部件互连标准(Peripheral Component Interconnect,PCI)设备(即GPU/NPU)的某个Bar空间映射出来,使得计算任务获得一个指针和长度作为任务提交信息。该指针指向PCI设备内为该计算任务分配的一个起始地址,该长度用于指示为该计算任务分配的地址长度。
由于PCI设备统一使用mmap技术。第一调度器的业务进程基于mmap调用,获取计算任务的任务提交信息。该PCI设备是指采用PCI总线连接的硬件加速处理器。
步骤702:劫持系统调用并分析;
第二调度器劫持mmap的系统调用,并分析mmap返回的mmap调用结果信息,该mmap调用结果信息包括:指针(addr)、长度(length)、设备控制位(flag)、设备控制位相对于指针指向地址的偏移值(offset)。指针指向GPU/NPU中的一块存储位置的起始位置,长度指示了该块存储位置的长度。设备控制位存储在该存储位置内,用于触发该计算任务的开始/恢复/暂停/挂起。本实施例中,暂停和挂起可理解为同一含义。“劫持”是计算机领域的一个技术术语,在本申请中指第二调度器截取mmap返回的调用结果信息,并修改,使得修改后的调用结果信息指向另一个存储位置。
其中,该mmap调用结果信息即为计算任务的任务提交信息。
步骤703:是否指向GPU/NPU的Bar空间。
第二调度器判断mmap调用结果信息中的指针是否指向GPU/NPU的Bar空间。
如果该指针指向GPU/NPU的Bar空间,则执行步骤704;如果指针未指向GPU/NPU的Bar空间,则执行步骤709。
步骤704:保存计算任务的任务提交信息。
第二调度器保存mmap调用结果信息,作为计算任务的任务提交信息。当计算任务全部配置完成后,需要将计算任务提交到GPU/NPU运行时,第一调度器会使用这个地址信息将计算任务的设备控制位写为使能状态,完成触发GPU/NPU执行该计算任务的动作,也即硬件上的门铃触发(trigger doorbell)操作。GPU/NPU收到该门铃消息后,会执行该计算任务。
步骤705:映射Bar空间。
第二调度器使用mmap调用结果信息中的指针映射GPU/NPU的Bar空间,获知该Bar空间内可提交的任务信息。比如,设备控制位用于控制计算任务的开启或暂停。
步骤706:保存Bar空间可提交的任务信息、POD的优先级等关联信息。
第二调度器将计算任务、计算任务所在的POD、POD的优先级、计算任务对应的Bar空间的指针和长度(第一地址信息)等关联信息进行关联存储。
步骤707:分配内存页。
第二调度器还分配系统内存中的内存页,该内存页作为第二调度器指定的存储位置。该内存页的地址信息包括指针和长度,该指针指向该内存页的起始地址,该长度表示该内存页的地址长度。可选地,该内存页的长度大于或等于mmap返回的长度。
步骤708:将内存页的地址信息返回给用户态,同时设置写保护和回调函数。
第二调度器将内存页的地址信息(第二地址信息)替换mmap返回的地址信息(第一地址信息),然后将修改后的mmap映射结果信息返回给用户态的第一调度器。
可选地,在计算任务/POD的优先级为第一优先级的情况下,还需要为该内存页设置写保护权限,以便第一调度器后续提交计算任务时触发系统错误信息。还需要设置一个回调函数,该回调函数用于在感知到第一优先级的计算任务被提交时,将当前运行模式设置为高优先级模式。在计算任务/POD的优先级为第二优先级的情况下,无需为该内存页设置写保护权限,以及设置回调函数。
由于第二调度器使用系统内存的内存页的地址信息,替换了操作系统返回的地址信息。因此第一调度器使用系统内存的内存页的地址信息提交计算任务后,只会将门铃消息(设备控制位为使能状态的消息)写入到这些内存页上,并不会真正触发GPU/NPU运行该计算任务。
步骤709:完成mmap操作并返回。
方面3:第二调度器的任务调度管理。
图8示出了本申请一个示例性实施例示出的基于硬件加速处理器的任务调度方法的流程图。该方法由第二调度器执行。该方法包括:
步骤801:初始化任务队列。
该任务队列用于保存还未执行完毕的计算任务。同一个POD包括至少一个计算任务。第二调度器在图7所示的方法中,能够获取各个计算任务的任务提交信息,根据任务提交信息初始化任务队列。
第二调度器在加载到内核态运行时,需要先按照各个硬件加速处理器的维度创建对应的内核线程,每个硬件加速处理器对应各自的内核线程,也即硬件加速处理器和内核线程一一对应。可选地,该内核线程是一个linux内核的内核kthread。
步骤802:判断是否需要停止。
停止条件是内核kthread需要设置的一项参数,本实施例中将停止条件设置为空。也即步骤802的判断结果总是为否。
若满足停止条件,则退出;若不满足停止条件,则执行步骤803。
步骤803:判断是否超时。
超时条件是内核kthread需要设置的一项参数,本实施例中将超时时间设置为永不超时。也即步骤803的判断结果总是为否。
若超时,则退出;若未超时,则执行步骤804。
步骤804:判断在线任务的空闲时间是否小于配置阈值。
在本实施例中,在线任务是第一优先级的任务或称高优先级任务。空闲时间是最近一个在线任务被提交后的累积时长。
若在线任务的空闲时间小于配置阈值,则执行步骤805;若在线任务的空闲时间大于或等于配置阈值,则执行步骤806。
步骤805:对在线任务的空闲时间继续计时。
可选地,在线任务的空闲时间由一个计时器来计时。第二调度器会在满足预设条件的情况下,复位该计时器。可选地,该预设条件为感知到在线任务被提交。
步骤806:将当前运行模式设置为第二优先级模式。
步骤807:判断当前是否为第一优先级模式。
若当前运行模式为第一优先级模式,则执行步骤808;若当前运行模式不是第二优先级模式,则执行步骤809。
步骤808:暂停(所有)离线任务;
在当前运行模式为第一优先级模式的情况下,暂停任务队列中的所有离线任务。本实施例中,以第二优先级的计算任务是离线任务来举例说明。
步骤809:恢复离线任务。
在当前运行模式为第二优先级模式的情况下,恢复任务队列中的一个或多个离线任务。可选地,第二调度器按照离线任务的调度策略来恢复任务队列中的一个或多个离线任务。本申请实施例对该离线任务的调度策略不加以限定。
步骤810:结束本轮迭代。
该内核kthread被创建时,被指定有每次迭代检查的时间,比如1ms。在不同实施例中,该时间也可以更小,比如仅仅是内核系统的1个时钟滴答数(jiffes)。该时间也可以更大,可以根据业务需求来动态调整。
方面4:低优先级任务的暂停(或称挂起)。
图9示出了本申请一个示例性实施例提供的低优先级任务的暂停方法的流程图。本实施例以该方法由第二调度器执行,高优先级任务是在线任务,低优先级任务是离线任务为例。该方法包括:
步骤901:判断是否还有未遍历的离线POD。
第二调度器遍历所有的离线POD。第二调度器确定是否还有未遍历完毕的离线POD。一个离线POD包括至少一个离线任务。本实施例中,离线POD是指具有第二优先级的POD,离线任务是指具有第二优先级的计算任务。
若还有未遍历的离线POD,则执行步骤902;若所有的离线POD均已遍历完毕,则退出。
步骤902:判断当前POD是否还有未遍历的离线任务。
第二调度器获取一个还未遍历完毕的POD作为当前POD,判断当前POD是否还有未遍历完毕的离线任务。
若当前POD中还有未遍历完毕的离线任务,则执行步骤903;若当前POD中的所有离线任务均已遍历完毕,返回执行步骤901。
步骤903:获取该离线任务的任务提交信息。
第二调度器在图7所示的方法中,已经预先保存了该离线任务、该离线任务所处的POD、该POD的优先级、第三地址信息和第四地址信息的对应关系。
其中,第三地址信息指向GPU/NPU中的一个存储位置(Bar空间),第四地址信息指向系统内存中的一个存储位置。
步骤904:将该离线任务的设备控制位写为去使能状态。
第二调度器基于第三地址信息,将该离线任务在GPU/NPU中的设备控制位写为去使能(enable)状态,从而实现将该离线任务的暂停或挂起。
方面5:高优先级任务抢占低优先级任务运行。
当离线任务在运行时,如果此时在线任务被提交至GPU/NPU,触发了门铃消息。此时,第二调度器需要实现如下能力:
1)实时感知在线任务的提交;
2)暂停离线任务(方面4已阐述);
3)执行在线任务。
在分析在线任务抢占离线任务的具体过程之前,首先参考一下相关技术中的原生计算任务的任务提交流程。
图10示出了本申请一个示例性实施例提供的原生计算任务的任务提交方法的流程图。该方法由第一调度器执行,该方法包括:
步骤1001:读取原生计算任务的任务提交信息。
第一调度器读取原生计算任务的任务提交信息,从而获取初始化时mmap得到的真实地址信息。该真实地址信息是指向GPU/NPU内的地址信息。
步骤1002:基于任务提交信息触发门铃消息。
在该真实地址信息所指示的存储位置中,存在有该原生计算任务的设备控制位。该设备控制位被设置为使能状态时,代表运行该原生计算任务;该设备控制位被设置为去使能状态时,代表暂停或挂起该原生计算任务。
其中,将设备控制位设置为使能状态,可视为触发门铃消息。第一调度器通过内存映射输入输出(Memory Mapping I/O,MMIO)写操作将该设备控制位设为使能状态,从而触发该原生计算任务对应的门铃消息。
在GPU/NPU中存在PCI Bar空间映射任务控制模块。当设备控制位被设置为使能状态后,该PCI Bar空间映射任务控制模块会运行该原生计算任务。该任务提交过程不需要驱动程序的参与,因此能达到更优的性能。
针对1)和3),在第一调度器提交在线任务时,会按照图10同样的方式进行MMIO写操作,以触发门铃消息。
图11示出了本申请一个示例性实施例提供的在线任务(高优先级任务)的任务提交方法的流程图。本实施例以该方法由第一调度器和第二调度器执行,高优先级任务是在线任务,低优先级任务是离线任务来举例说明。该方法包括:
步骤1101:读取在线任务的任务提交信息。
第一调度器读取任务的任务提交信息,从而获取初始化时mmap得到的冒充内存页的第二地址信息。该第二地址信息是被第二调度器修改过的,该第二地址信息指向系统内存内的一个内存页。
步骤1102:基于第二地址信息触发门铃消息。
由于第二地址信息所指向的冒充内存页被设置有写保护权限。第一调度器采用MMIO写操作向第二地址信息写入门铃消息时,会因写保护权限导致无法写入触发系统错误信息。
步骤1103:因写保护权限触发系统错误信息。
该系统错误信息是内存缺页错误(page fault)信息。该内存缺页错误信息是因写保护权限导致无法写入触发的。
步骤1104:分析系统错误信息。
第二调度器会监测系统错误信息。在监测到一条系统错误信息后,分析该系统错误信息。以系统错误信息是内存缺页错误信息为例,通过分析获知该内存缺页错误信息所要写入的地址以及写入指令的类型。
步骤1105:是否为触发门铃消息;
第二调度器会基于该内存缺页错误信息所要写入的地址以及写入指令的类型,判断写操作是否要触发门铃消息。
若是要触发门铃消息,则执行步骤1106;若不是要触发门铃消息,则忽略该系统错误信息,由操作系统执行原有流程。
步骤1106:调用回调函数。
该回调函数是预先使用操作系统内核的vma注册的回调函数。vma是内核管理用户空间的数据结构(struct vm_area_struct)的简称。
该回调函数用于在第二调度器感知到第一优先级的计算任务被提交时,将当前运行模式设置为第一优先级模式(即高优先级模式)。
步骤1107:设置在线任务的空闲时间为零,以及设置当前运行模式为第一优先级模式。
该回调函数用于更新第二调度器的当前运行模式。一方面,将当前运行模式设置为第一优先级模式;另一方面,将第一优先级任务的空闲时间复位为零,以便触发第二调度器在图8中的步骤804以及后续的步骤。
步骤1108:通过第一地址信息将在线任务的设备控制位写为使能状态。
第二调度器通过第一地址信息执行MMIO写操作,将在线任务的设备控制位写为使能状态。也即把在线任务的门铃消息写到GPU/NPU中Bar空间的真正物理页上,完成了在线任务提交流程中的触发门铃操作。
在GPU/NPU中存在PCI Bar控件映射任务控制模块。当设备控制位被设置为使能状态后,该PCI Bar控件映射任务控制模块会运行该在线任务。
方面6:低优先级任务的提交。
图12示出了本申请一个示例性实施例示出的离线任务(低优先级任务)的任务提交方法的流程图。该方法由第一调度器执行,该方法包括:
步骤1220:读取离线任务的任务提交信息。
第一调度器读取离线计算任务的任务提交信息,从而获取初始化时mmap得到的第四地址信息。该第四地址信息指向系统内存中的冒充内存页。
第二调度器将第三地址信息替换为第四地址信息的过程,第一调度器并不知晓。因此第一调度器会按照自己保存的第四地址信息,执行MMIP写操作。
步骤1240:基于第四地址信息触发门铃消息。
由于该第四地址信息指向系统内存中的冒充内存页,并非指向GPU/NPU中的实际内存页,因此并不会触发真正的门铃消息。该离线任务并未被真正提交给GPU/NPU运行。
该GPU/NPU的开始运行或恢复运行,由第二调度器基于第三地址信息来完成。
图13示出了本申请一个示例性实施例示出的任务调度装置的框图,装置包括:第一调度器模块1320和第二调度器模块1340;
第二调度器模块1340,用于在第一调度器模块1320创建第一计算任务的过程中,修改第一计算任务的任务提交信息,第一计算任务具有第一优先级;
第二调度器模块1340,用于在第一调度器模块1320基于修改后的任务提交信息提交第一计算任务的过程中,感知第一计算任务的提交;其中,感知第一计算任务的提交,可理解为:感知第一计算任务被第一调度器模块提交,或,感知第一计算任务的提交进度。
第二调度器模块1340,用于暂停第二计算任务的运行,以及提交第一计算任务至处理器运行,第二计算任务具有第二优先级;
其中,第一优先级高于第二优先级。
在一些实施例中,任务提交信息指向第二调度器模块1340指定的目标存储位置;
第二调度器模块1340,用于在第一调度器模块1320基于任务提交信息将第一计算任务提交至目标存储位置的过程中,感知第一计算任务的提交。
在一些实施例中,第二调度器模块1340指定的目标存储位置设置有写保护权限;
第二调度器模块1340,用于获取系统错误信息;在系统错误信息是第一调度器模块1320基于任务提交信息将第一计算任务提交至目标存储位置时因写保护权限无法写入触发的情况下,感知第一计算任务的提交。
在一些实施例中,第二调度器模块1340,用于在第一调度器模块1320向操作系统创建第一计算任务的过程中,修改第一计算任务的任务提交信息,修改前的任务提交信息是操作系统为第一计算任务分配的;
其中,修改后的任务提交信息用于使第一计算任务提交至第二调度器模块1340指定的目标存储位置。
在一些实施例中,第二调度器模块1340,用于在第一调度器模块1320创建第一计算任务的过程中,获取操作系统为第一计算任务分配的第一地址信息,第一地址信息指向处理器中的第一存储位置;将第一地址信息替换为第二地址信息,第二地址信息指向系统内存中的目标存储位置;保存第一计算任务、第一优先级、第一地址信息和第二地址信息之间的对应关系,以及将第二地址信息返回给第一调度器模块1320。
在一些实施例中,第二调度器模块1340,还用于为第二地址信息设置写保护权限。
在一些实施例中,第二调度器模块1340,还用于在周期性检测中的本次检测结果为当前运行模式是第一优先级模式的情况下,暂停第二计算任务的运行,以及提交第一计算任务至处理器运行;
其中,第一优先级模式是第二调度器模块1340在感知到第一计算任务的提交时设置的。
在一些实施例中,第二调度器模块1340,还用于感知到第一计算任务的提交时,设置当前任务模式为第一优先级模式,以及复位第一优先级的任务空闲计时器为零。
在一些实施例中,第二调度器模块1340,还用于在第一优先级的任务空闲计时器对应的空闲时间达到预设阈值的情况下,设置当前任务模式为第二优先级模式,低优先级模式用于触发或恢复第二计算任务的运行。
在一些实施例中,第二调度器模块1340,还用于通过第二调度器基于第二计算任务的任务提交信息,将第二计算任务的设备控制位设置为去使能状态,以暂停第二计算任务的运行。
在一些实施例中,第二调度器模块1340,还用于通过第一调度器模块1320向第二调度器模块1340通知第一计算任务的第一优先级,以及第二计算任务的第二优先级。
图14示出了本申请一个示例性实施例提供的计算机设备1400的框图。该计算机设备包括:处理器1420和存储器1440。
存储器1440中存储有至少一段计算机可读指令。处理器1420,用于执行存储器1440中的至少一段计算机可读指令以实现如上方面所述的任务调度方法。
在一些实施例中,用于执行计算任务的处理器就是处理器1420。
在一些实施例中,上述计算机设备还包括硬件加速处理器1460,该硬件加速处理器1460通过PCI总线与处理器1420相连。用于执行上述任务调度方法的是处理器1420,用于执行计算任务的处理器是硬件加速处理器1460。
在示例性实施例中,还提供了一种芯片,所述芯片包括可编程逻辑电路和/或程序指令,当所述芯片在计算机设备上运行时,用于实现上述方面所述的任务调度方法。
在示例性实施例中,还提供了一种计算机程序产品,该计算机程序产品包括计算机可读指令,该计算机可读指令存储在非易失性的计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机可读指令,处理器执行该计算机可读指令,使得该计算机设备执行上述各方法实施例提供的任务调度方法。
在示例性实施例中,还提供了一种非易失性的计算机可读存储介质,该计算机可读存储介质中存储有至少一条计算机可读指令,当该计算机可读指令由计算机设备的处理器加载并执行时,实现上述各方法实施例提供的任务调度方法。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过计算机可读指令来指令相关的硬件完成,所述的计算机可读指令可以存储于一种非易失性的计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种任务调度方法,由计算机设备执行,所述方法包括:
    在第一调度器创建第一计算任务的过程中,通过第二调度器修改所述第一计算任务的任务提交信息,所述第一计算任务具有第一优先级;
    在所述第一调度器基于修改后的所述任务提交信息提交所述第一计算任务的过程中,通过所述第二调度器感知所述第一计算任务的提交;
    在通过所述第二调度器感知到所述第一计算任务的提交的情况下,暂停第二计算任务的运行,以及提交所述第一计算任务至处理器运行,所述第二计算任务具有第二优先级;
    其中,所述第一优先级高于所述第二优先级。
  2. 根据权利要求1所述的方法,其特征在于,所述任务提交信息指向所述第二调度器指定的目标存储位置;
    所述在所述第一调度器基于修改后的所述任务提交信息提交所述第一计算任务的过程中,通过所述第二调度器感知所述第一计算任务的提交,包括:
    在所述第一调度器基于修改后的所述任务提交信息将所述第一计算任务提交至所述目标存储位置的过程中,通过所述第二调度器感知所述第一计算任务的提交。
  3. 根据权利要求2所述的方法,其特征在于,所述第二调度器指定的目标存储位置设置有写保护权限;
    所述在所述第一调度器基于修改后的所述任务提交信息提交所述第一计算任务的过程中,通过所述第二调度器感知所述第一计算任务的提交,包括:
    通过所述第二调度器获取系统错误信息;
    在所述系统错误信息是所述第一调度器基于修改后的所述任务提交信息将所述第一计算任务提交至所述目标存储位置时因所述写保护权限无法写入触发的情况下,通过所述第二调度器根据所述系统错误信息感知所述第一计算任务的提交。
  4. 根据权利要求1至3任一所述的方法,其特征在于,所述在第一调度器创建第一计算任务的过程中,通过第二调度器修改所述第一计算任务的任务提交信息,包括:
    在所述第一调度器向操作系统创建所述第一计算任务的过程中,通过所述第二调度器修改所述第一计算任务的任务提交信息,所述任务提交信息是所述操作系统为所述第一计算任务分配的;
    其中,修改后的所述任务提交信息用于使所述第一计算任务提交至所述第二调度器指定的目标存储位置。
  5. 根据权利要求4所述的方法,其特征在于,所述在所述第一调度器向操作系统创建所述第一计算任务的过程中,通过所述第二调度器修改所述第一计算任务的任务提交信息,包括:
    在所述第一调度器创建所述第一计算任务的过程中,通过所述第二调度器获取所述操作系统为所述第一计算任务分配的第一地址信息,所述第一地址信息指向所述处理器中的第一存储位置;
    通过所述第二调度器将所述第一地址信息替换为第二地址信息,所述第二地址信息指向系统内存中的所述目标存储位置;
    通过所述第二调度器保存所述第一计算任务、所述第一优先级、所述第一地址信息和所述第二地址信息之间的对应关系,以及将所述第二地址信息返回给所述第一调度器。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    为所述第二地址信息设置写保护权限。
  7. 根据权利要求1至6任一所述的方法,其特征在于,所述在通过所述第二调度器感知到所述第一计算任务的提交的情况下,暂停第二计算任务的运行,以及提交所述第一计算任务至处理器运行,包括:
    通过所述第二调度器周期性检测运行模式位,所述运行模式位用于指示第一优先级模式和第二优先级模式中的一种,所述运行模式位在所述第二调度器感知到第一计算任务的提交时被设置为第一优先级模式,在所述第一计算任务运行完毕的时长达到预设时长且所述预设时长内不存在具有第一优先级的其它计算任务被提交的情况下被设置为第二优先级模式;
    在周期性检测中的本次检测结果为当前运行模式是第一优先级模式的情况下,通过所述第二调度器暂停第二计算任务的运行,以及提交所述第一计算任务至所述处理器运行。
  8. 根据权利要求7所述的方法,其特征在于,所述方法还包括:
    在所述第二调度器感知到所述第一计算任务的提交时,设置所述当前任务模式为所述第一优先级模式,以及复位所述第一优先级的任务空闲计时器为零。
  9. 根据权利要求8所述的方法,其特征在于,所述方法还包括:
    在所述第一优先级的任务空闲计时器对应的空闲时间达到预设阈值的情况下,设置所述当前任务模式为第二优先级模式,所述第二优先级模式用于触发或恢复所述第二计算任务的运行。
  10. 根据权利要求1至9任一所述的方法,其特征在于,所述通过所述第二调度器暂停第二计算任务的运行,包括:
    通过所述第二调度器基于所述第二计算任务的任务提交信息,将所述第二计算任务的设备控制位设置为去使能状态,以暂停所述第二计算任务的运行。
  11. 根据权利要求1至10任一所述的方法,其特征在于,所述方法还包括:
    通过所述第一调度器向所述第二调度器通知所述第一计算任务的第一优先级,以及所述第二计算任务的第二优先级。
  12. 一种任务调度装置,所述装置包括:第一调度器模块和第二调度器模块;
    所述第二调度器模块,用于在所述第一调度器模块创建第一计算任务的过程中,修改所述第一计算任务的任务提交信息,所述第一计算任务具有第一优先级;
    所述第二调度器模块,用于在所述第一调度器模块基于修改后的所述任务提交信息提交所述第一计算任务的过程中,感知所述第一计算任务的提交;
    所述第二调度器模块,用于在感知到所述第一计算任务的提交的情况下,暂停第二计算任务的运行,以及提交所述第一计算任务至处理器运行,所述第二计算任务具有第二优先级;
    其中,所述第一优先级高于所述第二优先级。
  13. 根据权利要求12所述的装置,其特征在于,所述任务提交信息指向所述第二调度器模块指定的目标存储位置;
    第二调度器模块,用于在所述第一调度器模块基于修改后的所述任务提交信息将所述第一计算任务提交至所述目标存储位置的过程中,感知所述第一计算任务的提交。
  14. 根据权利要求13所述的装置,其特征在于,所述第二调度器模块指定的目标存储位置设置有写保护权限;
    第二调度器模块,用于获取系统错误信息;在所述系统错误信息是所述第一调度器模块基于修改后的任务提交信息将所述第一计算任务提交至所述目标存储位置时因所述写保护权限无法写入触发的情况下,感知所述第一计算任务的提交。
  15. 根据权利要求12至14任一项所述的装置,其特征在于,所述第二调度器模块,用于在所述第一调度器模块向操作系统创建所述第一计算任务的过程中,修改所述第一计算任务的任务提交信息,所述任务提交信息是所述操作系统为所述第一计算任务分配的;
    其中,修改后的所述任务提交信息用于使所述第一计算任务提交至所述第二调度器模块指定的目标存储位置。
  16. 根据权利要求15所述的装置,其特征在于,所述第二调度器模块,用于在所述第一调度器模块创建第一计算任务的过程中,获取操作系统为所述第一计算任务分配的第一地址信息,所述第一地址信息指向处理器中的第一存储位置;将所述第一地址信息替换为第二地址信息,所述第二地址信息指向系统内存中的目标存储位置;保存所述第一计算任务、所述第一优先级、所述第一地址信息和所述第二地址信息之间的对应关系,以及将所述第二地址信息返回给第一调度器模块。
  17. 根据权利要求16所述的装置,其特征在于,所述第二调度器模块,还用于为所述第二地址信息设置写保护权限。
  18. 一种计算机设备,所述计算机设备包括:处理器和存储器,所述存储器中存储有至少一段计算机可读指令;所述处理器,用于执行所述存储器中的所述至少一段计算机可读指令以实现如权利要求1至11任一所述的任务调度方法。
  19. 一种非易失性的计算机可读存储介质,所述计算机可读存储介质中存储有计算机可读指令,所述计算机可读指令由处理器加载并执行以实现上述如权利要求1至11任一所述的任务调度方法。
  20. 一种计算机程序产品,所述计算机程序产品包括计算机可读指令,所述计算机可读指令由处理器加载并执行以实现上述如权利要求1至11任一所述的任务调度方法。
PCT/CN2025/080171 2024-03-11 2025-03-03 任务调度方法、装置、设备、存储介质和程序产品 Pending WO2025190099A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410279265.3A CN120631519A (zh) 2024-03-11 2024-03-11 任务调度方法、装置、设备及介质
CN202410279265.3 2024-03-11

Publications (1)

Publication Number Publication Date
WO2025190099A1 true WO2025190099A1 (zh) 2025-09-18

Family

ID=96964719

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/080171 Pending WO2025190099A1 (zh) 2024-03-11 2025-03-03 任务调度方法、装置、设备、存储介质和程序产品

Country Status (2)

Country Link
CN (1) CN120631519A (zh)
WO (1) WO2025190099A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010267077A (ja) * 2009-05-14 2010-11-25 Hitachi Ulsi Systems Co Ltd オペレーティングシステムとメモリ保護方法
KR20130000253A (ko) * 2011-06-22 2013-01-02 한국과학기술원 가상화 시스템에서 메모리 접근을 제어하는 장치 및 방법
CN112130963A (zh) * 2020-09-30 2020-12-25 腾讯科技(深圳)有限公司 虚拟机任务的调度方法、装置、计算机设备及存储介质
CN114579279A (zh) * 2022-03-07 2022-06-03 阿里巴巴(中国)有限公司 任务调度方法及装置
WO2022236816A1 (zh) * 2021-05-14 2022-11-17 华为技术有限公司 一种任务分配方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010267077A (ja) * 2009-05-14 2010-11-25 Hitachi Ulsi Systems Co Ltd オペレーティングシステムとメモリ保護方法
KR20130000253A (ko) * 2011-06-22 2013-01-02 한국과학기술원 가상화 시스템에서 메모리 접근을 제어하는 장치 및 방법
CN112130963A (zh) * 2020-09-30 2020-12-25 腾讯科技(深圳)有限公司 虚拟机任务的调度方法、装置、计算机设备及存储介质
WO2022236816A1 (zh) * 2021-05-14 2022-11-17 华为技术有限公司 一种任务分配方法及装置
CN114579279A (zh) * 2022-03-07 2022-06-03 阿里巴巴(中国)有限公司 任务调度方法及装置

Also Published As

Publication number Publication date
CN120631519A (zh) 2025-09-12

Similar Documents

Publication Publication Date Title
US9753754B2 (en) Enforcing deterministic execution of threads of guest operating systems running in a virtual machine hosted on a multiprocessor machine
US9619270B2 (en) Remote-direct-memory-access-based virtual machine live migration
CA2849565C (en) Method, apparatus, and system for scheduling processor core in multiprocessor core system
US20180121366A1 (en) Read/write request processing method and apparatus
CN111488210A (zh) 基于云计算的任务调度方法、装置和计算机设备
US10242420B2 (en) Preemptive context switching of processes on an accelerated processing device (APD) based on time quanta
CN111324432B (zh) 处理器调度方法、装置、服务器及存储介质
CN114168271B (zh) 一种任务调度方法、电子设备及存储介质
US20110219373A1 (en) Virtual machine management apparatus and virtualization method for virtualization-supporting terminal platform
US10037225B2 (en) Method and system for scheduling computing
CN114840318A (zh) 一种多进程抢占硬件key加解密资源的调度方法
CN121255283A (zh) 控制数据处理器中的指令执行
US10891171B2 (en) Method, apparatus and device for transitioning between data and control core and migrating clock task from data core to control core
CN112306669A (zh) 一种基于多核系统的任务处理方法及装置
KR20260023016A (ko) 컨텍스트 언맵 중 gpu 회로 자체 컨텍스트 저장
Huh et al. Cross‐layer resource control and scheduling for improving interactivity in Android
US20260017099A1 (en) Interrupt Processing Method and Apparatus, and Electronic Device
CN115599508A (zh) Cpu及任务调度方法
KR101334842B1 (ko) 가상화 지원 단말 플랫폼을 위한 가상머신 관리장치 및 방법
CN114911538A (zh) 一种运行系统的启动方法及计算设备
Hamayun et al. Towards hard real-time control and infotainment applications in automotive platforms
CN114281529A (zh) 分布式虚拟化的客户操作系统调度优化方法、系统及终端
CN120631519A (zh) 任务调度方法、装置、设备及介质
CN114691279A (zh) 资源调度方法、设备及存储介质
CN118732600B (zh) 虚拟环境中plc指令实时通信系统、方法、装置和设备

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: 25769271

Country of ref document: EP

Kind code of ref document: A1