Task resource allocation method and apparatus, electronic device, and storage medium

By reconstructing the topology of device nodes in distributed AI training and selecting device nodes with unlimited bandwidth within the same switching unit to execute task instances, the problem of increased cross-SU data exchange volume caused by dispersed device resources is solved, thereby improving task execution efficiency and resource utilization.

WO2026114127A1PCT designated stage Publication Date: 2026-06-04CHINA TELECOM CLOUD TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
CHINA TELECOM CLOUD TECH CO LTD
Filing Date
2025-11-21
Publication Date
2026-06-04

AI Technical Summary

Technical Problem

In distributed AI training with multiple GPU servers, the distribution of device resources across different switching units (SUs) increases the amount of data exchanged across SUs, affecting the efficiency of server task processing.

Method used

By acquiring the topology of the device nodes, the secondary resource tree is reconstructed, and idle unlimited bandwidth device child nodes are identified as candidate nodes for task instances. A preset scoring strategy is used to select target child nodes, and task instances are assigned to the same switching unit node for execution, reducing cross-SU communication.

Benefits of technology

This reduces the amount of data exchanged across units, improves resource management and task execution efficiency, and ensures the efficient utilization of equipment resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025136778_04062026_PF_FP_ABST
    Figure CN2025136778_04062026_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a task resource allocation method and apparatus, an electronic device, and a storage medium. The method comprises: acquiring a topology structure corresponding to a device node of a task to be executed, and reconstructing a secondary resource tree in the topology structure, wherein the secondary resource tree comprises switching unit (SU) nodes and InfiniBand device child nodes under the SU nodes; in response to issuing of a task instance to which an InfiniBand device resource is to be allocated, determining idle InfiniBand device child nodes in the secondary resource tree as candidate child nodes for the task instance; determining, from among the candidate child nodes, a target child node for allocating the task instance to the same SU node; and allocating the task instance to the target child node, and executing the task instance on the target child node. In the present application, allocating instances of the same task to device nodes within the same SU reduces cross-SU communication, thereby decreasing the data exchange amount of a switch, and improving resource management efficiency and task execution efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Task resource allocation methods, devices, electronic equipment and storage media

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 2024117162967.7, filed on November 27, 2024, entitled “Task Resource Allocation Method, Apparatus, Electronic Device and Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This application belongs to the field of task processing technology, specifically relating to a task resource allocation method, a task resource allocation device, an electronic device, and a computer-readable storage medium. Background Technology

[0004] With the rapid development of artificial intelligence technology, the demand for computing resources in deep learning and large-scale data processing has increased dramatically. Distributed computing clusters composed of multiple GPU servers are widely used in AI training tasks. InfiniBand devices, also known as IB devices, are high-speed network communication devices designed specifically for high-performance computing and AI training. By providing low-latency, high-bandwidth communication channels, they significantly improve the data exchange efficiency between multiple GPU servers.

[0005] Networking of IB devices is based on a Unit (SU). Each SU consists of multiple nodes with IB cards and switches, and multiple SUs are connected through a spine switch and a core switch. Currently, when performing distributed AI training on multiple GPU servers, it is necessary to schedule IB devices to execute tasks. Since IB devices are distributed across different SUs, the device resources allocated to tasks are usually scattered across different SUs, resulting in cross-SU communication required for task execution. This increases the data exchange volume between the spine switch and the core switch, further affecting the efficiency of server task processing. Summary of the Invention

[0006] In view of this, this application aims to propose a task resource allocation method, apparatus, electronic device and storage medium to solve the problem that the equipment resources required to perform tasks are currently scattered in different SUs, resulting in an increase in cross-SU data exchange and affecting the efficiency of server task processing.

[0007] According to a first aspect of this application, a task resource allocation method is provided, the method comprising:

[0008] Obtain the topology structure corresponding to the device node of the task to be executed, and reconstruct a secondary resource tree in the topology structure; wherein, the secondary resource tree includes a switching unit node and an infinite bandwidth device sub-node under the switching unit node;

[0009] In response to the issuance of a task instance with unallocated unlimited bandwidth device resources, the idle unlimited bandwidth device child nodes in the secondary resource tree are determined as candidate child nodes of the task instance;

[0010] Among the candidate child nodes, a target child node is identified for assigning the task instance to the same exchange unit node;

[0011] The task instance is assigned to the target child node, and the task instance is executed on the target child node.

[0012] Optionally, obtaining the topology structure corresponding to the device node of the task to be executed, and reconstructing a secondary resource tree in the topology structure, includes:

[0013] The topology information of the device nodes to be executed is collected in advance to obtain the topology structure of the device nodes;

