Accelerator card allocation method, device and artificial intelligence platform

By matching the accelerator card demand of the container management unit and the supply information of the resource node, selecting the appropriate target resource node and annotating it, the problem of unreasonable accelerator card allocation in the artificial intelligence platform is solved, and the efficiency and task scheduling throughput are improved.

CN118502965BActive Publication Date: 2024-10-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410948693.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2024-10-01
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

In artificial intelligence platforms, when the traditional container orchestration engine is used to allocate accelerator cards, the node agent component randomly selects resources, resulting in resource demanders and resource providers being unable to correctly match, resulting in unreasonable accelerator card allocation, low efficiency, and task scheduling. Throughput decreases.

Method used

By matching the accelerator card demand information of the container management unit with the supply information of the resource node, select the most appropriate target resource node and add the device identifier to the container management unit annotation to ensure the correct allocation of the accelerator card.

Benefits of technology

It achieves reasonable allocation of accelerator cards, improves allocation efficiency and task scheduling throughput, and ensures accelerator card matching between container management units and resource nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118502965B_ABST
    Figure CN118502965B_ABST
Patent Text Reader

Abstract

The present application provides an accelerator card allocation method, device and artificial intelligence platform, which relates to the field of computer technology, including: determining the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node; matching the accelerator card demand information with the accelerator card supply information to determine the candidate resource node corresponding to the current container management unit; based on the number of idle accelerator cards in each candidate resource node, determining the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node; adding the device identifier of the target accelerator card to the annotation of the current container management unit, so that the target resource node allocates the target accelerator card to the current container management unit based on the annotation of the current container management unit. The method and device provided by the present application improve the allocation efficiency of the accelerator card and improve the task scheduling throughput of the artificial intelligence platform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to an acceleration card allocation method, device and artificial intelligence platform. Background Art

[0002] In artificial intelligence platforms, how to allocate resources has always been a key issue that needs to be focused on. Compared with traditional virtual machines, containers have the advantages of being more lightweight and more efficient in resource utilization. Container orchestration engines (such as Kubernetes) use container management units (Pods) as the smallest computing unit and have powerful container orchestration capabilities, making them the first choice for many artificial intelligence platforms.

[0003] When the related technology uses the container orchestration engine to allocate accelerator cards in the artificial intelligence platform, the node agent component usually randomly selects resources for allocation, which easily leads to the mismatch between resource demanders and resource providers, resulting in unreasonable accelerator card allocation in the artificial intelligence platform, low accelerator card allocation efficiency, and reduced task scheduling throughput. Summary of the invention

[0004] The present application provides an accelerator card allocation method, device and artificial intelligence platform, which are used to solve the technical problems of unreasonable accelerator card allocation, low accelerator card allocation efficiency and reduced task scheduling throughput in the artificial intelligence platform.

[0005] The present application provides an accelerator card allocation method, comprising:

[0006] Determine the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node;

[0007] Matching the accelerator card demand information with the accelerator card supply information to determine a candidate resource node corresponding to the current container management unit;

[0008] Determine, based on the number of idle accelerator cards in each candidate resource node, a target resource node corresponding to the current container management unit and a target accelerator card in the target resource node;

[0009] The device identification of the target accelerator card is added to the annotation of the current container management unit, so that the target resource node allocates the target accelerator card to the current container management unit based on the annotation of the current container management unit.

[0010] In some embodiments, matching the accelerator card demand information with the accelerator card supply information to determine the candidate resource node corresponding to the current container management unit includes:

[0011] Matching the acceleration card demand information with the acceleration card supply information to determine an initial candidate resource node corresponding to the current container management unit;

[0012] Determine virtual resource demand information of the current container management unit based on the annotation of the current container management unit, and determine virtual resource allocation information of the initial candidate resource nodes based on the annotations of each initial candidate resource node;

[0013] Matching the virtual resource demand information with the virtual resource allocation information, and determining a candidate resource node corresponding to the current container management unit from among the initial candidate resource nodes;

[0014] The virtual resource demand information is used to identify each container management unit.

[0015] In some embodiments, matching the virtual resource demand information with the virtual resource allocation information and determining the candidate resource node corresponding to the current container management unit from the initial candidate resource nodes includes:

[0016] Determine multiple virtual resource allocation information and the virtual resource allocation quantity of each virtual resource allocation information based on the occupied virtual resource set corresponding to any initial candidate resource node;

[0017] In the case that the virtual resource requirement quantity in the virtual resource requirement information does not match the virtual resource allocation quantity in each virtual resource allocation information, any one of the initial candidate resource nodes is determined as a candidate resource node corresponding to the current container management unit.

[0018] In some embodiments, the occupied set of virtual resources corresponding to any initial candidate resource node is determined based on the following steps:

[0019] Determine current virtual resource allocation information;

[0020] When the virtual resource used flag is missing in the annotation of the container management unit corresponding to the current virtual resource allocation information or the virtual resource used flag is not true, the current virtual resource allocation information is added to the virtual resource occupied set.

[0021] In some embodiments, before determining the virtual resource requirement information of the current container management unit based on the annotation of the current container management unit, the method further includes:

[0022] In case of creating the current container management unit, obtaining the annotation of the current container management unit;

[0023] Based on the annotation of the current container management unit, determine that the current container management unit applies for allocating an accelerator card;

[0024] Taking the current number in the circular array as the virtual resource requirement quantity of the current container management unit, and generating the virtual resource requirement information of the current container management unit based on the virtual resource requirement quantity;

[0025] The maximum number of the circular array is determined based on the concurrent number of the container management unit.

[0026] In some embodiments, matching the accelerator card demand information with the accelerator card supply information to determine the initial candidate resource node corresponding to the current container management unit includes:

[0027] Based on the accelerator card requirement information, determine the number of accelerator cards applied for the current container management unit and the video memory capacity application value of each accelerator card;

[0028] Based on the accelerator card supply information, determine the number of accelerator cards of each resource node and the remaining value of the video memory capacity of each accelerator card;

[0029] The resource nodes whose number of accelerator cards is greater than or equal to the number of accelerator cards applied for and whose remaining video memory capacity is greater than or equal to the video memory capacity applied value are determined as the initial candidate resource nodes.

[0030] In some embodiments, determining the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node based on the number of idle accelerator cards in each candidate resource node includes:

[0031] Determine a selection score of each candidate resource node based on the number of idle accelerator cards in each candidate resource node; the selection score is in inverse proportion to the number of idle accelerator cards;

[0032] Determine the candidate resource node with the highest selection score as the target resource node;

[0033] Determining the target accelerator card based on the accelerator card in the target resource node;

