CN111399905A - Computing method, device and related products - Google Patents

Computing method, device and related products Download PDF

Info

Publication number
CN111399905A
CN111399905A CN201910001855.9A CN201910001855A CN111399905A CN 111399905 A CN111399905 A CN 111399905A CN 201910001855 A CN201910001855 A CN 201910001855A CN 111399905 A CN111399905 A CN 111399905A
Authority
CN
China
Prior art keywords
vector
instruction
searched
checked
executed
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.)
Granted
Application number
CN201910001855.9A
Other languages
Chinese (zh)
Other versions
CN111399905B (en
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.)
Shanghai Cambricon Information Technology Co Ltd
Original Assignee
Shanghai Cambricon Information 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 Shanghai Cambricon Information Technology Co Ltd filed Critical Shanghai Cambricon Information Technology Co Ltd
Priority to CN201910001855.9A priority Critical patent/CN111399905B/en
Priority to PCT/CN2019/120893 priority patent/WO2020108471A1/en
Publication of CN111399905A publication Critical patent/CN111399905A/en
Application granted granted Critical
Publication of CN111399905B publication Critical patent/CN111399905B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/30007Arrangements for executing specific machine instructions to perform operations on data operands
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Advance Control (AREA)
  • Complex Calculations (AREA)

Abstract

The disclosure relates to an operation method, an operation device and a related product. The machine learning device comprises one or more instruction processing devices, is used for acquiring data to be operated and control information from other processing devices, executes specified machine learning operation and transmits the execution result to other processing devices through an I/O interface; when the machine learning arithmetic device includes a plurality of instruction processing devices, the plurality of instruction processing devices can be connected to each other by a specific configuration to transfer data. The command processing devices are interconnected through a Peripheral Component Interface Express (PCIE) bus and transmit data; the plurality of instruction processing devices share the same control system or own control system and share the memory or own memory; the interconnection mode of the plurality of instruction processing apparatuses is an arbitrary interconnection topology. The operation method, the operation device and the related products provided by the embodiment of the disclosure have the advantages of wide application range, high instruction processing efficiency and high instruction processing speed.

Description

运算方法、装置及相关产品Computing method, device and related products

技术领域technical field

本公开涉及计算机技术领域,尤其涉及一种向量查找指令处理方法、装置及相关产品。The present disclosure relates to the field of computer technology, and in particular, to a vector search instruction processing method, device and related products.

背景技术Background technique

随着科技的不断发展,机器学习,尤其是神经网络算法的使用越来越广泛。其在图像识别、语音识别、自然语言处理等领域中都得到了良好的应用。但由于神经网络算法的复杂度越来越高,所涉及的数据运算种类和数量不断增大。相关技术中,在对向量数据进行查找运算的效率低、速度慢。With the continuous development of science and technology, the use of machine learning, especially neural network algorithms, is becoming more and more extensive. It has been well used in image recognition, speech recognition, natural language processing and other fields. However, due to the increasing complexity of neural network algorithms, the types and quantities of data operations involved continue to increase. In the related art, the search operation on vector data has low efficiency and slow speed.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本公开提出了一种向量查找指令处理方法、装置及相关产品,以提高对向量进行查找运算的效率和速度。In view of this, the present disclosure proposes a vector search instruction processing method, device and related products, so as to improve the efficiency and speed of the vector search operation.

根据本公开的第一方面,提供了一种向量查找指令处理装置,所述装置包括:According to a first aspect of the present disclosure, there is provided a vector lookup instruction processing device, the device comprising:

控制模块,用于对接收到的向量查找指令进行解析,获得所述向量查找指令的操作码和操作域,并根据所述操作码和所述操作域确定执行所述向量查找指令所需的待查找向量、查找条件和目标地址;The control module is configured to parse the received vector search instruction, obtain the operation code and operation field of the vector search instruction, and determine the waiting period required to execute the vector search instruction according to the operation code and the operation field. lookup vector, lookup condition and target address;

运算模块,用于依次确定表示所述待查找向量的多个待查数是否满足所述查找条件,并将满足所述查找条件的待查数确定为目标数,将所述目标数的存储地址作为查找结果存入所述目标地址,an arithmetic module, configured to sequentially determine whether a plurality of to-be-checked numbers representing the to-be-searched vector satisfy the search condition, determine the to-be-checked number that satisfies the search condition as a target number, and determine the storage address of the target number into the target address as the search result,

其中,所述操作码用于指示所述向量查找指令对向量数据所进行的运算为查找运算,所述操作域包括所述待查找向量地址和所述目标地址。The operation code is used to indicate that the operation performed by the vector search instruction on the vector data is a search operation, and the operation field includes the address of the vector to be searched and the target address.

根据本公开的第二方面,提供了一种机器学习运算装置,所述装置包括:According to a second aspect of the present disclosure, there is provided a machine learning computing device, the device comprising:

一个或多个上述第一方面所述的向量查找指令处理装置,用于从其他处理装置中获取待运算数据和控制信息,并执行指定的机器学习运算,将执行结果通过I/O接口传递给其他处理装置;One or more vector search instruction processing devices described in the first aspect above are used to obtain data to be operated and control information from other processing devices, perform specified machine learning operations, and transmit the execution results to the I/O interface. other processing devices;

当所述机器学习运算装置包含多个所述向量查找指令处理装置时,所述多个所述向量查找指令处理装置间可以通过特定的结构进行连接并传输数据;When the machine learning computing device includes a plurality of the vector search instruction processing devices, the plurality of the vector search instruction processing devices can be connected through a specific structure and data can be transmitted;

其中,多个所述向量查找指令处理装置通过快速外部设备互连总线PCIE总线进行互联并传输数据,以支持更大规模的机器学习的运算;多个所述向量查找指令处理装置共享同一控制系统或拥有各自的控制系统;多个所述向量查找指令处理装置共享内存或者拥有各自的内存;多个所述向量查找指令处理装置的互联方式是任意互联拓扑。Wherein, a plurality of the vector search instruction processing devices are interconnected and transmit data through the fast peripheral device interconnection bus PCIE bus to support larger-scale machine learning operations; a plurality of the vector search instruction processing devices share the same control system Or have their own control systems; a plurality of the vector search instruction processing devices share memory or have their own memory; the interconnection mode of the multiple vector search instruction processing devices is any interconnection topology.

根据本公开的第三方面,提供了一种组合处理装置,所述装置包括:According to a third aspect of the present disclosure, there is provided a combined processing device, the device comprising:

上述第二方面所述的机器学习运算装置、通用互联接口和其他处理装置;The machine learning computing device, universal interconnection interface, and other processing devices described in the second aspect above;

所述机器学习运算装置与所述其他处理装置进行交互,共同完成用户指定的计算操作。The machine learning computing device interacts with the other processing devices to jointly complete the computing operation specified by the user.

根据本公开的第四方面,提供了一种机器学习芯片,所述机器学习芯片包括上述第二方面所述的机器学习络运算装置或上述第三方面所述的组合处理装置。According to a fourth aspect of the present disclosure, there is provided a machine learning chip, where the machine learning chip includes the machine learning network computing device described in the second aspect or the combined processing device described in the third aspect.

根据本公开的第五方面,提供了一种机器学习芯片封装结构,该机器学习芯片封装结构包括上述第四方面所述的机器学习芯片。According to a fifth aspect of the present disclosure, a machine learning chip packaging structure is provided, and the machine learning chip packaging structure includes the machine learning chip described in the fourth aspect.

根据本公开的第六方面,提供了一种板卡,该板卡包括上述第五方面所述的机器学习芯片封装结构。According to a sixth aspect of the present disclosure, there is provided a board card including the machine learning chip packaging structure described in the fifth aspect.

根据本公开的第七方面,提供了一种电子设备,所述电子设备包括上述第四方面所述的机器学习芯片或上述第六方面所述的板卡。According to a seventh aspect of the present disclosure, an electronic device is provided, and the electronic device includes the machine learning chip described in the fourth aspect or the board card described in the sixth aspect.

根据本公开的第八方面,提供了一种向量查找指令处理方法,所述方法应用于向量查找指令处理装置,所述方法包括:According to an eighth aspect of the present disclosure, there is provided a vector lookup instruction processing method, the method is applied to a vector lookup instruction processing apparatus, and the method includes:

对接收到的向量查找指令进行解析,获得所述向量查找指令的操作码和操作域,并根据所述操作码和所述操作域确定执行所述向量查找指令所需的待查找向量、查找条件和目标地址;Analyze the received vector search instruction, obtain the operation code and operation field of the vector search instruction, and determine the vector to be searched and search conditions required to execute the vector search instruction according to the operation code and the operation field and destination address;

依次确定表示所述待查找向量的多个待查数是否满足所述查找条件,并将满足所述查找条件的待查数确定为目标数,将所述目标数的存储地址作为查找结果存入所述目标地址,Determine in turn whether a plurality of to-be-checked numbers representing the to-be-searched vector satisfy the search condition, determine the to-be-checked number that satisfies the search condition as the target number, and store the storage address of the target number as the search result in the the target address,

其中,所述操作码用于指示所述向量查找指令对向量数据所进行的运算为查找运算,所述操作域包括所述待查找向量地址和所述目标地址。The operation code is used to indicate that the operation performed by the vector search instruction on the vector data is a search operation, and the operation field includes the address of the vector to be searched and the target address.

在一些实施例中,所述电子设备包括数据处理装置、机器人、电脑、打印机、扫描仪、平板电脑、智能终端、手机、行车记录仪、导航仪、传感器、摄像头、服务器、云端服务器、相机、摄像机、投影仪、手表、耳机、移动存储、可穿戴设备、交通工具、家用电器、和/或医疗设备。In some embodiments, the electronic device includes a data processing device, a robot, a computer, a printer, a scanner, a tablet computer, a smart terminal, a mobile phone, a driving recorder, a navigator, a sensor, a camera, a server, a cloud server, a camera, Cameras, projectors, watches, headphones, mobile storage, wearables, vehicles, home appliances, and/or medical equipment.

在一些实施例中,所述交通工具包括飞机、轮船和/或车辆;所述家用电器包括电视、空调、微波炉、冰箱、电饭煲、加湿器、洗衣机、电灯、燃气灶、油烟机;所述医疗设备包括核磁共振仪、B超仪和/或心电图仪。In some embodiments, the vehicles include airplanes, ships and/or vehicles; the household appliances include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, electric lights, gas stoves, and range hoods; the medical Equipment includes MRI machines, ultrasound machines and/or electrocardiographs.

本公开实施例所提供的向量查找指令处理方法、装置及相关产品,该装置包括控制模块和运算模块。控制模块用于对接收到的向量查找指令进行解析,获得向量查找指令的操作码和操作域,并根据操作码和操作域确定执行向量查找指令所需的待查找向量、查找条件和目标地址。运算模块用于依次确定表示待查找向量的多个待查数是否满足查找条件,并将满足查找条件的待查数确定为目标数,将目标数的存储地址作为查找结果存入目标地址。本公开实施例所提供的向量查找指令处理方法、装置及相关产品的适用范围广,对向量查找指令的处理效率高、处理速度快。The vector search instruction processing method, device, and related products provided by the embodiments of the present disclosure include a control module and an operation module. The control module is used to parse the received vector search instruction, obtain the operation code and operation domain of the vector search instruction, and determine the to-be-searched vector, search condition and target address required to execute the vector search instruction according to the opcode and operation domain. The operation module is used to sequentially determine whether a plurality of to-be-checked numbers representing the to-be-searched vector satisfy the search condition, determine the to-be-checked number satisfying the search condition as the target number, and store the storage address of the target number as the search result in the target address. The vector search instruction processing method, device and related products provided by the embodiments of the present disclosure have a wide range of applications, and have high processing efficiency and high processing speed for the vector search instruction.

根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.

附图说明Description of drawings

包含在说明书中并且构成说明书的一部分的附图与说明书一起示出了本公开的示例性实施例、特征和方面,并且用于解释本公开的原理。The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure, and together with the description, serve to explain the principles of the disclosure.

图1示出根据本公开一实施例的向量查找指令处理装置的框图。FIG. 1 shows a block diagram of a vector lookup instruction processing apparatus according to an embodiment of the present disclosure.

图2示出根据本公开一实施例的向量查找指令处理装置的框图。FIG. 2 shows a block diagram of a vector search instruction processing apparatus according to an embodiment of the present disclosure.