[0014] The topological relationships between the unlimited bandwidth devices and switching units are extracted from the topology to obtain the reconstructed secondary resource tree.

[0015] Optionally, in response to the issuance of a task instance to be allocated unlimited bandwidth device resources, determining the idle unlimited bandwidth device child nodes in the secondary resource tree as candidate child nodes of the task instance includes:

[0016] In response to the issuance of a task instance to be allocated unlimited bandwidth device resources, determine the task instance's task number;

[0017] By matching the available unlimited bandwidth device child nodes in the secondary resource tree one by one according to the task number, the candidate child nodes of the task instance are determined.

[0018] Optionally, determining the target child node from the candidate child nodes for assigning the task instance to the same exchange unit node includes:

[0019] The candidate child nodes are scored using a preset scoring strategy, and the candidate child node with the highest score is determined.

[0020] The candidate child node with the highest score is determined as the target child node of the task instance;

[0021] The task instances are assigned to the same exchange unit through the target sub-node.

[0022] Optionally, the step of using a preset scoring strategy to score the candidate child nodes and determine the candidate child node with the highest score includes:

[0023] A preset scoring strategy is used to determine whether the switching unit where the candidate sub-node is located has a device sub-node with unlimited bandwidth occupied by a task instance;

[0024] If so, then the candidate child node is determined to have the highest score;

[0025] Otherwise, the number of idle nodes in the exchange unit where the candidate child node is located is compared with the number of task instances. If the absolute difference between the number of idle nodes and the number of task instances is less than a preset threshold, then the candidate child node is determined to have the highest score.

[0026] Optionally, assigning the task instance to the target child node and executing the task instance on the target child node includes:

[0027] The task instance is assigned to the target child node, and the target child node in the secondary resource tree is marked as occupied.

[0028] Monitor the execution status of the task instance on the target child node;

[0029] Once the task instance is detected to have started execution, the task instance will be executed using the unlimited bandwidth device resources on the target child node.

[0030] Optionally, after assigning the task instance to the target child node and executing the task instance on the target child node, the method further includes:

[0031] Once the task instance is detected to have completed execution, the occupied status of the target child node is changed to an idle status.

[0032] According to a second aspect of this application, a task resource allocation apparatus is provided, the apparatus comprising:

[0033] The topology acquisition module is used to acquire the topology structure corresponding to the device nodes of the task to be executed, and reconstruct a secondary resource tree in the topology structure; wherein, the secondary resource tree includes switching unit nodes and infinite bandwidth device sub-nodes under the switching unit nodes;

[0034] The candidate determination module is used to determine the idle infinite bandwidth device child nodes in the secondary resource tree as candidate child nodes of the task instance in response to the issuance of the task instance to be allocated unlimited bandwidth device resources;

[0035] The target determination module is used to determine, from the candidate child nodes, the target child node for assigning the task instance to the same exchange unit node;

[0036] The task execution module is used to assign the task instance to the target child node and execute the task instance on the target child node.

[0037] According to another aspect of this application, an electronic device is also provided, comprising:

[0038] processor;

[0039] Memory used to store the processor's executable instructions;

[0040] The processor is configured to execute the instructions to implement the task resource allocation method described above.

[0041] According to another aspect of this application, a readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the task resource allocation method described above.

[0042] The task resource allocation method provided in this application obtains the topology structure corresponding to the device nodes of the task to be executed, reconstructs a secondary resource tree in the topology structure, and the secondary resource tree includes switching unit nodes and unlimited bandwidth device child nodes under the switching unit nodes. In response to the issuance of task instances with unlimited bandwidth device resources to be allocated, the idle unlimited bandwidth device child nodes in the secondary resource tree are determined as candidate child nodes of the task instances. Among the candidate child nodes, the target child node for allocating the task instance to the same switching unit node is determined, the task instance is allocated to the target child node, and the task instance is executed on the target child node. This application embodiment obtains the topology relationship of the switching unit and the unlimited bandwidth devices under the switching unit in the device node topology structure. When allocating the execution device node for the task instance, multiple instances of the same task are allocated to the same SU, reducing cross-SU communication. By prioritizing the selection of node resources within the same SU, the amount of data exchange between the spine switches and core switches required across SUs is reduced, improving resource management efficiency and task execution efficiency, ensuring that device resources can be used efficiently and tasks can be executed smoothly.

[0043] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0044] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:

[0045] Figure 1 is a flowchart of a task resource allocation method provided in an embodiment of this application;

[0046] Figure 2 is a flowchart of step 101 in the task resource allocation method provided in the embodiment of this application in Figure 1;

