Patent Description:
A requirement for a computing capability of a computing node becomes increasingly high with an explosive increase of client applications and data A computing capability of a general-purpose central processing unit (Central Processing Unit, CPU) cannot meet a demand for high performance computing of rapid development of a current service. Therefore, heterogeneous computing that can economically and effectively obtain a high performance computing capability and has high scalability, high computing resource utilization, and tremendous development potential rises to the occasion. However, services of different enterprises usually require different heterogeneous computing capabilities. For example, different enterprises have different selections in aspects of types and granularities of heterogeneous acceleration capabilities.

In the prior art, a heterogeneous acceleration solution dedicated to a graphics processing unit (Graphics Processing Unit, GPU) is provided. A computing node accesses and uses a GPU resource on a server in a client-server (client-server) manner. However, a virtual machine (Virtual Machine, VM) in the computing node cannot access or use the GPU resource on the server, and virtualization of all GPU resources on the server cannot be implemented either.

Further, <CIT> refers to an accelerator virtualization method and apparatus, and a centralized resource manager. The method comprises: a centralized resource manager selects, according to to-be-created virtual accelerator information in a virtual machine resource configuration command, a matching physical accelerator from a physical accelerator resource pool as a matched physical accelerator; the centralized resource manager sends a first virtual machine creation command to a virtual machine monitor, so that the virtual machine monitor creates a first virtual machine comprising a first virtual accelerator corresponding to the matched physical accelerator, or the centralized resource manager sends a second virtual machine creation command comprising a description information obtaining identifier to the virtual machine monitor, so that the virtual machine monitor creates a second virtual machine after receiving the second virtual machine creation command, and the second virtual machine generates a second virtual accelerator after obtaining description information according to the description information obtaining identifier.

Further the document <NPL> refers to scheduling multi-tenant cloud workloads on accelerator-based systems.

An objective of embodiments of this application is to provide an acceleration method and an acceleration system, in the expectation of implementing heterogeneous computing of a virtual machine in a scenario of heterogeneous acceleration resource virtualization, and improving computing performance of the virtual machine. This problem is solved by the subject matter of the independent claims. Further implementation forms are provided in the dependent claims.

To describe the technical solutions in the embodiments of this application or in the background more clearly, the following describes the accompanying drawings required for describing the embodiments of this application or the background.

The terms "including", "having", and any other variant thereof mentioned in this specification, claims, and the accompanying drawings of this application are intended to cover a non-exclusive inclusion. For example, a process, a method, a system, a product, or a device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes an unlisted step or unit, or optionally further includes another inherent step or unit of the process, the method, the product, or the device.

Referring to <FIG> is a schematic architectural diagram of an acceleration resource scheduling system according to an embodiment of this application. As shown in <FIG>, the acceleration resource scheduling system includes a computing node, a management node, and a physical acceleration resource. The computing node may be connected to the physical acceleration resource by using a network switch, the management node is connected to the computing node by using the network switch, and the management node is further connected to the physical acceleration resource by using the network switch. The management node and the physical acceleration resource may be deployed in a cloud, and the management node may be a server, configured to perform centralized management on physical acceleration resources in the cloud. The physical acceleration resource includes at least one network accelerator. The computing node may create one or more virtual machines. If the virtual machine created by the computing node needs to schedule the physical acceleration resource in the cloud to perform acceleration processing on to-be-accelerated data, the virtual machine may initiate an application for the acceleration resource to the management node in advance. After virtualizing the physical acceleration resource, the management node configures, for the virtual machine for use, at least some physical acceleration resources deployed in the cloud, and then the virtual machine may schedule the at least some configured physical acceleration resources in the cloud for acceleration processing.

The computing node may be a computing device such as a server, a computer, or a communications terminal.

Referring to <FIG> is a schematic architectural diagram of another acceleration resource scheduling system according to an embodiment of this application. Based on the system architecture shown in <FIG>, the system architecture shown in <FIG> is described by using an example in which physical acceleration resources include one network accelerator <NUM> and a computing node <NUM> includes one virtual machine <NUM>. As shown in <FIG>, the computing node <NUM> includes the virtual machine <NUM> and a scheduling apparatus <NUM>. The network accelerator <NUM> includes at least one physical accelerator, and in <FIG>, two physical accelerators <NUM> and <NUM> are used as an example for description. The physical accelerator in the network accelerator <NUM> may be implemented by using, but not limited to, an apparatus such as a graphics processing unit (English: Graphics Processing Unit, GPU for short), or a field programmable gate array (Field-Programmable Gate Array, FPGA), or an application-specific integrated chip (ASIC Application Specific Integrated Circuit, ASIC). At least one physical accelerator in each network accelerator <NUM> may be implemented by using, but not limited to, an apparatus such as a GPU, an FPGA, or an ASIC.

Specifically, a processor <NUM> used by the virtual machine <NUM> in the computing node <NUM> is connected to the scheduling apparatus <NUM> by using a high-speed serial computer expansion bus standard (Peripheral Component Interconnect express) PCIe bus <NUM>.

The management node <NUM> is separately connected to the network accelerator <NUM>, the virtual machine <NUM>, and the scheduling apparatus <NUM> by using a network, and the management node <NUM> is configured to allocate, based on an acceleration requirement of a user, at least some physical acceleration resources in the physical acceleration resources to the virtual machine <NUM> for use. In a specific implementation, the management node <NUM> sends a virtual accelerator application command to the scheduling apparatus <NUM>, so as to instruct the scheduling apparatus <NUM> to be responsible for creating a virtual accelerator <NUM> and processing mapping logic between the virtual accelerator <NUM> and an object accelerator <NUM> or mapping logic between the virtual accelerator <NUM> and the physical accelerator <NUM>. A mapping logic relationship between the virtual accelerator <NUM> and the object accelerator <NUM> is indicated by a dashed line shown in <FIG>. The virtual accelerator <NUM> is mapping, on the scheduling apparatus <NUM>, of a physical acceleration resource allocated to the virtual machine <NUM>, the physical acceleration resource includes at least some physical acceleration resources in the at least one physical accelerator <NUM> in the at least one network accelerator <NUM>, and a physical acceleration resource provided in the cloud is allocated to the virtual machine <NUM> as required.