[0034] The idle acceleration card is an acceleration card whose remaining video memory capacity is equal to the total video memory capacity of the acceleration card.

[0035] In some embodiments, determining the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node includes:

[0036] Determining the accelerator card requirement information based on the annotation of the current container management unit;

[0037] Based on the annotation of the resource node, the accelerator card provisioning information of the resource node is determined.

[0038] The present application provides an accelerator card allocation device, comprising:

[0039] A determination module is used to determine the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node;

[0040] A first selection module, configured to match the acceleration card demand information with the acceleration card supply information to determine a candidate resource node corresponding to the current container management unit;

[0041] A second selection module is used to determine the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node based on the number of idle accelerator cards in each candidate resource node;

[0042] The allocation module is used to add the device identification of the target accelerator card to the annotation of the current container management unit, so that the target resource node allocates the target accelerator card to the current container management unit based on the annotation of the current container management unit.

[0043] The present application provides an artificial intelligence platform, including the acceleration card allocation device, an interface management component and a plurality of resource nodes;

[0044] The interface management component is connected to the acceleration card allocation device and the resource node, and is used to send the acceleration card demand information of each container management unit and the acceleration card supply information of each resource node to the acceleration card allocation device, and add the device identifier of the target acceleration card determined by the acceleration card allocation device to the annotation of each container management unit.

[0045] In some embodiments, the resource node includes a node agent component, an accelerator card plug-in, and a virtual resource plug-in;

[0046] The node agent component is used to report resource information of the resource node to the acceleration card allocation device, and read the container management unit scheduled to the resource node;

[0047] The accelerator card plug-in is used to provide the node agent component with an accelerator card calling interface;

[0048] The virtual resource plug-in is used to provide a calling interface of the virtual resource to the node agent component.

[0049] In some embodiments, it also includes:

[0050] A database component is connected to the interface management component and is used to store data and operations in the artificial intelligence platform.

[0051] In some embodiments, it also includes:

[0052] An editing component, connected to the interface management component, is used to modify the annotation of the container management unit.

[0053] The present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the acceleration card allocation method when executing the computer program.

[0054] The present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and the computer program implements the acceleration card allocation method when executed by a processor.

[0055] The accelerator card allocation method, device and artificial intelligence platform provided in the present application match the accelerator card demand information of the current container management unit with the accelerator card supply information of each resource node to determine the candidate resource node corresponding to the current container management unit; based on the number of idle accelerator cards in each candidate resource node, determine the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node; add the device identifier of the target accelerator card to the annotation of the current container management unit; so that the resource node can allocate an accelerator card to the container management unit according to the annotation of the container management unit, thereby achieving correct matching between the accelerator cards of the container management unit and the resource node, making the allocation of accelerator cards in the artificial intelligence platform more reasonable, improving the allocation efficiency of accelerator cards, and improving the task scheduling throughput of the artificial intelligence platform. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0057] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0058] Figure 1 This is one of the flow charts of the acceleration card allocation method provided in this application.

[0059] Figure 2 This is the second flow chart of the acceleration card allocation method provided in this application.

[0060] Figure 3It is a structural schematic diagram of the acceleration card allocation device provided in this application.

[0061] Figure 4 It is one of the structural diagrams of the artificial intelligence platform provided in this application.

[0062] Figure 5 This is the second structural diagram of the artificial intelligence platform provided by this application.

[0063] Figure 6 It is a structural schematic diagram of the electronic device provided by this application. DETAILED DESCRIPTION

[0064] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0065] It should be noted that the terms "first", "second" etc. in the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units need not be limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.

[0066] An AI platform is a software platform that integrates various AI tools, libraries, and services to support the development, deployment, and use of AI models and applications. An accelerator card is a dedicated hardware acceleration device that is usually used to accelerate specific computing tasks, such as deep learning training, data analysis, scientific computing, etc.

[0067] In the related technologies of building an artificial intelligence platform through a container orchestration engine (such as Kubernetes), the accelerator card is abstracted as an extended resource. The working mechanism of allocating the accelerator card is as follows: the accelerator card manufacturer provides or the user redevelops a device plug-in component, the node agent component (Kubelet) calls the communication interface (ListAndWatch interface) of the device plug-in to obtain the accelerator card identifier (ID), then counts the number of accelerator cards, and finally reports the type and number of accelerator cards to the container orchestration engine (such as Kubernetes). When a container management unit (Pod) is created, the scheduler component in the container orchestration engine will schedule it to a node with sufficient accelerator cards according to the number of accelerator cards applied by the container management unit. After receiving the container management unit scheduling event, the node agent component selects the corresponding number of accelerator cards from the idle accelerator card devices, and then uses the identifiers of these accelerator cards as parameters to call the allocation (Allocate) interface of the device plug-in. The device plug-in mounts the accelerator card device to the container management unit according to the accelerator card device identifier. After the container management unit is started, the corresponding accelerator card device can be accessed.

[0068] However, in this method, when the node agent component calls the allocation interface of the device plug-in, it only passes the identifier of the randomly selected accelerator card, and does not pass any information related to the container management unit. Therefore, the device plug-in cannot accurately know which container management unit the device is currently being mounted to, resulting in the device plug-in being unable to accurately obtain information from the container management unit annotation. In some scenarios where the scheduler needs to allocate accelerator cards, the device plug-in cannot accurately identify and mount the accelerator card device to the container management unit. The above method makes the allocation of accelerator cards in the artificial intelligence platform unreasonable, the efficiency of accelerator card allocation is low, and the task scheduling throughput is reduced.

[0069] In order to solve the shortcomings of related technologies, Figure 1 This is one of the flow charts of the acceleration card allocation method provided by this application, such as Figure 1 As shown, the method includes step 110 , step 120 , step 130 and step 140 .

[0070] Step 110: Determine the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node.

[0071] Specifically, the execution subject of the acceleration card allocation method provided in the embodiment of the present application is an acceleration card allocation device. The device can be implemented by software, such as an acceleration card allocation program or an acceleration card allocation optimization program; it can also be a device that executes the acceleration card allocation method, such as a mobile terminal, a tablet computer, a desktop computer or a server.

[0072] The embodiment of the present application takes Kubernetes as an example of a container orchestration engine to illustrate the provided accelerator card allocation method. Kubernetes is a container orchestration platform for scheduling and automatically deploying, managing, and scaling containerized applications. In an artificial intelligence platform built using Kubernetes, the accelerator card allocation device can be a scheduler in Kubernetes.

[0073] A container is an instance of an independently running application or service. It contains the application code, operating environment, dependencies, and configuration. Containers are lightweight virtualization technologies that isolate applications at the operating system level.