[0047] Figure 3 is a flowchart of step 102 in the task resource allocation method provided in the embodiment of this application in Figure 1;

[0048] Figure 4 is a flowchart of step 103 in the task resource allocation method provided in the embodiment of this application in Figure 1;

[0049] Figure 5 is a flowchart of step 104 in the task resource allocation method provided in the embodiment of this application in Figure 1;

[0050] Figure 6 is a flowchart of another task resource allocation method provided in an embodiment of this application;

[0051] Figure 7 is a schematic diagram of a scenario for the task resource allocation method provided in an embodiment of this application;

[0052] Figure 8 is a second scenario diagram of the task resource allocation method provided in the embodiments of this application;

[0053] Figure 9 is a schematic diagram of a task resource allocation device provided in an embodiment of this application;

[0054] Figure 10 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0055] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of this application to enable readers to better understand this application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in this application can be implemented. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.

[0057] Referring to Figure 1, a flowchart of the steps of the task resource allocation method provided in an embodiment of this application is shown. The method may include:

[0058] Step 101: Obtain the topology structure corresponding to the device node of the task to be executed, and reconstruct the secondary resource tree in the topology structure; wherein, the secondary resource tree includes the switching unit node and the infinite bandwidth device sub-node under the switching unit node.

[0059] In this embodiment, to address the problem that the equipment resources required for the current task are scattered across different Units (SUs), leading to an increase in cross-SU data exchange and affecting the server's task processing efficiency, this embodiment adds topology awareness of equipment resources in the scheduler. In distributed multi-machine multi-card training scenarios, the equipment resources required for the task are automatically allocated to the same group of SUs, minimizing cross-SU communication. At the same time, the equipment resources within the same group of SUs are consumed first, reducing resource fragmentation and thus greatly reducing the data exchange volume between the Spine switch and the core switch.

[0060] It should be noted that in this embodiment, when multiple GPU servers perform distributed AI training, they utilize IB devices to execute training tasks. This embodiment uses IB devices as an example for explanation. InfiniBand (IB) is a network communication standard device dedicated to high-performance computing on the server side. It has extremely high throughput and extremely low latency and is used for data interconnection between computers. IB devices include nodes with IB cards, IB switches, etc. IB nodes are GPU servers with IB cards inserted. The IB cards are inserted into the GPU servers and connected to the IB switch at one end via a dedicated cable. Distributed training tasks are AI training tasks that start multiple instances on multiple devices to work collaboratively. Each task instance uses GPU cards of the same specifications and number to keep the time consumption of each training stage of each task instance close.

[0061] Referring to Figure 7, a scenario diagram of the task resource allocation method provided in this application embodiment is shown, which is the topology corresponding to all device nodes in the server. In this embodiment, a switching unit (SU) consists of 20 nodes with 8 IB cards (or 40 nodes with 4 IB cards, and so on) and 8 IB switches. Multiple SUs are connected through a spine switch and interconnected into a SG system, which supports multiple users running an AI load at the same time. Multiple SGs are connected through a core switch and interconnected into a CG system.

[0062] The execution entity in this application embodiment is a resource scheduler, which is a centralized management system that may include a topology parsing module, a resource management module, a resource pre-selection module, a resource scoring module, and a resource allocation module for resource allocation, task scheduling, and management. Based on task requirements and resource status, resources are dynamically allocated to ensure efficient task execution. In this embodiment, the scheduler is responsible for collecting topology information, parsing the topology structure, pre-selecting resources, scoring resources, allocating resources, starting tasks, and releasing resources. Device nodes refer to various hardware devices in the network, such as servers, computing nodes, storage devices, and network devices. These nodes provide computing, storage, and network resources to support task execution. In this technical embodiment, device nodes include devices with IB cards, supporting distributed training and multi-machine, multi-card training and inference scenarios.

[0063] Specifically, the scheduler obtains the topology structure corresponding to the device nodes of the task to be executed, and reconstructs a secondary resource tree in the topology structure. The secondary resource tree includes switching unit nodes and unlimited bandwidth device child nodes under the switching unit nodes. The scheduler can use the collector to collect the topology information of IB devices on the device nodes. Since task instances need to be allocated to IB devices within the same SU when executing task instances, the scheduler needs to obtain the secondary topology relationship between SU ​​nodes and IB device nodes, extract the topology relationship between unlimited bandwidth devices and switching units in the topology structure, and obtain the reconstructed secondary resource tree.

[0064] Step 102: In response to the issuance of a task instance with unallocated unlimited bandwidth device resources, the idle unlimited bandwidth device child nodes in the secondary resource tree are identified as candidate child nodes for the task instance.