图3a-图3c示出根据本公开一实施例的向量查找指令处理装置的应用场景的示意图。3a-3c are schematic diagrams illustrating application scenarios of a vector search instruction processing apparatus according to an embodiment of the present disclosure.

图4a、图4b示出根据本公开一实施例的组合处理装置的框图。4a and 4b illustrate block diagrams of a combined processing apparatus according to an embodiment of the present disclosure.

图5示出根据本公开一实施例的板卡的结构示意图。FIG. 5 shows a schematic structural diagram of a board according to an embodiment of the present disclosure.

图6示出根据本公开一实施例的向量查找指令处理方法的流程图。FIG. 6 shows a flowchart of a method for processing a vector search instruction according to an embodiment of the present disclosure.

具体实施方式Detailed ways

以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures denote elements that have the same or similar functions. While various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.

在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.

另外,为了更好的说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following detailed description. It will be understood by those skilled in the art that the present disclosure may be practiced without certain specific details. In some instances, methods, means, components and circuits well known to those skilled in the art have not been described in detail so as not to obscure the subject matter of the present disclosure.

图1示出根据本公开一实施例的向量查找指令处理装置的框图。如图1所示,该装置包括控制模块11和运算模块12。FIG. 1 shows a block diagram of a vector lookup instruction processing apparatus according to an embodiment of the present disclosure. As shown in FIG. 1 , the device includes a control module 11 and an arithmetic module 12 .

控制模块11,用于对接收到的向量查找指令进行解析,获得向量查找指令的操作码和操作域,并根据操作码和操作域确定执行向量查找指令所需的待查找向量、查找条件和目标地址。其中,操作码用于指示向量查找指令对向量数据所进行的运算为查找运算,操作域包括待查找向量地址和目标地址。The control module 11 is used to parse the received vector search instruction, obtain the operation code and operation domain of the vector search instruction, and determine the vector to be searched, the search condition and the target required to execute the vector search instruction according to the operation code and the operation domain address. The operation code is used to indicate that the operation performed by the vector search instruction on the vector data is a search operation, and the operation domain includes the address of the vector to be searched and the target address.

运算模块12,用于依次确定表示待查找向量的多个待查数是否满足查找条件,并将满足查找条件的待查数确定为目标数,将目标数的存储地址作为查找结果存入目标地址。The arithmetic module 12 is used to sequentially determine whether a plurality of to-be-searched numbers representing the to-be-searched vector satisfy the search condition, determine the to-be-searched number that satisfies the search condition as the target number, and store the storage address of the target number as the search result in the target address .

在本实施例中,待查找向量可以是由多个待查数构成的。例如,待查找向量m的十进制表示为(5,6,4),则待查找向量m的多个待查数即为“5”、“6”和“4”。待查找向量还可以通过二进制、十六进制等的字符串表示。例如,待查找向量m的二进制表示为“101110100”,其中,“101”、“110”和“100”为待查找向量m的多个待查数,分别为该待查找向量m转换为十进制时所对应数5、6、4。控制模块可以从待查找向量地址中获取待查找向量。待查找向量地址可以是存储待查找向量的首地址等。控制模块可以通过数据输入输出单元获得向量查找指令、待查找向量,该数据输入输出单元可以为一个或多个数据I/O接口或I/O引脚。In this embodiment, the vector to be searched may be composed of multiple numbers to be searched. For example, the decimal representation of the to-be-searched vector m is (5, 6, 4), then the multiple to-be-searched numbers of the to-be-searched vector m are "5", "6" and "4". The vector to be searched can also be represented by a string in binary, hexadecimal, or the like. For example, the binary representation of the vector m to be searched is "101110100", where "101", "110" and "100" are multiple numbers to be searched for the vector m to be searched, respectively when the vector m to be searched is converted to decimal The corresponding numbers are 5, 6, and 4. The control module can obtain the vector to be searched from the address of the vector to be searched. The address of the vector to be searched may be the first address where the vector to be searched is stored, or the like. The control module can obtain the vector search instruction and the vector to be searched through the data input and output unit, and the data input and output unit can be one or more data I/O interfaces or I/O pins.

在本实施例中,操作码可以是计算机程序中所规定的要执行操作的那一部分指令或字段(通常用代码表示),是指令序列号,用来告知执行指令的装置具体需要执行哪一条指令。操作域可以是执行对应的指令所需的所有数据的来源,执行对应的指令所需的所有数据包括参数数据、待查找向量、对应的运算方法,或者存储参数数据、待查找向量、对应的运算方法的地址等等。对于一个向量查找指令其必须包括操作码和操作域,其中操作域至少包括待查找向量地址和目标地址。In this embodiment, the operation code may be the part of the instruction or field (usually represented by code) specified in the computer program to perform the operation, and the instruction sequence number, which is used to inform the device that executes the instruction which instruction needs to be executed. . The operation domain can be the source of all data required to execute the corresponding instruction. All data required to execute the corresponding instruction includes parameter data, the vector to be searched, the corresponding operation method, or the storage parameter data, the vector to be searched, the corresponding operation the address of the method, etc. For a vector search instruction, it must include an operation code and an operation field, wherein the operation field at least includes the address of the vector to be searched and the target address.

应当理解的是,本领域技术人员可以根据需要对向量查找指令的指令格式以及所包含的操作码和操作域进行设置,本公开对此不作限制。It should be understood that those skilled in the art can set the instruction format of the vector search instruction and the included operation codes and operation fields as required, which is not limited in the present disclosure.

在本实施例中,该装置可以包括一个或多个控制模块,以及一个或多个运算模块,可以根据实际需要对控制模块和运算模块的数量进行设置,本公开对此不作限制。In this embodiment, the device may include one or more control modules and one or more operation modules, and the number of control modules and operation modules may be set according to actual needs, which is not limited in the present disclosure.

本公开实施例所提供的向量查找指令处理装置,该装置包括控制模块和运算模块。控制模块用于对接收到的向量查找指令进行解析,获得向量查找指令的操作码和操作域,并根据操作码和操作域确定执行向量查找指令所需的待查找向量、查找条件和目标地址。运算模块用于依次确定表示待查找向量的多个待查数是否满足查找条件,并将满足查找条件的待查数确定为目标数,将目标数的存储地址作为查找结果存入目标地址。本公开实施例所提供的向量查找指令处理装置的适用范围广,对向量查找指令的处理效率高、处理速度快。The vector search instruction processing device provided by the embodiment of the present disclosure includes a control module and an operation module. The control module is used to parse the received vector search instruction, obtain the operation code and operation domain of the vector search instruction, and determine the to-be-searched vector, search condition and target address required to execute the vector search instruction according to the opcode and operation domain. The operation module is used to sequentially determine whether a plurality of to-be-checked numbers representing the to-be-searched vector satisfy the search condition, determine the to-be-checked number satisfying the search condition as the target number, and store the storage address of the target number as the search result in the target address. The vector search instruction processing device provided by the embodiment of the present disclosure has a wide range of applications, and has high processing efficiency and high processing speed for the vector search instruction.

在一种可能的实现方式中,满足查找条件的待查数可以包括以下至少一项:In a possible implementation manner, the number to be checked that satisfies the search condition may include at least one of the following:

数值是指定值的指定倍数、且排序为指定排序的待查数;The value is the specified multiple of the specified value, and the order is the number to be checked in the specified order;

数值处于指定数值区间的待查数;The number to be checked whose value is in the specified value range;

数值是指定值的指定倍数的待查数。Numeric is the number to look up in the specified multiple of the specified value.

其中,指定排序可以包括以下至少一种:待查数的排序为数值是指定值的指定倍数的待查数中的第n个,n为大于或等于1的正整数;待查数的排序为数值是指定值的指定倍数的待查数中的倒数第m个,m为大于或等于1的正整数。其中,m、n小于或等于待查找向量中待查数的数量。The specified ordering may include at least one of the following: the ordering of the numbers to be checked is the nth number of the numbers to be checked whose numerical value is a specified multiple of the specified value, where n is a positive integer greater than or equal to 1; the ordering of the numbers to be checked is The value is the m-th penultimate of the number to be checked that is a specified multiple of the specified value, where m is a positive integer greater than or equal to 1. Among them, m and n are less than or equal to the number of numbers to be searched in the vector to be searched.

在该实现方式中,可以通过对“待查数的排序为数值是指定值的指定倍数的待查数中的第n个”、“待查数的排序为数值是指定值的指定倍数的待查数中的倒数第m个”设置不同表达方式等,来区分倒数和正数的指定排序。可以设定指定排序中“待查数的排序为数值是指定值的指定倍数的待查数中的第n个”在向量查找指令中的表达方式为“0n”,设定指定排序中“待查数的排序为数值是指定值的指定倍数的待查数中的倒数第m个”在向量查找指令中的表达方式为“m0”。本领域技术人员可以根据实际需要对指定排序的表达方式进行设置,本公开对此不作限制。In this implementation, it is possible to sort the number to be checked as the nth number to be checked whose value is a specified multiple of the specified value, and the order of the number to be checked as the number to be checked whose value is a specified multiple of the specified value. The m-th from the bottom in the number lookup sets different expressions, etc., to distinguish the specified order of the reciprocal and positive numbers. In the specified sorting, the expression of "the number to be checked is the nth number to be searched whose value is a specified multiple of the specified value" can be set as "0n" in the vector search instruction, and the expression of "to be searched" in the specified sorting can be set. The order of the number to be searched is the last mth in the number to be searched whose value is a specified multiple of the specified value. The expression in the vector search instruction is "m0". Those skilled in the art can set the expression manner of the specified sorting according to actual needs, which is not limited in the present disclosure.

在一种可能的实现方式中,指定值可以是0、1、2、3等数值。指定倍数可以是1倍(也即数值与指定值相同)、2倍、3倍等倍数。In a possible implementation, the specified value may be a numerical value such as 0, 1, 2, and 3. The specified multiple can be 1 times (that is, the value is the same as the specified value), 2 times, 3 times and other multiples.

举例来说,向量查找指令所查找到的目标数可以是待查找向量的多个待查数中的第一个1、最后一个1、第一个2的3倍的待查数、最后一个2的3倍的待查数、小于5的待查数、大于9的待查数等。For example, the target number found by the vector search instruction may be the first 1, the last 1, the first 2 to be checked three times the number to be checked, and the last 2 of the multiple to-be-checked numbers of the vector to be searched. 3 times the number to be checked, the number to be checked less than 5, the number to be checked greater than 9, etc.

在一种可能的实现方式中,操作域还可以包括输入长度。控制模块11,还用于根据输入长度,从待查找向量地址中获取待查找向量。In a possible implementation, the operation field may also include the input length. The control module 11 is further configured to obtain the vector to be searched from the address of the vector to be searched according to the input length.

在该实现方式中,根据输入长度从待查找向量地址中获取待查找向量的长度需等于输入长度,或者需小于输入长度。In this implementation manner, the length of the vector to be searched obtained from the address of the vector to be searched according to the input length needs to be equal to the input length, or needs to be smaller than the input length.

在一种可能的实现方式中,在操作域中不包括输入长度时,可以根据预先设置的默认输入长度获取待查找向量。还可以获取待查找向量地址中全部数据作为待查找向量。In a possible implementation manner, when the input length is not included in the operation field, the vector to be searched may be obtained according to a preset default input length. All data in the address of the vector to be searched can also be obtained as the vector to be searched.

在一种可能的实现方式中,操作域还可以包括待查数宽度。运算模块12,还用于根据待查数宽度,从待查找向量中确定出多个待查数。In a possible implementation manner, the operation field may further include the width of the number to be checked. The operation module 12 is further configured to determine a plurality of numbers to be searched from the vector to be searched according to the width of the number to be searched.

