Large language model reasoning method and system
Патент · CN B
Полный текст
The present disclosure proposes a LLM reasoning method and system suitable for a computing cluster having multiple computing devices. The method comprises the steps of generating a topological graph according to communication connection relations of a plurality of computing devices, carrying out Hamiltonian decomposition on the topological graph to obtain a plurality of directional loops which are orthogonal to each other, wherein each computing device corresponds to one vertex in the topological graph, communication connection between every two computing devices meeting preset conditions corresponds to an edge in the topological graph, distributing query sequence segments and original KV cache blocks for each computing device, and in subsequent iteration, transmitting and receiving KV cache sub-blocks in the plurality of directional loops at the same time by each computing device. The method and the device convert single annular communication among a plurality of computing devices into a plurality of parallel annular communication by Hamiltonian decomposition, improve communication efficiency and network resource utilization rate among the computing devices, and realize load balance under causal marks through symmetric distribution of sequence segments.