[0065] In this embodiment, in response to the issuance of a task instance to be allocated unlimited bandwidth device resources, the scheduler first identifies idle unlimited bandwidth device sub-nodes in the secondary resource tree as candidate sub-nodes for the task instance. Here, a task instance refers to a specific execution unit within a user-issued training task; each task instance corresponds to a specific computational task that needs to be executed on the resource device. Specifically, when a user-issued training task requests IB device resources, the resource pre-selection module in the scheduler will match idle unlimited bandwidth device sub-nodes with IB cards as candidate sub-nodes for each task instance to be created within the task.

[0066] Step 103: Determine the target child node from the candidate child nodes for assigning task instances to the same exchange unit node.

[0067] In this embodiment of the application, the resource scoring module in the scheduler scores the candidate child nodes of the task instance to be created, and determines the target child node for allocating the task instance to the same switching unit node from the candidate child nodes. The resource scoring module uses a preset scoring strategy to score the candidate child nodes. The preset scoring strategy is used to determine whether there are infinite bandwidth device child nodes occupied by the task instance in the switching unit where the candidate child node is located, and to determine the number of idle nodes in the switching unit where the candidate child node is located compared with the number of task instances. Finally, the candidate child node with the highest score is the target child node for allocating the task instance to the same switching unit node.

[0068] Step 104: Assign the task instance to the target child node and execute the task instance on the target child node.

[0069] The task resource allocation method provided in this application obtains the topology structure corresponding to the device nodes of the task to be executed, reconstructs a secondary resource tree in the topology structure, and the secondary resource tree includes switching unit nodes and unlimited bandwidth device child nodes under the switching unit nodes. In response to the issuance of task instances with unlimited bandwidth device resources to be allocated, the idle unlimited bandwidth device child nodes in the secondary resource tree are determined as candidate child nodes of the task instances. Among the candidate child nodes, the target child node for allocating the task instance to the same switching unit node is determined, the task instance is allocated to the target child node, and the task instance is executed on the target child node. This application embodiment obtains the topology relationship of the switching unit and the unlimited bandwidth devices under the switching unit in the device node topology structure. When allocating the execution device node for the task instance, multiple instances of the same task are allocated to the same SU, reducing cross-SU communication. By prioritizing the selection of node resources within the same SU, the amount of data exchange between the spine switches and core switches required across SUs is reduced, improving resource management efficiency and task execution efficiency, ensuring that device resources can be used efficiently and tasks can be executed smoothly.

[0070] Furthermore, referring to FIG2, a flowchart of step 101 in a task resource allocation method provided in FIG1 is shown. This method is basically the same as the task resource allocation method provided in the first embodiment of this application. Step 101 may include:

[0071] Step 1011: Pre-collect the topology information of the device nodes of the task to be executed to obtain the topology structure of the device nodes;

[0072] Step 1012: Extract the topological relationships between the unlimited bandwidth devices and switching units in the topology structure to obtain the reconstructed secondary resource tree.

[0073] It should be noted that in this embodiment, the scheduler uses the collector to collect topology information on each resource device or on the device with IB card, and queries the topology information of each device node. The topology information starts with the CA keyword and includes the device name, IB card name, corresponding IB switch port and IB switch name. Based on the switch port, switch and other information in the topology information, the topology structure of the entire device node can be obtained. For example, topology information CA: Node name: IB; Card name: lid 53; Network card port number [0]==(4X 53.125Gbps Active / LinkUp)==>4; Switch port number: [0]"leaf core 1"(); The scheduler extracts the topology relationship between the unlimited bandwidth device (IB device) and the switching unit (SU) in the topology structure of the entire device node to obtain the reconstructed secondary resource tree.

[0074] Referring to Figure 8, a second scenario diagram of the task resource allocation method provided in this application is shown, which is a schematic diagram of a two-level resource tree. Specifically, the scheduler first obtains the topology structure corresponding to the device nodes of the task to be executed, and uses the topology parsing module to parse the IB topology information reported by the collector. The IB device nodes belonging to the same SU are organized into a two-level resource tree and stored in the resource management module. For example, the uplinks of each SU to the spine and core switch are symmetrical, which also means that the communication level between SUs is the same. Ignoring the topology of the spine and core switch, the focus is on parsing the relationship between the nodes and Leaf switches within each SU. The Leaf switch is responsible for connecting the node devices within the SU. The Leaf switch connects to other SUs through the Spine switch to realize cross-SU data communication. The 8 IB cards on each node are connected to different Leaf switches within the SU. During the parsing process, the Leaf switches are aggregated. Each node is connected to 8 Leaf switches. Nodes with the same name of 8 Leaf switches form the same SU, thus obtaining the two-level resource tree of the switching unit node and the infinite bandwidth device sub-nodes under the switching unit node.