[0074] A container management unit is a unit for managing and deploying containers in a container orchestration engine. For example, the smallest container management unit in Kubernetes is a Pod, which is a container or a collection of related containers. Containers in a Pod share the same network namespace, storage volumes, and other resources. In an artificial intelligence platform, there is usually only one container in a Pod that needs to be assigned an accelerator card. Allocating or mounting an accelerator card to a container management unit actually means allocating or mounting an accelerator card to a container in the container management unit. The current container management unit is the container management unit that needs to be assigned an accelerator card.

[0075] An accelerator card refers to a device that performs accelerated computing for AI-related applications, such as various types of graphics processing units (GPUs).

[0076] The accelerator card requirement information refers to the requirement information of the container in the container management unit for the accelerator card, for example, it may include the number of accelerator cards, the video memory capacity of the accelerator card, etc.

[0077] Resource nodes refer to devices such as computers or servers that can provide resources in the artificial intelligence platform. Resource nodes can include multiple accelerator cards. For example, resource nodes can run node agent components (Kubelet) and device plug-ins. The node agent component runs in each resource node, collects node status and reports it to Kubernetes, and executes the corresponding process on the node where it is located when receiving events sent by Kubernetes. The device plug-in can provide the node agent component with a calling interface for the device (such as an accelerator card) so that the node agent component can drive the device.

[0078] The accelerator card supply information refers to the relevant information of the accelerator card that can be provided to the container management unit in the resource node, for example, it may include the number of accelerator cards, the remaining video memory capacity of the accelerator card, etc.

[0079] Step 120: Match the acceleration card demand information with the acceleration card supply information to determine the candidate resource node corresponding to the current container management unit.

[0080] Specifically, the acceleration card demand information and the acceleration card supply information may be matched with each other, and the candidate resource node corresponding to the current container management unit may be determined according to the matching result.

[0081] A candidate resource node refers to a resource node that can provide an accelerator card for the current container management unit. Generally, there can be multiple candidate resource nodes.

[0082] Step 130: Based on the number of idle accelerator cards in each candidate resource node, determine the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node.

[0083] Specifically, the target resource node refers to a resource node that provides an accelerator card for the current container management unit. The target accelerator card refers to an accelerator card allocated to the current container management unit.

[0084] Video memory refers to the memory in the graphics processor used to store and process data. Video memory capacity refers to the data capacity of the video memory. When allocating accelerator cards, accelerator cards can be allocated to the current container management unit based on the remaining video memory capacity of each accelerator card in the resource node. If the remaining video memory capacity of an accelerator card is greater than the video memory capacity of a single accelerator card required by the current container management unit, the accelerator card can be allocated to the current container management unit, so that the containerized application in the current container management unit can use the remaining video memory capacity of the accelerator card to perform computing tasks.

[0085] An idle accelerator card refers to an accelerator card whose video memory capacity is not yet used. If there are idle accelerator cards in the candidate resource nodes, the idle accelerator cards can also be allocated to the current container management unit.

[0086] In order to improve the concentration of resource allocation and avoid resource fragmentation in resource nodes, priority should be given to accelerator cards whose video memory capacity has been used but still has spare capacity. Therefore, each candidate resource node can be selected based on the number of idle accelerator cards in each candidate resource node. The resource node with fewer idle accelerator cards has a higher probability of being determined as the target resource node, while the resource node with more idle accelerator cards has a lower probability of being determined as the target resource node.

[0087] Step 140: Add the device identifier of the target accelerator card to the annotation of the current container management unit, so that the target resource node allocates the target accelerator card to the current container management unit based on the annotation of the current container management unit.

[0088] Specifically, annotation refers to a key-value pair that adds some additional information to resource objects such as container management units (Pods) and resource nodes in the container orchestration engine (Kubernetes). The device ID of the target accelerator card can be added to the annotation of the current container management unit.

[0089] The target resource node can accurately determine whether to allocate an accelerator card to the current container management unit and which accelerator card to allocate (that is, the target accelerator card) based on the annotation of the current container management unit. Even in concurrent scenarios, each resource node can accurately obtain the accelerator card device information that it needs to mount from the annotations of each container management unit in parallel.

[0090] The accelerator card allocation method provided in the embodiment of the present application matches the accelerator card demand information of the current container management unit with the accelerator card supply information of each resource node to determine the candidate resource node corresponding to the current container management unit; based on the number of idle accelerator cards in each candidate resource node, determines the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node; adds the device identifier of the target accelerator card to the annotation of the current container management unit; enables the resource node to allocate an accelerator card to the container management unit according to the annotation of the container management unit, thereby achieving correct matching between the accelerator cards of the container management unit and the resource node, making the allocation of accelerator cards in the artificial intelligence platform more reasonable, improving the allocation efficiency of accelerator cards, and improving the task scheduling throughput of the artificial intelligence platform.

[0091] It should be noted that each implementation method of the present application can be freely combined, the order can be changed, or it can be executed separately, and does not need to rely on or depend on a fixed execution order.

[0092] In some embodiments, matching the accelerator card demand information with the accelerator card supply information to determine the candidate resource node corresponding to the current container management unit includes:

[0093] Match the accelerator card demand information with the accelerator card supply information to determine the initial candidate resource node corresponding to the current container management unit;

[0094] Determine virtual resource demand information of the current container management unit based on the annotation of the current container management unit, and determine virtual resource allocation information of the initial candidate resource nodes based on the annotations of each initial candidate resource node;

[0095] Matching the virtual resource demand information with the virtual resource allocation information, and determining the candidate resource node corresponding to the current container management unit from the initial candidate resource nodes;

[0096] The virtual resource demand information is used to identify each container management unit.

[0097] Specifically, in the process of determining candidate resource nodes in a concurrent scenario, it is possible that a resource node is temporarily occupied, that is, the same resource node is allocated to multiple concurrent container management units. In order to reduce the probability of a resource node being temporarily occupied, the embodiment of the present application sets virtual resources in the resource node and identifies each container management unit through virtual resource demand information. In other words, different virtual resource demand information is set for different container management units, so that different container management units are distinguished according to the virtual resource demand information.

[0098] The virtual resource may be represented as a virtual device (vid), which represents a virtual resource allocated by the container management unit. The virtual resource demand information refers to the demand information of the container in the container management unit for the virtual resource, for example, it may include the required quantity of the virtual resource, etc. The virtual resource demand information may be added to the annotation of the container management unit.

