WO2022016833A1 - 一种图计算方法、装置、设备及存储介质 - Google Patents

一种图计算方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2022016833A1
WO2022016833A1 PCT/CN2021/071205 CN2021071205W WO2022016833A1 WO 2022016833 A1 WO2022016833 A1 WO 2022016833A1 CN 2021071205 W CN2021071205 W CN 2021071205W WO 2022016833 A1 WO2022016833 A1 WO 2022016833A1
Authority
WO
WIPO (PCT)
Prior art keywords
graph
computing
computed
processing node
subgraphs
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2021/071205
Other languages
English (en)
French (fr)
Inventor
胡克坤
董刚
赵雅倩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Publication of WO2022016833A1 publication Critical patent/WO2022016833A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/465Distributed object oriented systems

Definitions

  • the present application relates to the field of cloud computing, and in particular, to a graph computing method, apparatus, device and storage medium.
  • the present application provides a graph calculation method, including:
  • calculating the total task load corresponding to the graph to be calculated includes:
  • the sample task load of each combination relationship is counted to obtain the model data set.
  • the graph obtaining module is used to obtain the graph to be computed
  • the expected task load calculation module is used to calculate the task load expectation of each processing node according to the total task load and the proportion of computing resources;
  • the core of the present application is to provide a graph computing method to relatively ensure the overall efficiency of graph computing performed by multiple processing nodes.
  • Step S11 Obtain the graph to be calculated.
  • the graph to be computed obtained in this step refers to the graph that each processing node needs to perform distributed graph computation in subsequent steps, which can be considered as a data model with specific data content recorded.
  • the execution sequence between step S10 and step S11 is not fixed. Step S10 and step S11 may also be performed simultaneously, which should be determined according to the actual situation, which is not specifically limited here.
  • Step S12 Divide the graph to be computed into subgraphs to be computed of each processing node based on the ratio of computing resources.
  • the ratio between the task loads of the subgraphs to be operated that are allocated by each processing node is consistent with the ratio of computing resources.
  • this step further divides the to-be-operated graph into the to-be-operated subgraphs of each processing node according to the computing resource ratio.
  • Step S13 Allocate each subgraph to be computed to a corresponding processing node, so that each processing node can perform graph computing operations in parallel.
  • Subgraphs to be operated on, until all of the graphs to be operated on are divided.
  • This embodiment can further ensure the overall execution efficiency of the process of dividing the graph to be calculated into subgraphs to be calculated for each processing node based on the ratio of computing resources, thereby relatively ensuring the overall efficiency of the graph calculation process.
  • an embodiment of the present application discloses a graph computing method, including:
  • Step S20 Counting the computing resource ratio among the processing nodes.
  • Step S21 Obtain the graph to be calculated.
  • Step S22 Calculate the total task load corresponding to the graph to be calculated.
  • the total task load corresponding to the graph to be calculated is further calculated, which is equivalent to calculating the overall task load occupied by the graph to be calculated.
  • this step further calculates the task load expectation of each processing node according to the total task load and the ratio of computing resources.
  • the task load expectation here refers to the The load criteria that a node needs to meet when dividing the subgraph to be calculated is to ensure that the task load corresponding to the subgraph to be calculated matches the task load expectation of the target processing node when dividing the subgraph to be calculated for the target processing node.
  • Step S24 Divide the graph to be operated into corresponding subgraphs to be operated according to the task load expectation of each processing node.
  • the ratio between the task loads of the subgraphs to be operated that are allocated by each processing node is consistent with the ratio of computing resources.
  • the total task load corresponding to the graph to be calculated is calculated, and then the task load expectation of each processing node is calculated according to the total task load and the ratio of computing resources, and finally the graph to be calculated is divided into corresponding to-be-calculated graphs according to the task load expectation of each processing node.
  • the method of calculating subgraphs further ensures the overall accuracy of the process of dividing the graph to be calculated into subgraphs to be calculated for each processing node based on the ratio of computing resources, and further ensures the overall efficiency of graph computation performed by multiple processing nodes.
  • the task load expectation includes the computing load expectation and the communication load expectation.
  • the computing resource load generated by the subgraph to be operated in the processing node is specifically determined by the subgraph to be operated without considering the algorithm that the graph computation operation follows.
  • the number of edges and the number of vertices are affected jointly, and the communication resource load generated by the network communication between the processing node and other processing nodes is proportional to the number of cut edges of the subgraph to be operated.
  • the graph to be calculated is divided into corresponding subgraphs to be calculated according to the task load expectation of each processing node.
  • the sub-graphs to be operated with the corresponding number of edges, vertices, and cuts are divided in .
  • the focus of this embodiment is to calculate the graph to be computed on a specific target algorithm.
  • the total task load corresponding to the scene can further ensure the accuracy of the total task load corresponding to the graph to be calculated, and then after the subgraph to be calculated is divided based on the graph to be calculated, each subgraph to be calculated is allocated to the corresponding processing node, For each processing node to perform the graph computing operation based on the target algorithm, it can further ensure the overall efficiency of the graph computing performed by the multiple processing nodes.
  • the focus of this embodiment is to use a preset model data set to calculate the total task load corresponding to the graph to be computed in the target algorithm scenario.
  • the model data set is generated in advance based on the graph sample set and the sample algorithm set.
  • the graph sample set refers to the set of graph samples
  • the sample algorithm set refers to the set of graph algorithms. After the graph sample set and the sample algorithm set are obtained After that, the combination relationship between the map samples in the graph sample set and the sample algorithms in the sample algorithm set is further established.
  • the combination relationship referred to here is essentially the corresponding relationship between the graph samples and the sample algorithms.
  • the graph computing operation is performed in the embodiment of this scenario, it is mainly composed of two technical parts: (1) a quantitative analysis technique of graph task load; (2) a flow heuristic rule design technique of arbitrary scale.
  • the former provides measurement basis for the implementation of division; the latter provides reference for the formulation of division rules.
  • Load IN (G i ,Alg) can be obtained by referring to formula (1):
  • the proportion statistics module 10 is used to calculate the proportion of computing resources among the processing nodes
  • the graph obtaining module 11 is used to obtain the graph to be calculated
  • the graph dividing module 12 is configured to divide the graph to be computed into subgraphs to be computed of each processing node based on the ratio of computing resources; wherein, the ratio between the task loads of the subgraphs to be computed allocated to each processing node is consistent with the ratio of computing resources ;
  • the subgraph allocation module 13 is used for allocating each subgraph to be calculated to a corresponding processing node, so that each processing node can perform a graph calculation operation in parallel.
  • the device divides the sub-graphs based on the ratio of computing resources among the processing nodes to the corresponding task load ratio of the graph to be operated, and then the ratio of the task load between the processing nodes to the sub-graph to be operated is the same as that between the processing nodes.
  • the proportion of computing resources is the same, so as to realize the targeted distribution of sub-graphs to be operated on corresponding loads according to the difference in computing performance of each processing node, thereby relatively ensuring the overall efficiency of graph computing for multiple processing nodes.
  • the processor is configured to implement the steps of the above graph computing method when executing the computer program.
  • the graph computing device provided by the present application firstly counts the ratio of computing resources between processing nodes used to perform graph computation, obtains the graph to be computed, and then divides the graph to be computed into the computations to be computed of each processing node based on the ratio of computing resources. Subgraphs, in which the ratio of the task load of the subgraphs to be calculated to each processing node is consistent with the ratio of computing resources, and then each subgraph to be calculated is allocated to the corresponding processing node for each processing node to execute the graph in parallel computing operations.
  • this device is based on the ratio of computing resources among the processing nodes, the sub-graphs of the corresponding task load ratio to be executed on the graph to be operated are divided, and then the ratio of the task load between the processing nodes to the sub-graph to be operated and the ratio between the processing nodes
  • the proportion of computing resources is the same, so that the sub-graphs to be operated on the corresponding loads are allocated in a targeted manner according to the difference in the computing performance of each processing node, thereby relatively ensuring the overall efficiency of graph computing for multiple processing nodes.
  • an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned graph computing method are implemented.
  • the computer-readable storage medium provided by the present application firstly counts the ratio of computing resources between processing nodes used to perform graph computation, obtains the graph to be computed, and then divides the graph to be computed into A subgraph to be operated on, wherein the ratio of the task load of the subgraph to be operated to each processing node is the same as the ratio of computing resources, and then each subgraph to be operated is allocated to the corresponding processing node for parallel processing by each processing node Perform graph computation operations.
  • the sub-graphs are divided into sub-graphs that perform corresponding task load ratios on the graph to be operated, and then the task load ratio between the processing nodes and the sub-graph to be operated is related to each processing node.
  • the proportion of computing resources between nodes is consistent, so that according to the difference in computing performance of each processing node, the sub-graphs to be operated on corresponding loads are allocated in a targeted manner, thereby relatively ensuring the overall efficiency of graph computing for multiple processing nodes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种图计算方法、装置、设备及存储介质。该方法的步骤包括:统计各处理节点之间的计算资源比例;获取待运算图;基于计算资源比例将待运算图划分为各处理节点的待运算子图;其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致;将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。本方法相对确保了多个处理节点进行图计算的整体效率。此外,本申请还提供一种图计算装置、设备及存储介质,有益效果同上所述。

Description

一种图计算方法、装置、设备及存储介质
本申请要求于2020年7月24日提交中国专利局、申请号为202010724722.7、发明名称为“一种图计算方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及云计算领域,特别是涉及一种图计算方法、装置、设备及存储介质。
背景技术
图(Graph)是用于表示对象之间关联关系的一种抽象数据结构,使用顶点(Vertex)和边(Edge)进行描述:顶点表示对象,边表示对象之间的关系。可抽象成用图描述的数据即为图数据。
图计算,是以图作为数据模型来对现实问题进行建模、分析和求解的过程。实际场景下,图的规模往往比较大,通过多处理节点对图进行并行分布处理是当前实现图计算的主要方案。在通过由多个处理节点组成的并行计算系统对图进行并行分布处理前,需要先将图划分为子图,进而分别由各处理节点分别对相应的子图执行运算操作,进而由各处理节点共同运算得到图计算结果。但是在实际的运算场景下,由于各处理节点的运算性能往往存在差异,并且图计算的整体效率是由最后对子图完成运算操作的处理节点决定的。然而,当前的图划分算法往往假设并行计算系统是同构的,生成的图划分方案难以确保多个处理节点进行图计算的整体效率。
由此可见,提供一种图计算方法,以相对确保多个处理节点进行图计算的整体效率,是本领域技术人员需要解决的问题。
发明内容
本申请的目的是提供一种图计算方法、装置、设备及存储介质,以相对确保多个处理节点进行图计算的整体效率。
为解决上述技术问题,本申请提供一种图计算方法,包括:
统计各处理节点之间的计算资源比例;
获取待运算图;
基于计算资源比例将待运算图划分为各处理节点的待运算子图;其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致;
将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。
优选地,基于计算资源比例将待运算图划分为各处理节点的待运算子图,包括:
在获取待运算图的同时,基于计算资源比例将待运算图划分为各处理节点的待运算子图。
优选地,基于计算资源比例将待运算图划分为各处理节点的待运算子图,包括:
计算待运算图对应的总任务负载;
根据总任务负载以及计算资源比例计算各处理节点的任务负载期望;
依照各处理节点的任务负载期望将待运算图划分为相应的待运算子图。
优选地,任务负载期望包括计算负载期望以及通信负载期望。
优选地,计算待运算图对应的总任务负载,包括:
计算待运算图在目标算法场景下对应的总任务负载;
将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作,包括:
将各待运算子图分配至相应的处理节点,以供各处理节点执行基于目标算法的图计算操作。
优选地,计算待运算图在目标算法场景下对应的总任务负载,包括:
利用预设的模型数据集计算待运算图在目标算法场景下对应的总任务负载;
模型数据集的生成过程包括:
获取图样本集以及样本算法集;
建立图样本集中图样本与样本算法集中样本算法之间的组合关系;
统计各组合关系的样本任务负载,得到模型数据集。
优选地,计算资源比例包括计算资源的运算速率比例。
此外,本申请还提供一种图计算装置,包括:
比例统计模块,用于统计各处理节点之间的计算资源比例;
图获取模块,用于获取待运算图;
图划分模块,用于基于计算资源比例将待运算图划分为各处理节点的待运算子图;其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致;
子图分配模块,用于将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。
优选地,图划分模块,包括:
总任务负载计算模块,用于计算待运算图对应的总任务负载;
期望任务负载计算模块,用于根据总任务负载以及计算资源比例计算各处理节点的任务负载期望;
划分模块,用于依照各处理节点的任务负载期望将待运算图划分为相应的待运算子图。
此外,本申请还提供一种图计算设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行计算机程序时实现如上述的图计算方法的步骤。
此外,本申请还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述的图计算方法的步骤。
本申请所提供的图计算方法,首先统计用于执行图计算的各处理节点之间的计算资源比例,并获取待运算图,进而基于计算资源比例将待运算图划分为各处理节点的待运算子图,其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致,进而将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。由于本方法是基于各处理节点之间的计算资源比例对待运算图执行相应任务负载比例的 子图划分,进而各处理节点之间对与待运算子图的任务负载比例与各处理节点之间的计算资源比例一致,以此实现根据各处理节点的运算性能差异,有针对性的分配相应负载的待运算子图,进而相对确保了多个处理节点进行图计算的整体效率。此外,本申请还提供一种图计算装置、设备及存储介质,有益效果同上所述。
附图说明
图1为本申请实施例公开的一种图计算方法的流程图;
图2为本申请实施例公开的一种图计算方法的流程图;
图3为本申请实施例公开的一种图计算装置的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下,所获得的所有其他实施例,都属于本申请保护范围。
图计算,是以图作为数据模型来对现实问题进行建模、分析和求解的过程。实际场景下,图的规模往往比较大,通过多处理节点对图进行并行分布处理是当前实现图计算的主要方案。在通过由多个处理节点组成的并行计算系统对图进行并行分布处理前,需要先将图划分为子图,进而分别由各处理节点分别对相应的子图执行运算操作,进而由各处理节点共同运算得到图计算结果。但是在实际的运算场景下,由于各处理节点的运算性能往往存在差异,并且图计算的整体效率是由最后对子图完成运算操作的处理节点决定的。然而,当前的图划分算法往往假设并行计算系统是同构的,生成的图划分方案难以确保多个处理节点进行图计算的整体效率。
为此,本申请的核心是提供一种图计算方法,以相对确保多个处理节点进行图计算的整体效率。
为了使本技术领域的人员更好地理解本申请方案,下面结合附图和具体实施方式对本申请作进一步的详细说明。
请参见图1所示,本申请实施例公开了一种图计算方法,包括:
步骤S10:统计各处理节点之间的计算资源比例。
需要说明的是,本步骤中的各处理节点指的是共同对待运算图执行分布式图计算的节点。本步骤中统计的各处理节点之间的计算资源比例,本质是上各处理节点的计算资源量之间的比例值,计算资源量指的是处理节点执行图计算时能够调用的硬件资源数量,是反映处理节点的运算性能的指标,因此本步骤中统计得到的各处理节点之间的计算资源比例,相当于各处理节点的运算性能之间的比例关系。
步骤S11:获取待运算图。
本步骤中获取到待运算图指的是各处理节点需要在后续步骤中执行分布式图计算的图,可以认为是记录有特定数据内容的数据模型。另外,需要说明的是,获取待运算图的步骤与统计各处理节点之间的计算资源比例的步骤之间无先后顺序,因此本实施例中步骤S10与步骤S11之间的执行顺序不固定,步骤S10与步骤S11也可同时执行,应根据实际情况而定,在此不做具体限定。
步骤S12:基于计算资源比例将待运算图划分为各处理节点的待运算子图。
其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致。
需要说明的是,在获取到各处理节点之间的计算资源比例与待运算图之后,本步骤进一步根据计算资源比例将待运算图划分为各处理节点的待运算子图。也就是说,本步骤是根据各处理节点之间的计算资源比例,将待运算图划分为与各处理节点分别对应的待运算子图,并且各处理节点之间对待运算子图的任务负载比例与各处理节点之间的计算资源比例一致,其中,任务负载比例指的是各个待运算子图在被处理时产生的相应任务负载之间的比例关系,也就是说,本实施例是根据各处理节点的运算能力在 整体处理节点中的占比,对各处理节点划分待运算图中具有相应任务负载程度占比的待运算子图,以此确保处理节点中计算资源比例较大的目标处理节点,能够对任务负载较大的待运算子图进行图计算操作。
步骤S13:将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。
在基于计算资源比例将待运算图划分为各处理节点的待运算子图之后,待运算子图与处理节点之间相当于建立的对应关系,进而将各待运算子图分配至相应的处理节点,以供各处理节点分别对自身接收到的待运算子图执行图计算操作,进而实现通过各处理节点对于待运算图的协同运算处理。
本申请所提供的图计算方法,首先统计用于执行图计算的各处理节点之间的计算资源比例,并获取待运算图,进而基于计算资源比例将待运算图划分为各处理节点的待运算子图,其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致,进而将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。由于本方法是基于各处理节点之间的计算资源比例对待运算图执行相应任务负载比例的子图划分,进而各处理节点之间对与待运算子图的任务负载比例与各处理节点之间的计算资源比例一致,以此实现根据各处理节点的运算性能差异,有针对性的分配相应负载的待运算子图,进而相对确保了多个处理节点进行图计算的整体效率。
在上述实施例的基础上,作为一种优选的实施方式,基于计算资源比例将待运算图划分为各处理节点的待运算子图,包括:
在获取待运算图的同时,基于计算资源比例将待运算图划分为各处理节点的待运算子图。
需要说明的是,由于考虑到在实际的图计算场景中,待运算图的数据量可能相对较大,因此为了进一步提高对于待运算子图的处理效率,本实施方式的重点在于,在获取待运算图的同时,并行执行基于计算资源比例将待运算图划分为各处理节点的待运算子图的步骤,以此达到对于待运算 图进行流式划分的目的。更进一步的,在获取待运算图的同时,基于计算资源比例将待运算图划分为各处理节点的待运算子图,可以具体是基于计算资源比例循环对各处理节点划分具有相应任务负载比例的待运算子图,直至待运算图全部划分完成。本实施方式能够进一步确保基于计算资源比例将待运算图划分为各处理节点的待运算子图过程的整体执行效率,进而相对确保图计算过程的整体效率。
请参见图2所示,本申请实施例公开了一种图计算方法,包括:
步骤S20:统计各处理节点之间的计算资源比例。
步骤S21:获取待运算图。
步骤S22:计算待运算图对应的总任务负载。
需要说明的是,本步骤在获取到待运算图之后,进一步计算待运算图对应的总任务负载,相当于计算待运算图整体占用的任务负载。
步骤S23:根据总任务负载以及计算资源比例计算各处理节点的任务负载期望。
在获取到待运算图对应的总任务负载之后,本步骤进一步根据总任务负载以及计算资源比例计算各处理节点的任务负载期望,此处的任务负载期望,指的是基于待运算图对各处理节点划分待运算子图时需要满足的负载标准,目的是在针对目标处理节点划分待运算子图时,确保该待运算子图对应的任务负与该目标处理节点的任务负载期望相匹配。
步骤S24:依照各处理节点的任务负载期望将待运算图划分为相应的待运算子图。
其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致。
需要说明的是,本步骤在根据总任务负载以及计算资源比例计算各处理节点的任务负载期望之后,进一步依照各处理节点的任务负载期望将待运算图划分为相应的待运算子图,以此实现基于各处理节点之间的计算资源比例将待运算图划分为各处理节点的待运算子图的目的。
步骤S25:将各待运算子图分配至相应的处理节点,以供各处理节点 并行执行图计算操作。
本实施例通过计算待运算图对应的总任务负载,进而根据总任务负载以及计算资源比例计算各处理节点的任务负载期望,最终依照各处理节点的任务负载期望将待运算图划分为相应的待运算子图的方式,进一步确保了基于计算资源比例将待运算图划分为各处理节点的待运算子图过程的整体准确性,进一步确保了多个处理节点进行图计算的整体效率。
在上述实施例的基础上,作为一种优选的实施方式,任务负载期望包括计算负载期望以及通信负载期望。
需要说明的是,本实施方式中,任务负载期望进一步包括计算负载期望以及通信负载期望,其中,计算负载期望指的是处理节点对待运算子图进行图计算操作时,待运算子图在处理节点中所产生的计算资源负载的标准;通信负载期望指的是处理节点对待运算子图进行图计算操作时,该处理节点与其它处理节点之间进行网络通信所产生的通信资源负载的标准。本实施方式通过对任务负载期望进行进一步的细化,以此进一步确保了将待运算图划分为各处理节点相应的待运算子图时的准确性。
更进一步的,处理节点对待运算子图进行图计算操作时,在不考虑图计算操作所依照的算法的前提下,待运算子图在处理节点中所产生的计算资源负载具体由待运算子图的边数量以及顶点数量共同影响,该处理节点与其它处理节点之间进行网络通信所产生的通信资源负载,具体与待运算子图的割边数量成正比。在此基础上,本实施例中依照各处理节点的任务负载期望将待运算图划分为相应的待运算子图,可以具体是根据各处理节点的计算负载期望以及通信负载期望,在待运算图中划分具有相应边数量、顶点数量以及割边数量的待运算子图。
在上述实施例的基础上,作为一种优选的实施方式,计算待运算图对应的总任务负载,包括:
计算待运算图在目标算法场景下对应的总任务负载;
将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图 计算操作,包括:
将各待运算子图分配至相应的处理节点,以供各处理节点执行基于目标算法的图计算操作。
需要说明的是,由于考虑到在以不同的算法对待运算图执行图计算操作时,待运算图所产生的总任务负载往往不同,因此本实施方式的重点在于计算待运算图在特定的目标算法场景下对应的总任务负载,能够进一步确保待运算图对应的总任务负载的准确性,进而在基于待运算图划分得到待运算子图后,将各待运算子图分配至相应的处理节点,以供各处理节点执行基于该目标算法的图计算操作,能够进一步确保多个处理节点进行图计算的整体效率。
更进一步的,作为一种优选的实施方式,计算待运算图在目标算法场景下对应的总任务负载,包括:
利用预设的模型数据集计算待运算图在目标算法场景下对应的总任务负载;
模型数据集的生成过程包括:
获取图样本集以及样本算法集;
建立图样本集中图样本与样本算法集中样本算法之间的组合关系;
统计各组合关系的样本任务负载,得到模型数据集。
需要说明的是,本实施方式的重点在于利用预设的模型数据集计算待运算图在目标算法场景下对应的总任务负载。模型数据集是预先基于图样本集以及样本算法集生成的,其中,图样本集指的是图样本的集合,样本算法集指的是图算法的集合,在获取到图样本集以及样本算法集之后,进一步建立图样本集中图样本与样本算法集中样本算法之间的组合关系,此处所指的组合关系本质上是图样本与样本算法之间的对应关系,此处所指的组合关系,可以是图样本与样本算法之间的一对一的组合关系,也可以是一对多的组合关系,应根据实际需求而定,在建立图样本与样本算法之间的组合关系之后,本实施方式进一步统计对组合关系中的图样本执行该组合关系中的样本算法所产生的样本任务负载,以此得到包含有组合关系以及与组合关系对应的样本任务负载的模型数据集。在此基础上,利用预 设的模型数据集计算待运算图在目标算法场景下对应的总任务负载,可以具体是在模型数据集中获取与待运算图及目标算法的组合向对应的目标样本任务负载,并将目标样本任务负载设置为总任务负载。
本实施方式通过利用预设的模型数据集计算待运算图在目标算法场景下对应的总任务负载的方式,进一步确保了计算待运算图在目标算法场景下对应的总任务负载时的整体效率以及准确性。
在上述一系列实施方式的基础上,作为一种优选的实施方式,计算资源比例包括计算资源的运算速率比例。
需要说明的是,由于考虑到计算资源的运算速率比例相当于计算资源在单位时间对数据进行运算处理的数量,能够相对准确地反映处理节点的运算性能,进而处理节点之间的计算资源的运算速率比例,能够进一步准确地反映处理节点之间运算性能的关系,因此本实施方式能够进一步提高基于计算资源比例将待运算图划分为各处理节点的待运算子图过程的整体准确性,进一步确保了多个处理节点进行图计算的整体效率。
另外,在特定的场景下,计算资源可以包含多种类型,相应的,计算资源比例包括多种类型运算资源的运算速率比例。例如计算资源同时包含CPU(central processing unit,中央处理器)、GPU(Graphics Processing Unit,图形处理器)以及FPGA(Field Programmable Gate Array,现场可编程逻辑门阵列)中的一种或多种,则计算资源比例具体包括CPU、GPU以及FPGA的一种或多种计算资源之间的运算速率比例。
为了增加对于本申请上述实施例的理解,下面通过一个具体的场景实施例做进一步说明。
在本场景实施例中执行图计算操作时,主要由两个技术部分构成:(1)图任务负载量化分析技术;(2)任意比例的流式启发式规则设计技术。其中,前者为实施划分提供度量依据;后者为制定划分规则提供参考。
(1)图任务负载量化分析技术。所谓图任务负载,广义指解决某一图论问题的图算法Alg在待运算图G上执行时算法操作的工作量,具体指图顶 点的计算操作以及连接边的数据传输操作的工作量之和。因此,图任务负载Load(G,Alg)与G的拓扑结构和其上执行的图算法Alg密不可分。借鉴图算法复杂性分析理论,根据观察和总结,Load(G,Alg)可用以下公式度量:
Load(G,Alg)=a(|V|-r) α+b(|E|-s) β+clog((|V|-r)·(|E|-s)+1)+d  (1)
其中,a,b,c,d,r,s和α,β都是实数域的未知参数,它们的取值与图拓扑结构特征和图算法执行行为密切相关。这些参数可通过对机器学习算法进行多元非线性回归分析得到。其中,训练数据集生成方法如下:从开源图数据集下载图数据集,选取典型的图算法,在单机上对大图执行图算法所规定的操作以对大图实施分析和挖掘,记录图算法执行时间,由处理节点CPU计算速度乘以图算法执行时间,即可得到图任务负载。每一个图的顶点数、连接边数和图任务负载构成一个训练样本,重复执行即可得到多个样本,所有样本即构成训练数据集。
对于待运算图G的任一待运算子图G i,i∈[1,k],k为,图算法Alg在其上执行的任务负载由计算负载和通信负载两部分构成。不妨记上述三者分别为Load(G i,Alg)、Load IN(G i,Alg)和Load OUT(G i,Alg),则:
Load(G i,Alg)=Load IN(G i,Alg)+Load OUT(G i,Alg)  (2)
其中,Load IN(G i,Alg)可借鉴公式(1)得到:
Figure PCTCN2021071205-appb-000001
其中,
Figure PCTCN2021071205-appb-000002
表示待运算子图G i的内部边的集合。而G i与其他子图的通信负载由它们之间的割边总数成比例,若记G i与其他子图之间的割边集为
Figure PCTCN2021071205-appb-000003
则:
Figure PCTCN2021071205-appb-000004
其中,g,h和γ都是实数域的未知参数,它们同样可以用多元非线性回归分析方法得到。
(2)任意比例的流式启发式规则设计技术。任意比例的流式启发式规则是任意比例流式划分方法的核心,是实现任意比例划分的关键。以下介绍任意比例流式启发式规则设计的一般流程:(a)设并行计算系统由k个处理节点p 1,p 2,…,p k通过互连网络连接,它们的处理速度分别记为sv 1,sv 2,...,sv k, 且满足sv 1≤sv 2≤...≤sv k;统计目标并行计算系统处理节点个数以及各处理节点CPU的计算速度,取它们的比值为任意比例关系
Figure PCTCN2021071205-appb-000005
(b)给定待运算图G和图算法Alg,根据公式(1)计算在G上执行Alg算法的图任务负载Load(G i,Alg),理想情况下,处理节点p i分得的子图G i对应的图任务负载与p i的计算能力大小相匹配。不妨称该任务负载为p i或G i的期望任务负载,记为Load E(G i,Alg),则:
Load E(G i,Alg)=γ iLoad(G,Alg)  (5)
在划分过程中的每个时刻,可根据公式(2)~(4)计算节点p i上已分配子图G i对应的实际任务负载大小Load(G i,Alg)。以上述两个信息为依据,制定流式启发式规则,指定每个顶点应该流向哪个子图,以便在划分过程中,不断缩小每个子图的实际任务负载与期望任务负载之间的差异;待划分结束时,即可得到各子图任务负载满足任意比例关系的图划分,该划分由于保证了每个处理节点分得的图任务负载与其计算速度相匹配,可大大提高并行处理效率。
请参见图3所示,本申请实施例提供了一种图计算装置,包括:
比例统计模块10,用于统计各处理节点之间的计算资源比例;
图获取模块11,用于获取待运算图;
图划分模块12,用于基于计算资源比例将待运算图划分为各处理节点的待运算子图;其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致;
子图分配模块13,用于将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。
更进一步的,作为一种优选的实施方式,图划分模块,包括:
总任务负载计算模块,用于计算待运算图对应的总任务负载;
期望任务负载计算模块,用于根据总任务负载以及计算资源比例计算 各处理节点的任务负载期望;
划分模块,用于依照各处理节点的任务负载期望将待运算图划分为相应的待运算子图。
本申请所提供的图计算装置,首先统计用于执行图计算的各处理节点之间的计算资源比例,并获取待运算图,进而基于计算资源比例将待运算图划分为各处理节点的待运算子图,其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致,进而将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。由于本装置是基于各处理节点之间的计算资源比例对待运算图执行相应任务负载比例的子图划分,进而各处理节点之间对与待运算子图的任务负载比例与各处理节点之间的计算资源比例一致,以此实现根据各处理节点的运算性能差异,有针对性的分配相应负载的待运算子图,进而相对确保了多个处理节点进行图计算的整体效率。
此外,本申请实施例还提供一种图计算设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行计算机程序时实现如上述的图计算方法的步骤。
本申请所提供的图计算设备,首先统计用于执行图计算的各处理节点之间的计算资源比例,并获取待运算图,进而基于计算资源比例将待运算图划分为各处理节点的待运算子图,其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致,进而将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。由于本设备是基于各处理节点之间的计算资源比例对待运算图执行相应任务负载比例的子图划分,进而各处理节点之间对与待运算子图的任务负载比例与各处理节点之间的计算资源比例一致,以此实现根据各处理节点的运算性能差异,有针对性的分配相应负载的待运算子图,进而相对确保了多个处理节点进行图计算的整体效率。
此外,本申请实施例还提供一种计算机可读存储介质,计算机可读存 储介质上存储有计算机程序,计算机程序被处理器执行时实现如上述的图计算方法的步骤。
本申请所提供的计算机可读存储介质,首先统计用于执行图计算的各处理节点之间的计算资源比例,并获取待运算图,进而基于计算资源比例将待运算图划分为各处理节点的待运算子图,其中,各处理节点分配到的待运算子图的任务负载之间的比例与计算资源比例一致,进而将各待运算子图分配至相应的处理节点,以供各处理节点并行执行图计算操作。由于本计算机可读存储介质是基于各处理节点之间的计算资源比例对待运算图执行相应任务负载比例的子图划分,进而各处理节点之间对与待运算子图的任务负载比例与各处理节点之间的计算资源比例一致,以此实现根据各处理节点的运算性能差异,有针对性的分配相应负载的待运算子图,进而相对确保了多个处理节点进行图计算的整体效率。
以上对本申请所提供的一种图计算方法、装置、设备及存储介质进行了详细介绍。说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设 备中还存在另外的相同要素。

Claims (10)

  1. 一种图计算方法,其特征在于,包括:
    统计各处理节点之间的计算资源比例;
    获取待运算图;
    基于所述计算资源比例将所述待运算图划分为各所述处理节点的待运算子图;其中,各所述处理节点分配到的所述待运算子图的任务负载之间的比例与所述计算资源比例一致;
    将各所述待运算子图分配至相应的所述处理节点,以供各所述处理节点并行执行图计算操作。
  2. 根据权利要求1所述的图计算方法,其特征在于,所述基于所述计算资源比例将所述待运算图划分为各所述处理节点的待运算子图,包括:
    在获取所述待运算图的同时,基于所述计算资源比例将所述待运算图划分为各所述处理节点的待运算子图。
  3. 根据权利要求1所述的图计算方法,其特征在于,所述基于所述计算资源比例将所述待运算图划分为各所述处理节点的待运算子图,包括:
    计算所述待运算图对应的总任务负载;
    根据所述总任务负载以及所述计算资源比例计算各所述处理节点的任务负载期望;
    依照各所述处理节点的任务负载期望将所述待运算图划分为相应的所述待运算子图。
  4. 根据权利要求3所述的图计算方法,其特征在于,所述任务负载期望包括计算负载期望以及通信负载期望。
  5. 根据权利要求3所述的图计算方法,其特征在于,所述计算所述待运算图对应的总任务负载,包括:
    计算所述待运算图在目标算法场景下对应的所述总任务负载;
    所述将各所述待运算子图分配至相应的所述处理节点,以供各所述处理节点并行执行图计算操作,包括:
    将各所述待运算子图分配至相应的所述处理节点,以供各所述处理节点执行基于所述目标算法的图计算操作。
  6. 根据权利要求5所述的图计算方法,其特征在于,所述计算所述待运算图在目标算法场景下对应的所述总任务负载,包括:
    利用预设的模型数据集计算所述待运算图在目标算法场景下对应的所述总任务负载;
    所述模型数据集的生成过程包括:
    获取图样本集以及样本算法集;
    建立所述图样本集中图样本与所述样本算法集中样本算法之间的组合关系;
    统计各所述组合关系的样本任务负载,得到所述模型数据集。
  7. 根据权利要求1至6任意一项所述的图计算方法,其特征在于,所述计算资源比例包括计算资源的运算速率比例。
  8. 一种图计算装置,其特征在于,包括:
    比例统计模块,用于统计各处理节点之间的计算资源比例;
    图获取模块,用于获取待运算图;
    图划分模块,用于基于所述计算资源比例将所述待运算图划分为各所述处理节点的待运算子图;其中,各所述处理节点分配到的所述待运算子图的任务负载之间的比例与所述计算资源比例一致;
    子图分配模块,用于将各所述待运算子图分配至相应的所述处理节点,以供各所述处理节点并行执行图计算操作。
  9. 一种图计算设备,其特征在于,包括:
    存储器,用于存储计算机程序;
    处理器,用于执行所述计算机程序时实现如权利要求1至6任一项所述的图计算方法的步骤。
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至6任一项所述的图计算方法的步骤。
PCT/CN2021/071205 2020-07-24 2021-01-12 一种图计算方法、装置、设备及存储介质 Ceased WO2022016833A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010724722.7 2020-07-24
CN202010724722.7A CN111858059A (zh) 2020-07-24 2020-07-24 一种图计算方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022016833A1 true WO2022016833A1 (zh) 2022-01-27

Family

ID=72949562

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/071205 Ceased WO2022016833A1 (zh) 2020-07-24 2021-01-12 一种图计算方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN111858059A (zh)
WO (1) WO2022016833A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115016930A (zh) * 2022-04-29 2022-09-06 阿里云计算有限公司 一种规则引擎的调整方法、设备及存储介质
CN115061825A (zh) * 2022-08-09 2022-09-16 深圳致星科技有限公司 隐私计算、隐私数据和联邦学习的异构计算系统及方法
WO2025113318A1 (zh) * 2023-11-27 2025-06-05 华为技术有限公司 一种任务部署方法以及任务部署装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858059A (zh) * 2020-07-24 2020-10-30 苏州浪潮智能科技有限公司 一种图计算方法、装置、设备及存储介质

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488134A (zh) * 2015-11-25 2016-04-13 用友网络科技股份有限公司 大数据处理方法及大数据处理装置
US20180024869A1 (en) * 2016-07-22 2018-01-25 Board Of Regents, The University Of Texas System Guided load balancing of graph processing workloads on heterogeneous clusters
CN109710406A (zh) * 2018-12-21 2019-05-03 腾讯科技(深圳)有限公司 数据分配及其模型训练方法、装置、及计算集群
CN110415162A (zh) * 2019-07-22 2019-11-05 中国人民大学 大数据中面向异构融合处理器的自适应图划分方法
CN110619595A (zh) * 2019-09-17 2019-12-27 华中科技大学 一种基于多fpga加速器互联的图计算优化方法
CN110659278A (zh) * 2018-06-12 2020-01-07 上海郑明现代物流有限公司 基于cpu-gpu异构架构的图数据分布式处理系统
CN111858059A (zh) * 2020-07-24 2020-10-30 苏州浪潮智能科技有限公司 一种图计算方法、装置、设备及存储介质
CN112445940A (zh) * 2020-10-16 2021-03-05 苏州浪潮智能科技有限公司 图划分方法、装置及计算机可读存储介质

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105488134A (zh) * 2015-11-25 2016-04-13 用友网络科技股份有限公司 大数据处理方法及大数据处理装置
US20180024869A1 (en) * 2016-07-22 2018-01-25 Board Of Regents, The University Of Texas System Guided load balancing of graph processing workloads on heterogeneous clusters
CN110659278A (zh) * 2018-06-12 2020-01-07 上海郑明现代物流有限公司 基于cpu-gpu异构架构的图数据分布式处理系统
CN109710406A (zh) * 2018-12-21 2019-05-03 腾讯科技(深圳)有限公司 数据分配及其模型训练方法、装置、及计算集群
CN110415162A (zh) * 2019-07-22 2019-11-05 中国人民大学 大数据中面向异构融合处理器的自适应图划分方法
CN110619595A (zh) * 2019-09-17 2019-12-27 华中科技大学 一种基于多fpga加速器互联的图计算优化方法
CN111858059A (zh) * 2020-07-24 2020-10-30 苏州浪潮智能科技有限公司 一种图计算方法、装置、设备及存储介质
CN112445940A (zh) * 2020-10-16 2021-03-05 苏州浪潮智能科技有限公司 图划分方法、装置及计算机可读存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115016930A (zh) * 2022-04-29 2022-09-06 阿里云计算有限公司 一种规则引擎的调整方法、设备及存储介质
CN115061825A (zh) * 2022-08-09 2022-09-16 深圳致星科技有限公司 隐私计算、隐私数据和联邦学习的异构计算系统及方法
CN115061825B (zh) * 2022-08-09 2022-11-18 深圳致星科技有限公司 隐私计算、隐私数据和联邦学习的异构计算系统及方法
WO2025113318A1 (zh) * 2023-11-27 2025-06-05 华为技术有限公司 一种任务部署方法以及任务部署装置

Also Published As

Publication number Publication date
CN111858059A (zh) 2020-10-30

Similar Documents

Publication Publication Date Title
WO2022016833A1 (zh) 一种图计算方法、装置、设备及存储介质
Eidenbenz et al. Task allocation for distributed stream processing
Rashid et al. Design and analysis of proposed remote controlling distributed parallel computing system over the cloud
US9477707B2 (en) System and methods for predicting query execution time for concurrent and dynamic database workloads
US8402469B2 (en) Allocating resources for parallel execution of query plans
US8799916B2 (en) Determining an allocation of resources for a job
CN112445940B (zh) 图划分方法、装置及计算机可读存储介质
CN109189572B (zh) 一种资源预估方法及系统、电子设备和存储介质
Chen et al. AAGA: Affinity-aware grouping for allocation of virtual machines
Zou et al. Cloudia: a deployment advisor for public clouds
CN107729138A (zh) 一种高性能分布式矢量空间数据的分析方法和装置
WO2024255174A1 (zh) 基于异构计算的参数处理方法和装置
CN108509256B (zh) 调度运行设备的方法、设备和运行设备
CN109558232B (zh) 并行度的确定方法、装置、设备及介质
CN113766047B (zh) 一种任务分组方法、装置、计算机设备及存储介质
CN107222410A (zh) 链接预测的方法、装置、终端及计算机可读存储介质
Brandt et al. Demonstrating improved application performance using dynamic monitoring and task mapping
CN114138284A (zh) 模型部署处理方法、装置、电子设备及存储介质
CN106502790A (zh) 一种基于数据分布的任务分配优化方法
CN103729417B (zh) 一种数据扫描的方法及装置
Ribeiro et al. Parallel discovery of network motifs
Sotiriadis et al. Towards inter-cloud simulation performance analysis: Exploring service-oriented benchmarks of clouds in SimIC
Shehu et al. Fruit fly optimization algorithm for network-aware web service composition in the cloud
Di Lena et al. A right placement makes a happy emulator: a placement module for distributed sdn/nfv emulation
Wang et al. Optimizing the cloud platform performance for supporting large-scale cognitive radio networks

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21847301

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21847301

Country of ref document: EP

Kind code of ref document: A1