在该实现方式中,待查数宽度可以表示待查找向量的字符串中,各个待查数所对应的宽度。在操作域中包括待查数宽度时,可以从表示待查找向量的字符串中确定出宽度为待查数宽度的多组字符串,每组字符串对应表示一个待查数。例如,若待查数宽度为3,待查找向量m(转换为十进制时表示为(5,6,4))为“101110100”,待查找向量m的多个待查数为“101”“110”和“100”,多个待查数“101”、“110”和“100”分别为该待查找向量m转换为十进制时所对应数5、6、4。若待查数宽度为1,待查找向量m的多个待查数为“1”、“0”、“1”、“1”、“1”、“0”、“1”、“0”和“0”,或者待查数宽度为2、4等不为3的宽度时,所获得的待查找向量m的多个待查数仅为由字符串组成的数、与待查找向量m转换为十进制时所对应数5、6、4并无任何关系。In this implementation manner, the width of the number to be searched may represent the width corresponding to each number to be searched in the character string of the vector to be searched. When the operation field includes the width of the number to be searched, a plurality of sets of character strings with the width of the number to be searched may be determined from the character string representing the vector to be searched, and each set of strings corresponds to a number to be searched. For example, if the width of the number to be searched is 3, the vector m to be searched (expressed as (5,6,4) when converted to decimal) is "101110100", and the multiple numbers to be searched of the vector m to be searched are "101" and "110" " and "100", the multiple numbers to be searched "101", "110" and "100" are the corresponding numbers 5, 6, and 4 when the vector m to be searched is converted to decimal. If the width of the number to be searched is 1, the multiple numbers to be searched of the vector m to be searched are "1", "0", "1", "1", "1", "0", "1", "0" and "0", or when the width of the number to be searched is 2, 4 and other widths other than 3, the obtained multiple to-be-searched numbers of the to-be-searched vector m are only numbers composed of strings and converted to the to-be-searched vector m The corresponding numbers 5, 6, and 4 in decimal have nothing to do with each other.

在一种可能的实现方式中,操作域还可以包括查找条件。控制模块11,还用于根据操作域,确定查找条件。In a possible implementation manner, the operation domain may further include search conditions. The control module 11 is further configured to determine the search condition according to the operation domain.

在该实现方式中,在操作域中包括查找条件时,可以直接获取操作域中的查找条件。In this implementation manner, when a search condition is included in the operation domain, the search condition in the operation domain can be directly obtained.

在一种可能的实现方式中,控制模块11,还用于根据操作码,确定查找条件。其中,操作码还用于指示向量查找指令的查找条件。In a possible implementation manner, the control module 11 is further configured to determine the search condition according to the operation code. Wherein, the opcode is also used to indicate the search condition of the vector search instruction.

在该实现方式中,可以设置不同的操作码来表示不同的查找条件。还可以根据操作码或者默认宽度确定待查数宽度。In this implementation, different operation codes can be set to represent different search conditions. The width of the number to be checked can also be determined according to the opcode or the default width.

举例来说,可以设置操作码“Find_vfirst”为找到待查找向量的多个待查数中的第一个1(待查数的宽度大于1,满足查找条件的待查数是:数值为指定值的一倍的待查数中的第1个待查数)。操作码“Find_vlast”为找到待查找向量的多个待查数中的最后一个1(待查数的宽度大于1,满足查找条件的待查数是:数值为指定值一倍的待查数中的倒数第1个待查数)。在操作码为“Find_vfirst”和“Find_vlast”可以进一步根据操作码确定待查数宽度,或者将默认宽度确定为待查数宽度,进而获取待查找向量的具有待查数宽度的多个待查数。For example, you can set the opcode "Find_vfirst" to be the first 1 in the multiple to-be-searched numbers of the vector to be searched (the width of the to-be-searched number is greater than 1, and the to-be-searched number that satisfies the search condition is: the value is the specified value The 1st number to be checked in the double of the number to be checked). The opcode "Find_vlast" is to find the last 1 of the multiple numbers to be searched for the vector to be searched (the width of the number to be searched is greater than 1, and the number to be searched that satisfies the search condition is: the number to be searched whose value is twice the specified value) the penultimate number to be checked). When the opcode is "Find_vfirst" and "Find_vlast", the width of the number to be searched can be further determined according to the opcode, or the default width can be determined as the width of the number to be searched, and then a plurality of numbers to be searched with the width of the number to be searched of the vector to be searched can be obtained. .

图2示出根据本公开一实施例的向量查找指令处理装置的框图。在一种可能的实现方式中,如图2所示,运算模块12可以包括至少一个比较器121,用于对多个待查数与查找条件进行比较,获得比较结果,以便于根据比较结果确定待查数是否满足查找条件。FIG. 2 shows a block diagram of a vector search instruction processing apparatus according to an embodiment of the present disclosure. In a possible implementation manner, as shown in FIG. 2 , the operation module 12 may include at least one comparator 121 for comparing multiple numbers to be checked with search conditions to obtain a comparison result, so as to facilitate determination according to the comparison result Whether the number to be checked satisfies the search conditions.

举例来说,向量查找指令所要查找的是:数值是1(也即数值是指定值1的一倍)的待查数中的第1个为例,比较器可以依次将待查找向量的多个待查数的数值与指定值“1”进行比较,进而可以确定待查数的数值与指定值“1”是否相等,并将数值等于指定值“1”、且排序为等于指定值“1”的待查数中的第1个待查数确定为目标数,将目标数的存储地址作为查找结果存入目标地址。可以根据所需进行比较的数据量的大小、对比较的处理速度、效率等要求对比较器的数量进行设置,本公开对此不作限制。For example, what the vector search instruction is looking for is: the first one of the number to be searched whose value is 1 (that is, the value is twice the specified value of 1). The value of the number to be checked is compared with the specified value "1", and then it can be determined whether the value of the number to be checked is equal to the specified value "1", and the value is equal to the specified value "1" and sorted to be equal to the specified value "1" The first number to be searched in the number to be searched is determined as the target number, and the storage address of the target number is stored in the target address as the search result. The number of comparators may be set according to the size of the amount of data to be compared, the processing speed and efficiency of the comparison, and other requirements, which are not limited in the present disclosure.

在一种可能的实现方式中,如图2所示,该装置还可以包括存储模块13。存储模块13用于存储待查找向量。In a possible implementation manner, as shown in FIG. 2 , the apparatus may further include a storage module 13 . The storage module 13 is used for storing the vector to be searched.

在该实现方式中,存储模块可以包括内存、缓存和寄存器中的一种或多种,缓存可以包括速暂存缓存。可以根据需要将待查找向量在存储模块中的内存、缓存和/或寄存器中,本公开对此不作限制。In this implementation, the storage module may include one or more of a memory, a cache, and a register, and the cache may include a temporary cache. The vector to be searched may be stored in the memory, cache and/or register in the storage module as required, which is not limited in the present disclosure.

在一种可能的实现方式中,该装置还可以包括直接内存访问模块,用于从存储模块中读取或者存储数据。In a possible implementation manner, the apparatus may further include a direct memory access module for reading or storing data from the storage module.

在一种可能的实现方式中,如图2所示,控制模块11可以包括指令存储子模块111、指令处理子模块112和队列存储子模块113。In a possible implementation manner, as shown in FIG. 2 , the control module 11 may include an instruction storage sub-module 111 , an instruction processing sub-module 112 and a queue storage sub-module 113 .

指令存储子模块111用于存储向量查找指令。The instruction storage sub-module 111 is used for storing vector search instructions.

指令处理子模块112用于对向量查找指令进行解析,得到向量查找指令的操作码和操作域。The instruction processing sub-module 112 is used to parse the vector search instruction to obtain the operation code and operation domain of the vector search instruction.

队列存储子模块113用于存储指令队列,指令队列包括按照执行顺序依次排列的多个待执行指令,多个待执行指令可以包括向量查找指令。多个待执行指令可以包括还可以包括与向量查找指令相关的其他计算指令。The queue storage sub-module 113 is used to store an instruction queue, and the instruction queue includes a plurality of instructions to be executed sequentially arranged in an execution order, and the multiple instructions to be executed may include a vector search instruction. The plurality of instructions to be executed may include other computational instructions that may also include vector lookup instructions.

在该实现方式中,可以根据待执行指令的接收时间、优先级别等对多个待执行指令的执行顺序进行排列获得指令队列,以便于根据指令队列依次执行多个待执行指令。In this implementation manner, the execution order of the plurality of to-be-executed commands can be arranged according to the receiving time and priority level of the to-be-executed commands to obtain the command queue, so as to execute the plurality of to-be-executed commands in sequence according to the command queue.

在一种可能的实现方式中,如图2所示,控制模块11还可以包括依赖关系处理子模块114。In a possible implementation manner, as shown in FIG. 2 , the control module 11 may further include a dependency relationship processing sub-module 114 .

依赖关系处理子模块114,用于在确定多个待执行指令中的第一待执行指令与第一待执行指令之前的第零待执行指令存在关联关系时,将第一待执行指令缓存在指令存储子模块112中,在第零待执行指令执行完毕后,从指令存储子模块112中提取第一待执行指令发送至运算模块12。其中,第一待执行指令和第零待执行指令是多个待执行指令中的指令。The dependency relationship processing sub-module 114 is configured to cache the first to-be-executed instruction in the In the storage sub-module 112 , after the execution of the zeroth to-be-executed instruction is completed, the first to-be-executed instruction is extracted from the instruction storage sub-module 112 and sent to the operation module 12 . Wherein, the first to-be-executed instruction and the zeroth to-be-executed instruction are instructions in a plurality of to-be-executed instructions.

其中,第一待执行指令与第一待执行指令之前的第零待执行指令存在关联关系包括:存储第一待执行指令所需数据的第一存储地址区间与存储第零待执行指令所需数据的第零存储地址区间具有重叠的区域。反之,第一待执行指令与第零待执行指令之间没有关联关系可以是第一存储地址区间与第零存储地址区间没有重叠区域。Wherein, the relationship between the first instruction to be executed and the zeroth instruction to be executed before the first instruction to be executed includes: a first storage address range for storing data required by the first instruction to be executed and data required for storing the zeroth instruction to be executed The zeroth memory address range of has overlapping regions. Conversely, if there is no association between the first instruction to be executed and the zeroth instruction to be executed, it may be that the first storage address interval and the zeroth storage address interval have no overlapping area.

通过这种方式,可以根据待执行指令之间的依赖关系,使得在先的待执行令执行完毕之后,再执行在后的待执行指令,保证运算结果的准确性。In this way, according to the dependencies between the instructions to be executed, after the execution of the previous instruction to be executed is completed, the subsequent instruction to be executed is executed to ensure the accuracy of the operation result.

在一种可能的实现方式中,向量查找指令的指令格式可以如下表1所示,可以对操作码和操作码的位置进行设置。并在表2中给出了常规的向量查找指令(Find),利用该常规向量查找指令可以查找待查找向量中的任意数;以及在表2中给出了向量查找指令的示例,并定义了两个特殊类型的向量查找指令(Find_vfirst、Find_vlast)所需包括的操作码和操作域。利用特殊类型的向量查找指令对待查找向量进行查找,可以简化指令处理过程、节省查找的时间。In a possible implementation manner, the instruction format of the vector search instruction may be as shown in Table 1 below, and the operation code and the position of the operation code may be set. And in Table 2, the conventional vector lookup instruction (Find) is given, and the conventional vector lookup instruction can be used to find any number in the vector to be looked up; And in Table 2, the example of the vector lookup instruction is given, and defines Two special types of vector search instructions (Find_vfirst, Find_vlast) need to include opcodes and operation fields. Using a special type of vector search instruction to search the vector to be searched can simplify the instruction processing process and save the search time.

表1指令格式Table 1 Instruction format

Figure BDA0001934008950000101
Figure BDA0001934008950000101

其中,在查找条件中仅包含指定数值区间时,满足查找条件的待查数是指:数值是指定值的指定倍数的待查数。Wherein, when the search condition only includes the specified numerical range, the number to be searched that satisfies the search condition refers to the number to be searched whose numerical value is a specified multiple of the specified value.

在查找条件中包含指定值和指定排序时,满足查找条件的待查数是指:数值等于指定值、且排序为指定排序的待查数。When the search condition includes the specified value and the specified sort, the number to be searched that satisfies the search condition refers to the number to be searched that the numerical value is equal to the specified value and the sorting is the specified sort.

在查找条件中包含指定值和指定倍数时,满足查找条件的待查数是指:数值是指定值的指定倍数的待查数。When the search condition includes the specified value and the specified multiple, the number to be searched that satisfies the search condition refers to the number to be searched whose value is the specified multiple of the specified value.

在查找条件包括指定值、指定倍数和指定排序时,满足查找条件的待查数是指:数值是指定值的指定倍数、且排序为指定排序的待查数。When the search condition includes the specified value, the specified multiple, and the specified order, the number to be searched that satisfies the search condition refers to the number to be searched that the numerical value is the specified multiple of the specified value and the order is the specified order.