[0075] Furthermore, referring to Figure 3, a flowchart of step 102 in a task resource allocation method provided in Figure 1 is shown. This method is basically the same as the task resource allocation method provided in the first embodiment of this application. Step 102 may include:

[0076] Step 1021: In response to the issuance of a task instance to be allocated unlimited bandwidth device resources, determine the task number of the task instance;

[0077] Step 1022: Match the idle unlimited bandwidth device child nodes in the secondary resource tree one by one according to the task number to determine the candidate child nodes of the task instance.

[0078] In the above steps of this embodiment, when the server receives a training task from a user requesting IB device resources, and the task includes multiple task instances to be created, the scheduler, in response to the issuance of the task instances to be allocated unlimited bandwidth device resources, first determines the task number of the task instance. The task number is used to identify and distinguish different task instances. Through the task number, the scheduler can identify and distinguish different task instances, facilitating subsequent resource allocation and management. The scheduler matches the idle unlimited bandwidth device child nodes in the secondary resource tree one by one according to the task number to determine the candidate child nodes of the task instance. The candidate child nodes are idle nodes in the device with IB card.

[0079] It should be noted that the scheduler updates the occupancy status of the unlimited bandwidth device sub-nodes in the stored secondary resource tree in real time based on the occupancy status of each node, marking whether the unlimited bandwidth device sub-nodes are idle or occupied. This allows the scheduler to determine the available idle unlimited bandwidth device sub-nodes for each task instance in order of task number. The resource pre-selection module in the scheduler will match each task instance one by one, finding all idle nodes with IB cards. For example, within the SU, all nodes except for the 1-5 already occupied nodes meet the criteria and are considered candidate sub-nodes.

[0080] Furthermore, referring to Figure 4, a flowchart of step 103 in the task resource allocation method provided in Figure 1 is shown. This method is basically the same as the task resource allocation method provided in the first embodiment of this application. Step 103 may include:

[0081] Step 1031: Use a preset scoring strategy to score the candidate child nodes and determine the candidate child node with the highest score.

[0082] Step 1032: The candidate child node with the highest score is determined as the target child node of the task instance.

[0083] Step 1033: Assign task instances to the same exchange unit through the target child nodes.

[0084] It should be noted that in this embodiment, the scheduler uses a preset scoring strategy to score candidate child nodes. The preset scoring strategy includes: if other task instances are assigned to the SU where the candidate child node is located, then the candidate child node has the highest score; if the task where the instance is located has no already created instances, or there are no idle nodes in the assigned SU, then the number of idle nodes in the SU where the candidate child node is located is compared with the number of instances to be created, and a score is calculated to determine the candidate child node with the highest score as the target child node of the task instance. The task instance is then assigned to the same switching unit through the target child node.

[0085] This application embodiment uses a scoring mechanism to ensure that task instances can obtain optimal resource allocation. The scheduler determines the candidate child node with the highest score as the target child node of the task instance, and allocates multiple instances of the same task to the same SU, reducing cross-SU communication and improving task execution efficiency.

[0086] Specifically, step 1031 uses a preset scoring strategy to score the candidate child nodes and determines the candidate child node with the highest score, which may include:

[0087] First, a preset scoring strategy is used to determine whether the switching unit where the candidate child node is located has a device child node with unlimited bandwidth occupied by a task instance;

[0088] Secondly, if so, then the candidate child node is determined to have the highest score;

[0089] Secondly, otherwise, the number of idle nodes and the number of task instances in the exchange unit where the candidate child node is located are compared. If the absolute difference between the number of idle nodes and the number of task instances is less than a preset threshold, then the candidate child node is determined to have the highest score.

[0090] It should be noted that in this embodiment, the scheduler uses a preset scoring strategy to score candidate child nodes and determine the candidate child node with the highest score. The specific scoring strategy includes the following steps: determining whether there is an infinite bandwidth device child node occupied by a task instance in the switching unit where the candidate child node is located. If so, the candidate child node is determined to have the highest score. If not, the number of idle nodes in the switching unit where the candidate child node is located is compared with the number of task instances. If the absolute difference between the number of idle nodes and the number of task instances is less than a preset threshold, the candidate child node is determined to have the highest score. The absolute difference between the number of idle nodes and the number of task instances is less than the preset threshold, which is set according to actual needs. In this embodiment, it is ensured that the number of idle nodes is greater than or equal to and closest to the number of task instances to be created. Specifically, if the number of idle nodes is greater than or equal to and closest to the number of task instances to be created, the candidate child node has the highest score. If the number of idle nodes is greater than the number of task instances to be created, the candidate child node has the next highest score. If the number of idle nodes is less than the number of task instances to be created, the candidate child node has the next lowest score. If the number of idle nodes is less than the number of task instances to be created, the candidate child node has the lowest score.

[0091] For example, the resource scoring module in the scheduler scores the candidate child nodes of the task instance to be created. If there are no existing task instances under the task, the score is based on the comparison between the number of idle nodes in the SU where the candidate child node is located and the number of instances to be created for the task. The number of idle nodes in SU1 is greater than 10 of the number of task instances to be created, and is closer to 10 than the number of idle nodes in SU2, so the candidate child node in SU1 gets a higher score. If a task instance under the task has already been assigned to a node in a certain SU, the candidate child node in that SU will get the highest score. When the candidate child nodes are in the same SU, the candidate child nodes are determined as the target child nodes of the task instance in order of task number.

[0092] Furthermore, referring to Figure 5, a flowchart of step 104 in the task resource allocation method provided in Figure 1 is shown. This method is basically the same as the task resource allocation method provided in the first embodiment of this application. Step 104 may include:

[0093] Step 1041: Assign the task instance to the target child node and mark the target child node in the secondary resource tree as occupied.

[0094] Step 1042: Monitor the execution status of the task instance on the target child node.

[0095] Step 1043: The task instance is detected to have started execution, and the task instance is executed using the unlimited bandwidth device resources on the target child node.

[0096] In this embodiment, the scheduler allocates task instances to target child nodes and marks the target child nodes in the secondary resource tree as occupied to ensure real-time updates of resource status. The scheduler monitors the execution status of task instances on target child nodes, monitors whether task instances have started execution, and monitors status changes during execution. When the scheduler detects that a task instance has started execution, it uses the unlimited bandwidth device resources on the target child node to execute the task instance.

[0097] This application embodiment, by allocating task instances to target child nodes and using the unlimited bandwidth device resources on the target child nodes to execute the task instances, can ensure that the task instances can obtain optimal resource configuration, improve the efficiency of resource management and task execution, ensure efficient resource utilization, and ensure that tasks can be executed smoothly.

[0098] Referring to Figure 6, a flowchart of another task resource allocation method provided in an embodiment of this application is shown. This method is basically the same as the task resource allocation method provided in the first embodiment of this application, except that the method may further include:

[0099] Step 101: Obtain the topology structure corresponding to the device node of the task to be executed, and reconstruct the secondary resource tree in the topology structure; wherein, the secondary resource tree includes the switching unit node and the infinite bandwidth device sub-node under the switching unit node.

[0100] Step 102: In response to the issuance of a task instance with unallocated unlimited bandwidth device resources, the idle unlimited bandwidth device child nodes in the secondary resource tree are identified as candidate child nodes for the task instance.

[0101] Step 103: Determine the target child node from the candidate child nodes for assigning task instances to the same exchange unit node.

[0102] Step 104: Assign the task instance to the target child node and execute the task instance on the target child node.

[0103] Steps 101 to 104 described above are the same as those described previously and will not be repeated here.

[0104] Step 105: Once the task instance is detected to have completed execution, the occupied status of the target child node is changed to the idle status.

[0105] In this embodiment, the scheduler can monitor the execution status of task instances in real time. When a task instance is completed, the scheduler changes the occupied state of the target sub-node to the idle state to ensure real-time updates of resource status. Specifically, when the training task ends, the scheduler destroys the task instance on the target sub-node and marks the infinite bandwidth device sub-node occupied by the task instance as idle in the resource management module.

[0106] Compared with the prior art, the implementation method of this application, based on the beneficial effects brought by the first implementation method, releases the occupied resources in a timely manner after the task instance is executed, ensuring that the resources can be used by other tasks, improving resource utilization, and ensuring real-time updates of resource status by marking the target child node as idle, which facilitates resource allocation for subsequent tasks. By releasing resources in a timely manner, resource utilization is improved and resource waste is reduced.

[0107] Referring to Figure 9, a schematic diagram of a task resource allocation device provided in an embodiment of this application is shown. The device includes:

[0108] The topology acquisition module 201 is used to acquire the topology structure corresponding to the device nodes of the task to be executed, and reconstruct a secondary resource tree in the topology structure; wherein, the secondary resource tree includes switching unit nodes and infinite bandwidth device sub-nodes under the switching unit nodes;

[0109] Candidate determination module 202 is used to determine the idle infinite bandwidth device child nodes in the secondary resource tree as candidate child nodes of the task instance in response to the issuance of the task instance to be allocated unlimited bandwidth device resources;

[0110] The target determination module 203 is used to determine, from the candidate child nodes, the target child node for assigning the task instance to the same exchange unit node;

[0111] The task execution module 204 is used to assign the task instance to the target child node and execute the task instance on the target child node.

[0112] Furthermore, the topology acquisition module 201 includes:

[0113] The acquisition submodule is used to pre-acquire the topology information of the device nodes of the task to be executed, and obtain the topology structure of the device nodes;

[0114] An extraction submodule is used to extract the topological relationships between unlimited bandwidth devices and switching units in the topology to obtain a reconstructed secondary resource tree.

[0115] Furthermore, the candidate determination module 202 includes:

[0116] The first determination submodule is used to determine the task number of the task instance in response to the issuance of the task instance to be allocated unlimited bandwidth device resources;

[0117] The matching submodule is used to match the idle unlimited bandwidth device child nodes in the secondary resource tree one by one according to the task number, and determine the candidate child nodes of the task instance.

[0118] Furthermore, the target determination module 203 includes:

[0119] The second determining submodule is used to score the candidate child nodes using a preset scoring strategy and determine the candidate child node with the highest score.

[0120] The third determination submodule is used to determine the candidate child node with the highest score as the target child node of the task instance;

[0121] The allocation submodule is used to allocate the task instance to the same exchange unit through the target sub-node.

[0122] Furthermore, the second determining submodule includes:

[0123] The judgment unit is used to determine, using a preset scoring strategy, whether the switching unit where the candidate sub-node is located has an infinite bandwidth device sub-node occupied by a task instance;

[0124] The first determining unit is used to determine that the candidate child node has the highest score if the condition is met.

[0125] The second determining unit is used to otherwise compare the number of idle nodes in the exchange unit where the candidate child node is located with the number of task instances. If the absolute difference between the number of idle nodes and the number of task instances is less than a preset threshold, then the candidate child node is determined to have the highest score.

[0126] Furthermore, the task execution module 204 includes:

[0127] The marking submodule is used to assign the task instance to the target child node and mark the target child node in the secondary resource tree as occupied.

[0128] The monitoring submodule is used to monitor the execution status of the task instance on the target sub-node;

[0129] The execution submodule is used to detect when the task instance starts execution and execute the task instance using the unlimited bandwidth device resources on the target child node.

[0130] Furthermore, the device also includes:

[0131] The status modification module is used to detect when the task instance has been completed and change the occupied status of the target child node to the idle status.

[0132] The task resource allocation apparatus provided in this application obtains the topology structure corresponding to the device nodes of the task to be executed, reconstructs a secondary resource tree in the topology structure, and the secondary resource tree includes switching unit nodes and unlimited bandwidth device child nodes under the switching unit nodes. In response to the issuance of task instances with unlimited bandwidth device resources to be allocated, the idle unlimited bandwidth device child nodes in the secondary resource tree are determined as candidate child nodes of the task instances. Among the candidate child nodes, the target child node for allocating the task instance to the same switching unit node is determined, the task instance is allocated to the target child node, and the task instance is executed on the target child node. This application embodiment obtains the topology relationship of the switching unit and the unlimited bandwidth devices under the switching unit in the device node topology structure. When allocating the execution device node for the task instance, it allocates multiple instances of the same task to the same SU, reduces cross-SU communication, and reduces the data exchange volume of the spine switches and core switches required across SUs by prioritizing node resources within the same SU. This improves resource management efficiency and task execution efficiency, ensures efficient utilization of device resources, and ensures smooth task execution.

[0133] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0134] Referring to FIG10, this application embodiment also provides an electronic device, as shown in FIG10, including a processor 301, a communication interface 302, a memory 303, and a communication bus 304, wherein the processor 301, the communication interface 302, and the memory 303 communicate with each other through the communication bus 304.

[0135] Processor 301, memory 303 for storing processor-executable instructions;

[0136] The processor 301 is configured to execute the instructions to implement the task resource allocation method described below:

[0137] Obtain the topology structure corresponding to the device node of the task to be executed, and reconstruct a secondary resource tree in the topology structure; wherein, the secondary resource tree includes a switching unit node and an infinite bandwidth device sub-node under the switching unit node;

[0138] In response to the issuance of a task instance with unallocated unlimited bandwidth device resources, the idle unlimited bandwidth device child nodes in the secondary resource tree are determined as candidate child nodes of the task instance;

[0139] Among the candidate child nodes, a target child node is identified for assigning the task instance to the same exchange unit node;

[0140] The task instance is assigned to the target child node, and the task instance is executed on the target child node.

