Heterogeneous computing resource virtualization processing method, electronic device and storage medium
By building a computing unit graph structure, dynamic query and combination computing units, the problem of limitations in computing resource allocation in the existing technology is solved, and efficient utilization and flexible management of heterogeneous computing resources are realized.
Patent Information
- Application Number
- CN202411087821.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-08-09
AI Technical Summary
The existing heterogeneous computing resource virtualization technology cannot effectively identify the correlation between computing resources, resulting in limitations in computing resource allocation and the inability to fully utilize the potential of computing resources such as heterogeneous GPUs.
By obtaining the computing unit graph structure in the virtualized system, we can fully understand the basic attribute information and mutual dependencies of each computing unit, and dynamically query and combine suitable computing units to meet the needs of computing tasks.
It improves the efficiency of computing resource allocation and resource utilization, realizes more flexible and efficient computing resource management, and adapts to different intelligent computing needs.
Smart Images

Figure CN118626275B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for virtualizing heterogeneous computing resources, an electronic device, and a storage medium. Background Art
[0002] With the rise of large-scale industrial manufacturing models, the computing power of CPU (Central Processing Unit) can no longer meet the needs of enterprises, and the demand for computing resources such as GPU (Graphics Processing Unit) and FPGA (Field Programmable Gate Array) has increased dramatically. However, in actual applications, enterprises often face the dual challenges of limited heterogeneous computing resources such as GPU and low utilization. In order to solve this problem, heterogeneous GPU pooling technology came into being. Heterogeneous GPU pooling technology can integrate computing resources such as GPUs, CPUs, FPGAs of different types and manufacturers into a powerful computing resource pool through virtualization technology, and allocate and schedule these resources according to the task requirements of computing tasks to improve resource utilization and system elasticity.
[0003] However, the existing heterogeneous computing resource virtualization technology mainly adopts static resource configuration. The system maps computing resources to corresponding computing tasks according to certain rules based on the task requirement information of the computing tasks, so that they can perform the corresponding tasks, thereby improving the utilization efficiency of computing resources such as GPUs. However, in the existing technology, usually only the demand for computing resources by computing tasks is considered, but the correlation between computing resources cannot be identified, so the allocation of computing resources still has certain limitations. Summary of the invention
[0004] The purpose of this application is to provide a heterogeneous computing resource virtualization processing method, electronic device and storage medium to solve the above problems.
[0005] To achieve the above objectives, the present application proposes a method for virtualizing heterogeneous computing resources, the method comprising: obtaining a computing unit graph structure formed by a set of computing units in a virtualization system, the computing unit graph structure comprising computing nodes formed by computing units, and edges connecting computing nodes, the edges representing dependencies between computing nodes; obtaining task requirement information of computing tasks to be assigned; querying multiple candidate computing units that match the task requirement information from the computing unit set, the candidate computing units representing computing units that are suitable for executing the computing tasks and are in an idle state; constructing computing units to be combined that meet the task requirement information from the multiple candidate computing units based on the computing unit graph structure, and forming a computing unit combination for executing the computing tasks based on the computing units to be combined.
[0006] In one embodiment, the method also includes: obtaining basic attribute information of heterogeneous computing resources, the basic attribute information including one or more of computing power, memory bandwidth, energy consumption, latency and parallelism; abstracting the heterogeneous computing resources into programmable computing units based on the basic attribute information and a preset original description language; and dynamically updating the status label of the computing unit based on a computing unit state migration mechanism, the status label including idle, busy or migrating.
[0007] In addition, to achieve the above-mentioned objectives, the present application also proposes an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors execute the heterogeneous computing resource virtualization processing method described above.
[0008] In addition, to achieve the above objectives, the present application also proposes a computer storage medium, which stores executable instructions. When the instructions are executed by a processor, the processor executes the heterogeneous computing resource virtualization processing method as described above.
[0009] Compared with the prior art, the beneficial effects of the present application include: by obtaining the computing unit graph structure in the virtualization system, the basic attribute information of each computing unit in the system and the mutual dependencies can be fully understood, thereby achieving the beneficial effect of improving resource allocation efficiency and resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope of the present application.
[0011] Figure 1It is a schematic diagram of a heterogeneous computing resource pool in the prior art;
[0012] Figure 2 This is a flow chart of the first embodiment of the heterogeneous computing resource virtualization processing method of the present application;
[0013] Figure 3 This is a schematic diagram of the computing unit graph structure in the first embodiment of the heterogeneous computing resource virtualization processing method of the present application;
[0014] Figure 4 This is a flow chart of the second embodiment of the heterogeneous computing resource virtualization processing method of the present application;
[0015] Figure 5 This is a flow chart of the third embodiment of the heterogeneous computing resource virtualization processing method of the present application;
[0016] Figure 6 It is a structural schematic diagram of an electronic device involved in the heterogeneous computing resource virtualization processing method in an embodiment of the present application. DETAILED DESCRIPTION
[0017] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0018] With the rise of large industrial manufacturing models, the computing power of CPUs (Central Processing Units) can no longer meet the needs of enterprises, and the demand for computing resources such as GPUs (Graphics Processing Units) and FPGAs (Field Programmable Gate Arrays) has increased dramatically. This is mainly because several types of computing tasks such as deep learning and machine learning, computer vision, natural language processing, simulation and simulation, and graphics rendering and visualization require processing large amounts of data and complex calculations. GPUs are ideal for these tasks because of their powerful parallel computing capabilities. FPGAs have also become an indispensable computing resource in large industrial manufacturing models because of their high programmability and parallel processing capabilities.
[0019] However, in actual applications, enterprises often face the dual challenges of limited heterogeneous computing resources such as GPUs and low utilization. To solve this problem, heterogeneous GPU pooling technology came into being. Figure 1 , Figure 1Schematic diagram of heterogeneous computing resource pool provided by existing technologies. Heterogeneous GPU pooling technology can integrate computing resources such as GPUs, CPUs, FPGAs, etc. of different types and manufacturers into a powerful computing resource pool through virtualization technology, and allocate and schedule these resources according to the task requirements of computing tasks to improve resource utilization and system elasticity.
[0020] Existing heterogeneous computing resource virtualization technologies mainly use static resource configuration. Based on the task requirement information of the computing task, the system maps the computing resources to the corresponding computing tasks according to certain rules, so that they can perform the corresponding tasks, thereby improving the utilization efficiency of computing resources such as GPUs. For example, by setting up an intelligent scheduling layer and using relevant deep learning algorithms to allocate computing resources, the rationality of resource allocation and the efficiency of computing resource utilization are continuously improved. However, in existing technologies, usually only the demand for computing resources by computing tasks is taken into account, but the correlation between computing resources cannot be identified, which makes the allocation of computing resources still have certain limitations.
[0021] This application provides a solution, "Dynamic Reconfigurable Heterogeneous Resource Virtualization" (DRHRV), which is a new computing resource virtualization method that proposes a new perspective and can dynamically adjust the structure and function of virtualized resources at runtime to adapt to different intelligent computing needs. The core idea is to abstract heterogeneous computing resources such as CPU cores, GPU cores, and FPGA modules into standardized computing units. By obtaining the computing unit graph structure formed by a set of computing units in the virtualization system, the basic attribute information of each computing unit and the dependencies between them can be clearly represented and managed. Thereby achieving the beneficial effect of improving resource allocation efficiency and resource utilization.
[0022] Among them, the virtualization system is a system that can realize automated management from virtualizing computing resources, building a computing unit graph structure to configuring computing unit combinations for computing tasks. It can effectively improve resource utilization efficiency and has good scalability and compatibility.
[0023] It should be noted that the execution subject of this embodiment can be a virtualization system, or a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or a thermal management device of a virtualization system that can realize the above functions, etc. This embodiment does not specifically limit this. The following takes the virtualization system as the execution subject as an example to illustrate this embodiment and the following embodiments.
[0024] Based on this, the embodiment of the present application provides a method for virtualizing heterogeneous computing resources. Figure 2 , Figure 2 This is a flow chart of the first embodiment of the heterogeneous computing resource virtualization processing method of the present application.
[0025] In this embodiment, the heterogeneous computing resource virtualization processing method includes steps S10 to S40:
[0026] Step S10, obtaining a computing unit graph structure formed by a set of computing units in the virtualization system.
[0027] It should be understood that the computing unit in the traditional sense refers to the hardware unit used to perform computing tasks in a computer system. The computing unit defined in this application is a standardized software computing unit abstracted from heterogeneous computing resources such as CPU cores, GPU cores, and FPGA modules.
[0028] To ensure compatibility and interoperability between different hardware and software frameworks. This embodiment designs a virtualized interface adaptation technology, which separates the underlying hardware details from the high-level application logic by creating an abstraction layer. By defining a set of standardized APIs (Application Programming Interfaces), a unified calling method is provided, regardless of the underlying hardware or programming framework. In other words, the API is universal for all types of hardware resources (such as CPU, GPU, FPGA).
[0029] Exemplarily, the virtualization interface is adapted as follows:
[0030] class VirtualizationAPI:
[0031] def allocateResources(self, requirements): # Abstract resource allocation requests based on requirements
[0032] pass
[0033] def releaseResources(self, resourceIDs): # Abstract resource release request
[0034] pass
[0035] def executeTask(self, task, resources): # Abstract task execution request
[0036] Pass
[0037] In addition, this embodiment develops adapters for mainstream programming frameworks such as CUDA and OpenCL so that they can interact with the virtualization API seamlessly. By encapsulating framework-specific calls in the virtualization API, a unified access entry is provided. Thus, an efficient, flexible and easy-to-use virtualization interface adaptation layer is implemented.
[0038] Exemplarily, the virtualization interface is adapted as follows:
[0039] class FrameworkAdapter:
[0040] def __init__(self, frameworkName):
[0041] self.frameworkName = frameworkName
[0042] def adapt(self, task, resources): # Adapt tasks and resources according to framework features
[0043] pass
[0044] class CUDAAdapter(FrameworkAdapter):
[0045] def adapt(self, task, resources): # CUDA-specific adaptation logic
[0046] pass
[0047] class OpenCLAdapter(FrameworkAdapter):
[0048] def adapt(self, task, resources): # OpenCL-specific adaptation logic
[0049] pass
[0050] In addition, this embodiment also develops driver adapters for different types of hardware to interact with the virtualization system with a unified interface. The adapter can implement protocols for communicating with the hardware, such as PCIe, USB or other proprietary interfaces. In addition, the adapter can also provide the implementation of resource control commands, such as starting, stopping, and resetting hardware resources.
[0051] Exemplarily, the hardware driver is as follows:
[0052] class HardwareAdapter:
[0053] def __init__(self, hardwareType):
[0054] self.hardwareType = hardwareType
[0055] def initialize(self):# Initialize hardware devices
[0056] pass
[0057] def execute(self, command):# Execute control commands on hardware
[0058] pass
[0059] def communicate(self, data):# Communicate data with hardware
[0060] pass
[0061] class GPUAdapter(HardwareAdapter):
[0062] def execute(self, command):# GPU specific execution logic
[0063] pass
[0064] class FPGAAdapter(HardwareAdapter):
[0065] def execute(self, command):# FPGA specific execution logic
[0066] pass
[0067] In this embodiment, each computing unit has one or more of the following basic properties: (1) computing power, such as FLOPS (floating-point operations per second); (2) memory bandwidth, that is, the ability of the computing unit to access memory, usually measured in GB / s; (3) energy consumption, which refers to the energy consumption of the computing unit during operation, in watts (W); (4) latency, which refers to the time delay required for the computing unit to execute a task; (5) parallelism, which refers to the number of tasks that the computing unit can process simultaneously.
[0068] To this end, this application designs a language (PDL, Primitive Design Language) for describing and defining computing units. The language contains the following elements: (1) grammar rules, which are used to define the grammatical structure of PDL, including keywords, data types, expressions, etc.; (2) computing unit definition, which allows users to define new computing units or use predefined computing units; (3) attribute declaration, which allows users to declare the attributes of computing units, such as computing power, memory bandwidth, etc.; (4) interface definition, which is used to define how computing units interact with other computing units or external systems; (5) operation instructions, which are used to define the operations that computing units can perform, such as data transmission, computing tasks, etc.
[0069] Exemplarily, the syntax structure of PDL is as follows:
[0070] primitive CPUCore {
[0071] flops: 1000; / / floating point operations per second
[0072] memory_bandwidth: 50; / / GB / s
[0073] power_consumption: 15; / / Watts
[0074] }
[0075] primitive GPUCore {
[0076] flops: 5000;
[0077] memory_bandwidth: 300;
[0078] power_consumption: 250;} / / Define a complex computing task
[0079] task ComplexComputation {
[0080] use CPUCore with {
[0081] flops: 2000;
[0082] memory_bandwidth: 100;};
[0083] use GPUCore with {
[0084] flops: 10000;
[0085] power_consumption: 300;};
[0086] operations { / / define the operation sequence
[0087] }}
[0088] For example, in the intelligent manufacturing application scenario in the industrial field, the customized heterogeneous GPU resource pooling solution is as follows:
[0089] / / Define the computing power of the GPU core
[0090] primitive GPUCore {
[0091] property computeCapability: int;
[0092] property powerConsumption: float;}
[0093] / / Define GPU memory
[0094] primitive GPUMemory {
[0095] property memoryBandwidth: float;
[0096] property memorySize: int;} / / Define GPU stream
[0097] primitive GPUStream {
[0098] operation kernelLaunch(kernel: string, params: list);
[0099] operation memoryTransfer(data: byte[], from: string, to: string);}
[0100] / / Define the smart scheduler
[0101] primitive TaskScheduler {
[0102] operation scheduleTask(task: string, resources: list);
[0103] operation loadBalancing(resources: list);}
[0104] / / Define GPU resource pool module
[0105] module GPUResourcePool {
[0106] use GPUCore;
[0107] use GPUMemory;
[0108] use GPUStream;
[0109] use TaskScheduler;
[0110] operation allocateResources(task: string) {
[0111] / / Resource allocation logic
[0112] }}
[0113] / / Define GPU acceleration tasks in smart manufacturing
[0114] task MachineLearningInference {
[0115] use GPUResourcePool;
[0116] operation execute() {
[0117] allocateResources("InferenceTask");
[0118] GPUStream.kernelLaunch("inferenceKernel", [params]);
[0119] }}
[0120] Among them, GPUCore: represents the computing power of a single GPU core. GPUMemory: represents the memory resources of the GPU. GPUStream: represents the execution stream on the GPU, which is used for parallel task processing. ComputeCapability: the computing power of the GPU, such as the number of CUDA cores. MemoryBandwidth: the bandwidth of the GPU memory. MemorySize: the memory size of the GPU. PowerConsumption: the energy consumption of the GPU during operation. Temperature: the operating temperature of the GPU, used for monitoring and thermal management. CUDAInterface: defines an interface compatible with the CUDA programming model. OpenCLInterface: defines an interface compatible with the OpenCL programming model. KernelLaunch: launches a kernel function on the GPU. MemoryTransfer: transfers data between the GPU and the CPU or other GPUs. StreamSynchronization: synchronizes GPU streams to ensure task order. ParallelTask: defines tasks that can be executed in parallel, such as image processing or machine learning inference. ResourceAllocation: dynamically allocates GPU resources according to task requirements. ResourceFaultTolerance: designs a fault-tolerant mechanism to handle GPU resource failures. TaskRecovery: designs a task recovery mechanism to ensure that tasks can continue to execute after resource failures. PowerManagement: Define power management strategies to optimize GPU energy consumption TaskScheduling: Design intelligent task scheduling algorithms to optimize resource utilization LoadBalancing: Implement load balancing to avoid overloading certain GPUs GPUResourcePool: Define a GPU resource pool module to manage all available GPU resources. Optionally, you can also define CoolingSystemIntegration, an integrated cooling system interface, for automatic temperature adjustment according to actual needs.
[0121] In addition, it should be noted that the computing unit graph structure is a graphical model for describing and managing computing units and the dependencies between them. Figure 3 , Figure 3This is a schematic diagram of the computing unit graph structure in the first embodiment of the heterogeneous computing resource virtualization processing method of the present application. In this model, computing units exist in the form of nodes, each node has a unique identifier, and contains its state (such as idle, busy, etc.) and attributes (such as computing power, memory size, etc.). Edges represent directed or undirected connections between nodes, and can represent physical connections or logical connections, and are used to represent dependencies between nodes, such as data dependencies (paths of data or control flow), task dependencies, etc. At the same time, edges can also be accompanied by attributes, and the attributes of edges can include data transmission rate and the strength of dependency, etc.
[0122] As an optional implementation method for constructing a computing unit graph structure, first, all computing units connected to the virtualization system are discovered by querying the management interface of the virtualization system, such as VMware vSphere API, OpenStack Nova API, etc. Then, based on the discovered computing units, computing nodes are constructed, and each computing node carries status and attribute information. Next, the dependencies between computing nodes are determined by analyzing the data flow or task scheduling between settlement units. And edges are created between corresponding computing nodes based on the dependencies, and each edge can also be accompanied by attributes. Finally, computing nodes and edges are organized into a graph structure through graph data structures, such as adjacency lists or adjacency matrices.
[0123] Based on this, in order to apply the computing unit graph structure to configure the computing unit combination so that it has the ability to be dynamically updated, this embodiment designs a dynamic combination and splitting algorithm, a dynamic interconnection mechanism, a computing unit state migration mechanism and a data security mechanism based on the computing unit graph structure. Among them, the dynamic combination and splitting algorithm includes a combination strategy, which is used to select and combine appropriate computing units based on task requirements and resource attributes; a splitting strategy, which is used to safely split computing units when the task is completed or the resources are no longer needed; a graph matching algorithm, which is used to find the optimal computing unit combination in the resource graph. The dynamic interconnection mechanism includes a connection protocol, which is used to define how to establish and disconnect connections between resource nodes, and supports different types of communication protocols, such as PCIe, InfiniBand, etc.; a topology management mechanism, which is used to dynamically adjust the connection relationship between computing units, and supports star, ring, mesh and other topological structures; a resource discovery mechanism, which can discover and utilize new computing units or release computing units that are no longer needed. The computing unit state migration mechanism includes state definition, which is used to define the possible states of the computing unit, such as idle, busy, and migration; migration algorithm, which is used to migrate computing units between different states while ensuring data consistency and integrity; transaction management, which is used to handle state migration and ensure the atomicity of operations. Data security mechanisms include synchronization mechanisms, which are used to ensure data consistency of computing unit combinations during reconstruction; data copies, which create data copies when necessary to support concurrent access and fault recovery; and consistency protocols, which use consistency protocols such as two-phase commit to handle distributed transactions.
[0124] It can be understood that the dynamic update of the computing unit graph structure is a dynamic update at the software level. For the actual hardware resource update, this embodiment is designed with a dynamic discovery and registration mechanism based on hardware characteristics, including: hardware scanning, periodic scanning or scanning of available hardware resources in the system at startup; feature identification, identifying hardware characteristics, such as model, performance indicators, supported functions, etc.; registration mechanism, registering the discovered hardware resources and their characteristics in the resource manager for use by the virtualization system.
[0125] Exemplarily, dynamic discovery and registration based on hardware characteristics are as follows:
[0126] class HardwareScanner:
[0127] def scanHardware(self):# Scan the hardware resources in the system
[0128] pass
[0129] def identifyHardwareFeatures(self, hardware):# Identify hardware features
[0130] pass
[0131] class ResourceManager:
[0132] def __init__(self):
[0133] self.hardwareRegistry = {}
[0134] def registerHardware(self, hardware, features):
[0135] # Register hardware resources to the manager
[0136] pass
[0137] def getRegisteredHardware(self): # Get the list of registered hardware resources
[0138] pass
[0139] In addition, this embodiment also designs a hardware fault detection and automatic switching mechanism, including: health check, regularly performing health checks on the hardware to ensure its normal operation; fault detection, implementing fault detection logic, and being able to quickly identify when hardware problems occur. Fault response, designing fault response strategies such as retry, resource replacement, or task migration. Automatic switching, implementing a mechanism for automatically switching to backup hardware to ensure task continuity and high availability of the system.
[0140] Exemplarily, the hardware fault detection and automatic switching mechanism is as follows:
[0141] class HealthChecker:
[0142] def checkHealth(self, hardware):# Check the health of the hardware
[0143] pass
[0144] class FaultDetector:
[0145] def detectFault(self, hardware):# Detect if the hardware is faulty
[0146] pass
[0147] class FaultToleranceManager:
[0148] def __init__(self, resourceManager):
[0149] self.resourceManager = resourceManager
[0150] def respondToFault(self, faultyHardware):# respond to hardware failure
[0151] pass
[0152] def switchToBackup(self, task, faultyHardware): # Automatically switch to backup hardware
[0153] pass
[0154] In summary, in order to solve the technical problem that the existing heterogeneous computing resource virtualization technology still has certain limitations in the allocation of computing resources, step S10 is performed to obtain the computing unit graph structure. Through the visual display of the computing unit graph structure, the layout and connection relationship of the computing resources can be intuitively understood, thereby achieving efficient management and optimized scheduling of the computing units in the virtualization system.
[0155] Step S20, obtaining task requirement information of the computing task to be assigned.
[0156] It is important to understand that receiving computing tasks is also a core function of the virtualization system. These computing tasks can come from a variety of sources, including but not limited to: (1) Users submit computing tasks through the command line interface, graphical user interface, or API. For example, in the Hadoop ecosystem, users can submit MapReduce jobs; in Kubernetes, users can deploy Pods or Jobs. (2) Automated processes or scheduled tasks within the virtualization system may generate computing tasks, such as cron jobs, automatic backup tasks, system maintenance tasks, etc. (3) Passed from other upstream scheduling systems, for example, data processing and workflow management systems such as Airflow and Lucida will generate and assign tasks.
[0157] When receiving a computing task, the virtualization system will obtain the description information of the computing task, which may include: Task name, a unique name used to identify the task. Task type, such as CPU-intensive, GPU-intensive, data processing, etc. Task priority, indicating the importance of the task relative to other tasks. Resource requirements, the number of processor cores and frequency required. Memory requirements, the memory size required for task execution. Storage requirements, the disk space required for the task. Network requirements, the network bandwidth required for the task. Data requirements, the amount of input data that the task needs to process. Data transmission requirements, the rate and reliability requirements of data transmission. Execution constraints: Time constraints: the start time and deadline of the task. Real-time requirements: whether the task needs to be completed within a specific time. Task dependencies, whether the task depends on the results of other tasks, or needs to be executed under specific environmental conditions. Task duration, the expected length of time for task execution. Quality of service (QoS) requirements, such as throughput, response time, reliability, etc. Interruptibility, whether the task can be interrupted and continued at a later time. Task description files, which may contain more detailed information, such as the code, configuration files, and dependent libraries of the task.
[0158] For example, the virtualization system receives a computing task about predictive maintenance of production equipment. The following is a detailed description of this task: Task name: Predictive maintenance of production equipment. Task type: Data processing and machine learning. Task priority: High. Resource requirements: CPU requirements: 4 cores, frequency not less than 3.0GHz. Memory requirements: 16GB. Storage requirements: 500GB for storing historical data and models. Network requirements: 100Mbps for data transmission. Data requirements: Input data size: 200GB of historical data. Data transmission requirements: Data needs to be transmitted from the factory's SCADA system to the virtualization system. Execution constraints: Time constraints: The task needs to be completed within the maintenance window (00:00-06:00) every night. Real-time requirements: The model is updated once a day. Task dependencies: The task depends on the model of the previous day and the latest sensor data. Task duration: The expected execution time is 4 hours. Quality of service (QoS) requirements: Throughput: The data processing speed is not less than 50MB / s. Response time: The model prediction response time does not exceed 1 second. Reliability: The success rate of the task is not less than 99%. Interruptibility: The task can be interrupted and continued within the maintenance window. Task description file: Contains a detailed description of the task, data processing scripts, machine learning model code, and dependent libraries.
[0159] Based on the description information of the above computing tasks, the virtualization system can extract the task requirement information required to perform the task, so as to screen the computing resources suitable for performing the computing tasks. Task requirement information refers to various information and data required to complete a specific task. It can include task objectives, task environment, task resources, task constraints, data requirements, etc. Among them, the task objectives are used to clarify the goals and expected results that the task needs to achieve. Task type describes the computing type of task execution. Task resources are the various resources required to complete the task, such as computing resources, storage resources, data resources, etc. Task constraints are the various constraints that may be encountered during the execution of the task, such as time constraints, real-time requirements, etc. Task dependencies are whether the task depends on the results of other tasks, or needs to be executed under specific environmental conditions. Quality of service (QoS) requirements: such as throughput, response time, reliability, etc.
[0160] In addition, when the number of computing tasks exceeds the processing capacity of the system, the newly arrived tasks can only be placed in the queue and wait for scheduling. In this case, how to effectively manage and schedule the tasks in the queue to maximize the system throughput and resource utilization becomes an important issue. Therefore, this embodiment provides an optional implementation method of task scheduling to avoid or deal with the situation where the computing tasks exceed the processing capacity of the virtualization system. A scheduler is introduced to enable it to automatically arrange the execution order of computing tasks and allocate resources according to preset scheduling principles. The scheduling principles are as follows: (1) Priority: tasks with high priority can be scheduled first to meet the execution requirements of critical tasks. (2) Serial parallelism of tasks: The scheduler needs to identify the dependencies between tasks to determine whether they are executed serially or in parallel. For serial tasks, the scheduler needs to execute tasks in a specific order; for parallel tasks, the scheduler can allocate resources to multiple tasks at the same time. (3) Resource availability: The scheduler needs to consider the availability of current resources and give priority to tasks that can obtain the required resources immediately.
[0161] Furthermore, load balancing and feedback mechanisms can be introduced into the scheduler. The load balancing algorithm is to ensure the reasonable allocation of resources and avoid overloading of certain resources. The feedback mechanism is to dynamically adjust the scheduling strategy according to the task execution and resource usage.
[0162] Exemplarily, transparent task scheduling is implemented as follows:
[0163] class TaskScheduler:
[0164] def __init__(self, resourceManager):
[0165] self.resourceManager = resourceManager
[0166] def scheduleTask(self, task):# Schedule tasks based on resource status and task priority
[0167] pass
[0168] def balanceLoad(self):# Apply load balancing algorithm
[0169] pass
[0170] def adjustSchedulingPolicy(self, feedback):# Adjust scheduling policy based on feedback
[0171] pass
[0172] Step S30: Query a plurality of candidate computing units that match the task requirement information from the computing unit set.
[0173] It should be noted that the candidate computing units represent computing units that are suitable for executing computing tasks and are in an idle state. By screening the candidate computing units in step S30, those computing units that obviously do not meet the task requirements can be quickly excluded, reducing the amount of subsequent optimization and selection calculations and improving screening efficiency.
[0174] As an optional implementation for determining candidate computing units, based on the computing unit graph structure, the state of each computing unit is checked to determine whether they are in an idle state. Only computing units that have no tasks being executed or tasks that are about to be completed will be considered. Next, the system also needs to query candidate computing units that match the task requirement information. For example, if the task requires a large amount of memory, the system will select computing units with sufficient memory capacity. Finally, since there may be dependencies between computing units, the system also needs to check whether these dependencies will affect the execution of the task. For example, if there is a data transmission dependency between two computing units, the system needs to ensure that this dependency does not cause delays in task execution.
[0175] Exemplarily, a pseudo code implementation method based on a computational unit graph structure is provided:
[0176] class ResourceNode:
[0177] def __init__(self, id, capabilities):
[0178] self.id = id
[0179] self.capabilities = capabilities / / Resource capability description, such as computing, memory, bandwidth, etc.
[0180] self.state = 'idle' / / The initial state is idle
[0181] self.connections = [] / / Resource connection list
[0182] class ResourceGraph:
[0183] def __init__(self):
[0184] self.nodes = {} / / Store all resource nodes
[0185] def addNode(self, node):
[0186] self.nodes[node.id] = node
[0187] def removeNode(self, nodeId):
[0188] del self.nodes[nodeId]
[0189] def findNodesByCapability(self, requiredCapability):
[0190] / / Find matching resource nodes based on capability requirements
[0191] return [node for node in self.nodes.values() if matchesCapability(node.capabilities, requiredCapability)]
[0192] As another optional implementation of determining the candidate computing unit, step S30 may include steps S31 to S33:
[0193] Step S31, screening out a plurality of idle computing units in an idle state from the computing unit set.
[0194] First, the system needs to filter out idle computing units from the computing unit set. This step is to ensure that the selected computing units can be used to execute tasks immediately to avoid resource conflicts and waiting time.
[0195] Step S32, parsing the task characteristics of the computing task from the task requirement information.
[0196] It should be understood that the method for screening candidate computing units adopted in this embodiment is a reinforcement learning algorithm originally created by this application, called "Feature-Driven Dynamic Resource Optimization" (FDDRO). The FDDRO algorithm focuses on automatically optimizing candidate computing units based on task features. The core idea is to extract task features and map them to candidate computing units, and reinforcement learning is used to optimize this mapping process to achieve efficient use of resources.
[0197] Exemplarily, the FDDRO pseudo code is implemented as follows:
[0198] class FeatureExtractor:
[0199] def __init__(self, featureSet):
[0200] self.featureSet = featureSet
[0201] def extractFeatures(self, task) / / Extract features from task description
[0202] pass
[0203] class FeatureDrivenRLAgent:
[0204] def __init__(self, featureExtractor, stateSpace, actionSpace,rewardFunction):
[0205] self.featureExtractor = featureExtractor
[0206] self.stateSpace = stateSpace
[0207] self.actionSpace = actionSpace
[0208] self.rewardFunction = rewardFunction
[0209] self.policyModel = self.initializePolicyModel()
[0210] def initializePolicyModel(self): / / Initialize the reinforcement learning policy model
[0211] pass
[0212] def extractStateFeatures(self, state) / / Extract features from the state
[0213] return self.featureExtractor.extractFeatures(state)
[0214] def chooseAction(self, state) / / Select an action based on the current state characteristics
[0215] stateFeatures = self.extractStateFeatures(state)
[0216] return self.policyModel.act(stateFeatures)
[0217] def learn(self, state, action, reward, newState):
[0218] / / Learn from experience and update the policy model
[0219] stateFeatures = self.extractStateFeatures(state)
[0220] newStateFeatures = self.extractStateFeatures(newState)
[0221] self.policyModel.update(stateFeatures, action, reward,newStateFeatures)
[0222] def updateRewardFunction(self, newMetrics):
[0223] / / Adjust the reward function based on the new performance metric
[0224] pass
[0225] class FDDRO:
[0226] def __init__(self, featureDrivenRLAgent):
[0227] self.featureDrivenRLAgent = featureDrivenRLAgent
[0228] def run(self, task): / / Run the FDDRO algorithm to process the task
[0229] state = self.initializeState(task)
[0230] while not self.isTaskComplete(state):
[0231] action = self.featureDrivenRLAgent.chooseAction(state)
[0232] newState, reward = self.executeAction(action, state)
[0233] self.featureDrivenRLAgent.learn(state, action, reward, newState)
[0234] state = newState
[0235] def initializeState(self, task): / / Initialize task status
[0236] pass
[0237] def isTaskComplete(self, state): / / Check if the task is completed
[0238] pass
[0239] def executeAction(self, action, state): / / Execute the action and get the new state and reward
[0240] pass
[0241] Among them, extracting task features is to convert the task description into a feature vector that can be used to guide resource allocation. First, the task description is parsed through the task parser to extract task parameters and requirements. Then, key features related to resource allocation are selected, such as computing type, data size, real-time requirements, etc. Finally, the features are converted into numerical types for use in machine learning models.
[0242] Exemplarily, feature extraction is implemented as follows:
[0243] class TaskParser:
[0244] def parse(self, taskDescription): / / Parse the task description and extract task parameters
[0245] pass
[0246] class FeatureSelector:
[0247] def selectFeatures(self, taskParameters) / / Select key features from task parameters
[0248] pass
[0249] class FeatureTransformer:
[0250] def transform(self, features): / / Convert features to numeric values
[0251] pass
[0252] class FeatureExtractor:
[0253] def __init__(self):
[0254] self.taskParser = TaskParser()
[0255] self.featureSelector = FeatureSelector()
[0256] self.featureTransformer = FeatureTransformer()
[0257] def extractFeatures(self, taskDescription):
[0258] taskParameters = self.taskParser.parse(taskDescription)
[0259] features = self.featureSelector.selectFeatures(taskParameters)
[0260] return self.featureTransformer.transform(features)
[0261] Step S33, based on the preset reinforcement learning model, multiple candidate computing units matching the task characteristics are screened out from multiple idle computing units.
[0262] It is important to understand that in the process of screening candidate computing units, the policy model in the reinforcement learning model directly makes the decision, which is used to select the best candidate computing unit based on the feature vector. The architecture of the policy model includes: input layer, which receives the feature vector; hidden layer, which uses the fully connected layer or convolutional layer to further process the features; output layer, which outputs the decision of the candidate computing unit.
[0263] Exemplarily, the pseudo code implementation of the decision model is as follows:
[0264] class PolicyModel:
[0265] def __init__(self, inputSize, outputSize): / / Initialize the network structure
[0266] self.inputLayer = InputLayer(inputSize)
[0267] self.hiddenLayers = [DenseLayer(size) for size in hiddenSizes]
[0268] self.outputLayer = OutputLayer(outputSize)
[0269] def forward(self, features): / / Forward propagation
[0270] x = self.inputLayer(features)
[0271] for layer in self.hiddenLayers:
[0272] x = layer(x)
[0273] return self.outputLayer(x)
[0274] def act(self, features) / / Select actions based on features
[0275] return self.forward(features)
[0276] In a feasible implementation, step S33 may include steps S34-S35:
[0277] Step S34, constructing an input state vector of the reinforcement learning model based on the state information and task characteristics of multiple idle computing units.
[0278] It is important to understand that state information includes resource type, load information, and historical performance data. Resource type includes the hardware configuration of the computing unit, such as the number of CPU cores, memory size, storage capacity, network bandwidth, etc. Load information indicates the current load of the computing unit, such as computing resource utilization, memory occupancy, disk I / O rate, network traffic, etc. Historical performance data refers to the performance indicators of the computing unit when it performed similar tasks in the past, such as task completion time, resource consumption, success rate, etc. This information and task features are integrated into a state vector as the input of the reinforcement learning model.
[0279] Step S35, based on the preset reinforcement learning model, multiple candidate computing units are screened out according to the input state vector.
[0280] The constructed input state vector is input into the trained reinforcement learning model, and the model will evaluate the potential value of each idle computing unit relative to the computing task in the current state. The model will select the best action based on the evaluation results, that is, select the candidate computing unit that is most suitable for performing the current task. Finally, a list of candidate computing units is output, which are considered to be the most suitable for performing the task in the current state.
[0281] Step S40, constructing a computing unit to be combined that meets the task requirement information from multiple candidate computing units based on the computing unit graph structure, and forming a computing unit combination for executing the computing task based on the computing units to be combined.
[0282] It can be understood that step S40 constructs a computing unit combination that meets the task requirement information based on the candidate computing units obtained by screening, which decomposes the complex optimization problem into two relatively simple steps. The system can more easily handle large-scale computing tasks and complex resource dependencies, simplifying the complexity of the problem. Through the two-stage screening process, the system can further optimize and select the most appropriate computing unit combination based on the preliminary screening, so that resource optimization and task allocation can be carried out more finely, improving the optimization effect and task execution efficiency.
[0283] After determining the computing unit combination for executing the computing task, the code generator is called to dynamically generate code that can be executed on the corresponding hardware according to the intermediate representation of the computing task and resources and the selected computing unit combination.
[0284] Exemplarily, the dynamic code generation technique is as follows:
[0285] class CodeGenerator:
[0286] def __init__(self, intermediateRepresentation):
[0287] self.intermediateRepresentation = intermediateRepresentation
[0288] def generateCode(self, targetHardware):
[0289] # Generate executable code based on target hardware
[0290] pass
[0291] In a feasible implementation, step S40 includes steps S41 to S43:
[0292] Step S41, determining a matching computing unit construction strategy according to task requirement information.
[0293] In this embodiment, the shortest path and maximum flow are two different computing unit construction strategies. The shortest path strategy aims to make the path connecting the computing units involved in executing the computing task as short as possible. The "shortest" here can refer to physical distance, network delay, resource consumption, execution time, etc. The main goal of the shortest path strategy is to reduce the time and resource consumption of task execution. The maximum flow strategy refers to selecting a group of computing units from the candidate computing units so that the total data transmission between them is maximized. The main goal of the maximum flow strategy is to ensure maximum utilization of resources during task execution.
[0294] If the task has strict execution time requirements, the system can select the shortest path strategy to reduce the task execution time. If the task has high requirements for resource utilization, the system can select the maximum flow strategy to ensure maximum resource utilization. If the task has requirements for both execution time and resource utilization, the system can select a comprehensive strategy that combines the shortest path and maximum flow strategies to balance task execution time and resource utilization.
[0295] Through this process, the system can select the most appropriate computing unit construction strategy based on the task requirement information to meet the task requirements and optimize system performance.
[0296] Step S42: query and construct an initial combination computing unit that meets the task requirement information from the candidate computing units based on the construction strategy.
[0297] It can be understood that the computing unit combination problem of this embodiment is a combination problem in which both the participating computing nodes and the number of nodes are uncertain. For this reason, this embodiment proposes a dynamic and iterative combination determination method. First, based on a random or heuristic algorithm, some computing units are selected from the candidate computing units as the basic combination. Then, the scoring criteria are defined according to the computing unit construction strategy. And the performance of the basic combination is evaluated using the defined evaluation criteria. Then, based on the evaluation results, the combination is adjusted. For example, new computing units are added, inappropriate computing units are removed, or the configuration between computing units is changed. Repeat the evaluation and adjustment steps until a combination that meets all task requirements and has the highest score is found as the initial combination.
[0298] Step S43, analyzing whether the execution of computing tasks based on the initial combined computing unit will cause overload of the virtualization system. If so, the initial combined computing unit is discarded and an initial combined computing unit that meets the task requirement information is reconstructed. If not, the initial combined computing unit is used as a candidate computing unit.
[0299] Without affecting the existing workload, simulate the resource usage after the computing tasks are assigned to the initial combination computing units. Analyze the simulation results to determine whether the initial combination computing units will cause virtualization system resource overload after executing the tasks. If the analysis results show that the initial combination computing units will cause system overload, the combination should be abandoned and return to the construction phase to reselect computing units and consider a more reasonable resource allocation plan. If the analysis results show that the initial combination computing units will not cause system overload, the combination can be used as the computing unit to be combined, and a computing unit combination for executing computing tasks is formed based on the computing units to be combined.
[0300] Through this process, the system can ensure that the final selected computing unit combination can not only meet the needs of the task, but also ensure the stability and reliability of the system. This not only improves the system's resource utilization and task execution efficiency, but also ensures the overall performance of the system and user experience.
[0301] In addition, based on the implementation of steps S31 to S35 in this embodiment, step S40 may further include step S50:
[0302] Step S50, obtaining the execution status of the computing unit combination, and calculating the reward value according to the execution status and the preset multi-dimensional reward function, and updating the reinforcement learning model based on the reward value.
[0303] It is important to understand that the multidimensional reward function can quantify the performance of the computing unit combination in various dimensions. The specific dimensions are related to the task requirements or goals, and can be multiple indicators such as task completion time, resource utilization, and energy consumption. Its basic form is a mathematical expression that accepts the state before executing the computing task, the action of selecting the computing unit combination, and the execution of the computing task as input, and outputs a reward value, which represents the immediate reward generated by the action in this state. This implements an online learning mechanism, allowing the system to continuously learn and optimize during operation.
[0304] In this embodiment, by constructing a computing unit graph structure, the dependency between computing units is clearly expressed, so that computing resources can be used more efficiently when allocating computing tasks. By querying candidate computing units that match the task requirement information, it is ensured that the computing task is assigned to the computing unit that is most suitable for executing the task, thereby improving the success rate and efficiency of task execution. In addition, by adopting the construction strategy of the shortest path and / or maximum flow of computing nodes, a computing unit combination that meets the task requirements can be effectively constructed, avoiding resource waste and system overload. During the construction process, it is analyzed whether the virtualization system will be overloaded, and if so, it is rebuilt to ensure the stability and reliability of the system. At the same time, the reinforcement learning model is used to screen out candidate computing units that match the task characteristics, so that the allocation of computing tasks is more intelligent and adaptive, and the accuracy and efficiency of resource allocation are improved. Finally, by calculating the reward value and feeding it back to the reinforcement learning model, the online learning and optimization of the model is realized, and the performance and flexibility of resource allocation are further improved. In summary, this embodiment can effectively improve the utilization rate and task execution efficiency of heterogeneous computing resources, while ensuring the stability and reliability of the system.
[0305] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can refer to the above introduction, and will not be repeated later. Figure 4 , the method described further includes steps A10 to A30:
[0306] Step A10, obtaining the real-time status of task execution and the simulation status of task execution of the virtualization system.
[0307] It is important to understand that the real-time status refers to data that reflects the current actual operation of the system, including but not limited to: Load status: usage of different types of resources, such as CPU utilization, GPU occupancy, FPGA configuration status, etc. Fault status: whether there is a resource failure, such as a GPU failure, a FPGA configuration failure, etc. Dependency status between tasks: the dependency relationship between tasks executed on heterogeneous resources, such as task A needs to be completed on the GPU, and task B needs to be completed on the FPGA, and task A can only start after task B is completed. Increase and decrease status of computing units: operations such as creation, deletion, and migration of virtualized resources, such as dynamically adding or reducing virtual GPUs. System performance status: the overall performance of the system, such as response time, throughput, and latency of different types of resources. Simulation status refers to the task execution status at the current moment obtained through simulation or prediction based on the configuration of the system's computing units. In other words, the simulation state can be regarded as a prediction or ideal state, while the real-time state is the result of the actual operation of the system. Both are states for the same moment.
[0308] Step A20, comparing the matching degree between the real-time state and the simulation state.
[0309] In this embodiment, a matching score can be defined for each indicator, and then the overall matching degree can be calculated by judging individually or combining these scores. For example, the following formula can be used:
[0310]
[0311] Among them, P refers to the matching degree, N is the number of indicators, A i and B i They are the real-time status data and simulation status data of the ith indicator, respectively. For example, these indicators may include one or more of the load status, fault status, system performance status, increase or decrease status of computing units, and dependency status between tasks.
[0312] Exemplarily, the real-time status of the virtualization system specifically includes: Load status: The current CPU utilization rate is 60%, the GPU utilization rate is 70%, and the FPGA utilization rate is 50%. Fault status: A driver failure occurred in a GPU, resulting in the failure of some tasks to execute. Dependency status between tasks: Task A needs to be completed on the CPU, Task B needs to be completed on the GPU, and Task A can only start after Task B is completed. Increase and decrease status of computing units: No change. System performance status: The average response time of the current system is 150 milliseconds, the throughput is 800 requests per second, and the latency is 40 milliseconds.
[0313] The simulation status of the virtualized system specifically includes: Load status: The predicted system CPU utilization is 65%, the GPU utilization is 75%, and the FPGA utilization is 55%. Fault status: No fault. Dependency status between tasks: Task A needs to be completed on the CPU, Task B needs to be completed on the GPU, and Task A can only start after Task B is completed. Increase and decrease status of computing units: No change. System performance status: The expected average system response time is 160 milliseconds, the throughput is 750 requests per second, and the latency is 45 milliseconds.
[0314] By comparing the real-time status and the simulation status, we can find that: Load status: The actual load is basically consistent with expectations, but the actual GPU usage is slightly lower than expected. Rating: 8 / 10 (because except for the slightly lower GPU usage, the usage of other resources is in line with expectations). Fault status: There is actually a GPU driver fault, which is unexpected. Rating: 5 / 10 (because an unexpected fault occurred, which will affect the overall performance of the system). Task dependency status: The actual task dependency is consistent with expectations. Rating: 10 / 10 (because the task dependency is completely in line with expectations). Computing unit increase and decrease status: The actual computing unit is consistent with expectations. Rating: 10 / 10 (because the change of computing units is completely in line with expectations). System performance status: The actual performance is slightly better than expected. Rating: 9 / 10 (because the actual performance is generally in line with expectations, and even better than expectations in some aspects).
[0315] Next, the overall match can be calculated by weighting the scores of each category and then dividing by the weighted sum. Assuming that each category has the same weight (i.e., each category has the same importance), the overall match P = (8+5+10+10+9) / 5 = 8.4. That is, the overall match is 8.4 / 10.
[0316] Step A30: when the matching degree is lower than a preset matching degree threshold, reconstructing the computing unit combination for executing the computing task.
[0317] When the matching degree between the real-time state and the simulation state is lower than the preset matching degree threshold, it indicates that the current resource allocation and task scheduling strategy of the system fails to achieve the expected performance level. In order to improve this situation, it is necessary to dynamically reconstruct the combination of computing units used to perform computing tasks.
[0318] As an implementation method of reconstructing the computing unit combination, step A30 includes steps A31 to A36:
[0319] Step A31, obtaining a comparison result between the real-time state and the simulation state, and determining abnormal computing nodes and / or abnormal edges based on the comparison result and the computing unit graph structure.
[0320] In a virtualized system, obtaining specific comparison results between the real-time state and the simulated state can help determine which computing nodes and edges in the computing unit graph structure actually perform inconsistent with expectations.
[0321] Abnormal computing nodes include: computing nodes with abnormal loads, that is, computing nodes whose actual loads do not meet expectations; faulty computing nodes, that is, computing nodes that actually fail and cannot work properly; removed computing nodes, that is, computing nodes that no longer exist in the system but are still considered in the simulation state. Abnormal edges include: edges with changed dependencies, that is, edges where the actual task dependencies are inconsistent with those predicted in the simulation state; edges with performance bottlenecks, that is, edges connecting two computing nodes whose actual transmission rate or processing capacity becomes the performance bottleneck of the system.
[0322] Step A32, determining the computing tasks associated with the abnormal computing nodes and / or abnormal edges as computing tasks to be adjusted;
[0323] All computing tasks associated with abnormal computing nodes and / or abnormal edges are marked as computing tasks to be adjusted.
[0324] Step A33: When there is a computing node with abnormal load in the computing task to be adjusted, the dependency relationship of the computing unit combination executing the computing task to be adjusted is adjusted to achieve temporary load transfer.
[0325] When the abnormal situation of the abnormal node is that the load is too high, and there are other computing nodes with lower loads in the system, part of the load of the computing node with abnormal load is transferred to other computing nodes by adjusting the dependency relationship of the computing combination unit of the computing task to be adjusted. In other words, the temporary resource overload problem is solved through temporary load transfer.
[0326] Step A34, when there is a faulty computing node in the computing task to be adjusted, reconstruct the computing unit combination that executes the computing task to be adjusted, or bypass the faulty computing node by adjusting the dependency relationship of the computing unit combination that executes the computing task to be adjusted.
[0327] When there are faulty computing nodes in the computing tasks to be adjusted, the faulty computing nodes can be excluded and the computing unit combination can be reconstructed. Alternatively, the dependencies related to the faulty computing nodes can be identified and the dependencies can be modified so that the affected tasks can bypass the faulty nodes and find new execution paths without changing the original combination of computing units.
[0328] Step A35: when there are removed computing nodes in the computing task to be adjusted, reconstruct the computing unit combination that executes the computing task to be adjusted.
[0329] When there are removed computing nodes in the computing task to be adjusted, the computing unit combination can be reconstructed based on the actual existing computing nodes. The implementation method of reconstructing the computing unit combination refers to the first embodiment, and this embodiment will not be described in detail here.
[0330] Step A36, when the computing task to be adjusted has edges with changed dependencies and / or edges with performance bottlenecks, reconstruct the computing unit combination that executes the computing task to be adjusted, or avoid abnormal edges by adjusting the dependencies of the computing unit combination that executes the computing task to be adjusted.
[0331] When there are edges with changed dependencies and / or performance bottlenecks in the computing tasks to be adjusted, analyze the impact of these edges on task execution, including possible delays, resource contention, and other issues. Reconstruct the computing unit combination according to the abnormal edges and reallocate tasks to other computing nodes to avoid the affected edges. Alternatively, only modify the task dependencies so that the affected tasks can bypass the abnormal edges and find new execution paths.
[0332] In this embodiment, by real-time monitoring of the task execution status of the virtualized system and comparing it with the simulation status, it is possible to promptly discover abnormal conditions in the system during operation, such as load anomalies, failures, dependency changes, and performance bottlenecks. By reconstructing the computing unit combination and adjusting the task dependencies, it is possible to effectively deal with these abnormal conditions by dynamically adapting the computing units to the computing tasks being executed in real time, ensuring the efficient execution of computing tasks and reducing the risk of system interruption and performance degradation. This not only improves the reliability and flexibility of the system, but also optimizes resource utilization and reduces operating costs.
[0333] Based on the first and second embodiments of the present application, in the third embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above description, and will not be described in detail later. Figure 5 , the method described further comprises steps B10 to B40:
[0334] Step B10, obtaining resource demand prediction information based on the computing unit graph structure.
[0335] It is important to understand that resource demand forecast information refers to the forecast of the number of resources required for each computing task in the future. Based on the computing unit graph structure, the historical resource usage, current load, pending tasks, assigned tasks, task priorities, task dependencies and other data of the virtualization system can be analyzed to predict the changes in resource demand for each computing task in the future.
[0336] As an optional implementation method for obtaining resource demand forecast information, future resource demand changes are predicted from the perspective of time series analysis. For example, an autoregressive moving average model (ARIMA) is used to analyze historical resource usage data to predict future resource demand changes.
[0337] As another optional implementation for obtaining resource demand forecast information, the relationship between variables can be studied to predict how a variable (such as resource demand) changes with changes in other variables (such as time, task priority, etc.). For example, a multivariate linear regression model can be used to predict the relationship between resource demand and multiple influencing factors.
[0338] As another optional implementation for obtaining resource demand forecast information, a machine learning algorithm is used to predict future resource demand changes by learning patterns in historical data. For example, algorithms such as decision trees, random forests, and support vector machines (SVMs) may be used.
[0339] As another optional implementation method for obtaining resource demand forecast information, future resource demand changes can be predicted from the perspective of deep learning. For example, convolutional neural networks (CNNs) or recurrent neural networks (RNNs) can be used to process and analyze complex resource demand data and predict future resource demand changes.
[0340] As another optional implementation method for obtaining resource demand forecast information, statistical methods such as mean, standard deviation, confidence interval, etc. are used to analyze resource demand data and predict future changes in resource demand.
[0341] In addition, the prediction performance of the model can be evaluated using methods such as cross-validation and leave-one-out method, and the model can be optimized based on the evaluation results. For example, mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), coefficient of determination (R 2 ) and other indicators to evaluate the prediction performance of the regression model, and the prediction performance of the classification model can also be evaluated by using indicators such as precision, recall, and F1 score. And according to the evaluation results, the prediction performance of the model can be improved by adjusting the model's hyperparameters (such as learning rate, regularization parameter, number of trees, etc.) and selecting different feature combinations.
[0342] For example, suppose a random forest model is used to predict the resource requirements of a computing task. K-fold cross validation can be used to evaluate the prediction performance of the model, and MSE can be selected as the evaluation indicator. Through cross validation, the MSE values under different hyperparameter combinations can be obtained, and then the hyperparameter combination with the smallest MSE can be selected as the optimal model.
[0343] Step B20, determining the resource demand trend of each computing task based on the resource demand forecast information.
[0344] In step B20, the resource demand forecast information obtained in step B10 is used to conduct an in-depth analysis of the resource demand forecast information to identify the resource demand change trends of different computing tasks. For example, some tasks may require more resources in a specific time period, while the resource demand of other tasks may gradually decrease.
[0345] Step B30, when the resource demand trend of the computing task is an upward trend, increase the resource allocation of the computing task.
[0346] Step B40, when the resource demand trend of the computing task is a downward trend, releasing part of the resource configuration of the computing task.
[0347] Optimize resource allocation strategies based on the predicted resource demand trends. For example, for tasks with an increasing resource demand, you can increase resource allocation in advance to avoid resource bottlenecks; for tasks with a decreasing resource demand, you can appropriately reduce resource allocation to improve resource utilization.
[0348] It is important to understand that the increase and release of resource configuration involves various types of resources required for computing tasks, including but not limited to the following: CPU resources: increase or decrease the number of CPU cores or CPU time slices allocated to computing tasks. Memory resources: increase or decrease the memory capacity allocated to computing tasks. Storage resources: increase or decrease the disk space or I / O bandwidth allocated to computing tasks. Network resources: increase or decrease the network bandwidth or number of network connections allocated to computing tasks. GPU resources: for tasks that require graphics processing or deep learning calculations, increase or decrease the GPU devices or GPU computing resources allocated to computing tasks.
[0349] For example, when it is predicted that the CPU usage of a computing task will increase, the number of CPU cores or CPU time slices allocated to the task can be increased; when it is predicted that the memory demand will increase, the memory capacity allocated to the task can be increased.
[0350] For example, when it is predicted that the CPU usage of a computing task will decrease, the number of CPU cores or CPU time slices allocated to the task can be reduced; when it is predicted that the memory demand will decrease, the memory capacity allocated to the task can be reduced.
[0351] By monitoring system status and resource demand changes in real time and dynamically adjusting resource allocation based on the latest forecast information, the resource requirements of computing tasks can be better met while improving resource utilization and reducing costs.
[0352] In this embodiment, by obtaining resource demand prediction information based on the computing unit graph structure, the resource demand trend of each computing task can be accurately predicted. On this basis, by dynamically adjusting the resource configuration of the computing task, the resource configuration can be increased in time when the resource demand increases to ensure the smooth execution of the computing task; when the resource demand decreases, part of the resource configuration can be released in time to improve resource utilization and reduce costs. This dynamic resource configuration scheme based on resource demand prediction can not only improve the system's response speed and the flexibility of computing task processing, but also effectively reduce resource waste and improve the overall system's operating efficiency and economic benefits.
[0353] All terms (including technical and scientific terms) used in this application have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used here should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0354] For example, the terms "first", "second", etc. used in this application may be used in this article to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first state management container may be referred to as a second state management container, and similarly, a second state management container may be referred to as a first state management container. Both the first state management container and the second state management container are state management containers, but they are not the same state management container.
[0355] For another example, the terms “include”, “comprising”, etc. used in this application indicate the existence of features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0356] In one embodiment, a computer storage medium is provided, on which executable instructions are stored. When the instructions are executed by a processor, the processor executes the steps in the above-mentioned method embodiments.
[0357] In one embodiment, an electronic device is also provided, including one or more processors; a memory, wherein one or more programs are stored in the memory, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the steps in the above-mentioned method embodiments. For example, the electronic device can be any device such as the above-mentioned thermal management device and computing service device.
[0358] In one embodiment, Figure 6As shown, it shows a schematic diagram of the structure of an electronic device for implementing an embodiment of the present application. The electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 to a random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. CPU 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0359] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0360] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, including a computer-readable medium carrying instructions, in such an embodiment, the instructions can be downloaded and installed from a network through a communication part 609, and / or installed from a removable medium 611. When the instructions are executed by a central processing unit (CPU) 601, the various method steps described in the present application are executed.
[0361] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0362] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present application and form different embodiments. For example, in the above claims, any one of the claimed embodiments may be used in any combination. The information disclosed in this background technology section is intended only to deepen the understanding of the overall background technology of the present application and should not be regarded as an admission or in any form of implication that the information constitutes prior art known to those skilled in the art.
Claims
1. A method for virtualizing heterogeneous computing resources, characterized in that: The method comprises: Acquire a computing unit graph structure formed by a set of computing units in a virtualized system, wherein the computing unit graph structure includes computing nodes formed by the computing units and edges connecting the computing nodes, wherein the edges represent dependency relationships between the computing nodes; Obtaining task requirement information of the computing tasks to be assigned; Querying a plurality of candidate computing units that match the task requirement information from the computing unit set, wherein the candidate computing units represent computing units that are suitable for executing the computing task and are in an idle state; Based on the computing unit graph structure, construct a computing unit to be combined that meets the task requirement information from the multiple candidate computing units, and form a computing unit combination for executing the computing task according to the computing units to be combined; The method of constructing a computing unit to be combined that meets the task requirement information from the multiple candidate computing units based on the computing unit graph structure includes: determining a matching computing unit construction strategy according to the task requirement information, the construction strategy including the shortest path of computing nodes and / or the maximum flow of computing nodes, querying and constructing an initial combined computing unit that meets the task requirement information from the candidate computing units based on the construction strategy, analyzing whether the virtualization system will be overloaded when executing the computing task based on the initial combined computing unit, if so, abandoning the initial combined computing unit and reconstructing the initial combined computing unit that meets the task requirement information, if not, using the initial combined computing unit as the computing unit to be combined.
2. According to the method of claim 1, the step of querying a plurality of candidate computing units that match the task requirement information from the computing unit set comprises: Filtering out a plurality of idle computing units in an idle state from the computing unit set; parsing the task characteristics of the computing task from the task requirement information; According to a preset reinforcement learning model, a plurality of candidate computing units matching the task characteristics are screened out from the plurality of idle computing units.
3. The method according to claim 2, characterized in that The step of selecting, according to a preset reinforcement learning model, a plurality of candidate computing units matching the task characteristics from the plurality of idle computing units comprises: Based on the state information of the plurality of idle computing units and the task characteristics, constructing an input state vector of a reinforcement learning model, the state information including resource type, load information, and historical performance data; Based on a preset reinforcement learning model, a plurality of candidate computing units are screened out according to the input state vector; After constructing a computing unit to be combined that meets the task requirement information from the multiple candidate computing units based on the computing unit graph structure, and forming a computing unit combination for executing the computing task according to the computing unit to be combined, the method further includes: The execution status of the computing unit combination is obtained, and a reward value is calculated according to the execution status and a preset multidimensional reward function, and the reinforcement learning model is updated based on the reward value.
4. The method according to claim 1, characterized in that The method further comprises: Acquire the real-time status of task execution and the simulation status of task execution of the virtualization system; comparing the matching degree between the real-time state and the simulation state; When the matching degree is lower than a preset matching degree threshold, the computing unit combination for executing the computing task is reconstructed.
5. The method according to claim 4, characterized in that The real-time status includes one or more of a load status, a fault status, a dependency status between tasks, an increase or decrease status of computing units, and a system performance status; The reconstructing of the computing unit combination for executing the computing task includes: Obtaining a comparison result between the real-time state and the simulation state, and determining abnormal computing nodes and / or abnormal edges based on the comparison result and the computing unit graph structure, wherein the abnormal computing nodes include one or more of computing nodes with abnormal loads, faulty computing nodes, and removed computing nodes, and the abnormal edges include one or more of edges with changed dependencies and edges with performance bottlenecks; Determine the computing task associated with the abnormal computing node and / or the abnormal edge as the computing task to be adjusted; When the computing task to be adjusted has a computing node with the abnormal load, adjusting the dependency relationship of the computing unit combination executing the computing task to be adjusted to achieve temporary load transfer; When the computing task to be adjusted has the computing node with the fault, reconstructing the computing unit combination that executes the computing task to be adjusted, or bypassing the computing node with the fault by adjusting the dependency relationship of the computing unit combination that executes the computing task to be adjusted; When the computing task to be adjusted has the removed computing node, reconstructing a computing unit combination that executes the computing task to be adjusted; When the computing task to be adjusted has an edge with a changed dependency and / or an edge with a performance bottleneck, the computing unit combination that executes the computing task to be adjusted is reconstructed, or the dependency of the computing unit combination that executes the computing task to be adjusted is adjusted to avoid the abnormal edge.
6. The method according to claim 1, characterized in that The method further comprises: Obtain resource demand prediction information based on the computing unit graph structure; Determining resource demand trends of various computing tasks based on the resource demand forecast information; When the resource demand trend of the computing task is an upward trend, increasing the resource allocation of the computing task; When the resource demand trend of the computing task is a downward trend, part of the resource configuration of the computing task is released.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Obtaining basic attribute information of heterogeneous computing resources, wherein the basic attribute information includes one or more of computing power, memory bandwidth, energy consumption, latency, and parallelism; Based on the basic attribute information and a preset primitive description language, abstracting the heterogeneous computing resources into programmable computing units; Based on the computing unit state migration mechanism, the state label of the computing unit is dynamically updated, and the state label includes idle, busy or migrating.
8. An electronic device, characterized in that: include: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the heterogeneous computing resource virtualization processing method as described in any one of claims 1 to 7.
9. A computer storage medium, characterized in that The storage medium stores executable instructions, and when the instructions are executed by the processor, the processor executes the heterogeneous computing resource virtualization processing method according to any one of claims 1 to 7.
Citation Information
Patent Citations
GPU virtualization and resource scheduling method and device
CN111930522A
Heterogeneous computing-oriented resource scheduling method, node, system, equipment and medium
CN114996018A