The network accelerator <NUM>, which is connected to the scheduling apparatus <NUM> and the management node <NUM> by using a network, is configured to: create the object accelerator <NUM> based on a physical acceleration resource creation command sent by the management node <NUM>, create an identifier of the object accelerator <NUM>, and store a correspondence between the identifier of the object accelerator <NUM> and an identifier of a physical accelerator that is in the network accelerator <NUM> and that is configured to provide a physical acceleration resource for the virtual machine <NUM>. The correspondence between the identifier of the object accelerator <NUM> and the identifier of the physical accelerator that is in the network accelerator <NUM> and that is configured to provide the physical acceleration resource for the virtual machine <NUM> is indicated by a dashed line in <FIG>.

The scheduling apparatus <NUM> is configured to be responsible for: creating the virtual accelerator <NUM> based on a virtual accelerator application command sent by the management node <NUM> and processing the mapping logic between the virtual accelerator <NUM> and the object accelerator <NUM>; and deleting the mapping logic between the virtual accelerator <NUM> and the object accelerator <NUM> based on an object accelerator deletion command sent by the management node <NUM>.

The management node <NUM> is further configured to delete, based on a resource deletion requirement of the user from the at least some physical acceleration resources that are in the physical acceleration resources and that have been allocated to the virtual machine <NUM> for use, some or all physical acceleration resources that need to be deleted by the user. Optionally, in an implementation, the management node <NUM> receives an acceleration resource deletion request sent by a client, and deletes the physical acceleration resource that is of the virtual machine <NUM> and that needs to be deleted by the user. The client may be application management software deployed on the virtual machine <NUM> or any network communications device. After logging in to the client, the user may select the to-be-deleted physical acceleration resource based on physical acceleration resource information that corresponds to the virtual machine <NUM> and that is presented in an interface of the client, where the physical acceleration resource information includes an identifier of the virtual accelerator <NUM> or the identifier of the object accelerator <NUM> that has been allocated to the virtual machine <NUM>.

Referring to <FIG> is a schematic architectural diagram of another acceleration resource scheduling system according to an embodiment of this application. The system architecture shown in <FIG> and the system architecture shown in <FIG> have no difference in hardware implementation, except that mapping logic between a virtual machine accelerator and a physical acceleration resource is different. Mapping logic shown in <FIG> between a virtual accelerator and a physical acceleration resource is implemented by using mapping logic between the virtual accelerator and an object accelerator and mapping logic between the object accelerator and a physical accelerator. Mapping logic shown in <FIG> between a virtual accelerator and a physical acceleration resource is implemented by using mapping logic between the virtual machine accelerator and a physical accelerator. In the system architecture shown in <FIG>, a management node <NUM> is connected to a network accelerator <NUM>, a virtual machine <NUM>, and a scheduling apparatus <NUM> by using a network, and the management node <NUM> is configured to allocate, based on an acceleration requirement of a user, at least some physical acceleration resources in physical acceleration resources to the virtual machine <NUM> for use. In a specific implementation, the management node <NUM> sends a virtual accelerator application command to the scheduling apparatus <NUM>, so as to instruct the scheduling apparatus <NUM> to be responsible for creating a virtual accelerator <NUM> and processing mapping logic between the virtual accelerator <NUM> and a physical accelerator <NUM>. The mapping logic between the virtual accelerator <NUM> and the physical accelerator <NUM> is indicated by using a dashed line in <FIG>.

In addition, the system architecture shown in <FIG> is different from the system architecture shown in <FIG> in that, the scheduling apparatus <NUM> is configured to be responsible for: creating the virtual accelerator <NUM> based on a virtual accelerator application command sent by the management node <NUM> and processing the mapping logic between the virtual accelerator <NUM> and the physical accelerator <NUM>; and deleting the mapping logic between the virtual accelerator <NUM> and the physical accelerator <NUM> based on a physical accelerator deletion command sent by the management node <NUM>.

In addition, the system architecture shown in <FIG> is different from the system architecture shown in <FIG> in that, the management node <NUM> is further configured to delete, based on a resource deletion requirement of the user from at least some physical acceleration resources that are in the physical acceleration resources and that have been allocated to the virtual machine <NUM> for use, some or all physical acceleration resources that need to be deleted by the user. Optionally, in an implementation, the management node <NUM> receives a physical accelerator deletion command sent by a client, and deletes the physical acceleration resource that is of the virtual machine <NUM> and that needs to be deleted by the user. The physical accelerator deletion command includes an identifier of the to-be-deleted physical accelerator <NUM> and an identifier of the virtual machine <NUM>. The client may be application management software deployed on the virtual machine <NUM> or any network communications device. After logging in to the client, the user may select the to-be-deleted physical acceleration resource based on physical acceleration resource information that corresponds to the virtual machine <NUM> and that is presented in an interface of the client, where the physical acceleration resource information includes the identifier of the virtual accelerator <NUM> or the identifier of the physical accelerator <NUM> that has been allocated to the virtual machine <NUM>. In the embodiment of the foregoing system architecture, after the physical acceleration resource provided by the at least one network accelerator in the cloud is virtualized, the virtual machine corresponds to a virtual accelerator, so as to present, to the virtual machine, an acceleration resource provided for the virtual accelerator. The VM directly accesses a corresponding virtual accelerator to implement access of the virtual machine to the physical acceleration resource in the cloud, thereby implementing heterogeneous computing of the virtual machine in a scenario of heterogeneous acceleration resource virtualization.