表2向量查找指令示例Table 2 Examples of vector lookup instructions

Figure BDA0001934008950000102
Figure BDA0001934008950000102

其中,操作码为“Find_vfirst”的向量查找指令,其所查找的满足查找条件的待查数是:数值是指定值1的一倍(也即数值与指定值1相等)、且排序为数值是指定值1的一倍的待查数中的第1个。待查数宽度大于1。Among them, for the vector search instruction whose opcode is "Find_vfirst", the number to be searched that satisfies the search condition is: the numerical value is twice the specified value 1 (that is, the numerical value is equal to the specified value 1), and the sorted numerical value is Specifies the 1st of the number to be checked that is double the value of 1. The width of the number to be checked is greater than 1.

操作码为“Find_vlast”的向量查找指令,其所查找的满足查找条件的待查数是:数值是指定值1的一倍(也即数值与指定值1相等)且排序为数值是指定值1的一倍的待查数中的倒数第1个。待查数宽度大于1。For the vector search instruction whose opcode is "Find_vlast", the number to be searched that satisfies the search condition is: the value is twice the specified value 1 (that is, the value is equal to the specified value 1), and the sorted value is the specified value 1 The penultimate one of the double of the number to be checked. The width of the number to be checked is greater than 1.

应当理解的是,本领域技术人员可以根据需要对向量查找指令的操作码、指令格式中操作码以及操作域的位置进行设置,本公开对此不作限制。It should be understood that those skilled in the art can set the operation code of the vector search instruction, the operation code in the instruction format, and the position of the operation field, which is not limited in the present disclosure.

在一种可能的实现方式中,该装置可以设置于图形处理器(Graphics ProcessingUnit,简称GPU)、中央处理器(Central Processing Unit,简称CPU)和嵌入式神经网络处理器(Neural-network Processing Unit,简称NPU)的一种或多种之中。In a possible implementation manner, the apparatus may be provided in a graphics processing unit (Graphics Processing Unit, GPU for short), a central processing unit (Central Processing Unit, CPU for short), and an embedded neural-network processing unit (Neural-network Processing Unit, abbreviated as NPU) among one or more of them.

需要说明的是,尽管以上述实施例作为示例介绍了向量查找指令处理装置如上,但本领域技术人员能够理解,本公开应不限于此。事实上,用户完全可根据个人喜好和/或实际应用场景灵活设定各模块,只要符合本公开的技术方案即可。It should be noted that although the above embodiments are used as examples to describe the vector search instruction processing apparatus as above, those skilled in the art can understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set each module according to personal preferences and/or actual application scenarios, as long as it conforms to the technical solutions of the present disclosure.

应用示例Application example

以下结合“利用向量查找指令处理装置对待查找向量进行查找”作为一个示例性应用场景,给出根据本公开实施例的应用示例,以便于理解向量查找指令处理装置的流程。本领域技术人员应理解,以下应用示例仅仅是出于便于理解本公开实施例的目的,不应视为对本公开实施例的限制。In the following, an application example according to an embodiment of the present disclosure is given in conjunction with "using a vector search instruction processing apparatus to search for a vector to be searched" as an exemplary application scenario, so as to facilitate understanding of the flow of the vector search instruction processing apparatus. Those skilled in the art should understand that the following application examples are only for the purpose of facilitating the understanding of the embodiments of the present disclosure, and should not be regarded as limitations of the embodiments of the present disclosure.

图3a-图3c示出根据本公开一实施例的向量查找指令处理装置的应用场景的示意图。如图3a-图3c所示,向量查找指令处理装置对向量查找指令进行处理的过程如下。3a-3c are schematic diagrams illustrating application scenarios of a vector search instruction processing apparatus according to an embodiment of the present disclosure. As shown in Fig. 3a-Fig. 3c, the process of processing the vector search instruction by the vector search instruction processing device is as follows.

首先,假定待查找向量a为“0101 1011 0001 0101 1100 0001 1001”。并且,每四个二进制数表示待查找向量a在十进制中的一个数,也即在十进制中待查找向量a为(5,11,1,5,12,1,9)。为便于区分不同向量查找指令假定在不同的向量查找指令中待查找向量a的存储地址不同。First, assume that the vector a to be searched is "0101 1011 0001 0101 1100 0001 1001". Moreover, every four binary numbers represent a number of the vector a to be searched in decimal, that is, the vector a to be searched is (5, 11, 1, 5, 12, 1, 9) in decimal. For the convenience of distinguishing different vector search instructions, it is assumed that the storage addresses of the vector a to be searched are different in different vector search instructions.

装置所需处理的向量查找指令包括:The vector lookup instructions that the device needs to process include:

向量查找指令1:@Find#100#28#200#4#1#01Vector Find Instruction 1: @Find#100#28#200#4#1#01

向量查找指令2:@Find_vfirst#101#28#201#4Vector Find Instruction 2: @Find_vfirst#101#28#201#4

向量查找指令3:@Find_vlast#102#28#202#4Vector Find Instruction 3: @Find_vlast#102#28#202#4

示例1Example 1

如图3a所示,控制模块11在接收到向量查找指令1时,对向量查找指令1进行解析,获得向量查找指令1的操作码为Find,以及根据操作域确定向量查找指令1的、待查找向量地址为“100”、输入长度为“28”、目标地址为“200”、指定排序为“待查数的排序为等于指定值(由于向量查找指令1中指定倍数位置为空,默认指定倍数为一倍)的待查数中的第1个”、指定值为“1”、待查数宽度为“4”。进而控制模块11从待查找向量地址200中获取输入长度为28的上述待查找向量a“0101 1011 0001 0101 1100 0001 1001”。As shown in FIG. 3a, when receiving the vector search instruction 1, the control module 11 parses the vector search instruction 1, obtains the operation code of the vector search instruction 1 as Find, and determines the vector search instruction 1 according to the operation domain, to be searched The vector address is "100", the input length is "28", the target address is "200", and the specified sorting is "The sorting of the number to be searched is equal to the specified value (because the specified multiple position in vector search instruction 1 is empty, the multiple is specified by default. It is the first one in the number to be checked which is doubled)", the specified value is "1", and the width of the number to be checked is "4". Further, the control module 11 obtains the above-mentioned vector a "0101 1011 0001 0101 1100 0001 1001" with an input length of 28 from the address 200 of the vector to be searched.

运算模块12根据待查数宽度为“4”,从待查找向量a中依次得到多个待查数,并依次确定多个待查数的数值是否等于指定值“1”,并将数值等于指定值“1”、且排序为等于指定值“1”的待查数中的第1个的待查数确定为目标数,将目标数的存储地址作为查找结果存入目标地址200中。The arithmetic module 12 obtains a plurality of to-be-checked numbers in turn from the to-be-searched vector a according to the width of the number to be checked as "4", and sequentially determines whether the values of the multiple to-be-checked numbers are equal to the specified value "1", and sets the numerical value equal to the specified value "1". The number to be searched which has a value of "1" and is sorted to be equal to the specified value of "1" is determined as the target number, and the storage address of the target number is stored in the target address 200 as the search result.

在该示例中,运算模块12首先从待查找向量a中获得宽度为4的第一个待查数“0101”,并判断待查数“0101”的数值是否等于指定值“1”。由于待查数“0101”的数值不为1,运算模块12继续从待查找向量a中获取下一个待查数“1011”,并判断待查数“1011”的数值是否等于指定值“1”。由于待查数“1011”的数值不为1,运算模块12继续从待查找向量a中获取下一个待查数“0001”,并判断待查数“0001”的数值是否等于指定值“1”。由于待查数“0001”的数值等于1、且其排序为指定排序(即待查数的排序为等于指定值的待查数中的第1个),则将待查数“0001”确定为目标数,将待查数“0001”的存储地址500作为查找结果存入目标地址200中。In this example, the operation module 12 first obtains the first to-be-checked number "0101" with a width of 4 from the to-be-searched vector a, and determines whether the value of the to-be-checked number "0101" is equal to the specified value "1". Since the value of the number to be searched "0101" is not 1, the operation module 12 continues to obtain the next number to be searched "1011" from the vector a to be searched, and determines whether the value of the number to be searched "1011" is equal to the specified value "1" . Since the value of the to-be-checked number "1011" is not 1, the operation module 12 continues to obtain the next to-be-checked number "0001" from the to-be-searched vector a, and determines whether the value of the to-be-checked number "0001" is equal to the specified value "1" . Since the value of the number to be checked "0001" is equal to 1, and its order is the specified order (that is, the order of the number to be checked is the first of the number to be checked equal to the specified value), the number to be checked "0001" is determined as For the target number, the storage address 500 of the number to be checked "0001" is stored in the target address 200 as the search result.

示例2Example 2

如图3b所示,控制模块11在接收到向量查找指令2时,对向量查找指令2进行解析,获得向量查找指令2的操作码为Find_vfirst,以及根据操作域确定向量查找指令2的待查找向量地址为“101”、输入长度为“28”、目标地址为“201”、待查数宽度为“4”。并且,根据操作码Find_vfirst确定向量查找指令2的指定值为“1”、指定排序为“待查数的排序为等于指定值的待查数中的第1个”。进而控制模块11从待查找向量地址201中获取输入长度为28的上述待查找向量a“0101 1011 0001 0101 1100 0001 1001”。As shown in Figure 3b, when receiving the vector search instruction 2, the control module 11 parses the vector search instruction 2, obtains the operation code of the vector search instruction 2 as Find_vfirst, and determines the vector to be searched for the vector search instruction 2 according to the operation domain The address is "101", the input length is "28", the destination address is "201", and the width of the number to be checked is "4". And, according to the opcode Find_vfirst, it is determined that the specified value of the vector search instruction 2 is "1", and the specified order is "the order of the number to be searched is the first of the number to be searched equal to the specified value". Further, the control module 11 obtains the above-mentioned vector a "0101 1011 0001 0101 1100 0001 1001" whose input length is 28 from the address 201 of the vector to be searched.

运算模块12根据待查数宽度为“4”,从待查找向量a中依次得到多个待查数,并依次确定多个待查数的数值是否等于指定值“1”,并将数值等于指定值“1”、且排序为等于指定值“1”的待查数中的第1个的待查数确定为目标数,将目标数的存储地址作为查找结果存入目标地址201中。The arithmetic module 12 obtains a plurality of to-be-checked numbers in turn from the to-be-searched vector a according to the width of the number to be checked as "4", and sequentially determines whether the values of the multiple to-be-checked numbers are equal to the specified value "1", and sets the numerical value equal to the specified value "1". The number to be searched that has a value of "1" and is sorted to be equal to the first one of the numbers to be searched with the specified value of "1" is determined as the target number, and the storage address of the target number is stored in the target address 201 as the search result.

在该示例中,运算模块12首先从待查找向量a中获得宽度为4的第一个待查数“0101”,并判断待查数“0101”的数值是否等于指定值“1”。由于待查数“0101”的数值不为1,运算模块12继续从待查找向量a中获取下一个待查数“1011”,并判断待查数“1011”的数值是否等于指定值“1”。由于待查数“1011”的数值不为1,运算模块12继续从待查找向量a中获取下一个待查数“0001”,并判断待查数“0001”的数值是否等于指定值“1”。由于待查数“0001”的数值等于1、且其排序为指定排序(即待查数的排序为等于指定值的待查数中的第1个),则将待查数“0001”确定为目标数,将待查数“0001”的存储地址501作为查找结果存入目标地址201中。In this example, the operation module 12 first obtains the first to-be-checked number "0101" with a width of 4 from the to-be-searched vector a, and determines whether the value of the to-be-checked number "0101" is equal to the specified value "1". Since the value of the number to be searched "0101" is not 1, the operation module 12 continues to obtain the next number to be searched "1011" from the vector a to be searched, and determines whether the value of the number to be searched "1011" is equal to the specified value "1" . Since the value of the to-be-checked number "1011" is not 1, the operation module 12 continues to obtain the next to-be-checked number "0001" from the to-be-searched vector a, and determines whether the value of the to-be-checked number "0001" is equal to the specified value "1" . Since the value of the number to be checked "0001" is equal to 1, and its order is the specified order (that is, the order of the number to be checked is the first of the number to be checked equal to the specified value), the number to be checked "0001" is determined as For the target number, the storage address 501 of the number to be checked "0001" is stored in the target address 201 as the search result.