[0099] When determining the candidate resource nodes corresponding to the current container management unit, firstly, the acceleration card demand information is matched with the acceleration card supply information to determine the initial candidate resource nodes corresponding to the current container management unit, and the first pre-selection is realized; secondly, the virtual resource demand information of the current container management unit is obtained from the annotation of the current container management unit, and the virtual resource allocation information of the initial candidate resource nodes is obtained from the annotation of each initial candidate resource node; and the virtual resource demand information and the virtual resource allocation information are matched again, so that the candidate resource nodes corresponding to the current container management unit can be screened from the initial candidate resource nodes.

[0100] The accelerator card allocation method provided in the embodiment of the present application screens the resource nodes twice through the accelerator card demand information and the virtual resource demand information, and uses the virtual resource demand information to identify each container management unit, thereby greatly reducing the probability of resource nodes being temporarily occupied and improving the task scheduling throughput of the artificial intelligence platform and the optimized scheduling results of the accelerator card.

[0101] In some embodiments, matching the virtual resource demand information with the virtual resource allocation information and determining the candidate resource node corresponding to the current container management unit from the initial candidate resource nodes includes:

[0102] Determine multiple virtual resource allocation information and the virtual resource allocation quantity of each virtual resource allocation information based on the occupied virtual resource set corresponding to any initial candidate resource node;

[0103] When the virtual resource requirement quantity in the virtual resource requirement information does not match the virtual resource allocation quantity in each virtual resource allocation information, any initial candidate resource node is determined as a candidate resource node corresponding to the current container management unit.

[0104] Specifically, the relevant information of the virtual resources that have been allocated in the resource node can be saved to obtain a virtual resource occupied set. According to the virtual resource allocation quantity, the virtual resource allocation information is determined. The virtual resource allocation information is added to the virtual resource occupied set.

[0105] The virtual resource requirement quantity in the virtual resource requirement information of the current container management unit is matched with the virtual resource allocation quantity in the virtual resource allocation information of any initial candidate resource node. If there is a mismatch, it means that the virtual resource requirement quantity applied for by the current container management unit is not in the virtual resource occupied set. In this case, the initial candidate resource node can be determined as the candidate resource node corresponding to the current container management unit.

[0106] The accelerator card allocation method provided in the embodiment of the present application can screen the initial candidate resource nodes through virtual resource demand information in the above manner to obtain the final candidate resource nodes, which greatly reduces the probability of resource nodes being temporarily occupied and improves the task scheduling throughput of the artificial intelligence platform and the optimized scheduling results of the accelerator card.

[0107] In some embodiments, the occupied set of virtual resources corresponding to any initial candidate resource node is determined based on the following steps:

[0108] Determine current virtual resource allocation information;

[0109] When the virtual resource used flag is missing in the annotation of the container management unit corresponding to the current virtual resource allocation information or the virtual resource used flag is not true, the current virtual resource allocation information is added to the virtual resource occupied set.

[0110] Specifically, a device plug-in for a virtual resource (vid) can be set in a resource node, which implements some functions:

[0111] (1) When the node agent component (Kubelet) in the resource node calls the communication interface (ListAndWatch interface) of the device plug-in of the virtual resource (vid), the device plug-in returns a series of device identifiers of virtual devices (vid1, vid2, vid3, ..., vidn, where n is the number of virtual devices), and the total number of virtual resources is calculated by the formula total = maxPodsPerNode × numberRingMax. Among them, maxPodsPerNode is the maximum number of container management units (Pod) that can be accommodated on each resource node configured by the node agent component, and numberRingMax is a custom preset value, which indicates the concurrent number of container management units. For performance considerations, maxPodsPerNode uses the default value of 110, and numberRingMax uses the default value of 1000. In this way, the node agent component will believe that there are virtual resources in the node, and the total number of virtual resources is 110,000, and report this resource to the database (ETCD).

[0112] (2) Call the underlying driver of the accelerator card regularly (for example, every 60 seconds) to obtain the accelerator card device identifier (uid), index number (index) and video memory (cardmemory), and then submit related operations or updates (patch) to the database (ETCD), and add this information to the node annotation. The annotation format is a key-value pair. The annotation key is "accelerator-card" and the annotation value format is: "uid1-index1-cardmemory1, uid2-index2-cardmemory2, uid3-index3-cardmemory3".

[0113] (3) When the node agent component (Kubelet) calls the allocation interface (Allocate interface) of the device plug-in of the virtual resource (vid), the device plug-in of the virtual resource reads the container management unit (Pod) scheduled to this node. By comparing the number of virtual resources requested by the container management unit, the container management unit that currently needs to mount the device can be uniquely determined. Then read the value corresponding to the "bound-device-id" on the annotation of the container management unit, map it to the device file that needs to be mounted, and mount the device file to the container management unit. Finally, add an annotation to the container management unit (virtual resource used identifier) ​​to indicate that this container management unit has been processed. The annotation key corresponding to the virtual resource used identifier is "vid-used" and the annotation value is "true".

[0114] For a resource node, if there is a container management unit that has been scheduled to this node, and the "vid-used" annotation is missing in the annotation of the container management unit (indicating that the virtual resource used identifier is missing) or the value of this annotation is not "true" (indicating that the virtual resource used identifier is not true), it means that the container management unit temporarily occupies the virtual resources in the resource node. The current virtual resource allocation information can be generated based on the number of virtual resources occupied by the container management unit, and the current virtual resource allocation information can be added to the virtual resource occupied set of the node.

[0115] The acceleration card allocation method provided in the embodiment of the present application greatly reduces the probability of temporary occupation of resource nodes by constructing a virtual resource occupied set corresponding to the resource nodes.

[0116] In some embodiments, before determining the virtual resource requirement information of the current container management unit based on the annotation of the current container management unit, the method further includes:

[0117] When the current container management unit is created, the annotation of the current container management unit is obtained;

[0118] Based on the annotation of the current container management unit, determine that the current container management unit applies for allocating an accelerator card;

[0119] Taking the current number in the circular array as the virtual resource requirement quantity of the current container management unit, generating virtual resource requirement information of the current container management unit based on the virtual resource requirement quantity;

[0120] The maximum number of loop arrays is determined based on the number of concurrent operations of the container management unit.

[0121] Specifically, when the current container management unit is created, the annotation of the current container management unit can be obtained, and whether the current container management unit applies for allocation of an accelerator card can be determined according to the annotation. If yes, the current number is selected from the circular array as the virtual resource requirement number of the current container management unit, and the virtual resource requirement information of the current container management unit is generated.

[0122] Since each time a number is taken from the circular array in a circular order as the virtual resource requirement quantity of the current container management unit, each container management unit is uniquely identified, greatly reducing the probability of temporary occupation of resource nodes.

