WO2023240845A1 - 一种分布式计算方法、系统、设备及存储介质 - Google Patents

一种分布式计算方法、系统、设备及存储介质 Download PDF

Info

Publication number
WO2023240845A1
WO2023240845A1 PCT/CN2022/122792 CN2022122792W WO2023240845A1 WO 2023240845 A1 WO2023240845 A1 WO 2023240845A1 CN 2022122792 W CN2022122792 W CN 2022122792W WO 2023240845 A1 WO2023240845 A1 WO 2023240845A1
Authority
WO
WIPO (PCT)
Prior art keywords
computing
nodes
distributed
distributed computing
data
Prior art date
Application number
PCT/CN2022/122792
Other languages
English (en)
French (fr)
Inventor
闫瑞栋
刘璐
金良
徐聪
Original Assignee
苏州元脑智能科技有限公司
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 苏州元脑智能科技有限公司 filed Critical 苏州元脑智能科技有限公司
Publication of WO2023240845A1 publication Critical patent/WO2023240845A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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/5061Partitioning or combining of resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5017Task decomposition
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • This application relates to the field of data processing, and in particular to a distributed computing method, system, equipment and storage medium.
  • the large model or large data set to be trained is split in a model parallel, data parallel or hybrid parallel way, and then the split small-scale data or model is trained separately. , and finally all local training results are aggregated in some way and the global training results are output.
  • researchers are conducting research on distributed training methods at the software and hardware levels at the same time: at the software level, improvements and training strategies for various optimizers and optimization operators have been proposed; at the hardware system platform level, they have designed solutions such as those based on hybrid heterogeneous Distributed computing systems and other accelerated training methods.
  • this application provides a distributed computing method.
  • the specific technical solutions are as follows:
  • parallel modes include data parallel mode, model parallel mode and hybrid parallel mode; data parallel mode includes sample-based data parallelism and sample-dimension-based data parallelism.
  • the parallel mode is model parallel mode, it also includes:
  • connection method and communication synchronization method between each computing node including:
  • the data computing task includes a specified connection method
  • the specified connection method includes either a centralized architecture or a decentralized architecture
  • Analyze the data computing tasks obtain the communication synchronization method, and configure the communication synchronization method between nodes in the distributed computing system according to the communication synchronization method.
  • workers are used to complete local training tasks and communicate with the server through the client interface to obtain the latest global model parameters; send their own local parameters to the server;
  • the server is used to aggregate the local parameters sent by each worker and update the global model parameters using ADD or SUM operations.
  • Each worker uses Reduce architecture or Gossip architecture to interact with information and build a distributed computing system.
  • each worker communicates with all other workers and transmits local information to all other workers in a broadcast manner.
  • each worker communicates with its neighbor workers.
  • configuring the communication synchronization mode between each node in the distributed computing system according to the communication synchronization mode includes:
  • the communication synchronization mode configured between each node in the distributed computing system according to the communication synchronization mode includes:
  • the communication synchronization mode between nodes in the distributed computing system is configured according to asynchronous communication; wherein, when any computing node in the distributed training system completes the current round of iteration, it continues to process the next round of training iteration tasks.
  • aggregating the intermediate results generated by each computing node and outputting the final computing results corresponding to the data computing tasks include:
  • additive aggregation includes full aggregation logic and partial aggregation logic; full aggregation logic is used to assign different weights to different computing nodes and calculate the weighted sum of the intermediate results generated by all computing nodes.
  • This application also provides a server, which includes a memory and a processor.
  • a computer program is stored in the memory.
  • the processor calls the computer program in the memory, the steps of the above method are implemented.
  • This application provides a distributed computing method, which includes: obtaining data computing tasks; splitting the data computing tasks to obtain subtasks, deploying the subtasks to computing nodes, and configuring the parallel mode of each computing node in the general framework of distributed training; Configure the connection mode and communication synchronization mode between each computing node; use gradient optimization algorithm or non-gradient optimization algorithm to perform information synchronization efficiency optimization on computing nodes; aggregate the intermediate results generated by each computing node, and output the final calculation corresponding to the data computing task result.
  • the embodiment of the present application After receiving the data computing task, the embodiment of the present application first splits the data computing task to obtain each sub-task, thereby deploying the sub-tasks to the computing nodes and executing the parallel mode, connection method and communication synchronization in the distributed computing system. Configure the method and optimize the information synchronization between computing nodes to perform distributed computing and reduce the constraints of the hardware system.
  • Through effective distributed algorithm design explore the factors that affect deep learning model training and establish accurate Reliable distributed accelerated computing rules reduce sub-task training space and reduce model training time, which can effectively improve model training accuracy and reduce storage overhead of gradients and model parameter variables.
  • Figure 1 is a flow chart of a distributed computing method provided by an embodiment of the present application.
  • Figure 2 is a schematic diagram of the centralized architecture provided by the embodiment of this application.
  • Figure 3 is a schematic diagram of the decentralized architecture of the Reduce architecture provided by the embodiment of this application.
  • This step aims to obtain the data computing task.
  • the data computing sent by the cloud or other distributed computing devices can be received through the network or data link.
  • Task The specific content of the data calculation task is not limited here. It may include the task content required to perform data calculation, optional calculation methods, etc., so that an adapted distributed computing system or distributed computing can be used in the embodiments of the present application. method to calculate.
  • This step aims to split the data calculation task. Since the data calculation task is likely to be a task with a relatively large amount of calculation and data, this step can first split the data calculation task to obtain subtasks.
  • the splitting method is not limited, and the tasks can usually be split in a way that the data computing tasks adapt to the number or performance of the computing nodes in the distributed computing system.
  • the subtasks can be divided according to attributes or characteristics to obtain task samples, and then assign the task samples to the corresponding computing nodes. .
  • the distributed computing model can be split horizontally or vertically to adapt to subtasks.
  • the neural network model can be divided into horizontal splitting and splitting according to different splitting methods. Split vertically.
  • S1032 Build a distributed computing system with a designated connection method;
  • the designated connection method includes either a centralized architecture or a decentralized architecture;
  • Figure 2 is a schematic diagram of the centralized architecture provided by the embodiment of the present application.
  • Figure 3 is a schematic diagram of the decentralized architecture of the Reduce architecture provided by the embodiment of the present application.
  • Figure 4 is a schematic diagram of the decentralized architecture provided by the embodiment of the present application. Schematic diagram of the decentralized architecture of the Gossip architecture. The centralized architecture and decentralized architecture are explained below:
  • the specified connection method is a centralized architecture
  • the worker is used to complete local training tasks and communicate with the server through the client interface to obtain the latest global model parameters; it sends its own local parameters to the server.
  • the server is used to aggregate the local parameters sent by each worker and update the global model parameters using ADD or SUM operations.
  • the communication synchronization method includes synchronous communication and asynchronous communication. If synchronous communication is used, the communication synchronization mode between nodes in the distributed computing system can be configured according to synchronous communication; among them, when any computing node in the distributed training system completes the current round of iteration, it waits for other computing nodes to complete their current iteration. After a round of iteration tasks, all computing nodes start processing the next round of training iteration tasks.
  • optimization problems in deep learning using distributed training strategies can usually be described as the following optimization problems:
  • w ⁇ R d represents a d-dimensional parameter vector
  • f(w) is a global function
  • each local function f i (w) is smooth
  • Representative examples of the above problems include classification problems in logistic regression and energy consumption minimization problems in multi-agent systems.
  • B t is a sample set composed of multiple random samples.
  • the update formula of the gradient optimization algorithm such as the natural gradient descent NGD (Natural Gradient Descent) method, is as follows:
  • F is the Fisher information matrix
  • the improved 1-bit compression technology is as follows:
  • Formula (*) uses the L2 norm of the vector and introduces a scaling factor ⁇ (usually 0 ⁇ 1) to solve the bit error problem of the original 1-bit compression method.
  • the main function of formula (**) is to limit the compressed data The difference with the original data x cannot exceed the set constant ⁇ , so as to ensure the compression accuracy as much as possible.
  • S105 Aggregate the intermediate results generated by each computing node, and output the final computing result corresponding to the data computing task.
  • the final calculation result can be output by aggregating the intermediate results generated by the calculation nodes.
  • this step can use additive aggregation logic or integrated aggregation logic to aggregate the intermediate results generated by each computing node, and output the final computing results corresponding to the data computing task.
  • Jiajia aggregation includes full aggregation logic and partial aggregation logic. Full aggregation logic is used to assign different weights to different computing nodes and calculate the weighted sum of the intermediate results produced by all computing nodes.
  • the embodiment of the present application After receiving the data computing task, the embodiment of the present application first splits the data computing task to obtain each sub-task, thereby deploying the sub-tasks to the computing nodes and executing the parallel mode, connection method and communication synchronization in the distributed computing system. Configure the method and optimize the information synchronization between computing nodes to perform distributed computing and reduce the constraints of the hardware system.
  • Through effective distributed algorithm design explore the factors that affect deep learning model training and establish accurate Reliable distributed accelerated computing rules reduce sub-task training space and reduce model training time, which can effectively improve model training accuracy and reduce storage overhead of gradients and model parameter variables.
  • Communication component used to configure the connection method and communication synchronization method between computing nodes
  • the algorithm optimization component is used to optimize the information synchronization efficiency of computing nodes using gradient optimization algorithms or non-gradient optimization algorithms;
  • the aggregation component is used to aggregate the intermediate results generated by each computing node and output the final computing results corresponding to the data computing tasks.
  • the distributed computing system in the embodiments of this application mainly includes a partitioning component, a communication component, an algorithm optimization component, and an aggregation component.
  • the four components complement each other and play different roles in the distributed computing system. The following describes the four components one by one:
  • the dividing component corresponds to step S102 in the previous embodiment, and is mainly used to divide the data calculation tasks that need to be performed.
  • the data calculation task can be a data set or a data model, which can be split into corresponding sub-data sets or sub-models. For ease of understanding, this embodiment is described in terms of subtasks.
  • different splitting strategies can be followed.
  • This embodiment provides several parallel modes of computing nodes, and the splitting strategy can adopt a corresponding splitting method according to the adopted parallel mode.
  • the parallel mode may include a data parallel mode, a model parallel mode and a hybrid parallel mode, and the data parallel mode may further include sample-based data parallelism and sample dimension-based data parallelism.
  • data parallelism relies on subdividing the data set across multiple computing nodes in a parallel computing environment to achieve split computing.
  • Data parallel algorithms focus on distributing data on different parallel computing nodes, and each computing node executes the same computing model.
  • the data parallel mode is divided into sample-based data parallelism and sample-dimension-based data parallelism according to different splitting strategies of the data set.
  • Sample-based data parallelism Assume that the distributed training system data set contains m data samples and n computing nodes. These m samples are allocated to n through random sampling with replacement and local (global) scrambling sampling. computing nodes. Data parallelism based on sample dimensions.
  • Model parallelism splits the model parameters into multiple sub-models, and assigns each sub-model to different computing nodes. It is worth noting that due to the particularity of the neural network model, that is, the hierarchical structure of the neural network model, it has significant advantages in applying model parallelism. Neural network models can be divided into horizontal splitting and vertical splitting according to different splitting methods.
  • hybrid parallel mode in order to overcome the shortcomings of data parallelism and model parallelism, you can also set up a hybrid parallel mode, which combines the data parallel mode and the model parallel mode at the same time, so that it can be applied to more complex model training tasks. .
  • the communication component can use the collaboration between multiple computing nodes to accelerate the completion of training tasks. Due to the influence of factors such as hardware equipment, network bandwidth, and transmission rate, communication between computing nodes in distributed training systems often becomes a bottleneck, seriously restricting training performance. . In this case, the communication component strives to design a reasonable and efficient communication mechanism to reduce communication overhead. When designing a communication mechanism, it is necessary to consider not only the constraints at the hardware system level, but also the design issues at the software algorithm level.
  • the communication component in the embodiment of this application mainly optimizes the communication process in the distributed computing process from the aspects of communication content, communication topology, communication synchronization method, etc.
  • the distributed training network topology architecture determines the communication methods.
  • the communication topology architecture of a distributed training system refers to the connection method between various computing nodes, including physical topology and logical topology.
  • Physical topology mainly includes multiple topologies such as Fat-Tree and BCube.
  • Logical topology includes centralized architecture and decentralized architecture.
  • the PS architecture logically adopts a bipartite graph-based communication topology between workers and servers. In other words, communication only occurs between servers and workers, and there is no direct communication between workers.
  • the main idea of the synchronization algorithm is: when a computing node in the distributed training system completes the current round of iteration, it must wait for other computing nodes to complete its current round of iteration tasks, and then they can jointly process the next round of training iteration tasks.
  • Typical synchronization algorithms such as bulk synchronous parallel (BSP) algorithm, are taken as an example.
  • BSP bulk synchronous parallel
  • the BSP algorithm when a computing node completes the current iteration task, it needs to synchronize information such as model parameters or gradients with other computing nodes through different communication topology logic. Then, they enter the next iteration process with the same "starting line".
  • the BSP algorithm introduces a global synchronization barrier. Its working principle is to require those computing nodes with strong processing power and fast iteration speed to be forced to stop at the synchronization barrier, and wait for other computing nodes with weak processing power and slow iteration speed to complete their current round of iteration tasks before training. The system will then execute the next iteration task.
  • Asynchronous communication or asynchronous algorithms can be further subdivided into multi-machine asynchronous communication and single-machine multi-thread asynchronous communication.
  • the algorithm optimization component is mainly used to implement algorithm optimization, and mainly includes the following two categories of algorithms: (1) gradient optimization algorithms, including first-order optimization algorithms and high-order optimization algorithms; (2) non-gradient optimization algorithms.
  • first-order optimization algorithms mainly include gradient descent (Gradient Descent, GD), stochastic gradient descent (Stochastic Gradient Descent, SGD), mini-batch stochastic gradient descent, and projected sub-gradient method (Projected Sub-gradient Method, PSG). wait.
  • Second-order optimization algorithms mainly include Newton method, quasi-Newton method, etc.
  • Non-gradient optimization algorithms mainly include coordinate descent method (CDM), primal dual method (Primal Dual Method), etc.
  • the summation-based aggregation method is common in data parallel mode.
  • the aggregation component aggregates the intermediate results generated by the computing nodes based on specific aggregation logic.
  • Aggregation logic generally includes full aggregation and partial aggregation. The following describes the above two aggregation logics using the parameter server architecture.
  • the full aggregation logic assigns different weights to different computing nodes and calculates the weighted sum of the intermediate results generated by all computing nodes.
  • the advantage of full aggregation is that it has low computational complexity and is easy to implement.
  • the disadvantage is that when using a synchronous parallel algorithm framework, the algorithm is prone to a "dragger" effect.
  • partial aggregation logic including synchronous algorithms with backup nodes, asynchronous ADMM (Alternating Direction Method of Multipliers) algorithms and decentralized algorithms.
  • the synchronization algorithm with backup nodes adopts the strategy of exchanging space for time. For example, aggregating intermediate results from approximately 5% more computing nodes can effectively improve algorithm accuracy.
  • Asynchronous ADMM controls the maximum delay to aggregate the intermediate results of some computing nodes, thereby avoiding learning the inaccurate information of the "drag" computing nodes.
  • the decentralized algorithm aggregates the intermediate results of a small number of neighbor nodes.
  • the embodiments of this application explore the factors that affect the training of deep learning models, explore the deep internal correlation between distributed architecture, communication modes, and gradient calculations, establish accurate and reliable distributed accelerated computing rules, and reduce Subtask training space reduces model training time, can effectively improve model training accuracy, and reduce storage overhead of gradients and model parameter variables.
  • the storage medium can include: U disk, mobile hard disk, read-only memory (ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program code.
  • This application also provides a server (which can also be other distributed computing devices).
  • a server which can also be other distributed computing devices.
  • it can include a memory 601 and a processor 602.
  • the memory 601 stores a computer program
  • the processor 602 calls the computer in the memory 601.
  • the server can also include various network interfaces, power supplies and other components.

Abstract

本申请提供一种分布式计算方法,涉及数据处理领域,包括:获取数据计算任务;拆分数据计算任务得到子任务,并将子任务部署至计算节点,同时配置分布式训练通用框架中各计算节点的并行模式;配置各计算节点之间的连接方式和通信同步方式;利用梯度优化算法或者非梯度优化算法对计算节点执行信息同步效率优化;聚合各计算节点产生的中间结果,并输出对应的最终计算结果。本申请能降低受到的硬件系统的限制约束,通过有效的分布式算法设计,缩小子任务训练空间,减少模型训练时间,能够有效提升模型训练精度、降低梯度与模型参数变量的存储开销。本申请还提供一种分布式计算系统、分布式计算设备及计算机非易失性可读存储介质,具有上述有益效果。

Description

一种分布式计算方法、系统、设备及存储介质
相关申请的交叉引用
本申请要求于2022年06月15日提交中国专利局,申请号为202210671289.4,申请名称为“一种分布式计算方法、系统、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理领域,特别涉及一种分布式计算方法、系统、设备及存储介质。
背景技术
近年来,大数据、机器学习、深度学习、高性能计算以及互联网技术取得了重要进展,促进了计算机视觉、自然语言处理、语言识别、自动驾驶等领域的发展,并在学术界和产业界产生了深远影响。现阶段各领域产生的海量数据、超大参数规模的模型,如GPT-3、Bert等对人工智能训练方法性能以及算力资源提出了更高要求。为了解决大模型在大数据集上的有效训练问题,分布式训练技术逐渐引起了学术界和产业研究人员的广泛关注。分布式训练核心是利用“分而治之”的思想,首先将待训练的大模型或大数据集以模型并行、数据并行或混合并行的方式进行拆分,然后对拆分后小规模数据或模型单独训练,最后将所有局部训练结果再以某种方式进行聚合并输出全局训练结果。目前,研究人员同时开展软硬件层面分布式训练方法的研究:在软件层面,提出了各类优化器、优化算子的改进措施与训练策略;在硬件系统平台层面,设计了诸如基于混合异构算力的分布式计算系统等加速训练方法。
尽管现有一系列解决分布式训练的方法及装置,但依旧存在如下问题。对数据集或模型进行拆分时拆分不当,拆分后的子数据集或模型难以适合的计算节点,计算节点间通信效率低,不同计算节点产生的中间结果聚合效果差等诸多问题。
发明内容
本申请的目的是提供一种分布式计算系统、分布式计算方法、分布式计算设备及计算机非易失性可读存储介质,能够对分布式计算过程中的任务拆分、通信方式等过程优化,以提高分布式计算效果。
为解决上述技术问题,本申请提供一种分布式计算方法,具体技术方案如下:
获取数据计算任务;
拆分数据计算任务得到子任务,并将子任务部署至计算节点,同时配置分布式训练通用框架中各计算节点的并行模式;
配置各计算节点之间的连接方式和通信同步方式;
利用梯度优化算法或者非梯度优化算法对计算节点执行信息同步效率优化;
聚合各计算节点产生的中间结果,并输出数据计算任务对应的最终计算结果。
可选的,并行模式包括数据并行模式、模型并行模式和混合并行模式;数据并行模式包含基于样本的数据并行和基于样本维度的数据并行。
可选的,若采用基于样本的数据并行,将子任务部署至计算节点包括:
将各子任务通过有放回的随机采样和局部置乱采样部署至计算节点。
可选的,若采用基于样本维度的数据并行,且子任务包含若干维属性或特征,将子任务部署至计算节点包括:
将子任务按照属性或特征进行划分,得到任务样本;
将任务样本分配至相应的计算节点。
可选的,若并行模式为模型并行模式,还包括:
水平拆分分布式计算模型或垂直拆分分布式计算模型,以适配子任务。
可选的,配置各计算节点之间的连接方式和通信同步方式包括:
判断数据计算任务中是否包含指定连接方式;
在数据计算任务中包含指定连接方式的情况下,以指定连接方式构建分布式计算系统;指定连接方式包括中心化架构和去中心化架构中任一种;
解析数据计算任务,得到通信同步方式,并按照通信同步方式配置分布式计算系统中各节点之间的通信同步方式。
可选的,若指定连接方式为中心化架构,以指定连接方式构建分布式计算系统包括:
确定由计算节点构成的工作者和由一个或一组服务器节点构成的服务者;
其中,工作者用于完成局部训练任务,并通过客户端接口与服务者通信以获取最新的全局模型参数;将自身的局部参数发送至服务者;
服务者用于对各工作者发送的局部参数进行聚合,利用ADD或者SUM操作更新全局模型参数。
可选的,若指定连接方式为去中心化架构,以指定连接方式构建分布式计算系统包括:
确定由计算节点构成的工作者;
各工作者之间采用Reduce架构或Gossip架构进行信息交互,并构建分布式计算系统。
可选的,若分布式计算系统采用Reduce架构,每个工作者与其他所有工作者通信,并以广播的方式将本地信息传递给其他所有工作者。
可选的,若分布式计算系统采用Gossip架构,每个工作者与其邻居工作者通信。
可选的,若通信同步方式为同步通信,则按照通信同步方式配置分布式计算系统中各节点之间的通信同步方式包括:
按照同步通信配置分布式计算系统中各节点之间的通信同步方式;其中,在分布式训练系统中任一计算节点完成当前轮次迭代时,等待其他计算节点完成其当前轮次迭代任务后,所有计算节点开始处理下一轮次训练迭代任务。
可选的,通信同步方式为异步通信,则按照通信同步方式配置分布式计算系统中各节点之间的通信同步方式包括:
按照异步通信配置分布式计算系统中各节点之间的通信同步方式;其中,在分布式训练系统中任一计算节点完成当前轮次迭代时,继续处理下一轮次训练迭代任务。
可选的,聚合各计算节点产生的中间结果,并输出数据计算任务对应的最终计算结果包括:
采用加加聚合逻辑或集成聚合逻辑聚合各计算节点产生的中间结果,并输出数据计算任务对应的最终计算结果;
其中,加加聚合包含全聚合逻辑和部分聚合逻辑;全聚合逻辑用于为不同的计算节点赋予不同权重,并对所有计算节点产生的中间结果求加权和。
本申请还提供一种计算机非易失性可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现如上的方法的步骤。
本申请还提供一种服务器,包括存储器和处理器,存储器中存有计算机程序,处理器调用存储器中的计算机程序时实现如上的方法的步骤。
本申请提供一种分布式计算方法,包括:获取数据计算任务;拆分数据计算任务得到子任务,并将子任务部署至计算节点,同时配置分布式训练通用框架中各计算节点的并行模式;配置各计算节点之间的连接方式和通信同步方式;利用梯度优化算法或者非梯度优化算法对计算节点执行信息同步效率优化;聚合各计算节点产生的中间结果,并输出数据计算任务对应的最终计算结果。
本申请实施例在接收到数据计算任务后,先对数据计算任务进行拆分,以得到各个子任务,从而将子任务部署至计算节点,执行分布式计算系统中并行模式、连接方式和通信同步方式的配置,并对计算节点之间的信息同步进行优化,从而执行分布式计算,降低受到的硬件系统的限制约束,通过有效的分布式算法设计,发掘影响深度学习模型训练的因素,建立准确可靠的分布式加速计算规则,缩小子任务训练空间,减少模型训练时间,能够有效提升 模型训练精度、降低梯度与模型参数变量的存储开销。
本申请还提供一种分布式计算系统、分布式计算设备及计算机非易失性可读存储介质,具有上述有益效果,此处不再赘述。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请实施例所提供的一种分布式计算方法的流程图;
图2为本申请实施例所提供的中心化架构示意图;
图3为本申请实施例所提供的Reduce架构的去中心化架构示意图;
图4为本申请实施例所提供的Gossip架构的去中心化架构示意图;
图5为本申请实施例所提供的分布式计算系统的结构示意图;
图6为本申请实施例所提供的分布式计算设备的结构示意图。
具体实施方式
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
参见图1,图1为本申请实施例所提供的一种分布式计算方法的流程图,该方法包括:
S101:获取数据计算任务;
本步骤旨在获取数据计算任务,在此对于如何获取该数据计算任务不作限定,在本申请实施例的实际应用中,可以通过网络、数据链路接收云端或者其他分布式计算设备发送的数据计算任务。在此对于数据计算任务的具体内容也不作限定,其可以包含所需要执行数据计算的任务内容、可选择的计算方式等,以便应用本申请实施例采用适配的分布式计算系统或者分布式计算方法加以计算。
S102:拆分数据计算任务得到子任务,并将子任务部署至计算节点,同时配置分布式训练通用框架中各计算节点的并行模式;
本步骤旨在拆分数据计算任务,由于数据计算任务很可能是计算量和数据量均较为庞大的任务,因此本步骤可以先对数据计算任务进行拆分,从而得到子任务,在此对于具体的拆 分方式不作限定,其通常可以按照数据计算任务适配分布式计算系统中的计算节点数量或者性能的方式进行任务拆分。
在拆分得到子任务后,将子任务部署至计算节点,同时配置计算节点的并行模式。在此对于采用的并行模式不作限定,可以包括但不限于数据并行、模型并行和混合并行等方式。当然也可以采用其他并行模式,在此不一一举例限定。
并行模式可以包括数据并行模式、模型并行模式和混合并行模式,而数据并行模式包含基于样本的数据并行和基于样本维度的数据并行。
若采用基于样本的数据并行,在执行本步骤时,可以将各子任务通过有放回的随机采样和局部置乱采样部署至计算节点。
若采用基于样本维度的数据并行,且子任务包含若干维属性或特征,在执行本步骤时,可以将子任务按照属性或特征进行划分,得到任务样本,再将任务样本分配至相应的计算节点。
此外,若并行模式为模型并行模式,可以水平拆分分布式计算模型或垂直拆分分布式计算模型,以适配子任务,例如神经网络模型按照不同的拆分方式可以分为水平拆分和竖直拆分。
需要注意的是,在进行分布式计算时,需要构建相应的分布式计算系统,从而完成分布式计算,本步骤的分布式训练通用框架为构建分布式计算系统的必要基础结构,可由本领域技术人员事先配置分布式计算所需要的基础框架内容,从而适配不同分布式计算需要。
S103:配置各计算节点之间的连接方式和通信同步方式;
本步骤在上一步骤的基础上,进一步对需要配置分布式计算系统中各计算节点的连接方式和通信同步方式,该连接方式指分布式计算系统中各计算节点的通信拓扑架构,以及在该种通信拓扑架构中计算节点之间的通信方式。
作为本步骤的一种优选执行方式,可以按照如下步骤执行本步骤:
S1031:判断数据计算任务中是否包含指定连接方式;在数据计算任务中包含指定连接方式的情况下,在进入S1032;在数据计算任务中不包含指定连接方式的情况下,以默认连接方式配置计算节点之间的连接方式;
S1032:以指定连接方式构建分布式计算系统;指定连接方式包括中心化架构和去中心化架构中任一种;
S1033:解析数据计算任务,得到通信同步方式,并按照通信同步方式配置分布式计算系统中各节点之间的通信同步方式。
若是数据计算任务中指定了连接方式,则以数据计算任务中的指定连接方式为准,对分布式计算系统中计算节点的连接方式进行配置,若是数据计算任务中未指定连接方式,则以默认连接方式进行配置,在此对于默认连接方式不作限定,可由本领域技术人员自定义设置。
参见图2至图4,图2为本申请实施例所提供的中心化架构示意图,图3为本申请实施例所提供的Reduce架构的去中心化架构示意图,图4为本申请实施例所提供的Gossip架构的去中心化架构示意图,下面对中心化架构和去中心化架构分别进行说明:
若指定连接方式为中心化架构,以指定连接方式构建分布式计算系统时可以先确定由计算节点构成的工作者和由一个或一组服务器节点构成的服务者。工作者用于完成局部训练任务,并通过客户端接口与服务者通信以获取最新的全局模型参数;将自身的局部参数发送至服务者。服务者用于对各工作者发送的局部参数进行聚合,利用ADD或者SUM操作更新全局模型参数。
若指定连接方式为去中心化架构,则只需要确定由计算节点构成的工作者,各工作者之间采用Reduce架构或Gossip架构进行信息交互,并构建分布式计算系统。若分布式计算系统采用Reduce架构,参见图3每个工作者与其他所有工作者通信,并以广播的方式将本地信息传递给其他所有工作者。若分布式计算系统采用Gossip架构,参见图4,每个工作者仅与其邻居工作者通信。
而通信同步方式包含同步通信和异步通信。若采用同步通信,可以按照同步通信配置分布式计算系统中各节点之间的通信同步方式;其中,在分布式训练系统中任一计算节点完成当前轮次迭代时,等待其他计算节点完成其当前轮次迭代任务后,所有计算节点开始处理下一轮次训练迭代任务。
若采用异步通信,可以按照异步通信配置分布式计算系统中各节点之间的通信同步方式。异步通信时,在分布式训练系统中任一计算节点完成当前轮次迭代时,可以直接继续处理下一轮次训练迭代任务。
S104:利用梯度优化算法或者非梯度优化算法对计算节点执行信息同步效率优化;
为了进一步提高分布式计算效率,可以利用梯度优化算法或者非梯度优化算法对计算节点执行信息同步效率优化,即进一步提高计算节点之间的信息同步,确保能尽快执行下一轮迭代计算。
深度学习中的优化问题采用分布式训练策略通常可以描述为如下的优化问题:
Figure PCTCN2022122792-appb-000001
其中w∈R d表示一个d维参数向量,f(w)为全局函数,每个局部函数f i(w)是光滑的,[n]={1,2,...,n},n表示分布式计算节点数量。上述问题的代表性实例有逻辑回归中分类问题、多代理系统中能源消耗最小化问题等。
为了解决上述问题,一阶优化算法,如梯度下降(Gradient Descent,GD)算法发挥了基础性作用。GD算法的核心迭代步骤如下:
Figure PCTCN2022122792-appb-000002
其中,η表示学习率,
Figure PCTCN2022122792-appb-000003
表示在t在迭代中基于参数w t和样本i t的随机梯度。然而,GD在每次迭代中需要遍历完整的数据集并计算全梯度。如果数据集规模非常大,这将导致计算开销巨大。为了避免计算全梯度的问题,还可以进一步采用随机梯度下降(Stochastic Gradient Descent,SGD)算法,其核心迭代过程如下:
Figure PCTCN2022122792-appb-000004
与GD算法相比,SGD在每次迭代中仅需计算一个样本的随机梯度,计算梯度的时间开销由O(m)降低到了O(1),其中m表示数据集样本数量。但是,由于SGD采用单样本随机代替全梯度,因此产生了额外的“偏差”,该偏差被业界定义为“方差”。方差的存在会导致SGD算法收敛速度变慢。为了解决这个问题,小批量随机梯度下降(Mini-Batch SGD)算法被提出,其核心迭代规则如下:
Figure PCTCN2022122792-appb-000005
其中,B t是由多个随机样本构成的样本集合。
阶梯度优化算法,如自然梯度下降NGD(Natural Gradient Descent)方法的更新公式如下:
Figure PCTCN2022122792-appb-000006
上式中,F为Fisher信息矩阵。
上文为部分优化算法的描述,在本申请的一种具体应用中,针对各计算节点处理子任务所得到的中间结果,在以产生最终计算结果前,可以利用梯度优化算法或者非梯度优化算法将中间结果作为所需要处理的数据进行优化计算,从而确保快速聚合。
此外,梯度计算或通信占GPU训练总时长的94%以上,严重制约了训练效率。因此,提升分布式训练通信效率尤为关键。通常,可采用降低通信量来提高通信效率。本步骤提出一种改进的1-bit压缩优化技术。下面分别介绍原始的1-bit压缩优化技术和改进的1-bit压缩技术。
原始的1-bit压缩技术定义为:
令C[*]表示压缩操作运算,||·|| 1表示求向量的L1范数,x∈R d表示一个d维实数向量,sign(x)表示取向量x的符号,则对向量x取1-bit压缩操作:
Figure PCTCN2022122792-appb-000007
上述压缩过程中虽然能够减少通信量,但在某些情况下会产生误码。例如对于向量x=[1,-2,3]和向量y=[1,2,3]而言:
C[x]=(|1|+|-2|+|3|)/3*(+);
C[y]=(|1|+|2|+|3|)/3*(+);
可见,上述两个向量压缩结果相同。换言之,不同的向量,采用原始的1-bit压缩后结果竟然相同,显然这种压缩会产生误码。相反地,压缩的目标应尽量做到差异化。为此,本步骤可采用一种改进的1-bit压缩技术规避上述问题。
改进后的1-bit压缩技术如下:
Figure PCTCN2022122792-appb-000008
Figure PCTCN2022122792-appb-000009
公式(*)采用向量的L2范数,以及引入了缩放因子λ(通常0<λ<1),用以解决原始1-bit压缩方法的误码问题。公式(**)主要作用在于限制压缩后的数据
Figure PCTCN2022122792-appb-000010
与原始数据x之间的差距不能超过设置的常数μ,从而尽可能地保证压缩精度。
因此,虽然不同的计算节点受限于自身硬件,以及要处理子任务的任务难度和数据量等,导致计算节点计算得到中间结果所需时长不同,但可以通过对输出的中间结果采用梯度优化或者非梯度优化,以压缩各计算节点得到的中间结果,从而使得各计算节点执行中间结果同步时所需时间相对集中,避免造成计算时长越长的中间结果所需要的同步时间越长,从而拖累整个系统得到中间结果的所需时长,进一步影响节点间的信息同步效率。
S105:聚合各计算节点产生的中间结果,并输出数据计算任务对应的最终计算结果。
在完成目标轮次的迭代计算后,通过聚合计算节点产生的中间结果,即可输出最终计算结果。
作为一种的执行方式,本步骤可以采用加加聚合逻辑或集成聚合逻辑聚合各计算节点产生的中间结果,并输出数据计算任务对应的最终计算结果。其中,加加聚合包含全聚合逻辑和部分聚合逻辑。全聚合逻辑用于为不同的计算节点赋予不同权重,并对所有计算节点产生的中间结果求加权和。
本申请实施例在接收到数据计算任务后,先对数据计算任务进行拆分,以得到各个子任务,从而将子任务部署至计算节点,执行分布式计算系统中并行模式、连接方式和通信同步方式的配置,并对计算节点之间的信息同步进行优化,从而执行分布式计算,降低受到的硬件系统的限制约束,通过有效的分布式算法设计,发掘影响深度学习模型训练的因素,建立准确可靠的分布式加速计算规则,缩小子任务训练空间,减少模型训练时间,能够有效提升模型训练精度、降低梯度与模型参数变量的存储开销。
请参考图5,图5为本申请实施例所提供的分布式计算系统的结构示意图,与上述实施例提供的分布式计算方法可相互参考对照,该系统包括:
划分组件,用于拆分数据计算任务得到子任务,并将子任务部署至计算节点,同时配置分布式训练通用框架中各计算节点的并行模式;
通信组件,用于配置各计算节点之间的连接方式和通信同步方式;
算法优化组件,用于利用梯度优化算法或者非梯度优化算法对计算节点执行信息同步效率优化;
聚合组件,用于聚合各计算节点产生的中间结果,并输出数据计算任务对应的最终计算结果。
本申请实施例同的分布式计算系统主要包含划分组件、通信组件、算法优化组件和聚合组件,四个组件相辅相成,在分布式计算系统中起到不同的作用。下文针对四个组件逐一进行说明:
划分组件对应上一实施例中的步骤S102,主要用于拆分所需要执行的数据计算任务。该数据计算任务可以为数据集或者数据模型,从而拆分得到相应的子数据集或子模型。为了便于理解,本实施例统一以子任务进行描述。在拆分过程中,可以按照不同的拆分策略。本实施例在此提供几种计算节点的并行模式,而拆分策略可以按照所采用的并行模式采用相应的拆分方式。该并行模式可以包括数据并行模式、模型并行模式和混合并行模式,而数据并行模式可以进一步包含基于样本的数据并行和基于样本维度的数据并行。
对于数据并行模式,数据并行依赖于在并行计算环境中多个计算节点细分数据集实现分割计算。数据并行算法侧重于将数据分布在不同的并行计算节点上,并且各计算节点执行相同的计算模型。数据并行模式按照数据集不同的拆分策略分为基于样本的数据并行和基于样本维度的数据并行。基于样本的数据并行:假定分布式训练系统数据集包含m个数据样本和n个计算节点,将这m个样本通过有放回的随机采样与局部(全局)置乱采样两种方式分配至 n个计算节点。基于样本维度的数据并行。假定数据集包含m个样本且每个样本具有d维属性或特征,分布式训练系统包括n个计算节点。基于样本维度的数据并行则是从样本属性维度出发,将m个样本按照不同的属性进行拆分,并把拆分后的样本子集分配至相应的计算节点。
对于模型并行模式,如果数据计算任务过大且无法通过单机方式实现存储,则需要对模型进行有效拆分使得训练任务变得可行。模型并行将模型参数拆分成多个子模型,并且各个子模型分配至不同的计算节点。值得注意的是由于神经网络模型的特殊性,即神经网络模型的分层结构使得其在应用模型并行方面具有显著优势。神经网络模型按照不同的拆分方式可以分为水平拆分和垂直拆分。
对于混合并行模式,为了克服数据并行和模型并行的不足,还可以设置一种混合并行的模式,即同时将数据并行模式与模型并行模式结合起来,使其能够应用于更复杂的模型训练任务中。
而通信组件能够利用多个计算节点间的协同合作加速完成训练任务,由于硬件设备、网络带宽和传输速率等因素的影响,分布式训练系统计算节点间的通信往往成为瓶颈,严重制约了训练性能。在这种情况下,通信组件的力求设计合理、高效的通信机制,减少通信开销。在设计通信机制时,不仅要考虑硬件系统层面的限制约束,还要兼顾软件算法层面的设计问题。本申请实施例中的通信组件主要从通信内容、通信拓扑、通信同步方式等方面对分布式计算过程中的通信过程进行优化。
具体的,通信内容与上文所采用的并行模式相关。在数据并行中,每个计算节点使用本地训练数据进行模型训练。为了达到全局模型一致性的目的,各计算节点需要同其他计算节点进行通信以获得其他计算节点的局部模型参数或更新,进而保持全局模型参数一致性。区别于数据并行,模型并行模式中各计算节点使用相同的数据来训练不同的子任务。例如,在神经网络模型训练过程中,某个计算节点的迭代必须依赖于其他节点的中间计算结果或输出,此时需要进行通信才能获得其他节点训练的中间结果及输出。
对于通信拓扑,不同的分布式系统架构产生了不同的通信方式,即分布式训练网络拓扑架构决定了通信方式。一般而言,分布式训练系统的通信拓扑架构是指各个计算节点之间的连接方式,包括物理拓扑和逻辑拓扑。物理拓扑主要包括Fat-Tree和BCube等在内的多种拓扑。逻辑拓扑包括中心化架构和去中心化架构。
中心化架构具有一个中心主节点来协调各个工作节点。中心化架构的代表是参数服务器(parameter服务者,PS)架构。在PS架构中存在两种角色:工作者和服务者。前者通常由 计算节点构成,而后者一般是一个或一组服务器节点构成。工作者主要负责如下操作:(1)基于其局部数据样本完成局部训练任务;(2)通过客户端接口与服务者进行通信,即从服务者处获取最新的全局模型参数并将其自身的局部参数发送到服务者处。服务者作为PS架构的核心部件主要完成如下操作:
(1)对各个工作者发送来的局部梯度进行聚合;
(2)通过ADD或SUM操作更新全局模型参数并返回至各个工作者处。
另外,PS架构在工作者和服务者之间逻辑上采用基于二部图的通信拓扑。换言之,通信只发生在服务者与工作者之间,而工作者与工作者之间不存在直接的通信。
中心化架构的瓶颈主要表现在中心服务者的通信拥塞问题,特别是随着工作者数量逐渐增加的情况下该问题尤为凸显。为了缓解中心化架构服务者节点的通信拥塞问题,研究人员提出了不包含中心服务者节点的去中心化架构。与中心化架构相比,去中心化架构中的工作者之间通过某些巧妙的通信设计进行信息交互,如All-Reduce架构。在All-reduce架构中,每个工作者需要与所有工作者进行通信,并以广播的方式将其本地信息传递给其他所有工作者。因此,每个工作者以该方式获取了所有工作者的信息,进而实现了全局信息同步。值得注意的是与All-Reduce相比,在Grossip架构中,每个工作者只与它的邻居工作者通信。
在分布式训练系统中,基于不同通信拓扑实现模型参数、梯度等信息的同步直接影响到算法的收敛性。一般地,通信同步方式主要包括同步通信和异步通信,也称之为同步算法和异步算法。
同步算法主要思想是:当分布式训练系统中的一个计算节点完成当前轮次迭代时,它必须等待其他计算节点完成其当前轮次迭代任务,然后它们才能共同处理下一轮次训练迭代任务。在此对于采用何种同步算法不作限定,以典型的同步算法,如整体同步并行(bulk synchronous parallel,BSP)算法为例。在BSP算法中,当某个计算节点完成当前迭代任务后,需要通过不同通信拓扑逻辑与其他计算节点同步模型参数或梯度等信息。然后,它们以相同的“起跑线”进入下一轮次迭代过程。为了保证迭代以相同的“起跑线”进行,BSP算法引入了一个全局同步障碍(synchronization barrier)。它的工作原理是要求那些处理能力较强且迭代速度快的计算节点都被强制在同步障碍处停止,等待其他处理能力较弱且迭代速度慢的计算节点完成其当前轮次迭代任务后,训练系统才会执行下一轮次迭代任务。
异步通信或异步算法主要思想是当系统中的某个计算节点完成其当前轮次迭代后,它可以继续执行下一轮次迭代而无需等待其他计算节点。异步算法可进一步细分为多机异步通信 和单机多线程异步通信。
算法优化组件主要用于实现算法优化,主要包含以下两大类别算法:(1)梯度类优化算法,包括一阶优化算法和高阶优化算法;(2)非梯度类优化算法。具体而言,一阶优化算法主要有梯度下降(Gradient Descent,GD)、随机梯度下降(Stochastic Gradient Descent,SGD)、mini-batch随机梯度下降、投影次梯度方法(Projected Sub-gradient Method,PSG)等。二阶优化算法主要有Newton方法、拟Newton方法等。非梯度类优化算法主要有坐标下降方法(coordinate Descent Method,CDM)、原始对偶方法(Primal Dual Method)等。
聚合组件将各个计算节点产生的中间结果进行聚合,从而输出最终的训练结果有效的聚合方法会加速训练过程。一般地,聚合组件可以包括基于加和的聚合以及基于集成的聚合。
基于加和的聚合方法常见于数据并行模式,当全体计算节点完成各自训练任务后,聚合组件基于特定的聚合逻辑将计算节点产生的中间结果进行聚合。聚合逻辑一般包括全聚合与部分聚合。下面以参数服务器架构说明上述2种聚合逻辑。全聚合逻辑为不同计算节点赋予不同的权重,并对全体计算节点产生的中间结果求加权和。全聚合的优点是计算复杂性较低且易于实施,缺点是当使用同步并行算法框架的情形下,算法容易产生“拖累者”效应。为了克服全聚合的不足,研究人员提出了部分聚合逻辑,包括带备份节点的同步算法、异步ADMM(Alternating Direction Method of Multipliers,交替方向乘子法)算法以及去中心化算法。带备份节点的同步算法采取以空间换时间的策略。例如,聚合额外大约5%计算节点的中间结果能够有效提升算法精确性。异步ADMM则是控制最大延迟来聚合部分计算节点中间结果,从而避免学习到“拖累者”计算节点的不精确信息。去中心化算法则聚合少量邻居节点中间结果。
基于集成的聚合则可以用于解决非凸神经网络模型训练的聚合问题。例如,已有研究指出简单地对各计算节点的局部中间结果进行平均,并不能保证全局模型性能优于局部模型。因此,可以采用一种融合压缩的方法EC-DNN(Deep Neural Networks,深度神经网络)。此外,基于投票的聚合发挥了重要作用。与单机训练相比,算法在几乎不损失精度的前提下,保证模型训练过程快速收敛。
本申请实施例通过有效的分布式算法设计,发掘影响深度学习模型训练的因素,探索分布式架构、通信模式、梯度计算之间深层次的内在关联,建立准确可靠的分布式加速计算规则,缩小子任务训练空间,减少模型训练时间,能够有效提升模型训练精度、降低梯度与模型参数变量的存储开销。
本申请还提供了一种计算机非易失性可读存储介质,其上存有计算机程序,该计算机程序被执行时可以实现上述实施例所提供的步骤。该存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请还提供了一种服务器(也可以为其他的分布式计算设备),参考图6,可以包括存储器601和处理器602,存储器601中存有计算机程序,处理器602调用存储器601中的计算机程序时,可以实现上述实施例所提供的步骤。当然服务器(也可以为其他的分布式计算设备)还可以包括各种网络接口,电源等组件。
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例提供的系统而言,由于其与实施例提供的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。
本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请权利要求的保护范围内。
还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。

Claims (20)

  1. 一种分布式计算方法,其特征在于,包括:
    获取数据计算任务;
    拆分所述数据计算任务得到子任务,并将所述子任务部署至计算节点,同时配置分布式训练通用框架中各所述计算节点的并行模式;
    配置各所述计算节点之间的连接方式和通信同步方式;
    利用梯度优化算法或者非梯度优化算法对所述计算节点执行信息同步效率优化;
    聚合各所述计算节点产生的中间结果,并输出所述数据计算任务对应的最终计算结果。
  2. 根据权利要求1所述的分布式计算方法,其特征在于,所述并行模式包括数据并行模式、模型并行模式和混合并行模式;所述数据并行模式包含基于样本的数据并行和基于样本维度的数据并行。
  3. 根据权利要求2所述的分布式计算方法,其特征在于,若采用基于样本的数据并行,所述将所述子任务部署至计算节点包括:
    将各所述子任务通过有放回的随机采样和局部置乱采样部署至计算节点。
  4. 根据权利要求2所述的分布式计算方法,其特征在于,若采用基于样本维度的数据并行,且所述子任务包含若干维属性或特征,所述将所述子任务部署至计算节点包括:
    将所述子任务按照所述属性或所述特征进行划分,得到任务样本;
    将所述任务样本分配至相应的计算节点。
  5. 根据权利要求2所述的分布式计算方法,其特征在于,若所述并行模式为所述模型并行模式,还包括:
    水平拆分分布式计算模型或垂直拆分分布式计算模型,以适配所述子任务。
  6. 根据权利要求1所述的分布式计算方法,其特征在于,配置各所述计算节点之间的连接方式和通信同步方式包括:
    判断所述数据计算任务中是否包含指定连接方式;
    在所述数据计算任务中包含指定连接方式的情况下,以所述指定连接方式构建分布式计算系统;所述指定连接方式包括中心化架构和去中心化架构中任一种;
    解析所述数据计算任务,得到所述通信同步方式,并按照所述通信同步方式配置所述分布式计算系统中各节点之间的通信同步方式。
  7. 根据权利要求6所述的分布式计算方法,其特征在于,若所述指定连接方式为中 心化架构,以所述指定连接方式构建分布式计算系统包括:
    确定由计算节点构成的工作者和由一个或一组服务器节点构成的服务者;
    其中,所述工作者用于完成局部训练任务,并通过客户端接口与所述服务者通信以获取最新的全局模型参数;将自身的局部参数发送至所述服务者;
    所述服务者用于对各所述工作者发送的局部参数进行聚合,利用ADD或者SUM操作更新所述全局模型参数。
  8. 根据权利要求6所述的分布式计算方法,其特征在于,若所述指定连接方式为去中心化架构,以所述指定连接方式构建分布式计算系统包括:
    确定由计算节点构成的工作者;
    各所述工作者之间采用Reduce架构或Gossip架构进行信息交互,并构建分布式计算系统。
  9. 根据权利要求8所述的分布式计算方法,其特征在于,若所述分布式计算系统采用所述Reduce架构,每个所述工作者与其他所有工作者通信,并以广播的方式将本地信息传递给其他所有工作者。
  10. 根据权利要求8所述的分布式计算方法,其特征在于,若所述分布式计算系统采用所述Gossip架构,每个所述工作者与其邻居工作者通信。
  11. 根据权利要求6所述的分布式计算方法,其特征在于,若所述通信同步方式为同步通信,则按照所述通信同步方式配置所述分布式计算系统中各节点之间的通信同步方式包括:
    按照同步通信配置所述分布式计算系统中各节点之间的通信同步方式;其中,在所述分布式训练系统中任一计算节点完成当前轮次迭代时,等待其他计算节点完成其当前轮次迭代任务后,所有所述计算节点开始处理下一轮次训练迭代任务。
  12. 根据权利要求6所述的分布式计算方法,其特征在于,所述通信同步方式为异步通信,则按照所述通信同步方式配置所述分布式计算系统中各节点之间的通信同步方式包括:
    按照异步通信配置所述分布式计算系统中各节点之间的通信同步方式;其中,在所述分布式训练系统中任一计算节点完成当前轮次迭代时,继续处理下一轮次训练迭代任务。
  13. 根据权利要求1所述的分布式计算方法,其特征在于,聚合各所述计算节点产生的中间结果,并输出所述数据计算任务对应的最终计算结果包括:
    采用加加聚合逻辑或集成聚合逻辑聚合各所述计算节点产生的中间结果,并输出所 述数据计算任务对应的最终计算结果;
    其中,所述加加聚合包含全聚合逻辑和部分聚合逻辑;所述全聚合逻辑用于为不同的计算节点赋予不同权重,并对所有所述计算节点产生的所述中间结果求加权和。
  14. 根据权利要求1所述的分布式计算方法,其特征在于,所述数据计算任务为通过网络、数据链路接收云端或者其他分布式计算设备发送的数据计算任务。
  15. 根据权利要求5所述的分布式计算方法,其特征在于,所述分布式计算模型包括神经网络模型。
  16. 根据权利要求1所述的分布式计算方法,其特征在于,各所述计算节点之间的连接方式包括分布式计算系统中各计算节点的通信拓扑架构,以及在所述通信拓扑架构中计算节点之间的通信方式。
  17. 根据权利要求6所述的分布式计算方法,其特征在于,所述方法还包括:
    在数据计算任务中不包含指定连接方式的情况下,以默认连接方式配置计算节点之间的连接方式。
  18. 一种分布式计算系统,其特征在于,包括:
    划分组件,用于拆分数据计算任务得到子任务,并将所述子任务部署至计算节点,同时配置分布式训练通用框架中各所述计算节点的并行模式;
    通信组件,用于配置各所述计算节点之间的连接方式和通信同步方式;
    算法优化组件,用于利用梯度优化算法或者非梯度优化算法对所述计算节点执行信息同步效率优化;
    聚合组件,用于聚合各所述计算节点产生的中间结果,并输出所述数据计算任务对应的最终计算结果。
  19. 一种计算机非易失性可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1-17任一项所述的分布式计算方法的步骤。
  20. 一种分布式计算设备,其特征在于,包括存储器和处理器,所述存储器中存有计算机程序,所述处理器调用所述存储器中的计算机程序时实现如权利要求1-17任一项所述的分布式计算方法的步骤。
PCT/CN2022/122792 2022-06-15 2022-09-29 一种分布式计算方法、系统、设备及存储介质 WO2023240845A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210671289.4A CN114756383B (zh) 2022-06-15 2022-06-15 一种分布式计算方法、系统、设备及存储介质
CN202210671289.4 2022-06-15

Publications (1)

Publication Number Publication Date
WO2023240845A1 true WO2023240845A1 (zh) 2023-12-21

Family

ID=82336772

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/122792 WO2023240845A1 (zh) 2022-06-15 2022-09-29 一种分布式计算方法、系统、设备及存储介质

Country Status (2)

Country Link
CN (1) CN114756383B (zh)
WO (1) WO2023240845A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806835A (zh) * 2024-02-29 2024-04-02 浪潮电子信息产业股份有限公司 一种任务分配方法、装置及电子设备和存储介质

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114756383B (zh) * 2022-06-15 2023-06-16 苏州浪潮智能科技有限公司 一种分布式计算方法、系统、设备及存储介质
CN114997337B (zh) * 2022-07-18 2023-01-13 浪潮电子信息产业股份有限公司 信息融合、数据通信方法、装置及电子设备和存储介质
CN115268800B (zh) * 2022-09-29 2022-12-20 四川汉唐云分布式存储技术有限公司 基于计算路由重定向的数据处理方法及数据存储系统
CN115310566A (zh) * 2022-10-12 2022-11-08 浪潮电子信息产业股份有限公司 分布式训练系统、方法、装置、设备及可读存储介质
CN115730681B (zh) * 2022-11-11 2023-08-15 北京百度网讯科技有限公司 模型训练方法、装置、设备以及存储介质
CN115665174B (zh) * 2022-12-13 2023-03-14 浪潮电子信息产业股份有限公司 一种梯度数据的同步方法、系统、设备及存储介质
CN115660078A (zh) * 2022-12-29 2023-01-31 浪潮电子信息产业股份有限公司 一种分布式计算方法、系统、存储介质和电子设备
CN115879543B (zh) * 2023-03-03 2023-05-05 浪潮电子信息产业股份有限公司 一种模型训练方法、装置、设备、介质及系统
CN116702885B (zh) * 2023-08-02 2023-11-07 浪潮电子信息产业股份有限公司 同步数据并行训练控制方法、系统、装置、设备及介质
CN116681973B (zh) * 2023-08-03 2023-11-03 浪潮电子信息产业股份有限公司 一种图像处理方法、装置、系统、设备及计算机存储介质
CN116701771B (zh) * 2023-08-03 2024-02-20 北京民谐文化传播有限公司 一种基于云计算的数字图书馆检索与资源共享系统
CN116996516B (zh) * 2023-09-22 2023-12-05 新华三技术有限公司 一种集群通信方法及装置、电子设备及可读存储介质
CN117035123B (zh) * 2023-10-09 2024-01-09 之江实验室 一种并行训练中的节点通信方法、存储介质、设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190325302A1 (en) * 2018-04-23 2019-10-24 EMC IP Holding Company LLC Implementing parameter server in networking infrastructure for high-performance computing
CN110659796A (zh) * 2019-08-08 2020-01-07 北京理工大学 一种可充电群车智能中的数据采集方法
CN114035937A (zh) * 2021-10-15 2022-02-11 北京潞晨科技有限公司 一种基于人工智能的分布式训练和推理方法、系统、设备和可读存储介质
CN114418129A (zh) * 2022-03-30 2022-04-29 苏州浪潮智能科技有限公司 一种深度学习模型训练方法及相关装置
CN114756383A (zh) * 2022-06-15 2022-07-15 苏州浪潮智能科技有限公司 一种分布式计算方法、系统、设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109034396B (zh) * 2018-07-11 2022-12-23 北京百度网讯科技有限公司 用于处理分布式集群中的深度学习作业的方法和装置
CN111367630A (zh) * 2019-07-12 2020-07-03 北京关键科技股份有限公司 一种基于云计算的多用户多优先级的分布式协同处理方法
CN114265898A (zh) * 2021-12-24 2022-04-01 北京天融信网络安全技术有限公司 数据处理方法、装置、设备和存储介质
CN114611688A (zh) * 2022-01-19 2022-06-10 阿里云计算有限公司 深度学习模型分布式训练方法及其训练执行计划构建方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190325302A1 (en) * 2018-04-23 2019-10-24 EMC IP Holding Company LLC Implementing parameter server in networking infrastructure for high-performance computing
CN110659796A (zh) * 2019-08-08 2020-01-07 北京理工大学 一种可充电群车智能中的数据采集方法
CN114035937A (zh) * 2021-10-15 2022-02-11 北京潞晨科技有限公司 一种基于人工智能的分布式训练和推理方法、系统、设备和可读存储介质
CN114418129A (zh) * 2022-03-30 2022-04-29 苏州浪潮智能科技有限公司 一种深度学习模型训练方法及相关装置
CN114756383A (zh) * 2022-06-15 2022-07-15 苏州浪潮智能科技有限公司 一种分布式计算方法、系统、设备及存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806835A (zh) * 2024-02-29 2024-04-02 浪潮电子信息产业股份有限公司 一种任务分配方法、装置及电子设备和存储介质

Also Published As

Publication number Publication date
CN114756383A (zh) 2022-07-15
CN114756383B (zh) 2023-06-16

Similar Documents

Publication Publication Date Title
WO2023240845A1 (zh) 一种分布式计算方法、系统、设备及存储介质
Liu et al. Adaptive asynchronous federated learning in resource-constrained edge computing
CN110533183B (zh) 流水线分布式深度学习中异构网络感知的任务放置方法
CN105117286B (zh) MapReduce中任务的调度方法和流水化执行方法
Shi et al. Communication-efficient distributed deep learning with merged gradient sparsification on GPUs
WO2024016542A1 (zh) 信息融合方法、数据通信方法、装置及电子设备和非易失性可读存储介质
WO2021008259A1 (zh) 用于异构架构的数据处理系统及其方法
CN110348571A (zh) 一种神经网络模型训练方法、装置、芯片和系统
CN111079921A (zh) 一种基于异构分布式系统的高效神经网络训练调度方法
US11481627B2 (en) Distributed learning of composite machine learning models
Wang et al. An efficient and non-intrusive GPU scheduling framework for deep learning training systems
Kim et al. Efficient large-scale deep learning framework for heterogeneous multi-gpu cluster
Li et al. Optimizing makespan and resource utilization for multi-DNN training in GPU cluster
US20210390405A1 (en) Microservice-based training systems in heterogeneous graphic processor unit (gpu) cluster and operating method thereof
CN115879543B (zh) 一种模型训练方法、装置、设备、介质及系统
Zhang et al. A parallel task scheduling algorithm based on fuzzy clustering in cloud computing environment
Cao et al. Sap-sgd: Accelerating distributed parallel training with high communication efficiency on heterogeneous clusters
WO2017113865A1 (zh) 一种大数据增量计算方法和装置
Yang et al. Parameter communication consistency model for large-scale security monitoring based on mobile computing
CN113342313B (zh) 一种基于参数服务器异步更新Spark MLlib中线性分类模型参数的方法
Fan et al. Model aggregation method for data parallelism in distributed real-time machine learning of smart sensing equipment
Ma et al. Cloud-based multidimensional parallel dynamic programming algorithm for a cascade hydropower system
KR20230024418A (ko) 빠른 분산 훈련을 위한 축소 서버
Xu et al. BDPGO: balanced distributed pose graph optimization framework for swarm robotics
Xu et al. Talos: A weighted speedup-aware device placement of deep learning models

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: 22946517

Country of ref document: EP

Kind code of ref document: A1