示例3Example 3

如图3c所示,控制模块11在接收到向量查找指令3时,对向量查找指令3进行解析,获得向量查找指令3的操作码为Find_vlast,以及根据操作域确定向量查找指令3的待查找向量地址为“102”、输入长度为“28”、目标地址为“202”、待查数宽度为“4”。并且,根据操作码Find_vlast确定向量查找指令3的指定值为“1”、指定排序为“待查数的排序为等于指定值的待查数中的倒数第1个”。进而控制模块11从待查找向量地址202中获取输入长度为28的上述待查找向量a“0101 1011 0001 0101 1100 0001 1001”。As shown in Figure 3c, when the control module 11 receives the vector search instruction 3, it parses the vector search instruction 3, obtains the operation code of the vector search instruction 3 as Find_vlast, and determines the vector to be searched for the vector search instruction 3 according to the operation domain. The address is "102", the input length is "28", the destination address is "202", and the width of the number to be checked is "4". And, according to the opcode Find_vlast, it is determined that the specified value of the vector search instruction 3 is "1", and the specified order is "the order of the number to be searched is the last one in the number to be searched equal to the specified value". Further, the control module 11 obtains the above-mentioned vector a "0101 1011 0001 0101 1100 0001 1001" whose input length is 28 from the address 202 of the vector to be searched.

运算模块12根据待查数宽度为“4”,从待查找向量a中依次得到多个待查数,并依次确定多个待查数的数值是否等于指定值“1”,并将数值等于指定值“1”、且排序为等于指定值“1”的待查数中的倒数第1个的待查数确定为目标数,将目标数的存储地址作为查找结果存入目标地址202中。The arithmetic module 12 obtains a plurality of to-be-checked numbers in turn from the to-be-searched vector a according to the width of the number to be checked as "4", and sequentially determines whether the values of the multiple to-be-checked numbers are equal to the specified value "1", and sets the numerical value equal to the specified value "1". The number to be searched that has a value of "1" and is sorted to be equal to the specified value of "1" is determined as the target number, and the storage address of the target number is stored in the target address 202 as the search result.

在该示例中,运算模块12首先从待查找向量a中获得宽度为4的倒数第一个待查数“1001”,并判断待查数“1001”的数值是否等于指定值“1”。由于待查数“1001”的数值不为1,运算模块12继续从待查找向量a中获取下一个待查数“0001”,并判断待查数“0001”的数值是否等于指定值“1”。由于待查数“0001”的数值等于1、且其排序为指定排序(即待查数的排序为等于指定值的待查数中的倒数第1个),则将待查数“0001”确定为目标数,将待查数“0001”的存储地址502作为查找结果存入目标地址202中。In this example, the operation module 12 first obtains the penultimate number "1001" with a width of 4 from the vector a to be searched, and determines whether the value of the number "1001" to be searched is equal to the specified value "1". Since the value of the to-be-checked number "1001" is not 1, the operation module 12 continues to obtain the next to-be-checked number "0001" from the to-be-searched vector a, and judges whether the value of the to-be-checked number "0001" is equal to the specified value "1" . Since the value of the number to be checked "0001" is equal to 1, and its order is the specified order (that is, the order of the number to be checked is the last one in the number to be checked equal to the specified value), the number to be checked "0001" is determined. As the target number, the storage address 502 of the number to be searched "0001" is stored in the target address 202 as the search result.

这样,向量查找指令处理装置可以快速、高效地向量查找指令进行处理。In this way, the vector search instruction processing apparatus can process the vector search instructions quickly and efficiently.

本公开提供一种机器学习运算装置,该机器学习运算装置可以包括一个或多个上述向量查找指令处理装置,用于从其他处理装置中获取待运算数据和控制信息,执行指定的机器学习运算。该机器学习运算装置可以从其他机器学习运算装置或非机器学习运算装置中获得向量查找指令,并将执行结果通过I/O接口传递给外围设备(也可称其他处理装置)。外围设备譬如摄像头,显示器,鼠标,键盘,网卡,wifi接口,服务器。当包含一个以上向量查找指令处理装置时,向量查找指令处理装置间可以通过特定的结构进行链接并传输数据,譬如,通过PCIE总线进行互联并传输数据,以支持更大规模的神经网络的运算。此时,可以共享同一控制系统,也可以有各自独立的控制系统;可以共享内存,也可以每个加速器有各自的内存。此外,其互联方式可以是任意互联拓扑。The present disclosure provides a machine learning computing device, the machine learning computing device may include one or more of the above vector search instruction processing devices, used to obtain data to be operated and control information from other processing devices, and perform specified machine learning operations. The machine learning computing device can obtain vector search instructions from other machine learning computing devices or non-machine learning computing devices, and transmit the execution results to peripheral devices (also called other processing devices) through the I/O interface. Peripherals such as camera, monitor, mouse, keyboard, network card, wifi interface, server. When more than one vector search instruction processing device is included, the vector search instruction processing devices can be linked and transmitted through a specific structure, for example, interconnected and transmitted through the PCIE bus to support larger-scale neural network operations. At this time, the same control system can be shared, or there can be independent control systems; memory can be shared, or each accelerator can have its own memory. In addition, the interconnection method can be any interconnection topology.

该机器学习运算装置具有较高的兼容性,可通过PCIE接口与各种类型的服务器相连接。The machine learning computing device has high compatibility and can be connected with various types of servers through the PCIE interface.

图4a示出根据本公开一实施例的组合处理装置的框图。如图4a所示,该组合处理装置包括上述机器学习运算装置、通用互联接口和其他处理装置。机器学习运算装置与其他处理装置进行交互,共同完成用户指定的操作。FIG. 4a shows a block diagram of a combined processing apparatus according to an embodiment of the present disclosure. As shown in Fig. 4a, the combined processing device includes the above-mentioned machine learning computing device, a general interconnection interface and other processing devices. The machine learning computing device interacts with other processing devices to jointly complete the operation specified by the user.

其他处理装置,包括中央处理器CPU、图形处理器GPU、神经网络处理器等通用/专用处理器中的一种或以上的处理器类型。其他处理装置所包括的处理器数量不做限制。其他处理装置作为机器学习运算装置与外部数据和控制的接口,包括数据搬运,完成对本机器学习运算装置的开启、停止等基本控制;其他处理装置也可以和机器学习运算装置协作共同完成运算任务。Other processing devices include one or more processor types among general-purpose/special-purpose processors such as a central processing unit (CPU), a graphics processing unit (GPU), and a neural network processor. The number of processors included in other processing devices is not limited. Other processing devices serve as the interface between the machine learning computing device and external data and control, including data handling, to complete basic controls such as starting and stopping the machine learning computing device; other processing devices can also cooperate with the machine learning computing device to complete computing tasks.

通用互联接口,用于在机器学习运算装置与其他处理装置间传输数据和控制指令。该机器学习运算装置从其他处理装置中获取所需的输入数据,写入机器学习运算装置片上的存储装置;可以从其他处理装置中获取控制指令,写入机器学习运算装置片上的控制缓存;也可以读取机器学习运算装置的存储模块中的数据并传输给其他处理装置。A universal interconnect interface for transferring data and control instructions between machine learning computing devices and other processing devices. The machine learning computing device obtains the required input data from other processing devices, and writes it into the storage device on the machine learning computing device chip; it can obtain control instructions from other processing devices and write it into the control cache on the machine learning computing device chip; The data in the storage module of the machine learning computing device can be read and transmitted to other processing devices.

图4b示出根据本公开一实施例的组合处理装置的框图。在一种可能的实现方式中,如图4b所示,该组合处理装置还可以包括存储装置,存储装置分别与机器学习运算装置和其他处理装置连接。存储装置用于保存在机器学习运算装置和其他处理装置的数据,尤其适用于所需要运算的数据在本机器学习运算装置或其他处理装置的内部存储中无法全部保存的数据。FIG. 4b shows a block diagram of a combined processing apparatus according to an embodiment of the present disclosure. In a possible implementation manner, as shown in FIG. 4b, the combined processing device may further include a storage device, and the storage device is respectively connected to the machine learning computing device and other processing devices. The storage device is used to save data in the machine learning computing device and other processing devices, and is especially suitable for data that cannot be fully stored in the internal storage of the machine learning computing device or other processing devices.

该组合处理装置可以作为手机、机器人、无人机、视频监控设备等设备的SOC片上系统,有效降低控制部分的核心面积,提高处理速度,降低整体功耗。此情况时,该组合处理装置的通用互联接口与设备的某些部件相连接。某些部件譬如摄像头,显示器,鼠标,键盘,网卡,wifi接口。The combined processing device can be used as an SOC system for mobile phones, robots, drones, video surveillance equipment and other equipment, effectively reducing the core area of the control part, improving the processing speed and reducing the overall power consumption. In this case, the general interconnection interface of the combined processing device is connected to certain components of the apparatus. Some components such as camera, monitor, mouse, keyboard, network card, wifi interface.

本公开提供一种机器学习芯片,该芯片包括上述机器学习运算装置或组合处理装置。The present disclosure provides a machine learning chip, which includes the above-mentioned machine learning computing device or combined processing device.

本公开提供一种机器学习芯片封装结构,该机器学习芯片封装结构包括上述机器学习芯片。The present disclosure provides a machine learning chip packaging structure, and the machine learning chip packaging structure includes the above-mentioned machine learning chip.

本公开提供一种板卡,图5示出根据本公开一实施例的板卡的结构示意图。如图5所示,该板卡包括上述机器学习芯片封装结构或者上述机器学习芯片。板卡除了包括机器学习芯片389以外,还可以包括其他的配套部件,该配套部件包括但不限于:存储器件390、接口装置391和控制器件392。The present disclosure provides a board, and FIG. 5 shows a schematic structural diagram of the board according to an embodiment of the present disclosure. As shown in FIG. 5 , the board includes the above-mentioned machine learning chip packaging structure or the above-mentioned machine learning chip. In addition to the machine learning chip 389 , the board may also include other supporting components, including but not limited to: a storage device 390 , an interface device 391 and a control device 392 .

存储器件390与机器学习芯片389(或者机器学习芯片封装结构内的机器学习芯片)通过总线连接,用于存储数据。存储器件390可以包括多组存储单元393。每一组存储单元393与机器学习芯片389通过总线连接。可以理解,每一组存储单元393可以是DDR SDRAM(英文:Double Data Rate SDRAM,双倍速率同步动态随机存储器)。The storage device 390 is connected to the machine learning chip 389 (or the machine learning chip in the machine learning chip package structure) through a bus for storing data. The memory device 390 may include groups of memory cells 393 . Each group of storage units 393 is connected to the machine learning chip 389 through a bus. It can be understood that each group of storage units 393 may be DDR SDRAM (English: Double Data Rate SDRAM, double-rate synchronous dynamic random access memory).

DDR不需要提高时钟频率就能加倍提高SDRAM的速度。DDR允许在时钟脉冲的上升沿和下降沿读出数据。DDR的速度是标准SDRAM的两倍。DDR does not need to increase the clock frequency to double the speed of SDRAM. DDR allows data to be read out on both the rising and falling edges of the clock pulse. DDR is twice as fast as standard SDRAM.

在一个实施例中,存储器件390可以包括4组存储单元393。每一组存储单元393可以包括多个DDR4颗粒(芯片)。在一个实施例中,机器学习芯片389内部可以包括4个72位DDR4控制器,上述72位DDR4控制器中64bit用于传输数据,8bit用于ECC校验。可以理解,当每一组存储单元393中采用DDR4-3200颗粒时,数据传输的理论带宽可达到25600MB/s。In one embodiment, the memory device 390 may include four sets of memory cells 393 . Each set of memory cells 393 may include a plurality of DDR4 particles (chips). In one embodiment, the machine learning chip 389 may include four 72-bit DDR4 controllers inside, where 64 bits of the 72-bit DDR4 controllers are used for data transmission and 8 bits are used for ECC verification. It can be understood that when DDR4-3200 particles are used in each group of storage units 393, the theoretical bandwidth of data transmission can reach 25600MB/s.