[0141] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0142] The communication interface is used for communication between the aforementioned terminal and other devices.

[0143] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0144] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0145] In another embodiment provided in this application, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements any of the task resource allocation methods described in the above embodiments.

[0146] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the 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 a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0147] The various component embodiments of this application can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the computing processing device according to the embodiments of this application. This application can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such an implementation of this application can be stored on a computer-readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

[0148] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0149] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0150] The terms "an embodiment," "embodiment," or "one or more embodiments" as used herein mean that a particular feature, structure, or characteristic described in connection with an embodiment is included in at least one embodiment of this application. Furthermore, please note that the examples of the phrase "in one embodiment" do not necessarily all refer to the same embodiment.

[0151] In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.

[0152] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of this application may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.

[0153] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. A method for allocating task resources, characterized in that, The method includes: Obtain the topology structure corresponding to the device node of the task to be executed, and reconstruct a secondary resource tree in the topology structure; wherein, the secondary resource tree includes a switching unit node and an infinite bandwidth device sub-node under the switching unit node; In response to the issuance of a task instance with unallocated unlimited bandwidth device resources, the idle unlimited bandwidth device child nodes in the secondary resource tree are determined as candidate child nodes of the task instance; Among the candidate child nodes, a target child node is identified for assigning the task instance to the same exchange unit node; The task instance is assigned to the target child node, and the task instance is executed on the target child node.

2. The method according to claim 1, characterized in that, The process of obtaining the topology structure corresponding to the device node of the task to be executed, and reconstructing a secondary resource tree in the topology structure, includes: The topology information of the device nodes to be executed is collected in advance to obtain the topology structure of the device nodes; The topological relationships between the unlimited bandwidth devices and switching units are extracted from the topology to obtain the reconstructed secondary resource tree.

3. The method according to claim 1, characterized in that, In response to the issuance of a task instance for which unlimited bandwidth device resources are to be allocated, the process of determining idle unlimited bandwidth device child nodes in the secondary resource tree as candidate child nodes for the task instance includes: In response to the issuance of a task instance to be allocated unlimited bandwidth device resources, determine the task instance's task number; By matching the available unlimited bandwidth device child nodes in the secondary resource tree one by one according to the task number, the candidate child nodes of the task instance are determined.

4. The method according to claim 1, characterized in that, The step of determining the target child node from the candidate child nodes for assigning the task instance to the same exchange unit node includes: The candidate child nodes are scored using a preset scoring strategy, and the candidate child node with the highest score is determined. The candidate child node with the highest score is determined as the target child node of the task instance; The task instances are assigned to the same exchange unit through the target sub-node.

5. The method according to claim 4, characterized in that, The step of scoring the candidate child nodes using a preset scoring strategy to determine the candidate child node with the highest score includes: A preset scoring strategy is used to determine whether the switching unit where the candidate sub-node is located has a device sub-node with unlimited bandwidth occupied by a task instance; If so, then the candidate child node is determined to have the highest score; Otherwise, the number of idle nodes in the exchange unit where the candidate child node is located is compared with the number of task instances. If the absolute difference between the number of idle nodes and the number of task instances is less than a preset threshold, then the candidate child node is determined to have the highest score.

6. The method according to claim 1, characterized in that, The step of assigning the task instance to the target child node and executing the task instance on the target child node includes: The task instance is assigned to the target child node, and the target child node in the secondary resource tree is marked as occupied. Monitor the execution status of the task instance on the target child node; Once the task instance is detected to have started execution, the task instance will be executed using the unlimited bandwidth device resources on the target child node.

7. The method according to claim 1, characterized in that, After assigning the task instance to the target child node and executing the task instance on the target child node, the method further includes: Once the task instance is detected to have completed execution, the occupied status of the target child node is changed to an idle status.

8. A task resource allocation device, characterized in that, The device includes: The topology acquisition module is used to acquire the topology structure corresponding to the device nodes of the task to be executed, and reconstruct a secondary resource tree in the topology structure; wherein, the secondary resource tree includes switching unit nodes and infinite bandwidth device sub-nodes under the switching unit nodes; The candidate determination module is used to determine the idle infinite bandwidth device child nodes in the secondary resource tree as candidate child nodes of the task instance in response to the issuance of the task instance to be allocated unlimited bandwidth device resources; The target determination module is used to determine, from the candidate child nodes, the target child node for assigning the task instance to the same exchange unit node; The task execution module is used to assign the task instance to the target child node and execute the task instance on the target child node.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the task resource allocation method as described in any one of claims 1-7.

10. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the task resource allocation method as described in any one of claims 1-7.