With reference to the acceleration resource scheduling system architectures shown in <FIG> and <FIG>, the following describes an acceleration resource scheduling method in an embodiment of this application in detail. An implementation of an acceleration requirement of a virtual machine through the system architecture shown in <FIG> or <FIG> is: processing the acceleration requirement of the virtual machine by using a scheduling apparatus in a computing node. In a specific implementation, referring to <FIG> is a schematic flowchart of an acceleration resource scheduling method according to an embodiment of this application. The method is applied to an acceleration system, where the acceleration system includes a computing node and at least one network accelerator, the computing node includes a virtual machine and a scheduling apparatus, and the network accelerator includes at least one physical accelerator. Step S401 in the method in <FIG> may be performed by the virtual machine in <FIG>, <FIG>, or <FIG>; and steps S402, S403, and S406 in the method in <FIG> may be performed by the scheduling apparatus in <FIG>, <FIG>, or <FIG>, or a scheduling apparatus in <FIG>, or a processing unit in a scheduling apparatus shown in <FIG>, or a processor <NUM> in a scheduling apparatus shown in <FIG>.

A VM sends an acceleration instruction to a scheduling apparatus, where the acceleration instruction includes to-be-accelerated data.

The acceleration instruction further includes an identifier of the virtual machine or an identifier of a virtual accelerator.

The identifier of the virtual machine is used to indicate a virtual machine that sends the acceleration instruction.

The identifier of the virtual accelerator is used to indicate a virtual accelerator that is to process the acceleration instruction. Based on the system architecture shown in <FIG> or <FIG>, one corresponding virtual accelerator is allocated to each virtual machine in each computing node. Each virtual machine pre-stores an identifier of a virtual accelerator corresponding to the virtual machine.

The scheduling apparatus determines a virtual accelerator allocated to the virtual machine.

Optionally, if the acceleration instruction in step S401 further includes the identifier of the virtual machine, the scheduling apparatus pre-stores a correspondence between the identifier of the virtual machine and the identifier of the virtual accelerator, and the determining a virtual accelerator allocated to the virtual machine includes: determining, based on the correspondence between the identifier of the virtual machine and the identifier of the virtual accelerator, the virtual accelerator corresponding to the virtual machine.

Optionally, if the acceleration instruction in step S401 further includes the identifier of the virtual machine, the determining a virtual accelerator allocated to the virtual machine includes: determining, based on the identifier of the virtual accelerator, the virtual accelerator corresponding to the virtual machine.

The virtual accelerator is mapping, on the scheduling apparatus, of a physical acceleration resource allocated to the virtual machine, and the physical acceleration resource includes at least some physical acceleration resources in the at least one physical accelerator in the at least one network accelerator.

The scheduling apparatus determines, based on the virtual accelerator, a network accelerator that is to process the acceleration instruction, and sends the acceleration instruction to the network accelerator.

The network accelerator sends the acceleration instruction to a physical accelerator that is to process the acceleration instruction.

The physical accelerator performs acceleration computing on the to-be-accelerated data by using the physical acceleration resource, and then returns a computing result to the scheduling apparatus.

The scheduling apparatus sends the computing result to the virtual machine.

An entire scheduling process in which the VM accesses the physical acceleration resource in the network accelerator does not require participation of a virtualization middle layer (hypervisor) in the computing node, and can be implemented by the scheduling apparatus by directly accessing the virtual accelerator corresponding to the virtual machine, thereby reducing a delay of the virtual machine in accessing the network accelerator. In addition, a virtual accelerator is visible to the VM, and the VM does not need to directly manage a plurality of network accelerators, thereby simplifying use and management of an acceleration resource by a VM tenant. In addition, a mapping relationship between the virtual accelerator and the physical acceleration resource is implemented by implementing the mapping, on the scheduling apparatus, of the physical acceleration resource allocated to the virtual machine. In this way, physical acceleration resources to which virtual accelerators respectively corresponding to different virtual machines are mapped can be determined rapidly, and direct forwarding of an acceleration command of the virtual machine can be implemented, thereby completing acceleration of an entire data flow of the virtual machine. In addition, different types of physical acceleration resources in a cloud, such as GPU, FPGA, or ASIC acceleration resources, can be managed and virtualized in a centralized manner. The physical acceleration resources in the cloud are flexibly virtualized based on different acceleration requirements of different virtual machines, and therefore compatibility is strong.

To implement mapping between a virtual accelerator and at least some physical acceleration resources in physical acceleration resources in a cloud, the virtual accelerator may be mapped to an object accelerator, and a network accelerator at which the object accelerator is located is a network accelerator that is allocated to the virtual machine to process to-be-accelerated data. Specifically, the mapping may be implemented based on the system architecture shown in <FIG> and with reference to a method exemplified in <FIG> and <FIG>. Alternatively, the virtual accelerator may be directly mapped to a physical accelerator in the at least some physical acceleration resources in a cloud, and a network accelerator at which the physical accelerator is located is a network accelerator that is allocated to the virtual machine to process to-be-accelerated data. Specifically, the mapping may be implemented based on the system architecture shown in <FIG> and with reference to a method exemplified in <FIG> and <FIG>.

Referring to <FIG> and <FIG>, <FIG> and <FIG> are a schematic flowchart of another acceleration resource scheduling method according to an embodiment of this application. When a VM intends to apply for an acceleration resource, the VM may initiate an acceleration resource application request to a management node by using a client; and the management node may generate a virtual accelerator application command based on an acceleration resource requirement of the VM and resource usage of a network accelerator, and send the command to a scheduling apparatus, so as to instruct the scheduling apparatus to perform acceleration resource scheduling. Steps S501 and S510 in the method in <FIG> and <FIG> may be performed by the virtual machine in <FIG>, <FIG>, or <FIG>; steps S502, S503, S504, S506, and S507 in the method in <FIG> and <FIG> may be performed by the management node in <FIG>, <FIG>, or <FIG>, or a management node in <FIG> or <FIG>, or a processing unit in a management node shown in <FIG>, or a processor <NUM> in a management node shown in <FIG>; and steps S508, S509, S511, S512, S513, and S516 in the method in <FIG> and <FIG> may be performed by the scheduling apparatus in <FIG>, <FIG>, or <FIG>, or a scheduling apparatus in <FIG>, or a processing unit in a scheduling apparatus shown in <FIG>, or a processor <NUM> in a scheduling apparatus shown in <FIG>. The method may include the following steps.

A virtual machine sends an acceleration resource application request to a management node.

The acceleration resource application request includes an identifier of the virtual machine, a quantity of required physical acceleration resources allocated to the virtual machine, and a type identifier of a physical accelerator that provides the physical acceleration resource for the virtual machine.

The management node determines, based on the type identifier of the physical accelerator and the quantity of the required physical acceleration resources, each network accelerator to which the at least one physical accelerator that provides the physical acceleration resource belongs.

The management node generates a physical acceleration resource creation command, where the physical acceleration resource creation command is used to instruct the network accelerator to create an object accelerator, and store a correspondence between an identifier of the object accelerator and an identifier of a physical accelerator that is in the network accelerator and that is configured to provide a physical acceleration resource for the virtual machine.

The management node sends the physical acceleration resource creation command to the network accelerator.

The network accelerator sends the identifier of the object accelerator to the management node.

The network accelerator receives the physical acceleration resource creation command, creates the identifier of the object accelerator, and stores the correspondence between the identifier of the object accelerator and an identifier of each physical accelerator that is in the network accelerator and that is configured to provide a physical acceleration resource for the virtual machine.

The management node generates a virtual accelerator application command, where the virtual accelerator application command includes an identifier of the virtual machine and the identifier of the object accelerator.

The management node sends the virtual accelerator application command to the scheduling apparatus, so that the scheduling apparatus stores a correspondence between an identifier of a virtual accelerator and the identifier of the object accelerator based on the virtual accelerator application command.

The acceleration resource is allocated to the virtual accelerator of the virtual machine by using steps S501 to S507. When a user needs to delete the acceleration resource subsequently, a specific implementation is: receiving, by the management node, an acceleration resource deletion request sent by the client, and deleting a physical acceleration resource that is of the virtual machine and that needs to be deleted by the user. The client may be application management software deployed on the virtual machine or any network communications device. After logging in to the client, the user may select the to-be-deleted physical acceleration resource based on physical acceleration resource information that corresponds to the virtual machine and that is presented in an interface of the client, where the physical acceleration resource information includes the identifier of the virtual accelerator, the identifier of the physical accelerator, or the identifier of the object accelerator that has been allocated to the virtual machine.

If the user needs to delete physical acceleration resources that are provided by some physical accelerators corresponding to an object accelerator corresponding to the virtual accelerator, the client sends the acceleration resource deletion request to the management node. The acceleration resource deletion request includes an identifier of a to-be-deleted physical accelerator and an identifier of an object accelerator corresponding to the to-be-deleted physical accelerator. After receiving the acceleration resource deletion request sent by the client, the management node generates a physical acceleration resource deletion command, and sends the physical acceleration resource deletion command to a network accelerator at which the to-be-deleted physical accelerator is located. The physical acceleration resource deletion command is used to instruct the network accelerator at which the to-be-deleted physical accelerator is located to delete a correspondence between the identifier of the to-be-deleted physical accelerator and the identifier of the object accelerator corresponding to the to-be-deleted physical accelerator.

If the user needs to delete physical acceleration resources that are provided by all physical accelerators corresponding to the object accelerator corresponding to the virtual accelerator, the acceleration resource deletion request sent by the user by using the client further includes the identifier of the virtual machine. In a specific implementation, after the receiving, by the management node, an acceleration resource deletion request sent by the client, the following is further included: sending, by the management node, an object accelerator deletion command to the scheduling apparatus, where the object accelerator deletion command includes the identifier of the virtual machine and the identifier of the object accelerator, and the object accelerator deletion command is used to instruct the scheduling apparatus to: after it is determined, based on the identifier of the virtual machine, that there is a virtual accelerator corresponding to the virtual machine, if it is determined that all object accelerators corresponding to the virtual accelerator include an object accelerator indicated by the identifier of the object accelerator, delete the identifier of the object accelerator.

If the user needs to delete all physical acceleration resources provided by the virtual accelerator, the acceleration resource deletion request sent by the user by using the client further includes the identifier of the virtual machine and the identifier of the virtual accelerator. In a specific implementation, after the receiving, by the management node, an acceleration resource deletion request sent by the client, the following is further included: sending, by the management node, a virtual accelerator deletion command to the scheduling apparatus, where the virtual accelerator deletion command includes the identifier of the virtual machine and the identifier of the virtual accelerator, and the virtual accelerator deletion command is used to instruct the scheduling apparatus to: after it is determined, based on the identifier of the virtual machine, that there is a virtual accelerator indicated by the identifier of the virtual accelerator corresponding to the virtual machine, delete correspondences between the identifier of the virtual accelerator and identifiers of all object accelerators.

The following describes a process in which the scheduling apparatus creates a virtual accelerator after receiving the virtual accelerator application command and determining, based on the identifier of the virtual machine, that there is no virtual accelerator corresponding to the virtual machine. For specific implementation, refer to step S508.

If it is determined that there is no virtual accelerator corresponding to the virtual machine, the scheduling apparatus creates a virtual accelerator corresponding to the virtual machine, allocates an identifier to the virtual accelerator, and stores a correspondence between the identifier of the virtual accelerator and the identifier of the object accelerator.

The following describes a process in which the scheduling apparatus updates a virtual accelerator after receiving the virtual accelerator application command and determining, based on the identifier of the virtual machine, that there is a virtual accelerator corresponding to the virtual machine. For specific implementation, refer to step S509.

If it is determined that there is a virtual accelerator corresponding to the virtual machine, determine whether all object accelerators corresponding to the virtual accelerator include an object accelerator indicated by the identifier of the object accelerator; and if it is determined that none of the object accelerators corresponding to the virtual accelerator include the object accelerator indicated by the identifier of the object accelerator, store a mapping relationship between the virtual accelerator and the identifier of the object accelerator.

The following describes how the scheduling apparatus provides the physical acceleration resource to perform acceleration processing on to-be-accelerated data after creating the virtual accelerator. Specifically, the following steps S510 to S516 are included.