在一个实施例中,每一组存储单元393包括多个并联设置的双倍速率同步动态随机存储器。DDR在一个时钟周期内可以传输两次数据。在机器学习芯片389中设置控制DDR的控制器,用于对每个存储单元393的数据传输与数据存储的控制。In one embodiment, each set of memory cells 393 includes a plurality of double-rate synchronous dynamic random access memories arranged in parallel. DDR can transfer data twice in one clock cycle. A controller for controlling the DDR is provided in the machine learning chip 389 for controlling data transmission and data storage of each storage unit 393 .

接口装置391与机器学习芯片389(或者机器学习芯片封装结构内的机器学习芯片)电连接。接口装置391用于实现机器学习芯片389与外部设备(例如服务器或计算机)之间的数据传输。例如在一个实施例中,接口装置391可以为标准PCIE接口。比如,待处理的数据由服务器通过标准PCIE接口传递至机器学习芯片289,实现数据转移。优选的,当采用PCIE 3.0X 16接口传输时,理论带宽可达到16000MB/s。在另一个实施例中,接口装置391还可以是其他的接口,本公开并不限制上述其他的接口的具体表现形式,接口装置能够实现转接功能即可。另外,机器学习芯片的计算结果仍由接口装置传送回外部设备(例如服务器)。The interface device 391 is electrically connected to the machine learning chip 389 (or the machine learning chip within the machine learning chip package structure). The interface device 391 is used to realize data transmission between the machine learning chip 389 and an external device (such as a server or a computer). For example, in one embodiment, the interface device 391 may be a standard PCIE interface. For example, the data to be processed is transmitted by the server to the machine learning chip 289 through a standard PCIE interface to realize data transfer. Preferably, when the PCIE 3.0X 16 interface is used for transmission, the theoretical bandwidth can reach 16000MB/s. In another embodiment, the interface device 391 may also be other interfaces, and the present disclosure does not limit the specific expression forms of the other interfaces, as long as the interface device can realize the switching function. In addition, the calculation result of the machine learning chip is still transmitted back to the external device (such as a server) by the interface device.

控制器件392与机器学习芯片389电连接。控制器件392用于对机器学习芯片389的状态进行监控。具体的,机器学习芯片389与控制器件392可以通过SPI接口电连接。控制器件392可以包括单片机(Micro Controller Unit,MCU)。如机器学习芯片389可以包括多个处理芯片、多个处理核或多个处理电路,可以带动多个负载。因此,机器学习芯片389可以处于多负载和轻负载等不同的工作状态。通过控制器件可以实现对机器学习芯片中多个处理芯片、多个处理和/或多个处理电路的工作状态的调控。The control device 392 is electrically connected to the machine learning chip 389 . The control device 392 is used to monitor the state of the machine learning chip 389 . Specifically, the machine learning chip 389 and the control device 392 may be electrically connected through an SPI interface. The control device 392 may include a Micro Controller Unit (MCU). For example, the machine learning chip 389 may include multiple processing chips, multiple processing cores or multiple processing circuits, and may drive multiple loads. Therefore, the machine learning chip 389 can be in different working states such as multi-load and light-load. The control device can realize the regulation of the working states of multiple processing chips, multiple processing and/or multiple processing circuits in the machine learning chip.

本公开提供一种电子设备,该电子设备包括上述机器学习芯片或板卡。The present disclosure provides an electronic device including the above-mentioned machine learning chip or board.

电子设备可以包括数据处理装置、机器人、电脑、打印机、扫描仪、平板电脑、智能终端、手机、行车记录仪、导航仪、传感器、摄像头、服务器、云端服务器、相机、摄像机、投影仪、手表、耳机、移动存储、可穿戴设备、交通工具、家用电器、和/或医疗设备。Electronic equipment may include data processing devices, robots, computers, printers, scanners, tablet computers, smart terminals, mobile phones, driving recorders, navigators, sensors, cameras, servers, cloud servers, cameras, video cameras, projectors, watches, Headphones, mobile storage, wearables, vehicles, home appliances, and/or medical equipment.

交通工具可以包括飞机、轮船和/或车辆。家用电器可以包括电视、空调、微波炉、冰箱、电饭煲、加湿器、洗衣机、电灯、燃气灶、油烟机。医疗设备可以包括核磁共振仪、B超仪和/或心电图仪。Vehicles may include aircraft, ships and/or vehicles. Household appliances may include televisions, air conditioners, microwave ovens, refrigerators, rice cookers, humidifiers, washing machines, electric lights, gas stoves, and range hoods. Medical equipment may include MRI machines, ultrasound machines and/or electrocardiographs.

图6示出根据本公开一实施例的向量查找指令处理方法的流程图。如图6所示,该方法应用于上述向量查找指令处理装置,该方法包括步骤S51和步骤S52。FIG. 6 shows a flowchart of a method for processing a vector search instruction according to an embodiment of the present disclosure. As shown in FIG. 6, the method is applied to the above-mentioned vector search instruction processing apparatus, and the method includes step S51 and step S52.

在步骤S51中,对接收到的向量查找指令进行解析,获得向量查找指令的操作码和操作域,并根据操作码和操作域确定执行向量查找指令所需的待查找向量、查找条件和目标地址。其中,操作码用于指示向量查找指令对向量数据所进行的运算为查找运算,操作域包括待查找向量地址和目标地址。In step S51, parse the received vector search instruction, obtain the operation code and operation field of the vector search instruction, and determine the vector to be searched, search conditions and target address required to execute the vector search instruction according to the operation code and operation field . The operation code is used to indicate that the operation performed by the vector search instruction on the vector data is a search operation, and the operation domain includes the address of the vector to be searched and the target address.

在步骤S52中,依次确定表示待查找向量的多个待查数是否满足查找条件,并将满足查找条件的待查数确定为目标数,将目标数的存储地址作为查找结果存入目标地址。In step S52, it is sequentially determined whether a plurality of to-be-searched numbers representing the to-be-searched vector satisfy the search condition, and the to-be-searched number satisfying the search condition is determined as the target number, and the storage address of the target number is stored in the target address as the search result.

在一种可能的实现方式中,操作域还可以包括输入长度。其中,根据操作码和操作域确定执行向量查找指令所需的待查找向量、查找条件和目标地址,可以包括:根据输入长度,从待查找向量地址中获取待查找向量。In a possible implementation, the operation field may also include the input length. Wherein, determining the vector to be searched, the search condition and the target address required for executing the vector search instruction according to the operation code and the operation domain may include: obtaining the vector to be searched from the address of the vector to be searched according to the input length.

在一种可能的实现方式中,操作域还可以包括待查数宽度。该方法还可以包括:根据待查数宽度,从待查找向量中确定出多个待查数。In a possible implementation manner, the operation field may further include the width of the number to be checked. The method may further include: determining a plurality of numbers to be searched from the vector to be searched according to the width of the number to be searched.

在一种可能的实现方式中,操作域还可以包括查找条件。其中,根据操作码和操作域确定执行向量查找指令所需的待查找向量、查找条件和目标地址,可以包括:根据操作域,确定查找条件。In a possible implementation manner, the operation domain may further include search conditions. Wherein, determining the vector to be searched, the search condition and the target address required for executing the vector search instruction according to the operation code and the operation domain may include: determining the search condition according to the operation domain.

在一种可能的实现方式中,根据操作码和操作域确定执行向量查找指令所需的待查找向量、查找条件和目标地址,可以包括:In a possible implementation manner, determining the vector to be searched, the search condition and the target address required for executing the vector search instruction according to the operation code and the operation domain may include:

根据操作码,确定查找条件,操作码还用于指示向量查找指令的查找条件。According to the opcode, the search condition is determined, and the opcode is also used to indicate the search condition of the vector search instruction.

在一种可能的实现方式中,依次确定表示待查找向量的多个待查数是否满足查找条件,可以包括:In a possible implementation manner, determining sequentially whether multiple numbers to be searched representing the vector to be searched satisfy the search condition may include:

利用至少一个比较器对多个待查数与查找条件进行比较,获得比较结果,以便于根据比较结果确定待查数是否满足查找条件。At least one comparator is used to compare a plurality of numbers to be checked with a search condition to obtain a comparison result, so as to determine whether the number to be checked satisfies the search condition according to the comparison result.

在一种可能的实现方式中,满足查找条件的待查数可以包括以下至少一项:In a possible implementation manner, the number to be checked that satisfies the search condition may include at least one of the following:

数值是指定值的指定倍数、且排序为指定排序的待查数;The value is the specified multiple of the specified value, and the order is the number to be checked in the specified order;

数值处于指定数值区间的待查数;The number to be checked whose value is in the specified value range;

数值是指定值的指定倍数的待查数。Numeric is the number to look up in the specified multiple of the specified value.

其中,指定排序可以包括以下至少一种:待查数的排序为数值是指定值的指定倍数的待查数中的第n个,n为大于或等于1的正整数;待查数的排序为数值是指定值的指定倍数的待查数中的倒数第m个,m为大于或等于1的正整数。其中,m、n小于或等于待查找向量中待查数的数量。The specified ordering may include at least one of the following: the ordering of the numbers to be checked is the nth number of the numbers to be checked whose numerical value is a specified multiple of the specified value, where n is a positive integer greater than or equal to 1; the ordering of the numbers to be checked is The value is the m-th penultimate of the number to be checked that is a specified multiple of the specified value, where m is a positive integer greater than or equal to 1. Among them, m and n are less than or equal to the number of numbers to be searched in the vector to be searched.

在一种可能的实现方式中,该方法还可以包括:存储待查找向量。In a possible implementation manner, the method may further include: storing the vector to be searched for.

在一种可能的实现方式中,对接收到的向量查找指令进行解析,获得向量查找指令的操作码和操作域,可以包括:In a possible implementation manner, the received vector search instruction is parsed to obtain the operation code and operation domain of the vector search instruction, which may include:

存储向量查找指令;Store vector lookup instructions;

对向量查找指令进行解析,得到向量查找指令的操作码和操作域;Analyze the vector search instruction to obtain the opcode and operation domain of the vector search instruction;

存储指令队列,指令队列包括按照执行顺序依次排列的多个待执行指令,多个待执行指令可以包括向量查找指令。An instruction queue is stored, and the instruction queue includes multiple instructions to be executed sequentially arranged in an execution order, and the multiple instructions to be executed may include vector search instructions.

在一种可能的实现方式中,该方法还可以包括:In a possible implementation, the method may further include:

在确定多个待执行指令中的第一待执行指令与第一待执行指令之前的第零待执行指令存在关联关系时,缓存第一待执行指令,并在确定第零待执行指令执行完毕后,控制进行第一待执行指令的执行,When it is determined that the first to-be-executed instruction in the plurality of to-be-executed instructions has an associated relationship with the zeroth to-be-executed instruction before the first to-be-executed instruction, the first to-be-executed instruction is cached, and after it is determined that the zeroth to-be-executed instruction is executed , control the execution of the first instruction to be executed,

其中,第一待执行指令与第一待执行指令之前的第零待执行指令存在关联关系包括:Wherein, the relationship between the first instruction to be executed and the zeroth instruction to be executed before the first instruction to be executed includes:

存储第一待执行指令所需数据的第一存储地址区间与存储第零待执行指令所需数据的第零存储地址区间具有重叠的区域。The first storage address interval storing the data required by the first instruction to be executed and the zeroth storage address interval storing the data required by the zeroth instruction to be executed have an overlapping area.

需要说明的是,尽管以上述实施例作为示例介绍了向量查找指令处理方法如上,但本领域技术人员能够理解,本公开应不限于此。事实上,用户完全可根据个人喜好和/或实际应用场景灵活设定各步骤,只要符合本公开的技术方案即可。It should be noted that although the above embodiments are used as examples to introduce the vector search instruction processing method as above, those skilled in the art can understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set each step according to personal preference and/or actual application scenarios, as long as it conforms to the technical solutions of the present disclosure.

本公开实施例所提供的向量查找指令处理方法的适用范围广,对向量查找指令的处理效率高、处理速度快。The vector search instruction processing method provided by the embodiment of the present disclosure has a wide range of applications, and has high processing efficiency and high processing speed for the vector search instruction.

需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本公开所必须的。It should be noted that, for the sake of simple description, the foregoing method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the described action sequence. Because in accordance with the present application, certain steps may be performed in other orders or concurrently. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