[0123] The maximum number of loop arrays is determined by the number of concurrent container management units (numberRingMax). For example, if the number of concurrent container management units in the artificial intelligence platform is 1000, the maximum number of loop arrays can be set to 1000.

[0124] For example, a mutating-admission-webhook can be implemented in the Kubernetes platform. A number ring (that is, a circular array) is implemented internally. The number ring takes the next number from [1, numberRingMax] in a circular manner. The next number of numberRingMax is 1, thus forming a ring structure. When a Pod is created, the Kube-apiserver in the Kubernetes platform will call this mutating-admission-webhook. If the Pod applies for an accelerator card in the annotation, the webhook will add a vid resource to the Pod. The number of vid resources is the next number taken from the number ring.

[0125] The acceleration card allocation method provided in the embodiment of the present application realizes unique identification of each container management unit by using the current number in the circular array as the virtual resource requirement quantity of the current container management unit and generating the virtual resource requirement information of the current container management unit according to the virtual resource requirement quantity.

[0126] In some embodiments, matching the accelerator card demand information with the accelerator card supply information to determine an initial candidate resource node corresponding to the current container management unit includes:

[0127] Based on the accelerator card demand information, determine the number of accelerator cards applied for the current container management unit and the video memory capacity application value of each accelerator card;

[0128] Based on the accelerator card supply information, determine the number of accelerator cards of each resource node and the remaining value of the video memory capacity of each accelerator card;

[0129] The resource nodes whose number of accelerator cards is greater than or equal to the number of accelerator cards applied for and whose remaining video memory capacity is greater than or equal to the video memory capacity applied value are determined as initial candidate resource nodes.

[0130] Specifically, according to the accelerator card requirement information of the current container management unit, the number of accelerator cards applied for the current container management unit and the video memory capacity application value of each accelerator card can be determined. The number of accelerator cards applied indicates the number of accelerator cards required by the current container management unit. The video memory capacity application value indicates the video memory capacity requirement value of each accelerator card in the current container management unit.

[0131] According to the accelerator card supply information of the resource node, the number of accelerator cards of each resource node and the remaining value of the video memory capacity of each accelerator card can be determined. The number of accelerator cards indicates the number of accelerator cards that the resource node can provide. The remaining value of the video memory capacity indicates the remaining value of the video memory capacity of each accelerator card that is not used.

[0132] The accelerator card demand information is matched with the accelerator card supply information. If the number of accelerator cards in any resource node is greater than or equal to the number of accelerator cards applied for, and the remaining value of the video memory capacity of the accelerator card is greater than or equal to the video memory capacity application value, then the resource node can be determined as the initial candidate resource node.

[0133] The accelerator card allocation method provided in the embodiment of the present application matches the accelerator card demand information with the accelerator card supply information, determines the initial candidate resource node corresponding to the current container management unit, and realizes the correct matching between the container management unit and the accelerator card of the resource node.

[0134] In some embodiments, based on the number of idle accelerator cards in each candidate resource node, determining the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node includes:

[0135] Based on the number of idle accelerator cards in each candidate resource node, a selection score of each candidate resource node is determined; the selection score is inversely proportional to the number of idle accelerator cards;

[0136] Determine the candidate resource node with the highest selection score as the target resource node;

[0137] Determine a target accelerator card based on an accelerator card in a target resource node;

[0138] The idle accelerator card is an accelerator card whose remaining video memory capacity is equal to the total video memory capacity of the accelerator card.

[0139] Specifically, the remaining value of the video memory capacity of the accelerator card is compared with the total value of the video memory capacity of the accelerator card, and the accelerator card for which the remaining value and the total value are equal is an idle accelerator card.

[0140] The selection score of each candidate resource node can be determined according to the number of idle accelerator cards. The selection score is inversely proportional to the number of idle accelerator cards, that is, the resource node with fewer idle accelerator cards has a higher selection score, and the resource node with more idle accelerator cards has a lower selection score. Finally, the candidate resource node with the highest selection score is determined as the target resource node, and the target accelerator card is selected from the accelerator cards in the target resource node.

[0141] The acceleration card allocation method provided in the embodiment of the present application selects each candidate resource node according to the number of idle acceleration cards in each candidate resource node, thereby improving the centralization of acceleration card allocation and avoiding resource fragmentation in resource nodes.

[0142] In some embodiments, the selection score can also be determined based on the performance parameters of the accelerator cards in each resource node. Performance parameters may include the number of computing cores, frequency, memory bandwidth, storage capacity, and power consumption. Weights can be determined for each performance parameter, and the selection score is determined based on the weighted sum of the performance parameters and the weights. In this embodiment, the selection score is determined based on the performance parameters, and the accelerator card with a higher selection score is more likely to be selected as the target accelerator card. Selecting an accelerator card by performance parameters is suitable for scenarios with relatively high acceleration performance requirements, and can improve the system performance and response speed of the artificial intelligence platform.

[0143] In some embodiments, determining the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node includes:

[0144] Determine the accelerator card requirement information based on the annotation of the current container management unit;

[0145] Based on the annotation of the resource node, the accelerator card provisioning information of the resource node is determined.

[0146] Specifically, the accelerator card demand information may be added to the annotation of the current container management unit. Similarly, the accelerator card supply information may be added to the annotation of the resource node, so that the accelerator card demand information and the accelerator card supply information may be obtained through the annotation.

[0147] The accelerator card allocation method provided in the embodiment of the present application obtains accelerator card demand information and accelerator card supply information according to annotations, solves the problem that resource nodes can concurrently and accurately obtain the accelerator card device information that they need to mount from the annotations of the container management unit, improves the accelerator card allocation efficiency, and improves the task scheduling throughput of the artificial intelligence platform.

[0148] The following takes the scheduler execution accelerator card allocation method in the Kubernetes platform as an example to illustrate. Figure 2 This is the second flow chart of the acceleration card allocation method provided by this application, such as Figure 2 As shown, the method includes:

[0149] Step 1: During the first preselection, the scheduler reads the value corresponding to "request-card-number" in the Pod annotation as the number of accelerator cards requested by the Pod. The scheduler reads the value corresponding to "request-card-memory" in the Pod annotation as the amount of video memory requested by the Pod from each accelerator card, which is an integer expressed in bytes. The scheduler reads the value corresponding to "accelerator-card" in each node annotation, initializes each accelerator card (identified as uid) and the total amount of video memory of each accelerator card, and then deducts the amount of video memory requested by the Pod that has been scheduled to this node from the total amount of video memory of each accelerator card. The remaining amount is the remaining video memory of each card on this node. Finally, compare the number of accelerator cards and video memory requested by the Pod, as well as the remaining video memory of each accelerator card. If there are enough accelerator cards and the remaining video memory of the accelerator card is more than the video memory of each card requested by the Pod, then this node meets the Pod's requirements.