The VM sends an acceleration instruction to the scheduling apparatus, where the acceleration instruction includes to-be-accelerated data. For specific implementation, refer to step S401 shown in <FIG>.

The scheduling apparatus determines a virtual accelerator allocated to the virtual machine. For specific implementation details, refer to step S402 shown in <FIG>.

Optionally, the acceleration instruction further includes the identifier of the virtual machine; and the scheduling apparatus pre-stores a correspondence between the identifier of the virtual machine and the identifier of the virtual accelerator, and may determine, based on the correspondence between the identifier of the virtual machine and the identifier of the virtual accelerator, the virtual accelerator corresponding to the virtual machine.

Alternatively, the acceleration instruction further includes the identifier of the virtual accelerator, and the virtual machine pre-stores a correspondence between the identifier of the virtual machine and the identifier of the virtual accelerator; and the scheduling apparatus may determine, based on the identifier of the virtual accelerator, the virtual accelerator corresponding to the virtual machine.

The scheduling apparatus determines an object accelerator corresponding to the virtual accelerator.

A network accelerator at which the object accelerator is located is the network accelerator that is to process the acceleration instruction.

The scheduling apparatus sends the identifier of the object accelerator to the network accelerator.

The network accelerator determines, based on the identifier of the object accelerator, a physical accelerator corresponding to the object accelerator, and sends the acceleration instruction to the physical accelerator.

The physical accelerator performs acceleration computing on the to-be-accelerated data by using the physical acceleration resource, and then returns a computing result to the scheduling apparatus.

The scheduling apparatus sends the computing result to the virtual machine.

Certainly, to implement mapping between the virtual accelerator and at least some physical acceleration resources in physical acceleration resources in a cloud, in another optional implementation, the virtual accelerator may be directly mapped to a physical accelerator in the at least some physical acceleration resources in the cloud, and a network accelerator at which the physical accelerator is located is a network accelerator that is allocated to the virtual machine to process to-be-accelerated data. Specifically, the mapping may be implemented based on the system architecture shown in <FIG> and with reference to a method exemplified in <FIG> and <FIG>.

Referring to <FIG> and <FIG>, <FIG> and <FIG> are a schematic flowchart of still another acceleration resource scheduling method according to an embodiment of this application. When a VM intends to apply for an acceleration resource, the VM may initiate an acceleration resource application request to a management node by using a client; and the management node may generate a virtual accelerator application command based on an acceleration resource requirement of the VM and resource usage of a network accelerator, and send the command to a scheduling apparatus, so as to instruct the scheduling apparatus to perform acceleration resource scheduling. Steps S601 and S607 in the method in <FIG> and <FIG> may be performed by the virtual machine in <FIG>, <FIG>, or <FIG>; steps S602, S603, and S604 in the method in <FIG> may be performed by the management node in <FIG>, <FIG>, or <FIG>, or a management node in <FIG>, or a processing unit in a management node shown in <FIG>, or a processor <NUM> in a management node shown in <FIG>; and steps S605, S606, S608, S609, S610, and S613 in the method in <FIG> and <FIG> may be performed by the scheduling apparatus in <FIG>, <FIG>, or <FIG>, or a scheduling apparatus in <FIG>, or a processing unit in a scheduling apparatus shown in <FIG>, or a processor <NUM> in a scheduling apparatus shown in <FIG>. The method may include the following steps.

A virtual machine sends an acceleration resource application request to a management node.

The management node determines, based on the type identifier of the physical accelerator and the quantity of the required physical acceleration resources, each network accelerator to which the at least one physical accelerator that provides the physical acceleration resource belongs.

The management node generates a virtual accelerator application command.

The virtual accelerator application command includes the identifier of the virtual machine and an identifier of a physical accelerator that is in each network accelerator and that is configured to provide a physical acceleration resource for the virtual machine.

The management node sends the virtual accelerator application command to the scheduling apparatus, so that the scheduling apparatus stores, based on the virtual accelerator application command, a correspondence between an identifier of a virtual accelerator and the identifier of the physical accelerator that is in each network accelerator and that is configured to provide the physical acceleration resource for the virtual machine.

The acceleration resource is allocated to the virtual accelerator of the virtual machine by using steps S601 to S604. When a user needs to delete the acceleration resource subsequently, a specific implementation is: receiving, by the management node, a physical accelerator deletion command sent by the client, and deleting a physical acceleration resource that is of the virtual machine and that needs to be deleted by the user. The physical accelerator deletion command includes an identifier of the to-be-deleted physical accelerator and the identifier of the virtual machine. The client may be application management software deployed on the virtual machine or any network communications device. After logging in to the client, the user may select the to-be-deleted physical acceleration resource based on physical acceleration resource information that corresponds to the virtual machine and that is presented in an interface of the client, where the physical acceleration resource information includes the identifier of the virtual accelerator or the identifier of the physical accelerator that has been allocated to the virtual machine. After receiving the physical accelerator deletion command sent by the user by using the client, the management node sends the physical accelerator deletion command to the scheduling apparatus, where the physical accelerator deletion command is used to instruct the scheduling apparatus to: after it is determined that there is a virtual accelerator corresponding to the virtual machine, if it is determined, based on the identifier of the physical accelerator, that all physical accelerators corresponding to the virtual accelerator include a physical accelerator indicated by the identifier of the to-be-deleted physical accelerator, delete the identifier of the to-be-deleted physical accelerator.

If the user needs to delete all physical acceleration resources provided by the virtual accelerator, the physical accelerator deletion command sent by the user by using the client further includes the identifier of the virtual accelerator. In a specific implementation, after the receiving, by the management node, a physical accelerator deletion command sent by the client, the following is further included: sending, by the management node, a virtual accelerator deletion command to the scheduling apparatus, where the virtual accelerator deletion command includes the identifier of the virtual machine and the identifier of the virtual accelerator, and the virtual accelerator deletion command is used to instruct the scheduling apparatus to: after it is determined, based on the identifier of the virtual machine, that there is a virtual accelerator indicated by the identifier of the virtual accelerator corresponding to the virtual machine, delete correspondences between the identifier of the virtual accelerator and identifiers of all physical accelerators.

The following describes a process in which the scheduling apparatus creates a virtual accelerator after receiving the virtual accelerator application command and determining, based on the identifier of the virtual machine, that there is no virtual accelerator corresponding to the virtual machine. For specific implementation, refer to step S605.

If it is determined that there is no virtual accelerator corresponding to the virtual machine, the scheduling apparatus creates a virtual accelerator corresponding to the virtual machine, allocates an identifier to the virtual accelerator, and stores a correspondence between the identifier of the virtual accelerator and the identifier of the physical accelerator.

The following describes a process in which the scheduling apparatus creates a virtual accelerator after receiving the virtual accelerator application command and determining, based on the identifier of the virtual machine, that there is a virtual accelerator corresponding to the virtual machine. For specific implementation, refer to step S606.

If it is determined that there is a virtual accelerator corresponding to the virtual machine, the scheduling apparatus determines whether all physical accelerators corresponding to the virtual accelerator include a physical accelerator indicated by the identifier of the physical accelerator; and if it is determined that none of the physical accelerators corresponding to the virtual accelerator include the physical accelerator indicated by the identifier of the physical accelerator, stores a mapping relationship between the virtual accelerator and the identifier of the physical accelerator.

The following describes how the scheduling apparatus provides the physical acceleration resource for the virtual machine to perform acceleration processing on to-be-accelerated data after creating the virtual accelerator. Specifically, the following steps S607 to S613 are included.

The VM sends an acceleration instruction to the scheduling apparatus, where the acceleration instruction includes to-be-accelerated data. For specific implementation details, refer to step S401 shown in <FIG>.

The scheduling apparatus determines a virtual accelerator allocated to the virtual machine. For specific implementation details, refer to step S402 shown in <FIG>.

The scheduling apparatus determines a physical accelerator corresponding to the virtual accelerator.

A network accelerator at which the physical accelerator is located is the network accelerator that is to process the acceleration instruction.

The scheduling apparatus sends the identifier of the physical accelerator to the network accelerator.

The network accelerator sends the acceleration instruction to the physical accelerator based on the identifier of the physical accelerator.

The physical accelerator performs acceleration computing on the to-be-accelerated data by using the physical acceleration resource, and then returns a computing result to the scheduling apparatus.

The scheduling apparatus sends the computing result to the virtual machine.

An embodiment of this application further discloses a resource scheduling method that is performed by a management node. For main steps of the method, refer to the descriptions in the embodiments in <FIG>.

Referring to <FIG> which is a schematic structural diagram of a scheduling apparatus according to an embodiment of this application. The scheduling apparatus is applied to an acceleration system, where the acceleration system includes a computing node and at least one network accelerator, the computing node includes a virtual machine and the scheduling apparatus, and the network accelerator includes at least one physical accelerator; and the scheduling apparatus includes a transceiver unit <NUM> and a processing unit <NUM>.

The transceiver unit <NUM> is configured to receive an acceleration instruction sent by the virtual machine, where the acceleration instruction includes to-be-accelerated data.

The processing unit <NUM> is configured to determine a virtual accelerator allocated to the virtual machine, where the virtual accelerator is mapping, on the scheduling apparatus, of a physical acceleration resource allocated to the virtual machine, and the physical acceleration resource includes at least some physical acceleration resources in the at least one physical accelerator in the at least one network accelerator. The processing unit <NUM> is further configured to: determine, based on the virtual accelerator, a network accelerator that is to process the acceleration instruction, and send the acceleration instruction to the network accelerator, so that the network accelerator sends the acceleration instruction to a physical accelerator that is to process the acceleration instruction.

The transceiver unit <NUM> is further configured to: receive a computing result that is returned after the physical accelerator performs acceleration computing on the to-be-accelerated data by using the physical acceleration resource; and send the computing result to the virtual machine.

Optionally, when determining, based on the virtual accelerator, the network accelerator that is to process the acceleration instruction, the processing unit <NUM> is specifically configured to:
determine an object accelerator corresponding to the virtual accelerator, where a network accelerator at which the object accelerator is located is the network accelerator that is to process the acceleration instruction.

After determining, based on the virtual accelerator, the network accelerator that is to process the acceleration instruction, the processing unit <NUM> is further configured to:
send an identifier of the object accelerator to the network accelerator, so that the network accelerator determines, based on the identifier of the object accelerator, a physical accelerator corresponding to the object accelerator, and sends the acceleration instruction to the physical accelerator.

Optionally, when determining, based on the virtual accelerator, the network accelerator that is to process the acceleration instruction, the processing unit <NUM> is specifically configured to:
determine a physical accelerator corresponding to the virtual accelerator, where a network accelerator at which the physical accelerator is located is the network accelerator that is to process the acceleration instruction.

After determining, based on the virtual accelerator, the network accelerator that is to process the acceleration instruction, the processing unit <NUM> is further configured to:
send an identifier of the physical accelerator to the network accelerator, so that the network accelerator sends the acceleration instruction to the physical accelerator based on the identifier of the physical accelerator.

Optionally, before receiving the acceleration instruction sent by the virtual machine, the transceiver unit <NUM> is further configured to:
receive a virtual accelerator application command sent by a management node, where the virtual accelerator application command includes the identifier of the object accelerator and an identifier of the virtual machine.

The processing unit <NUM> is further configured to:.

Optionally, before receiving the acceleration instruction sent by the virtual machine, the transceiver unit <NUM> is further configured to:
receive a virtual accelerator application command sent by a management node, where the virtual accelerator application command includes the identifier of the physical accelerator and an identifier of the virtual machine.

Optionally, the transceiver unit <NUM> is further configured to:
receive a virtual accelerator application command sent by the management node, where the virtual accelerator application command includes the identifier of the object accelerator and an identifier of the virtual machine.

Optionally, the transceiver unit <NUM> is further configured to:
receive a virtual accelerator application command sent by the management node, where the virtual accelerator application command includes the identifier of the physical accelerator and an identifier of the virtual machine.

Optionally, the transceiver unit <NUM> is further configured to:
receive an object accelerator deletion command sent by the management node, where the object accelerator deletion command includes the identifier of the virtual machine and the identifier of the object accelerator.

Optionally, the transceiver unit <NUM> is further configured to:
receive a physical accelerator deletion command sent by the management node, where the physical accelerator deletion command includes the identifier of the virtual machine and the identifier of the physical accelerator.

Optionally, the acceleration instruction further includes the identifier of the virtual machine; the processing unit <NUM> is further configured to pre-store a correspondence between the identifier of the virtual machine and the identifier of the virtual accelerator; and when determining the virtual accelerator allocated to the virtual machine, the processing unit <NUM> is specifically configured to:
determine, based on the correspondence between the identifier of the virtual machine and the identifier of the virtual accelerator, the virtual accelerator corresponding to the virtual machine.

Optionally, the acceleration instruction further includes the identifier of the virtual accelerator, and the virtual machine pre-stores a correspondence between the identifier of the virtual machine and the identifier of the virtual accelerator; and when determining the virtual accelerator allocated to the virtual machine, the processing unit <NUM> is specifically configured to:
determine, based on the identifier of the virtual accelerator, the virtual accelerator corresponding to the virtual machine.

Functions of the transceiver unit <NUM> in the scheduling apparatus shown in <FIG> correspond to steps S401, S405, and S406 in <FIG>, or steps S507, S510, S513, S515, and S516 in <FIG> and <FIG>, or steps S604, S607, S610, S612, and S613 in <FIG> and <FIG>. The transceiver unit <NUM> can perform actions in steps S401, S405, and S406 in <FIG>, or steps S507, S510, S513, S515, and S516 in <FIG> and <FIG>, or steps S604, S607, S610, S612, and S613 in <FIG> and <FIG>. Functions of the processing unit <NUM> in the scheduling apparatus shown in <FIG> correspond to steps S402 and S403 in <FIG>, or steps S508, S509, S511, S512, and S516 in <FIG> and <FIG>, or steps S605, S606, S608, and S609 in <FIG> and <FIG>. The processing unit <NUM> can perform actions in steps S402 and S403 in <FIG>, or steps S508, S509, S511, S512, and S516 in <FIG> and <FIG>, or steps S605, S606, S608, and S609 in <FIG> and <FIG>.

In addition, the scheduling apparatus shown in <FIG> may be specifically an apparatus having a control function.

In addition, the scheduling apparatus shown in <FIG> is an independent device that is disposed outside the computing node and is configured to schedule an acceleration resource based on an acceleration requirement of the virtual machine on the computing node.

Referring to <FIG> is a schematic structural diagram of another scheduling apparatus according to an embodiment of this application. As shown in <FIG>, the apparatus may include a processor <NUM>, a memory <NUM>, and a bus <NUM>, where the processor <NUM> and the memory <NUM> are connected by using the bus <NUM>, the memory <NUM> is configured to store an instruction, and the processor <NUM> is configured to execute the instruction stored by the memory <NUM>, to implement corresponding steps performed by the scheduling apparatus in the methods in <FIG>.

Further, the apparatus may further include an input interface <NUM> and an output interface <NUM>, where the processor <NUM>, the memory <NUM>, the input interface <NUM>, and the output interface <NUM> may be connected by using the bus <NUM>.

The processor <NUM> is configured to execute an instruction stored by the memory <NUM>, to control the input interface <NUM> to receive a signal, and control the output interface <NUM> to send a signal, thereby completing the steps that are performed by a controller in the foregoing method. The input interface <NUM> and the output interface <NUM> may be same or different physical entities, and may be collectively referred to as an input/output interface when being the same physical entities. The memory <NUM> may be integrated into the processor <NUM>, or may be separate from the processor <NUM>.

In an implementation, functions of the input interface <NUM> and the output interface <NUM> may be implemented by using a transceiver circuit or a dedicated transceiver chip. The processor <NUM> may be implemented by using a dedicated processing chip, processing circuit, or processor, or a general-purpose chip.

In another implementation, the apparatus provided in this embodiment of this application may be implemented by using a general-purpose computer. To be specific, program code that implements functions of the processor <NUM>, the input interface <NUM>, and the output interface <NUM> is stored in the memory, and a general-purpose processor implements the functions of the processor <NUM>, the input interface <NUM>, and the output interface <NUM> by executing the code in the memory.

For concepts, explanations, and detailed descriptions about the apparatus that are related to the technical solution provided in this embodiment of this application and other steps, refer to descriptions of the content in the foregoing method or other embodiments.

A person skilled in the art may understand that, for ease of description, <FIG> merely shows a memory and a processor. In an actual controller, there may be a plurality of processors and memories. The memory may also be referred to as a storage medium, a storage device, or the like. This is not limited in this embodiment of this application.

The scheduling apparatus exists independently of the computing node and an interface that is connected to the computing node is configured to implement data transmission with the computing node. For example, the scheduling apparatus may be configured as an embedded card, a PCIe interface is configured for the scheduling apparatus to be connected to a PCIe interface of the computing node, and a network interface is configured for the scheduling apparatus to be connected to a management node and a network accelerator in a network or a cloud, to implement data exchange between two ends. In addition, an independently disposed processor, memory, and the like implement storage and execution of the program code, thereby implementing the method steps that are performed by the scheduling apparatus in the method embodiments of this application.

Referring to <FIG> is a schematic structural diagram of a management node according to an embodiment of this application. The management node is applied to an acceleration system, where the acceleration system includes the management node, a computing node, and at least one network accelerator, the computing node includes a virtual machine and a scheduling apparatus, and the network accelerator includes at least one physical accelerator; and the management node includes:.

The transceiver unit <NUM> is further configured to: send the physical acceleration resource creation command to the network accelerator; and receive the identifier of the object accelerator that is sent by the network accelerator.

The processing unit <NUM> is further configured to: generate a virtual accelerator application command, where the virtual accelerator application command includes the identifier of the virtual machine and the identifier of the object accelerator; and
send the virtual accelerator application command to the scheduling apparatus, so that the scheduling apparatus stores a correspondence between an identifier of a virtual accelerator and the identifier of the object accelerator based on the virtual accelerator application command.

Functions of the transceiver unit <NUM> in the management node shown in <FIG> correspond to steps S501, S504, S505, and S507 in <FIG> and <FIG>. The transceiver unit <NUM> can perform actions in steps S501, S504, S505, and S507 in <FIG> and <FIG>. Functions of the processing unit <NUM> in the management node shown in <FIG> correspond to steps S502, S503, and S506 in <FIG> and <FIG>. The processing unit <NUM> can perform actions in steps S502, S503, and S506 in <FIG> and <FIG>.

Referring to <FIG> is a schematic structural diagram of another management node according to an embodiment of this application. As shown in <FIG>, the apparatus may include a processor <NUM>, a memory <NUM>, and a bus <NUM>, where the processor <NUM> and the memory <NUM> are connected by using the bus <NUM>, the memory <NUM> is configured to store an instruction, and the processor <NUM> is configured to execute the instruction stored by the memory <NUM>, to implement the steps in the method corresponding to <FIG> or <FIG> and <FIG>.

Further, the management node may further include an input interface <NUM> and an output interface <NUM>, where the processor <NUM>, the memory <NUM>, the input interface <NUM>, and the output interface <NUM> may be connected by using the bus <NUM>.

The processor <NUM> is configured to execute an instruction stored by the memory <NUM>, to control the input interface <NUM> to receive a signal, and control the output interface <NUM> to send a signal, thereby completing the steps that are performed by the management node in the foregoing method. The input interface <NUM> and the output interface <NUM> may be same or different physical entities, and may be collectively referred to as an input/output interface when being the same physical entities. The memory <NUM> may be integrated into the processor <NUM>, or may be separate from the processor <NUM>.

A function of the transceiver unit <NUM> in the management node shown in <FIG> corresponds to step S601 in <FIG>. The transceiver unit <NUM> can perform an action in step S601 in <FIG>. Functions of the processing unit <NUM> in the management node shown in <FIG> correspond to steps S602, S603, and S604 in <FIG>. The processing unit <NUM> can perform actions in steps S602, S603, and S604 in <FIG>.

For concepts, explanations, and detailed descriptions about the management node that are related to the technical solution provided in this embodiment of this application and other steps, refer to descriptions of the content in the foregoing method or other embodiments.

A person skilled in the art may understand that, for ease of description, <FIG> merely show a memory and a processor. In an actual controller, there may be a plurality of processors and memories. The memory may also be referred to as a storage medium, a storage device, or the like. This is not limited in this embodiment of this application.

It should be understood that, in this embodiment of this application, the processor may be a central processing unit (Central Processing Unit, "CPU" for short), or the processor may be another general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or another programmable logical device, a discrete gate or a transistor logical device, a discrete hardware assembly, or the like. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor or the like.

The memory may include a read-only memory and a random access memory, and provide an instruction and data for the processor. A part of the memory may further include a non-volatile random access memory.

In addition to a data bus, the bus may further include a power bus, a control bus, a status signal bus, and the like. However, for clear description, various buses are all denoted as the bus in the figure.

In an implementation process, steps in the foregoing methods may be implemented by using a hardware integrated logic circuit in the processor or using instructions in a form of software. The steps of the method disclosed with reference to the embodiments of this application may be directly performed by a hardware processor, or may be performed by using a combination of hardware in the processor and a software module. The software module may be located in a mature storage medium in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, or a register. The storage medium is located in the memory, and the processor reads information in the memory and completes the steps in the foregoing methods in combination with hardware of the processor. To avoid repetition, details are not described herein again.

According to the method provided in this embodiment of this application, an embodiment of this application further provides a system, including the foregoing management node, a computing node, and at least one network accelerator, where the computing node includes a virtual machine and the foregoing scheduling apparatus, and the network accelerator includes at least one physical accelerator. For functions of the devices and an interaction process, refer to descriptions in the foregoing embodiments.

A person of ordinary skill in the art may be aware that, with reference to descriptions in the embodiments disclosed in this specification, various illustrative logical blocks (illustrative logical block) and steps (step) may be implemented by electronic hardware or a combination of computer software and electronic hardware.

In the embodiments provided in this application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. In addition, mutual couplings, direct couplings, or communication connections that are displayed or discussed herein may be indirect couplings or communication connections that are implemented by some interfaces, apparatuses, or units, and may be electrical, mechanical, or in other forms.

All or some of the foregoing embodiments may be implemented by means of software, hardware, firmware, or any combination thereof. When software is used to implement the embodiments, the embodiments may be implemented completely or partially in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the procedure or functions according to the embodiments of this application are all or partly generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible by a computer, or a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), a semiconductor medium (for example, a solid state disk (Solid State Disk, SSD)), or the like.

Claim 1:
A system comprising:
a computing device (<NUM>) configured to create a virtual machine (<NUM>), wherein the virtual machine is configured to generate data of an application running on the virtual machine;
a plurality of physical accelerators (<NUM>,<NUM>), wherein the physical accelerators form a physical acceleration resource, wherein the physical acceleration resource comprises a first physical acceleration resource;
a scheduling apparatus (<NUM>); and
a management server (<NUM>) configured to send, according to a requirement of the first virtual machine, to the scheduling apparatus a command for allocating the first physical acceleration resource from the physical acceleration resource to the virtual machine after the virtual machine is created,
wherein the scheduling apparatus is configured to transfer the data to the first physical acceleration resource, which is allocated to the first virtual machine by the scheduling apparatus,
wherein the first physical acceleration resource is configured to:
receive the data from the scheduling apparatus;
process the data to obtain a result;
return the result to the scheduling apparatus; and
wherein the scheduling apparatus is further configured to send the result to the first virtual machine.