在本公开所提供的实施例中,应该理解到,所揭露的系统、装置,可通过其它的方式实现。例如,以上所描述的系统、装置实施例仅仅是示意性的,例如设备、装置、模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块可以结合或者可以集成到另一个系统或装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,设备、装置或模块的间接耦合或通信连接,可以是电性或其它的形式。In the embodiments provided in the present disclosure, it should be understood that the disclosed systems and devices may be implemented in other manners. For example, the above-described system and device embodiments are only illustrative, for example, the division of devices, devices, and modules is only a logical function division. In actual implementation, there may be other division methods. For example, multiple modules may be combined. Or it may be integrated into another system or device, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices, devices or modules, which may be in electrical or other forms.

作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。Modules described as separate components may or may not be physically separated, and components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本公开各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件程序模块的形式实现。In addition, each functional module in each embodiment of the present disclosure may be integrated into one processing unit, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, or can be implemented in the form of software program modules.

集成的模块如果以软件程序模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储器中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储器包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。The integrated modules, if implemented in the form of software program modules and sold or used as stand-alone products, may be stored in a computer-readable memory. Based on such understanding, the technical solutions of the present disclosure essentially or the parts that contribute to the prior art or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a memory, Several instructions are included to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present disclosure. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储器中,存储器可以包括:闪存盘、只读存储器(英文:Read-Only Memory,简称:ROM)、随机存取器(英文:Random Access Memory,简称:RAM)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable memory, and the memory can include: a flash disk , Read-only memory (English: Read-Only Memory, referred to as: ROM), random access device (English: Random Access Memory, referred to as: RAM), magnetic disk or optical disk, etc.

以上对本申请实施例进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The embodiments of the present application have been introduced in detail above, and the principles and implementations of the present application are described in this paper by using specific examples. The descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application; at the same time, for Persons of ordinary skill in the art, based on the idea of the present application, will have changes in the specific implementation manner and application scope. In summary, the contents of this specification should not be construed as limitations on the present application.

Claims (21)

1.一种向量查找指令处理装置,其特征在于,所述装置包括:1. A vector search instruction processing device, wherein the device comprises: 控制模块,用于对接收到的向量查找指令进行解析,获得所述向量查找指令的操作码和操作域,并根据所述操作码和所述操作域确定执行所述向量查找指令所需的待查找向量、查找条件和目标地址;The control module is configured to parse the received vector search instruction, obtain the operation code and operation field of the vector search instruction, and determine the waiting period required to execute the vector search instruction according to the operation code and the operation field. lookup vector, lookup condition and target address; 运算模块,用于依次确定表示所述待查找向量的多个待查数是否满足所述查找条件,并将满足所述查找条件的待查数确定为目标数,将所述目标数的存储地址作为查找结果存入所述目标地址,an arithmetic module, configured to sequentially determine whether a plurality of to-be-checked numbers representing the to-be-searched vector satisfy the search condition, determine the to-be-checked number that satisfies the search condition as a target number, and determine the storage address of the target number into the target address as the search result, 其中,所述操作码用于指示所述向量查找指令对向量数据所进行的运算为查找运算,所述操作域包括所述待查找向量地址和所述目标地址。The operation code is used to indicate that the operation performed by the vector search instruction on the vector data is a search operation, and the operation field includes the address of the vector to be searched and the target address. 2.根据权利要求1所述的装置,其特征在于,所述操作域还包括输入长度,2. The apparatus according to claim 1, wherein the operation field further comprises an input length, 所述控制模块,还用于根据所述输入长度,从所述待查找向量地址中获取所述待查找向量。The control module is further configured to obtain the vector to be searched from the address of the vector to be searched according to the input length. 3.根据权利要求1所述的装置,其特征在于,所述操作域还包括待查数宽度,3. The device according to claim 1, wherein the operation field further comprises the width of the number to be checked, 所述运算模块,还用于根据所述待查数宽度,从所述待查找向量中确定出所述多个待查数。The operation module is further configured to determine the plurality of numbers to be checked from the vector to be searched according to the width of the number to be checked. 4.根据权利要求1所述的装置,其特征在于,所述操作域还包括查找条件,4. The apparatus according to claim 1, wherein the operation field further comprises a search condition, 所述控制模块,还用于根据所述操作域,确定所述查找条件。The control module is further configured to determine the search condition according to the operation domain. 5.根据权利要求1所述的装置,其特征在于,5. The device of claim 1, wherein 所述控制模块,还用于根据所述操作码,确定所述查找条件,其中,所述操作码还用于指示所述向量查找指令的查找条件。The control module is further configured to determine the search condition according to the operation code, wherein the operation code is further used to indicate the search condition of the vector search instruction. 6.根据权利要求1所述的装置,其特征在于,所述运算模块,包括:6. The device according to claim 1, wherein the operation module comprises: 至少一个比较器,用于对所述多个待查数与所述查找条件进行比较,获得比较结果,以便于根据所述比较结果确定待查数是否满足所述查找条件。at least one comparator, configured to compare the plurality of numbers to be checked with the search condition to obtain a comparison result, so as to determine whether the number to be checked satisfies the search condition according to the comparison result. 7.根据权利要求1-6任一项所述的装置,其特征在于,满足所述查找条件的待查数包括以下至少一项:7. The device according to any one of claims 1-6, wherein the number to be checked that satisfies the search condition comprises at least one of the following: 数值是指定值的指定倍数、且排序为指定排序的待查数;The value is the specified multiple of the specified value, and the order is the number to be checked in the specified order; 数值处于指定数值区间的待查数;The number to be checked whose value is in the specified value range; 数值是指定值的指定倍数的待查数,The value is the number to be checked in the specified multiple of the specified value, 其中,所述指定排序包括以下至少一种:Wherein, the specified ordering includes at least one of the following: 所述待查数的排序为数值是指定值的指定倍数的待查数中的第n个,所述n为大于或等于1的正整数;The order of the number to be checked is the nth number in the number to be checked whose numerical value is a specified multiple of the specified value, and the n is a positive integer greater than or equal to 1; 所述待查数的排序为数值是指定值的指定倍数的待查数中的倒数第m个,所述m为大于或等于1的正整数,The order of the number to be searched is the m-th penultimate in the number to be searched whose numerical value is a specified multiple of the specified value, and the m is a positive integer greater than or equal to 1, 其中,m、n小于或等于所述待查找向量中待查数的数量。Wherein, m and n are less than or equal to the number of numbers to be searched in the vector to be searched. 8.根据权利要求1所述的装置,其特征在于,8. The device of claim 1, wherein 所述装置还包括:存储模块,用于存储所述待查找向量,The device further includes: a storage module for storing the to-be-searched vector, 其中,所述控制模块,包括:Wherein, the control module includes: 指令存储子模块,用于存储所述向量查找指令;an instruction storage submodule for storing the vector search instruction; 指令处理子模块,用于对所述向量查找指令进行解析,得到所述向量查找指令的操作码和操作域;an instruction processing submodule, configured to parse the vector search instruction to obtain an opcode and an operation domain of the vector search instruction; 队列存储子模块,用于存储指令队列,所述指令队列包括按照执行顺序依次排列的多个待执行指令,所述多个待执行指令包括所述向量查找指令,a queue storage sub-module, used for storing an instruction queue, the instruction queue includes a plurality of instructions to be executed sequentially arranged in an execution order, and the multiple instructions to be executed include the vector search instruction, 其中,所述控制模块,还包括:Wherein, the control module also includes: 依赖关系处理子模块,用于在确定所述多个待执行指令中的第一待执行指令与所述第一待执行指令之前的第零待执行指令存在关联关系时,将所述第一待执行指令缓存在所述指令存储子模块中,在所述第零待执行指令执行完毕后,从所述指令存储子模块中提取所述第一待执行指令发送至所述运算模块,The dependency relationship processing submodule is configured to, when it is determined that the first to-be-executed instruction in the plurality of to-be-executed instructions has an associated relationship with the zeroth to-be-executed instruction before the first to-be-executed instruction, to process the first to-be-executed instruction The execution instruction is cached in the instruction storage sub-module, and after the execution of the zeroth instruction to be executed is completed, the first instruction to be executed is extracted from the instruction storage sub-module and sent to the operation module, 其中,所述第一待执行指令与所述第一待执行指令之前的第零待执行指令存在关联关系包括:Wherein, the relationship between the first instruction to be executed and the zeroth instruction to be executed before the first instruction to be executed includes: 存储所述第一待执行指令所需数据的第一存储地址区间与存储所述第零待执行指令所需数据的第零存储地址区间具有重叠的区域。The first storage address interval storing the data required by the first instruction to be executed and the zeroth storage address interval storing the data required by the zeroth instruction to be executed have an overlapping area. 9.一种机器学习运算装置,其特征在于,所述装置包括:9. A machine learning computing device, wherein the device comprises: 一个或多个如权利要求1-8任一项所述的向量查找指令处理装置,用于从其他处理装置中获取待运算数据和控制信息,并执行指定的机器学习运算,将执行结果通过I/O接口传递给其他处理装置;One or more vector search instruction processing devices as described in any one of claims 1-8, for obtaining the data to be calculated and control information from other processing devices, and executing the specified machine learning operation, the execution result is passed through I The /O interface is passed to other processing devices; 当所述机器学习运算装置包含多个所述向量查找指令处理装置时,所述多个所述向量查找指令处理装置间可以通过特定的结构进行连接并传输数据;When the machine learning computing device includes a plurality of the vector search instruction processing devices, the plurality of the vector search instruction processing devices can be connected through a specific structure and data can be transmitted; 其中,多个所述向量查找指令处理装置通过快速外部设备互连总线PCIE总线进行互联并传输数据,以支持更大规模的机器学习的运算;多个所述向量查找指令处理装置共享同一控制系统或拥有各自的控制系统;多个所述向量查找指令处理装置共享内存或者拥有各自的内存;多个所述向量查找指令处理装置的互联方式是任意互联拓扑。Wherein, a plurality of the vector search instruction processing devices are interconnected and transmit data through the fast peripheral device interconnection bus PCIE bus to support larger-scale machine learning operations; a plurality of the vector search instruction processing devices share the same control system Or have their own control systems; a plurality of the vector search instruction processing devices share memory or have their own memory; the interconnection mode of the multiple vector search instruction processing devices is any interconnection topology. 10.一种组合处理装置,其特征在于,所述组合处理装置包括:10. A combined processing device, characterized in that the combined processing device comprises: 如权利要求9所述的机器学习运算装置、通用互联接口和其他处理装置;The machine learning computing device, universal interconnection interface and other processing devices as claimed in claim 9; 所述机器学习运算装置与所述其他处理装置进行交互,共同完成用户指定的计算操作,The machine learning computing device interacts with the other processing devices to jointly complete the computing operation specified by the user, 其中,所述组合处理装置还包括:存储装置,该存储装置分别与所述机器学习运算装置和所述其他处理装置连接,用于保存所述机器学习运算装置和所述其他处理装置的数据。Wherein, the combined processing device further includes: a storage device, the storage device is respectively connected to the machine learning computing device and the other processing device, and is used for saving the data of the machine learning computing device and the other processing device. 11.一种机器学习芯片,其特征在于,所述机器学习芯片包括:11. A machine learning chip, wherein the machine learning chip comprises: 如权利要求9所述的机器学习运算装置或如权利要求10所述的组合处理装置。The machine learning computing device as claimed in claim 9 or the combined processing device as claimed in claim 10 . 12.一种电子设备,其特征在于,所述电子设备包括:12. An electronic device, characterized in that the electronic device comprises: 如权利要求11所述的机器学习芯片。The machine learning chip of claim 11 . 13.一种板卡,其特征在于,所述板卡包括:存储器件、接口装置和控制器件以及如权利要求11所述的机器学习芯片;13. A board, characterized in that the board comprises: a storage device, an interface device, a control device, and a machine learning chip as claimed in claim 11; 其中,所述机器学习芯片与所述存储器件、所述控制器件以及所述接口装置分别连接;Wherein, the machine learning chip is connected to the storage device, the control device and the interface device respectively; 所述存储器件,用于存储数据;the storage device for storing data; 所述接口装置,用于实现所述机器学习芯片与外部设备之间的数据传输;The interface device is used to realize data transmission between the machine learning chip and an external device; 所述控制器件,用于对所述机器学习芯片的状态进行监控。The control device is used for monitoring the state of the machine learning chip. 14.一种向量查找指令处理方法,其特征在于,所述方法应用于向量查找指令处理装置,所述方法包括:14. A vector search instruction processing method, wherein the method is applied to a vector search instruction processing device, and the method comprises: 对接收到的向量查找指令进行解析,获得所述向量查找指令的操作码和操作域,并根据所述操作码和所述操作域确定执行所述向量查找指令所需的待查找向量、查找条件和目标地址;Analyze the received vector search instruction, obtain the operation code and operation field of the vector search instruction, and determine the vector to be searched and search conditions required to execute the vector search instruction according to the operation code and the operation field and destination address; 依次确定表示所述待查找向量的多个待查数是否满足所述查找条件,并将满足所述查找条件的待查数确定为目标数,将所述目标数的存储地址作为查找结果存入所述目标地址,Determine in turn whether a plurality of to-be-checked numbers representing the to-be-searched vector satisfy the search condition, determine the to-be-checked number that satisfies the search condition as the target number, and store the storage address of the target number as the search result in the the target address, 其中,所述操作码用于指示所述向量查找指令对向量数据所进行的运算为查找运算,所述操作域包括所述待查找向量地址和所述目标地址。The operation code is used to indicate that the operation performed by the vector search instruction on the vector data is a search operation, and the operation field includes the address of the vector to be searched and the target address. 15.根据权利要求14所述的方法,其特征在于,所述操作域还包括输入长度,15. The method of claim 14, wherein the operation field further comprises an input length, 其中,根据所述操作码和所述操作域确定执行所述向量查找指令所需的待查找向量、查找条件和目标地址,包括:Wherein, determining the vector to be searched, the search condition and the target address required to execute the vector search instruction according to the operation code and the operation domain, including: 根据所述输入长度,从所述待查找向量地址中获取所述待查找向量。According to the input length, the to-be-searched vector is acquired from the to-be-searched vector address. 16.根据权利要求14所述的方法,其特征在于,所述操作域还包括待查数宽度,所述方法还包括:16. The method according to claim 14, wherein the operation field further comprises the width of the number to be checked, and the method further comprises: 根据所述待查数宽度,从所述待查找向量中确定出所述多个待查数。According to the width of the number to be looked up, the plurality of numbers to be looked up are determined from the vector to be looked up. 17.根据权利要求14所述的方法,其特征在于,所述操作域还包括查找条件,17. The method according to claim 14, wherein the operation field further comprises a search condition, 其中,根据所述操作码和所述操作域确定执行所述向量查找指令所需的待查找向量、查找条件和目标地址,包括:Wherein, determining the vector to be searched, the search condition and the target address required to execute the vector search instruction according to the operation code and the operation domain, including: 根据所述操作域,确定所述查找条件。According to the operation domain, the search condition is determined. 18.根据权利要求14所述的方法,其特征在于,根据所述操作码和所述操作域确定执行所述向量查找指令所需的待查找向量、查找条件和目标地址,包括:18. The method according to claim 14, wherein determining the vector to be searched, the search condition and the target address required for executing the vector search instruction according to the operation code and the operation domain, comprising: 根据所述操作码,确定所述查找条件,所述操作码还用于指示所述向量查找指令的查找条件。The search condition is determined according to the operation code, and the operation code is further used to indicate the search condition of the vector search instruction. 19.根据权利要求14所述的方法,其特征在于,依次确定表示所述待查找向量的多个待查数是否满足所述查找条件,包括:19. The method according to claim 14, wherein determining sequentially whether multiple numbers to be searched representing the vector to be searched satisfy the search condition, comprising: 利用至少一个比较器对所述多个待查数与所述查找条件进行比较,获得比较结果,以便于根据所述比较结果确定待查数是否满足所述查找条件。At least one comparator is used to compare the plurality of numbers to be checked with the search condition to obtain a comparison result, so as to determine whether the number to be checked satisfies the search condition according to the comparison result. 20.根据权利要求14-19任一项所述的方法,其特征在于,满足所述查找条件的待查数包括以下至少一项:20. The method according to any one of claims 14-19, wherein the number to be checked that satisfies the search condition comprises at least one of the following: 数值是指定值的指定倍数、且排序为指定排序的待查数;The value is the specified multiple of the specified value, and the order is the number to be checked in the specified order; 数值处于指定数值区间的待查数;The number to be checked whose value is in the specified value range; 数值是指定值的指定倍数的待查数,The value is the number to be checked in the specified multiple of the specified value, 其中,所述指定排序包括以下至少一种:Wherein, the specified ordering includes at least one of the following: 所述待查数的排序为数值是指定值的指定倍数的待查数中的第n个,所述n为大于或等于1的正整数;The order of the number to be checked is the nth number in the number to be checked whose numerical value is a specified multiple of the specified value, and the n is a positive integer greater than or equal to 1; 所述待查数的排序为数值是指定值的指定倍数的待查数中的倒数第m个,所述m为大于或等于1的正整数,The order of the number to be searched is the m-th penultimate in the number to be searched whose numerical value is a specified multiple of the specified value, and the m is a positive integer greater than or equal to 1, 其中,m、n小于或等于所述待查找向量中待查数的数量。Wherein, m and n are less than or equal to the number of numbers to be searched in the vector to be searched. 21.根据权利要求14所述的方法,其特征在于,21. The method of claim 14, wherein 所述方法还包括:存储所述待查找向量,The method further includes: storing the to-be-searched vector, 其中,对接收到的向量查找指令进行解析,获得所述向量查找指令的操作码和操作域,包括:Wherein, the received vector search instruction is parsed to obtain the operation code and operation domain of the vector search instruction, including: 存储所述向量查找指令;storing the vector lookup instruction; 对所述向量查找指令进行解析,得到所述向量查找指令的操作码和操作域;Parsing the vector search instruction to obtain an opcode and an operation domain of the vector search instruction; 存储指令队列,所述指令队列包括按照执行顺序依次排列的多个待执行指令,所述多个待执行指令包括所述向量查找指令,an instruction queue is stored, the instruction queue includes a plurality of instructions to be executed sequentially arranged in an execution order, and the multiple instructions to be executed include the vector search instruction, 其中,所述方法还包括:Wherein, the method also includes: 在确定所述多个待执行指令中的第一待执行指令与所述第一待执行指令之前的第零待执行指令存在关联关系时,缓存所述第一待执行指令,并在确定所述第零待执行指令执行完毕后,控制进行所述第一待执行指令的执行,When it is determined that the first to-be-executed instruction in the plurality of to-be-executed instructions has an associated relationship with the zeroth to-be-executed instruction before the first to-be-executed instruction, the first to-be-executed instruction is cached, and the first to-be-executed instruction is determined when the After the execution of the zeroth instruction to be executed is completed, the execution of the first instruction to be executed is controlled to be executed, 其中,所述第一待执行指令与所述第一待执行指令之前的第零待执行指令存在关联关系包括:Wherein, the relationship between the first instruction to be executed and the zeroth instruction to be executed before the first instruction to be executed includes: 存储所述第一待执行指令所需数据的第一存储地址区间与存储所述第零待执行指令所需数据的第零存储地址区间具有重叠的区域。The first storage address interval storing the data required by the first instruction to be executed and the zeroth storage address interval storing the data required by the zeroth instruction to be executed have an overlapping area.
CN201910001855.9A 2018-11-30 2019-01-02 Operation method, device and related product Active CN111399905B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910001855.9A CN111399905B (en) 2019-01-02 2019-01-02 Operation method, device and related product
PCT/CN2019/120893 WO2020108471A1 (en) 2018-11-30 2019-11-26 Computing method and apparatus, and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910001855.9A CN111399905B (en) 2019-01-02 2019-01-02 Operation method, device and related product