[0150] For example, if a pod applies for two accelerator cards, the video memory of each accelerator card must be at least After searching, there is a node with 4 accelerator cards. The remaining video memory of accelerator card uid1 is Bytes, the remaining video memory of the accelerator card uid2 is Bytes, the remaining video memory of the accelerator card uid3 is Bytes, the remaining video memory of the accelerator card uid4 is Bytes. Three accelerator cards (uid1, uid3, and uid4) are found, which exceed the requested video memory, so this node meets the Pod requirements.

[0151] Step 2: During the second pre-selection process, read the number of vid resources requested by the Pod. Then read the number of vid resources requested by the Pod that has been scheduled to this node but lacks the "vid-used" annotation or the value of this annotation is not "true" and save it in an occupied vid set. Finally, check whether the number of vid resources requested by the Pod is already in this occupied vid set. If not, this node meets the Pod requirements.

[0152] Step 3: During the optimization process, the accelerator card whose remaining video memory is equal to the total video memory is considered to be an idle accelerator card. The node with fewer idle accelerator cards has a higher score. Among the accelerator cards that meet the requirements on the same node, the one with less remaining video memory has a higher score. For example, the accelerator cards corresponding to uid3 and uid4 have a higher score than the accelerator card corresponding to uid1. The node and accelerator card with the highest score are selected as the final scheduling result.

[0153] Step 4: When the scheduler binds the scheduling result, add the allocated accelerator card to the Pod annotation, with the annotation key as "bound-device-id" and the annotation value format as "uid3, uid4". As mentioned above, this value will be used when Kubelet calls the Allocate interface of the vid device plug-in.

[0154] The device provided in the embodiment of the present application is described below. The device described below and the method described above can refer to each other.

[0155] Figure 3 is a schematic diagram of the structure of the acceleration card allocation device provided by the present application, such as Figure 3 As shown, the acceleration card allocation device 300 includes:

[0156] The determination module 310 is used to determine the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node;

[0157] A first selection module 320 is used to match the accelerator card demand information with the accelerator card supply information to determine a candidate resource node corresponding to the current container management unit;

[0158] A second selection module 330 is used to determine the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node based on the number of idle accelerator cards in each candidate resource node;

[0159] The allocation module 340 is used to add the device identification of the target accelerator card to the annotation of the current container management unit, so that the target resource node allocates the target accelerator card to the current container management unit based on the annotation of the current container management unit.

[0160] The accelerator card allocation device provided in the embodiment of the present application matches the accelerator card demand information of the current container management unit with the accelerator card supply information of each resource node, and determines the candidate resource node corresponding to the current container management unit; based on the number of idle accelerator cards in each candidate resource node, determines the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node; adds the device identifier of the target accelerator card to the annotation of the current container management unit; enables the resource node to allocate an accelerator card to the container management unit according to the annotation of the container management unit, thereby achieving correct matching between the accelerator cards of the container management unit and the resource node, making the allocation of accelerator cards in the artificial intelligence platform more reasonable, improving the allocation efficiency of accelerator cards, and improving the task scheduling throughput of the artificial intelligence platform.

[0161] In some embodiments, the first selection module is used to:

[0162] Match the accelerator card demand information with the accelerator card supply information to determine the initial candidate resource node corresponding to the current container management unit;

[0163] Determine virtual resource demand information of the current container management unit based on the annotation of the current container management unit, and determine virtual resource allocation information of the initial candidate resource nodes based on the annotations of each initial candidate resource node;

[0164] Matching the virtual resource demand information with the virtual resource allocation information, and determining the candidate resource node corresponding to the current container management unit from the initial candidate resource nodes;

[0165] The virtual resource demand information is used to identify each container management unit.

[0166] In some embodiments, the first selection module is used to:

[0167] Determine multiple virtual resource allocation information and the virtual resource allocation quantity of each virtual resource allocation information based on the occupied virtual resource set corresponding to any initial candidate resource node;

[0168] When the virtual resource requirement quantity in the virtual resource requirement information does not match the virtual resource allocation quantity in each virtual resource allocation information, any initial candidate resource node is determined as a candidate resource node corresponding to the current container management unit.

[0169] In some embodiments, the occupied set of virtual resources corresponding to any initial candidate resource node is determined based on the following steps:

[0170] Determine current virtual resource allocation information;

[0171] When the virtual resource used flag is missing in the annotation of the container management unit corresponding to the current virtual resource allocation information or the virtual resource used flag is not true, the current virtual resource allocation information is added to the virtual resource occupied set.

[0172] In some embodiments, the first selection module is further configured to:

[0173] When the current container management unit is created, the annotation of the current container management unit is obtained;

[0174] Based on the annotation of the current container management unit, determine that the current container management unit applies for allocating an accelerator card;

[0175] Taking the current number in the circular array as the virtual resource requirement quantity of the current container management unit, generating virtual resource requirement information of the current container management unit based on the virtual resource requirement quantity;

[0176] The maximum number of loop arrays is determined based on the number of concurrent operations of the container management unit.

[0177] In some embodiments, the first selection module is used to:

[0178] Based on the accelerator card demand information, determine the number of accelerator cards applied for the current container management unit and the video memory capacity application value of each accelerator card;

[0179] Based on the accelerator card supply information, determine the number of accelerator cards of each resource node and the remaining value of the video memory capacity of each accelerator card;

[0180] The resource nodes whose number of accelerator cards is greater than or equal to the number of accelerator cards applied for and whose remaining video memory capacity is greater than or equal to the video memory capacity applied value are determined as initial candidate resource nodes.

[0181] In some embodiments, the second selection module is used to:

[0182] Based on the number of idle accelerator cards in each candidate resource node, a selection score of each candidate resource node is determined; the selection score is inversely proportional to the number of idle accelerator cards;

[0183] Determine the candidate resource node with the highest selection score as the target resource node;

[0184] Determine a target accelerator card based on an accelerator card in a target resource node;

[0185] The idle accelerator card is an accelerator card whose remaining video memory capacity is equal to the total video memory capacity of the accelerator card.

[0186] In some embodiments, the determination module is configured to:

[0187] Determine the accelerator card requirement information based on the annotation of the current container management unit;

[0188] Based on the annotation of the resource node, the accelerator card provisioning information of the resource node is determined.

[0189] Figure 4 This is one of the structural diagrams of the artificial intelligence platform provided by this application, such as Figure 4 As shown, the artificial intelligence platform 400 includes an accelerator card allocation device 300, an interface management component 410 and multiple resource nodes 420.

[0190] The interface management component is connected to the accelerator card allocation device and the resource node, and is used to send the accelerator card demand information of each container management unit and the accelerator card supply information of each resource node to the accelerator card allocation device, and add the device identifier of the target accelerator card determined by the accelerator card allocation device to the annotation of each container management unit.

[0191] Specifically, the artificial intelligence platform can be implemented through Kubernetes. The artificial intelligence platform at least includes an accelerator card allocation device, an interface management component, and multiple resource nodes.

[0192] The accelerator card allocation device can be implemented by a scheduler. The scheduler can be a scheduling component suitable for the Kubernetes platform, such as Kube-scheduler, Volcano, etc. The accelerator card allocation device is mainly used to execute the accelerator card allocation method in the above embodiment. For example, in the pre-selection process, the scheduler makes some judgments on each node based on the label selector of the Pod, the amount of resources applied for, the node affinity and other information, so as to obtain the node that meets the Pod requirements. In the optimization process, the nodes are scored, and the scoring methods are various. For example, using the Binpack scoring strategy, the nodes with fewer idle accelerator cards have higher scores, which can reduce resource fragmentation. After the scoring is completed, the node with the highest score is selected as the final scheduling result. Finally, the scheduler sends the scheduling result to ETCD, that is, binds the scheduling result.

[0193] The interface management component can be implemented using Kube-apiserver. Kube-apiserver is a core component in the Kubernetes cluster. It is the front-end component of the Kubernetes API and is responsible for providing API (Application Programming Interface) services for the entire cluster. In an embodiment of the present application, the interface management component is mainly used to schedule and control data between the accelerator card allocation device and the resource nodes, such as sending the accelerator card demand information of each container management unit and the accelerator card supply information of each resource node to the accelerator card allocation device, and adding the device identifier of the target accelerator card determined by the accelerator card allocation device to the annotation of each container management unit.

[0194] The artificial intelligence platform provided in the embodiment of the present application includes an accelerator card allocation device, which realizes the correct matching between the container management unit and the accelerator card of the resource node, making the allocation of the accelerator card in the artificial intelligence platform more reasonable, improving the allocation efficiency of the accelerator card, and improving the task scheduling throughput of the artificial intelligence platform.

[0195] In some embodiments, a resource node includes a node agent component, an accelerator card plug-in, and a virtual resource plug-in;

[0196] The node agent component is used to report resource information of the resource node to the accelerator card allocation device, and read the container management unit scheduled to the resource node;

[0197] The accelerator card plug-in is used to provide the node agent component with an accelerator card calling interface;

[0198] The virtual resource plug-in is used to provide a calling interface of virtual resources to the node agent component.

[0199] Specifically, a node agent component, an accelerator card plug-in, and a virtual resource plug-in may be run in a resource node.

[0200] The node agent component Kubelet is mainly used to report resource information of resource nodes to the accelerator card allocation device and read the container management unit scheduled to the resource node.

[0201] The accelerator card plug-in is used to provide the node agent component with an accelerator card calling interface. The virtual resource plug-in is used to provide the node agent component with a virtual resource calling interface.

[0202] In some embodiments, the platform further comprises:

[0203] The database component is connected to the interface management component and is used to store data and operations in the artificial intelligence platform.

[0204] Specifically, the database component may be ETCD. ETCD is an open source distributed key-value storage system that can store data and operations in the artificial intelligence platform, support large-scale distributed systems, and provide consistency, high availability, and high reliability.

[0205] In some embodiments, the platform further comprises:

[0206] The editing component is connected to the interface management component and is used to modify the annotations of the container management unit.

[0207] Specifically, the editing component may be mutating-admission-webhook. Mutating-admission-webhook is an advanced feature in Kubernetes, which is used to intercept and modify API requests for creating or updating resource objects (such as Pods, etc.), allowing Kubernetes API requests to be dynamically modified and adjusted before entering the cluster.

[0208] Figure 5 This is the second structural diagram of the artificial intelligence platform provided by this application, such as Figure 5 As shown in the figure, the artificial intelligence platform is implemented through the Kubernetes platform, and the components involved include Kube-apiserver, ETCD, mutating-admission-webhook, and scheduler. The figure takes two nodes as an example for explanation.

[0209] Kube-apiserver is an interface management component. All additions, deletions, modifications, and queries of Kubernetes data must be completed through this component. ETCD can be used as a database component. All database access operations are completed through Kube-apiserver. Mutating-admission-webhook is an external component that Kube-apiserver calls when it receives a Pod creation request. It can modify the fields of the Pod and then return the modified Pod to Kube-apiserver.

[0210] The scheduler is responsible for assigning a node and an accelerator card on the node to Pods that have not yet been assigned a node. Each node has a Kubelet component, which acts as a Kubernetes agent to complete resource reporting, read Pods scheduled to this node for startup, and other operations on their respective nodes. When working, Kubelet will call the interface of the device plug-in to complete the process of resource acquisition and device mounting.

[0211] Figure 6 is a schematic diagram of the structure of the electronic device provided by this application, such as Figure 6 As shown, the electronic device may include: a processor (Processor) 610, a communication interface (Communications Interface) 620, a memory (Memory) 630 and a communication bus (Communications Bus) 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic command in the memory 630 to execute the method described in the above embodiment, for example:

[0212] Determine the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node; match the accelerator card demand information with the accelerator card supply information to determine the candidate resource node corresponding to the current container management unit; determine the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node based on the number of idle accelerator cards in each candidate resource node; add the device identifier of the target accelerator card to the annotation of the current container management unit, so that the target resource node allocates the target accelerator card to the current container management unit based on the annotation of the current container management unit.

[0213] In addition, the logical commands in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several commands to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.

[0214] The processor in the electronic device provided in the embodiment of the present application can call the logic instructions in the memory to implement the above method. Its specific implementation method is consistent with the implementation method of the aforementioned method and can achieve the same beneficial effects, which will not be repeated here.

[0215] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the methods provided in the above embodiments are implemented.

[0216] Its specific implementation is consistent with the aforementioned method implementation and can achieve the same beneficial effects, so it will not be repeated here.

[0217] An embodiment of the present application provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0218] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0219] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0220] 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 make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for allocating an accelerator card, characterized in that: include: Determine the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node; Matching the accelerator card demand information with the accelerator card supply information to determine a candidate resource node corresponding to the current container management unit; Determine, based on the number of idle accelerator cards in each candidate resource node, a target resource node corresponding to the current container management unit and a target accelerator card in the target resource node; Adding the device identifier of the target accelerator card to the annotation of the current container management unit, so that the target resource node allocates the target accelerator card to the current container management unit based on the annotation of the current container management unit; The matching the accelerator card demand information with the accelerator card supply information to determine the candidate resource node corresponding to the current container management unit includes: Matching the acceleration card demand information with the acceleration card supply information to determine an initial candidate resource node corresponding to the current container management unit; Determine virtual resource demand information of the current container management unit based on the annotation of the current container management unit, and determine virtual resource allocation information of the initial candidate resource nodes based on the annotations of each initial candidate resource node; Matching the virtual resource demand information with the virtual resource allocation information, and determining a candidate resource node corresponding to the current container management unit from among the initial candidate resource nodes; Wherein, the virtual resource demand information is used to identify each container management unit; The determining, based on the number of idle accelerator cards in each candidate resource node, a target resource node corresponding to the current container management unit and a target accelerator card in the target resource node includes: Determine a selection score of each candidate resource node based on the number of idle accelerator cards in each candidate resource node; the selection score is in inverse proportion to the number of idle accelerator cards; Determine the candidate resource node with the highest selection score as the target resource node; Determining the target accelerator card based on the accelerator card in the target resource node; The idle acceleration card is an acceleration card whose remaining video memory capacity is equal to the total video memory capacity of the acceleration card.

2. The acceleration card allocation method according to claim 1, characterized in that: The matching of the virtual resource demand information and the virtual resource allocation information to determine the candidate resource node corresponding to the current container management unit from the initial candidate resource nodes includes: Determine multiple virtual resource allocation information and virtual resource allocation quantity of each virtual resource allocation information based on the occupied virtual resource set corresponding to any initial candidate resource node; In the case that the virtual resource requirement quantity in the virtual resource requirement information does not match the virtual resource allocation quantity in each virtual resource allocation information, any one of the initial candidate resource nodes is determined as a candidate resource node corresponding to the current container management unit.

3. The acceleration card allocation method according to claim 2, characterized in that: The occupied set of virtual resources corresponding to any initial candidate resource node is determined based on the following steps: Determine current virtual resource allocation information; When the virtual resource used flag is missing in the annotation of the container management unit corresponding to the current virtual resource allocation information or the virtual resource used flag is not true, the current virtual resource allocation information is added to the virtual resource occupied set.

4. The acceleration card allocation method according to claim 1, characterized in that: Before determining the virtual resource requirement information of the current container management unit based on the annotation of the current container management unit, the method further includes: In case of creating the current container management unit, obtaining the annotation of the current container management unit; Based on the annotation of the current container management unit, determining that the current container management unit applies for allocating an accelerator card; Taking the current number in the circular array as the virtual resource requirement quantity of the current container management unit, and generating the virtual resource requirement information of the current container management unit based on the virtual resource requirement quantity; The maximum number of the circular array is determined based on the concurrent number of the container management unit.

5. The acceleration card allocation method according to claim 1, characterized in that: The matching the accelerator card demand information with the accelerator card supply information to determine the initial candidate resource node corresponding to the current container management unit includes: Based on the accelerator card requirement information, determine the number of accelerator cards applied for the current container management unit and the video memory capacity application value of each accelerator card; Based on the accelerator card supply information, determine the number of accelerator cards of each resource node and the remaining value of the video memory capacity of each accelerator card; The resource nodes whose number of accelerator cards is greater than or equal to the number of accelerator cards applied for and whose remaining video memory capacity is greater than or equal to the video memory capacity applied value are determined as the initial candidate resource nodes.

6. The acceleration card allocation method according to claim 1, characterized in that: The determining of the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node includes: Determining the accelerator card requirement information based on the annotation of the current container management unit; Based on the annotation of the resource node, the accelerator card provisioning information of the resource node is determined.

7. An accelerator card distribution device, characterized in that: include: A determination module is used to determine the accelerator card demand information of the current container management unit and the accelerator card supply information of each resource node; A first selection module, configured to match the acceleration card demand information with the acceleration card supply information to determine a candidate resource node corresponding to the current container management unit; A second selection module is used to determine the target resource node corresponding to the current container management unit and the target accelerator card in the target resource node based on the number of idle accelerator cards in each candidate resource node; an allocation module, configured to add the device identification of the target accelerator card to the annotation of the current container management unit, so that the target resource node allocates the target accelerator card to the current container management unit based on the annotation of the current container management unit; The first selection module is used for: Matching the acceleration card demand information with the acceleration card supply information to determine an initial candidate resource node corresponding to the current container management unit; Determine virtual resource demand information of the current container management unit based on the annotation of the current container management unit, and determine virtual resource allocation information of the initial candidate resource nodes based on the annotations of each initial candidate resource node; Matching the virtual resource demand information with the virtual resource allocation information, and determining a candidate resource node corresponding to the current container management unit from among the initial candidate resource nodes; Wherein, the virtual resource demand information is used to identify each container management unit; The second selection module is used for: Determine a selection score of each candidate resource node based on the number of idle accelerator cards in each candidate resource node; the selection score is in inverse proportion to the number of idle accelerator cards; Determine the candidate resource node with the highest selection score as the target resource node; Determining the target accelerator card based on the accelerator card in the target resource node; The idle acceleration card is an acceleration card whose remaining video memory capacity is equal to the total video memory capacity of the acceleration card.

8. An artificial intelligence platform, characterized in that: It comprises the acceleration card allocation device according to claim 7, an interface management component and a plurality of resource nodes; The interface management component is connected to the acceleration card allocation device and the resource node, and is used to send the acceleration card demand information of each container management unit and the acceleration card supply information of each resource node to the acceleration card allocation device, and add the device identifier of the target acceleration card determined by the acceleration card allocation device to the annotation of each container management unit.

9. The artificial intelligence platform according to claim 8, characterized in that: The resource node includes a node agent component, an accelerator card plug-in and a virtual resource plug-in; The node agent component is used to report resource information of the resource node to the acceleration card allocation device, and read the container management unit scheduled to the resource node; The acceleration card plug-in is used to provide the node agent component with an acceleration card calling interface; The virtual resource plug-in is used to provide a calling interface of the virtual resource to the node agent component.

10. The artificial intelligence platform according to claim 9, characterized in that: Also includes: A database component is connected to the interface management component and is used to store data and operations in the artificial intelligence platform.

11. The artificial intelligence platform according to claim 9, characterized in that: Also includes: An editing component, connected to the interface management component, is used to modify the annotation of the container management unit.

12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the acceleration card allocation method according to any one of claims 1 to 6 is implemented.

13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the acceleration card allocation method according to any one of claims 1 to 6 is implemented.