Publications (2)

Publication Number Publication Date
CN111399905A true CN111399905A (en) 2020-07-10
CN111399905B CN111399905B (en) 2022-08-16

Family

ID=71430183

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910001855.9A Active CN111399905B (en) 2018-11-30 2019-01-02 Operation method, device and related product

Country Status (1)

Country Link
CN (1) CN111399905B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060259737A1 (en) * 2005-05-10 2006-11-16 Telairity Semiconductor, Inc. Vector processor with special purpose registers and high speed memory access
CN101510234A (en) * 2009-03-18 2009-08-19 中国科学院计算技术研究所 Instruction combination filtration method and system for instruction grade stochastic verification
CN104169907A (en) * 2012-03-15 2014-11-26 国际商业机器公司 Vector find element equal instruction
CN104662538A (en) * 2012-10-02 2015-05-27 甲骨文国际公司 Semi-join acceleration
CN106990940A (en) * 2016-01-20 2017-07-28 南京艾溪信息科技有限公司 A vector computing device
CN107315717A (en) * 2016-04-26 2017-11-03 北京中科寒武纪科技有限公司 A device and method for performing four arithmetic operations of vectors
CN107992486A (en) * 2017-10-30 2018-05-04 上海寒武纪信息科技有限公司 A kind of information processing method and Related product
CN108292294A (en) * 2015-12-18 2018-07-17 英特尔公司 For mixing and the instruction of replacement operator sequence and logic
CN108388446A (en) * 2018-02-05 2018-08-10 上海寒武纪信息科技有限公司 Computing module and method
CN109104876A (en) * 2017-04-20 2018-12-28 上海寒武纪信息科技有限公司 Computing device and related products

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060259737A1 (en) * 2005-05-10 2006-11-16 Telairity Semiconductor, Inc. Vector processor with special purpose registers and high speed memory access
CN101510234A (en) * 2009-03-18 2009-08-19 中国科学院计算技术研究所 Instruction combination filtration method and system for instruction grade stochastic verification
CN104169907A (en) * 2012-03-15 2014-11-26 国际商业机器公司 Vector find element equal instruction
CN104662538A (en) * 2012-10-02 2015-05-27 甲骨文国际公司 Semi-join acceleration
CN108292294A (en) * 2015-12-18 2018-07-17 英特尔公司 For mixing and the instruction of replacement operator sequence and logic
CN106990940A (en) * 2016-01-20 2017-07-28 南京艾溪信息科技有限公司 A vector computing device
CN107315717A (en) * 2016-04-26 2017-11-03 北京中科寒武纪科技有限公司 A device and method for performing four arithmetic operations of vectors
CN109104876A (en) * 2017-04-20 2018-12-28 上海寒武纪信息科技有限公司 Computing device and related products
CN107992486A (en) * 2017-10-30 2018-05-04 上海寒武纪信息科技有限公司 A kind of information processing method and Related product
CN108388446A (en) * 2018-02-05 2018-08-10 上海寒武纪信息科技有限公司 Computing module and method
CN109062611A (en) * 2018-02-05 2018-12-21 上海寒武纪信息科技有限公司 Processing with Neural Network device and its method for executing vector scaling instruction
CN109086076A (en) * 2018-02-05 2018-12-25 上海寒武纪信息科技有限公司 Processing with Neural Network device and its method for executing dot product instruction

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
严迎建 等: "基于指令集模拟器的处理器建模与验证", 《计算机工程》 *

Also Published As

Publication number Publication date
CN111399905B (en) 2022-08-16

Similar Documents

Publication Publication Date Title
CN110119807B (en) Operation method, operation device, computer equipment and storage medium
CN111381871A (en) Computing method, device and related products
CN111209243B (en) Data processing device, method and related product
CN111210012B (en) Data processing method and device and related products
CN113033789B (en) Bus system, integrated circuit device, board card and order preserving method for order preserving
CN111381873A (en) Computing method, device and related products
CN111813449A (en) Computing method, device and related products
CN111400341B (en) Scalar lookup instruction processing method and device and related product
CN111399905A (en) Computing method, device and related products
CN111026440B (en) Operation method, operation device, computer equipment and storage medium
CN111290789B (en) Operation method, operation device, computer equipment and storage medium
CN111382850A (en) Computing method, device and related products
CN111381802B (en) Data comparator, data processing method, chip and electronic equipment
CN111381875B (en) Data comparator, data processing method, chip and electronic device
CN111382851A (en) Operation method, device and related product
CN111381872A (en) Operation method, device and related product
CN111353595A (en) Operation method, device and related product
CN111382390A (en) Computing method, device and related products
CN111325331B (en) Computing method, device and related products
CN111401536A (en) Computing method, device and related products
CN111966402A (en) Instruction processing method and device and related product
CN111258641A (en) Computing method, device and related products
CN111260070A (en) Operation method, device and related product
CN111338694B (en) Operation method, device, computer equipment and storage medium
CN112396186B (en) Execution method, execution device and related product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant