[go: up one dir, main page]

CN116450519A - DL model precision testing method, device, equipment, server and storage medium - Google Patents

DL model precision testing method, device, equipment, server and storage medium Download PDF

Info

Publication number
CN116450519A
CN116450519A CN202310426841.8A CN202310426841A CN116450519A CN 116450519 A CN116450519 A CN 116450519A CN 202310426841 A CN202310426841 A CN 202310426841A CN 116450519 A CN116450519 A CN 116450519A
Authority
CN
China
Prior art keywords
model
target
development code
compiler
tested
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.)
Pending
Application number
CN202310426841.8A
Other languages
Chinese (zh)
Inventor
段艳云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202310426841.8A priority Critical patent/CN116450519A/en
Publication of CN116450519A publication Critical patent/CN116450519A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software
    • G06F11/3628Debugging of software of optimised code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/362Debugging of software
    • G06F11/3624Debugging of software by performing operations on the source code, e.g. via a compiler
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

本发明公开了一种DL模型精度测试方法、装置、设备、服务器及存储介质,属于深度学习领域,用于对深度学习模型的精度进行测试。考虑到目前存在的标准硬件对于DL模型的精确执行结果可作为标准进行参考,而且进行IR转换的开发代码的可靠性可以由DL模型的执行结果体现,本申请可以首先得到目标DL模型在指定类型标准硬件中的执行结果并将其作为预期结果,然后利用待测开发代码将DL编译器的原始IR转换为人工智能AI芯片可识别的IR得到可执行文件,接着将可执行文件在AI芯片中的执行结果作为观测结果,通过预期结果与观测结果便可对待测开发代码的可靠性进行评估,从而指导开发代码的设计,有利于提升DL模型也即DL算法的精度。

The invention discloses a DL model precision testing method, device, equipment, server and storage medium, which belong to the field of deep learning and are used for testing the precision of the deep learning model. Considering that the existing standard hardware can be used as a reference for the accurate execution results of the DL model, and the reliability of the development code for IR conversion can be reflected by the execution results of the DL model, this application can first obtain the target DL model in the specified type The execution result in the standard hardware is used as the expected result, and then the original IR of the DL compiler is converted into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested to obtain an executable file, and then the executable file is placed in the AI chip The execution result of the test is used as the observation result. Through the expected result and the observation result, the reliability of the developed code to be tested can be evaluated to guide the design of the developed code, which is conducive to improving the accuracy of the DL model, that is, the DL algorithm.

Description

DL模型精度测试方法、装置、设备、服务器及存储介质DL model accuracy testing method, device, equipment, server and storage medium

技术领域technical field

本发明涉及深度学习领域,特别是涉及一种DL模型精度测试方法,本发明还涉及一种DL模型精度测试装置、设备、服务器及计算机可读存储介质。The present invention relates to the field of deep learning, in particular to a DL model accuracy testing method, and the present invention also relates to a DL model accuracy testing device, equipment, server and computer-readable storage medium.

背景技术Background technique

DL(Deep Learning,深度学习)算法在应用时,通常会将DL模型输入到DL编译器进行编译,然后将编译后的内容输送至后端硬件中进行DL算法的执行,后端硬件通常会选择CPU(Central Processing Unit,中央处理器)或者GPU(Graphics Processing Unit,图形处理器)等,目前新出现了将AI(Artificial Intelligence,人工智能)芯片用作后端硬件的做法,以便利用到AI芯片中高效的AI算法,但是需要开发代码将DL编译器的原始IR(Intermediate Representation,中间表示)转换为AI芯片可识别的IR,以便AI芯片执行DL算法,但是不同工作人员设计出的用于转换IR的开发代码不同,不同开发代码的可靠性也就存在差异,若无法确保开发代码的可靠性,那么便会严重影响DL算法的精度。When the DL (Deep Learning, deep learning) algorithm is applied, the DL model is usually input to the DL compiler for compilation, and then the compiled content is sent to the back-end hardware for the execution of the DL algorithm. The back-end hardware usually selects CPU (Central Processing Unit, central processing unit) or GPU (Graphics Processing Unit, graphics processing unit), etc. At present, there is a new practice of using AI (Artificial Intelligence, artificial intelligence) chips as back-end hardware in order to utilize AI chips Medium and efficient AI algorithm, but it needs to develop code to convert the original IR (Intermediate Representation, intermediate representation) of the DL compiler into the IR recognizable by the AI chip, so that the AI chip can execute the DL algorithm, but different staff have designed it for conversion The development codes of IR are different, and the reliability of different development codes is also different. If the reliability of the development codes cannot be ensured, the accuracy of the DL algorithm will be seriously affected.

因此,如何提供一种解决上述技术问题的方案是本领域技术人员目前需要解决的问题。Therefore, how to provide a solution to the above technical problems is a problem that those skilled in the art need to solve at present.

发明内容Contents of the invention

本发明的目的是提供一种DL模型精度测试方法,通过CPU执行的预期结果与AI芯片执行的观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度;本发明的另一目的是提供一种DL模型精度测试装置、设备、服务器及计算机可读存储介质,通过CPU执行的预期结果与AI芯片执行的观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度。The purpose of the present invention is to provide a DL model accuracy testing method, the reliability of the code to be tested can be evaluated through the expected result of CPU execution and the observation result of AI chip execution, so as to guide the design of reliable development code, which is beneficial to Improve the accuracy of the DL model, that is, the DL algorithm; another object of the present invention is to provide a DL model accuracy test device, equipment, server, and computer-readable storage medium, through which the expected result executed by the CPU and the observed result executed by the AI chip can be easily The reliability of the code to be tested can be evaluated, so as to guide the design of a reliable development code, which is conducive to improving the accuracy of the DL model, that is, the DL algorithm.

为解决上述技术问题,本发明提供了一种DL模型精度测试方法,包括:In order to solve the above technical problems, the present invention provides a DL model accuracy testing method, including:

将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果;The execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware is taken as the expected result;

利用待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;Using the code to be tested to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file;

将所述可执行文件在所述AI芯片中的执行结果作为观测结果;Taking the execution result of the executable file in the AI chip as the observation result;

根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性。Evaluate the reliability of the developed code to be tested according to the expected result and the observed result.

优选地,该DL模型精度测试方法还包括:Preferably, the DL model accuracy testing method also includes:

预先通过所述DL编译器将目标DL模型转换为目标格式的所述原始的IR;converting the target DL model into the original IR in the target format through the DL compiler in advance;

所述将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果具体为:The execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware as the expected result is specifically:

控制所述DL编译器根据所述目标格式的原始IR对所述目标DL模型进行编译;controlling the DL compiler to compile the target DL model according to the original IR of the target format;

将指定类型的标准硬件对编译后的所述目标DL模型的执行结果作为预期结果;Taking the execution result of the compiled target DL model on the specified type of standard hardware as the expected result;

所述利用待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件具体为:The described use of the development code to be tested converts the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and the executable file obtained is specifically:

利用待测开发代码将所述DL编译器的所述目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件。The original IR of the target format of the DL compiler is converted into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and an executable file is obtained.

优选地,所述预先通过所述DL编译器将目标DL模型转换为目标格式的所述原始的IR具体为:Preferably, the original IR that converts the target DL model into the target format through the DL compiler in advance is specifically:

预先从DL模型库中挑选指定类型框架的DL模型作为目标DL模型;Pre-select the DL model of the specified type of frame from the DL model library as the target DL model;

通过所述DL编译器将所述目标DL模型转换为目标格式的所述原始的IR。converting the target DL model into the original IR in target format by the DL compiler.

优选地,所述DL模型库中包括DL模型以及预先构建的DL模型原始IR;Preferably, the DL model library includes the DL model and the original IR of the pre-built DL model;

所述预先从DL模型库中挑选指定类型框架的DL模型作为目标DL模型具体为:The pre-selected DL model of a specified type of frame from the DL model library as the target DL model is specifically:

预先从DL模型库中挑选指定类型框架的DL模型;Pre-select the DL model of the specified type of frame from the DL model library;

判断所述指定类型框架的DL模型在所述DL模型库中是否已存在所述预先构建的DL模型原始IR;Judging whether the DL model of the specified type of framework already exists in the DL model library in the original IR of the pre-built DL model;

若存在,则执行所述利用待测开发代码将所述DL编译器的所述目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件的步骤;If it exists, the original IR of the target format of the DL compiler is converted into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and the step of obtaining an executable file is performed;

若不存在,通过所述DL编译器将所述目标DL模型转换为目标格式的所述原始的IR。If not, converting the target DL model into the original IR in target format by the DL compiler.

优选地,所述利用待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件具体为:Preferably, the use of the development code to be tested converts the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and the executable file is specifically:

从开发代码库中与所述目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码;Select one as the development code to be tested from a plurality of candidate development codes corresponding to the framework type of the target DL model in the development code library;

利用所述待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;Using the code to be tested to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file;

所述根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性之后,该DL模型精度测试方法还包括:After evaluating the reliability of the developed code to be tested according to the expected result and the observed result, the DL model accuracy testing method further includes:

判断所述开发代码库中是否存在与所述目标DL模型的框架类型对应的未经测试的开发代码;Judging whether there is untested development code corresponding to the framework type of the target DL model in the development code library;

若存在,则执行所述从开发代码库中与所述目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码的步骤。If it exists, the step of selecting one as the development code to be tested from a plurality of candidate development codes corresponding to the framework type of the target DL model in the development code base is executed.

优选地,所述根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性之后,该DL模型精度测试方法还包括:Preferably, after evaluating the reliability of the developed code to be tested according to the expected result and the observed result, the DL model accuracy testing method further includes:

控制提示器提示所述待测开发代码的可靠性评估结果。The control prompter prompts the reliability evaluation result of the development code to be tested.

优选地,所述判断所述开发代码库中是否存在与所述目标DL模型的框架类型对应的未经测试的开发代码之后,该DL模型精度测试方法还包括:Preferably, after determining whether there is untested development code corresponding to the framework type of the target DL model in the development code library, the DL model accuracy testing method further includes:

若不存在,生成与所述目标DL模型的框架类型对应且经过测试的所有所述开发代码的所述可靠性评估结果的横向对比信息;If it does not exist, generate horizontal comparison information of the reliability evaluation results of all the developed codes that correspond to the framework type of the target DL model and have been tested;

控制所述提示器提示所述DL编译器对应的各个所述开发代码的所述横向对比信息。The prompter is controlled to prompt the horizontal comparison information of each of the development codes corresponding to the DL compiler.

优选地,所述判断所述开发代码库中是否存在与所述目标DL模型的框架类型对应的未经测试的开发代码之后,该DL模型精度测试方法还包括:Preferably, after determining whether there is untested development code corresponding to the framework type of the target DL model in the development code library, the DL model accuracy testing method further includes:

若不存在,则判断所述DL模型库中所有的DL模型是否均已完成测试;If it does not exist, it is judged whether all the DL models in the DL model library have been tested;

若未均完成,则执行所述预先从DL模型库中挑选指定类型框架的DL模型的步骤。If not completed, the step of selecting a DL model of a specified type of frame from the DL model library in advance is performed.

优选地,该DL模型精度测试方法还包括:Preferably, the DL model accuracy testing method also includes:

响应于开发代码修改指令,对所述开发代码库中指定的所述开发代码进行修改;modifying the development code specified in the development code library in response to a development code modification instruction;

响应于开发代码添加指令,将指定的所述开发代码添加至所述开发代码库。Adding the specified development code to the development code library in response to the development code adding instruction.

优选地,所述DL编译器为端到端的深度学习编译器TVM,所述目标格式为JS对象简谱JSON。Preferably, the DL compiler is an end-to-end deep learning compiler TVM, and the target format is JS object numbered musical notation JSON.

优选地,所述根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性具体为:Preferably, the evaluating the reliability of the development code under test according to the expected result and the observed result is specifically:

基于卡方测试法,根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性。Based on the chi-square test method, the reliability of the development code to be tested is evaluated according to the expected result and the observed result.

为解决上述技术问题,本发明还提供了一种DL模型精度测试装置,包括:In order to solve the above technical problems, the present invention also provides a DL model accuracy testing device, including:

第一获取模块,用于将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果;The first acquisition module is used to take the execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware as the expected result;

控制模块,用于利用待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;The control module is used to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and obtain an executable file;

第二获取模块,用于将所述可执行文件在所述AI芯片中的执行结果作为观测结果;The second acquisition module is used to take the execution result of the executable file in the AI chip as the observation result;

评估模块,用于根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性。An evaluation module, configured to evaluate the reliability of the developed code to be tested according to the expected result and the observed result.

为解决上述技术问题,本发明还提供了一种DL模型精度测试设备,包括:In order to solve the above technical problems, the present invention also provides a DL model accuracy testing equipment, including:

存储器,用于存储计算机程序;memory for storing computer programs;

处理器,用于执行所述计算机程序时实现如上所述DL模型精度测试方法的步骤。A processor, configured to implement the steps of the above-mentioned DL model accuracy testing method when executing the computer program.

为解决上述技术问题,本发明还提供了一种服务器,包括服务器本体以及与所述服务器本体连接的如上所述的DL模型精度测试设备。In order to solve the above technical problems, the present invention also provides a server, including a server body and the above-mentioned DL model accuracy testing device connected to the server body.

为解决上述技术问题,本发明还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述DL模型精度测试方法的步骤。In order to solve the above technical problems, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above-mentioned DL model accuracy testing method is implemented. A step of.

本发明提供了一种DL模型精度测试方法,考虑到目前存在的标准硬件对于DL模型的精确执行结果可作为标准进行参考,而且进行IR转换的开发代码的可靠性可以由DL模型的执行结果体现,因此本申请可以首先得到目标DL模型在指定类型的标准硬件中的执行结果并将其作为预期结果,然后利用待测开发代码将DL编译器的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件,接着将可执行文件在AI芯片中的执行结果作为观测结果,通过预期结果与观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度。The present invention provides a DL model accuracy testing method, considering that the existing standard hardware can be used as a reference for the accurate execution result of the DL model, and the reliability of the development code for IR conversion can be reflected by the execution result of the DL model , so this application can first obtain the execution result of the target DL model in the specified type of standard hardware and take it as the expected result, and then use the code to be tested to convert the original IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip , and get the executable file, and then take the execution result of the executable file in the AI chip as the observation result, and then evaluate the reliability of the code to be tested and develop through the expected result and observation result, so as to guide the design of a reliable development code, It is conducive to improving the accuracy of the DL model, that is, the DL algorithm.

本发明还提供了一种DL模型精度测试装置、设备、服务器及计算机可读存储介质,具有如上DL模型精度测试方法相同的有益效果。The present invention also provides a DL model accuracy testing device, equipment, server and computer-readable storage medium, which have the same beneficial effect as the above DL model accuracy testing method.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对现有技术和实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the prior art and the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1为本发明提供的一种DL模型精度测试方法的流程示意图;Fig. 1 is a schematic flow chart of a DL model accuracy testing method provided by the present invention;

图2为本发明提供的另一种DL模型精度测试方法的流程示意图;Fig. 2 is a schematic flow chart of another DL model accuracy testing method provided by the present invention;

图3为本发明提供的一种DL模型精度测试装置的结构示意图;Fig. 3 is a schematic structural view of a DL model accuracy testing device provided by the present invention;

图4为本发明提供的一种DL模型精度测试设备的结构示意图;Fig. 4 is a schematic structural diagram of a DL model accuracy testing device provided by the present invention;

图5为本发明提供的一种计算机可读存储介质的结构示意图。FIG. 5 is a schematic structural diagram of a computer-readable storage medium provided by the present invention.

具体实施方式Detailed ways

本发明的核心是提供一种DL模型精度测试方法,通过CPU执行的预期结果与AI芯片执行的观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度;本发明的另一核心是提供一种DL模型精度测试装置、设备、服务器及计算机可读存储介质,通过CPU执行的预期结果与AI芯片执行的观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度。The core of the present invention is to provide a DL model accuracy testing method, the reliability of the code to be tested can be evaluated through the expected result of CPU execution and the observation result of AI chip execution, so as to guide the design of reliable development code, which is beneficial to Improve the accuracy of the DL model, that is, the DL algorithm; another core of the present invention is to provide a DL model accuracy test device, equipment, server and computer-readable storage medium, through the expected results executed by the CPU and the observed results executed by the AI chip. The reliability of the code to be tested can be evaluated, so as to guide the design of a reliable development code, which is conducive to improving the accuracy of the DL model, that is, the DL algorithm.

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

请参考图1,图1为本发明提供的一种DL模型精度测试方法的流程示意图,该DL模型精度测试方法包括:Please refer to FIG. 1. FIG. 1 is a schematic flowchart of a DL model accuracy testing method provided by the present invention. The DL model accuracy testing method includes:

S101:将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果;S101: Taking the execution result of the target DL model compiled by the deep learning DL compiler on the specified type of standard hardware as the expected result;

具体的,考虑到如上背景技术中的技术问题,又结合考虑到目前存在的标准硬件(例如CPU或GPU)对于DL模型的精确执行结果可作为标准进行参考,并且进行IR转换的开发代码的可靠性可以由DL模型的执行结果体现,因此本申请欲将“经由待测开发代码进行IR转换后在AI芯片中得到的执行结果”与“标准硬件对DL模型的执行结果”进行对比,以便评估待测开发代码的可靠性,而由于DL模型的执行通常需要先经DL编译器进行编译,然后在后端硬件进行执行,因此本步骤中率先将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果,以便作为后续步骤的数据基础。Specifically, considering the technical problems in the above background technology, combined with the consideration that the accurate execution results of the DL model on the existing standard hardware (such as CPU or GPU) can be used as a standard reference, and the development code for IR conversion is reliable. The performance can be reflected by the execution results of the DL model, so this application intends to compare the "execution results obtained in the AI chip after IR conversion of the developed code to be tested" with "the execution results of the DL model by standard hardware" for evaluation The reliability of the development code to be tested, and because the execution of the DL model usually needs to be compiled by the DL compiler first, and then executed on the back-end hardware, so in this step, the target DL model compiled by the deep learning DL compiler is first , the execution result in the specified type of standard hardware is taken as the expected result, so as to serve as the data basis for the subsequent steps.

为了更好地对本发明实施例进行说明,请参考图2,图2为本发明提供的另一种DL模型精度测试方法的流程示意图,在图2中,在欲通过CPU执行DL模型时,可以设置DL编译器的目标为目标标识2对应的目标,并导入目标DL模型对应的JSON文件,编译器便可以便可以将DL模型部署到CPU上运行并得到结果1(也即预期结果),在欲通过AI芯片执行DL模型时,可以设置DL编译器的目标为目标标识1对应的目标,并导入目标DL模型对应的JSON文件,然后调用对接AI芯片的与目标DL模型对应的待测开发代码,将DL编译器的原始IR转换为AI芯片可识别的IR,并得到可执行文件,可执行文件在AI芯片上执行的结果2便为观测结果。In order to better illustrate the embodiment of the present invention, please refer to FIG. 2, which is a schematic flow chart of another DL model accuracy testing method provided by the present invention. In FIG. 2, when the DL model is to be executed by the CPU, you can Set the target of the DL compiler to the target corresponding to the target ID 2, and import the JSON file corresponding to the target DL model, and the compiler can deploy the DL model to the CPU to run and get result 1 (that is, the expected result). When you want to execute the DL model through the AI chip, you can set the target of the DL compiler to the target corresponding to the target ID 1, and import the JSON file corresponding to the target DL model, and then call the development code to be tested corresponding to the target DL model that is connected to the AI chip , convert the original IR of the DL compiler into an IR recognizable by the AI chip, and obtain an executable file. The result 2 of the executable file executed on the AI chip is the observation result.

其中,目标标识1以及目标标识2均可以进行自主设定,例如目标标识1可以设置为AIPU,目标标识2可以设置为LLVM等,本发明实施例在此不做限定。Wherein, both the target ID 1 and the target ID 2 can be independently set, for example, the target ID 1 can be set to AIPU, and the target ID 2 can be set to LLVM, etc., which are not limited in this embodiment of the present invention.

具体的,JSON格式的文件可以包括两部分,分别为目标DL模型的模型部分和参数部分,模型部分可以保存为Mod.json,参数部分可以保存为Param.json。Specifically, the file in JSON format may include two parts, namely a model part and a parameter part of the target DL model, the model part may be saved as Mod.json, and the parameter part may be saved as Param.json.

其中,执行类型的标准硬件可以为多种类型,除了CPU或GPU外,还可以为多种类型,例如可以为ARM处理以及张量处理器等,本发明实施例在此不做限定。Wherein, the execution type of standard hardware can be of various types, besides CPU or GPU, it can also be of various types, for example, it can be ARM processing and tensor processor, etc., which is not limited in this embodiment of the present invention.

S102:利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;S102: Use the development code to be tested to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file;

具体的,为了使得经过DL编译器编译的DL模型在AI芯片上顺利执行,需要开发代码以实现DL编译器原始的IR(也即Relay IR)到AI芯片可识别的IR的算子转换,而本发明实施例的目的即为检测该开发代码的可靠性,因此本步骤中可以利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件,并将其作为后续步骤的数据基础。Specifically, in order to make the DL model compiled by the DL compiler run smoothly on the AI chip, it is necessary to develop codes to realize the operator conversion from the original IR (that is, Relay IR) of the DL compiler to the IR recognizable by the AI chip. The purpose of the embodiment of the present invention is to detect the reliability of the development code, so in this step, the development code to be tested can be used to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file and use it as the data basis for subsequent steps.

S103:将可执行文件在AI芯片中的执行结果作为观测结果;S103: Taking the execution result of the executable file in the AI chip as the observation result;

具体的,在得到可执行文件后,便可以将可执行文件在AI芯片中运行,也即在AI芯片中执行目标DL模型的运算,并将得到的执行结果作为观测结果,以便作为后续步骤的数据基础。Specifically, after the executable file is obtained, the executable file can be run in the AI chip, that is, the calculation of the target DL model is executed in the AI chip, and the obtained execution result is used as the observation result, so as to be used as the next step. data base.

S104:根据预期结果以及观测结果评估待测开发代码的可靠性。S104: Evaluate the reliability of the developed code to be tested according to the expected results and the observed results.

具体的,在有了预期结果与观测结果后,由于观测结果在理想状况下应与预期结果一致,在此关系的基础上便可以根据预期结果以及观测结果评估待测开发代码的可靠性,以便指导开发代码的设计,有利于提升AI芯片执行DL模型的精度。Specifically, after the expected results and observation results are obtained, since the observation results should be consistent with the expected results under ideal conditions, on the basis of this relationship, the reliability of the developed code to be tested can be evaluated according to the expected results and observation results, so that Guiding the design of the development code is conducive to improving the accuracy of the DL model executed by the AI chip.

本发明提供了一种DL模型精度测试方法,考虑到目前存在的标准硬件对于DL模型的精确执行结果可作为标准进行参考,而且进行IR转换的开发代码的可靠性可以由DL模型的执行结果体现,因此本申请可以首先得到目标DL模型在指定类型的标准硬件中的执行结果并将其作为预期结果,然后利用待测开发代码将DL编译器的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件,接着将可执行文件在AI芯片中的执行结果作为观测结果,通过预期结果与观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度。The present invention provides a DL model accuracy testing method, considering that the existing standard hardware can be used as a reference for the accurate execution result of the DL model, and the reliability of the development code for IR conversion can be reflected by the execution result of the DL model , so this application can first obtain the execution result of the target DL model in the specified type of standard hardware and take it as the expected result, and then use the code to be tested to convert the original IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip , and get the executable file, and then take the execution result of the executable file in the AI chip as the observation result, and then evaluate the reliability of the code to be tested and develop through the expected result and observation result, so as to guide the design of a reliable development code, It is conducive to improving the accuracy of the DL model, that is, the DL algorithm.

在上述实施例的基础上:On the basis of above-mentioned embodiment:

作为一种优选的实施例,该DL模型精度测试方法还包括:As a preferred embodiment, the DL model accuracy testing method also includes:

预先通过DL编译器将目标DL模型转换为目标格式的原始的IR;Convert the target DL model to the original IR in the target format through the DL compiler in advance;

将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果具体为:The execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware is the expected result:

控制DL编译器根据目标格式的原始IR对目标DL模型进行编译;Control the DL compiler to compile the target DL model according to the original IR of the target format;

将指定类型的标准硬件对编译后的目标DL模型的执行结果作为预期结果;The execution result of the compiled target DL model on the specified type of standard hardware is taken as the expected result;

利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件具体为:Use the development code to be tested to convert the original intermediate representation IR of the DL compiler into the IR recognizable by the artificial intelligence AI chip, and obtain the executable file as follows:

利用待测开发代码将DL编译器的目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件。Use the development code to be tested to convert the original IR in the target format of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file.

具体的,考虑到不同的DL模型在被导入DL编译器时所采用的文件格式各不相同,这就导致了某些DL模型在被导入DL编译器时需要耗费的时间非常长,降低了工作效率,而对于特定的某一种DL编译器来说,其对于特定的某一种文件格式的DL模型的导入速度较快,因此为了提升导入效率,本发明实施例中可以预先通过DL编译器将目标DL模型转换为目标格式的原始的IR,如此一来,DL编译器在对DL模型进行编译时,便可以导入目标格式的原始IR并基于目标格式的原始IR进行编译,提升了工作效率。Specifically, considering that different DL models adopt different file formats when being imported into the DL compiler, this leads to a very long time-consuming when some DL models are imported into the DL compiler, which reduces the work efficiency, and for a specific DL compiler, the import speed of the DL model of a specific file format is relatively fast, so in order to improve the import efficiency, the DL compiler can be used in advance in the embodiment of the present invention Convert the target DL model to the original IR in the target format, so that when the DL compiler compiles the DL model, it can import the original IR in the target format and compile based on the original IR in the target format, which improves work efficiency .

其中,DL编译器可以为多种类型,针对不同的DL编译器,对应的目标格式也有所不同,本发明实施例在此不做限定。The DL compilers can be of various types, and the corresponding target formats are also different for different DL compilers, which is not limited in this embodiment of the present invention.

作为一种优选的实施例,预先通过DL编译器将目标DL模型转换为目标格式的原始的IR具体为:As a preferred embodiment, the original IR that converts the target DL model into the target format through the DL compiler in advance is specifically:

预先从DL模型库中挑选指定类型框架的DL模型作为目标DL模型;Pre-select the DL model of the specified type of frame from the DL model library as the target DL model;

通过DL编译器将目标DL模型转换为目标格式的原始的IR。The target DL model is converted to the original IR in the target format by a DL compiler.

具体的,为了高效的对多种框架类型的DL模型的开发代码进行测试,本发明实施例中可以预先设计DL模型库,然后从DL模型库中挑选指定类型框架的DL模型作为目标DL模型,然后再通过DL编译器将目标DL模型转换为目标格式的原始的IR,可以实现对DL模型库中包含的多种框架类型的DL模型的开发代码的验证,提升了工作效率。Specifically, in order to efficiently test the development code of DL models of various framework types, in the embodiment of the present invention, a DL model library can be pre-designed, and then a DL model of a specified type of framework can be selected from the DL model library as the target DL model, Then, the target DL model is converted into the original IR of the target format through the DL compiler, which can realize the verification of the development code of the DL model of various framework types contained in the DL model library, and improve work efficiency.

作为一种优选的实施例,DL模型库中包括DL模型以及预先构建的DL模型原始IR;As a preferred embodiment, the DL model library includes the DL model and the original IR of the pre-built DL model;

预先从DL模型库中挑选指定类型框架的DL模型作为目标DL模型具体为:Pre-select the DL model of the specified type of frame from the DL model library as the target DL model, specifically:

预先从DL模型库中挑选指定类型框架的DL模型;Pre-select the DL model of the specified type of frame from the DL model library;

判断指定类型框架的DL模型在DL模型库中是否已存在预先构建的DL模型原始IR;Determine whether the DL model of the specified type of framework already has the original IR of the pre-built DL model in the DL model library;

若存在,则执行利用待测开发代码将DL编译器的目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件的步骤;If it exists, then perform the steps of converting the original IR of the target format of the DL compiler into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and obtaining an executable file;

若不存在,通过DL编译器将目标DL模型转换为目标格式的原始的IR。If it does not exist, the target DL model is converted to the original IR in the target format by the DL compiler.

具体的,考虑到除了某些现有的完整的DL模型需要进行检测外,对于某些不常见的DL模型也需要设计开发代码并对开发代码进行检测,而开发代码本身的作用就是将DL模型原始的IR转换为AI芯片可识别的IR,因此对于不常见的DL模型,本发明实施例中并没有构建完整的DL模型,而是预先构建了完整DL模型中的一部分:“DL模型原始IR”,不但实现了对于“不常见DL模型”的开发代码的测试,而且直接减少了工作量。Specifically, considering that in addition to some existing complete DL models that need to be detected, for some uncommon DL models, it is also necessary to design and develop codes and detect the developed codes, and the function of the developed codes is to convert the DL model The original IR is converted into the IR recognizable by the AI chip. Therefore, for the uncommon DL model, the embodiment of the present invention does not construct a complete DL model, but pre-builds a part of the complete DL model: "DL model original IR ", which not only realizes the test of the development code for "uncommon DL models", but also directly reduces the workload.

具体的,在确定目标DL模型的时候,DL模型库中完整的DL模型以及预先构建的DL模型原始IR对应的DL模型均可以被选做目标DL模型,因此本发明实施例中可以在预先从DL模型库中挑选指定类型框架的DL模型后,判断指定类型框架的DL模型在DL模型库中是否已存在预先构建的DL模型原始IR,如果不存在,可以通过DL编译器将目标DL模型转换为目标格式的原始的IR,如果存在则可以直接利用待测开发代码将DL编译器的目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件。Specifically, when determining the target DL model, both the complete DL model in the DL model library and the DL model corresponding to the original IR of the pre-built DL model can be selected as the target DL model. After selecting the DL model of the specified type of frame in the DL model library, judge whether the DL model of the specified type of frame already exists in the DL model library. The original IR of the pre-built DL model, if not, can convert the target DL model through the DL compiler The original IR in the target format, if it exists, can directly use the development code to be tested to convert the original IR in the target format of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file.

其中,DL模型可以为多种,例如可以为Tensorflow、Pytorch、onnx、PaddlePaddle、Caffe、shufflenet以及faster rcnn等,本发明实施例在此不做限定。Among them, there can be various DL models, such as Tensorflow, Pytorch, onnx, PaddlePaddle, Caffe, shufflenet, and faster rcnn, etc., which are not limited in this embodiment of the present invention.

作为一种优选的实施例,利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件具体为:As a preferred embodiment, use the code to be tested to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain the executable file as follows:

从开发代码库中与目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码;Select one of the multiple candidate development codes corresponding to the framework type of the target DL model in the development code library as the development code to be tested;

利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;Use the development code to be tested to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file;

根据预期结果以及观测结果评估待测开发代码的可靠性之后,该DL模型精度测试方法还包括:After evaluating the reliability of the developed code to be tested according to the expected results and observation results, the DL model accuracy testing method also includes:

判断开发代码库中是否存在与目标DL模型的框架类型对应的未经测试的开发代码;Determine whether there is untested development code corresponding to the framework type of the target DL model in the development code base;

若存在,则执行从开发代码库中与目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码的步骤。If it exists, the step of selecting one as the development code to be tested from among multiple candidate development codes corresponding to the frame type of the target DL model in the development code library is performed.

具体的,考虑到对于同一种框架类型的DL模型可能同时存在多种类型的开发代码,因此需要对同一框架类型对应的多种不同开发代码分别进行测试,因此为了提高工作效率,本发明实施例中可以从开发代码库中与目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码,然后利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件,最后在得到待测开发代码的可靠性之后,还可以判断开发代码库中是否存在与目标DL模型的框架类型对应的未经测试的开发代码,如果存在,则可以继续从开发代码库中与目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码,从而自动化地实现对于同一框架类型对应的多种不同开发代码的测试过程,提升了自动化程度以及工作效率。Specifically, considering that there may be multiple types of development codes for the DL model of the same framework type, it is necessary to test the various development codes corresponding to the same framework type. Therefore, in order to improve work efficiency, the embodiment of the present invention In the development code library, one can be selected from multiple candidate development codes corresponding to the framework type of the target DL model as the development code to be tested, and then the original intermediate representation IR of the DL compiler can be converted into artificial The smart AI chip can recognize the IR and get the executable file. Finally, after getting the reliability of the development code to be tested, it can also judge whether there is untested development code corresponding to the framework type of the target DL model in the development code base , if it exists, you can continue to select one of the multiple candidate development codes corresponding to the framework type of the target DL model in the development code base as the development code to be tested, so as to automatically implement multiple different development codes corresponding to the same framework type. The testing process of developing code improves the degree of automation and work efficiency.

作为一种优选的实施例,根据预期结果以及观测结果评估待测开发代码的可靠性之后,该DL模型精度测试方法还包括:As a preferred embodiment, after evaluating the reliability of the developed code to be tested according to the expected results and observation results, the DL model accuracy testing method further includes:

控制提示器提示待测开发代码的可靠性评估结果。The control prompter prompts the reliability evaluation result of the developed code to be tested.

具体的,为了便于工作人员及时获知待测开发代码的可靠性评估结果,本发明实施例可以控制提示器提示待测开发代码的可靠性评估结果。Specifically, in order to facilitate the staff to know the reliability evaluation result of the development code to be tested in time, the embodiment of the present invention may control the prompter to prompt the reliability evaluation result of the development code to be tested.

其中,提示器可以为多种类型,例如可以为显示器等,本发明实施例在此不做限定。Wherein, the prompter can be of various types, for example, it can be a display, etc., which is not limited in this embodiment of the present invention.

作为一种优选的实施例,判断开发代码库中是否存在与目标DL模型的框架类型对应的未经测试的开发代码之后,该DL模型精度测试方法还包括:As a preferred embodiment, after determining whether there is untested development code corresponding to the framework type of the target DL model in the development code library, the DL model accuracy testing method further includes:

若不存在,生成与目标DL模型的框架类型对应且经过测试的所有开发代码的可靠性评估结果的横向对比信息;If it does not exist, generate horizontal comparison information of the reliability evaluation results of all developed codes corresponding to the framework type of the target DL model and tested;

控制提示器提示DL编译器对应的各个开发代码的横向对比信息。The control prompter prompts the horizontal comparison information of each development code corresponding to the DL compiler.

具体的,考虑到工作人员可能需要对同一框架类型的DL模型对应的多个开发代码的可靠性评估结果进行横向对比,因此为了提升工作效率以及用户体验,本发明实施例中可以在开发代码库中不存在与目标DL模型的框架类型对应的未经测试的开发代码之后,生成与目标DL模型的框架类型对应且经过测试的所有开发代码的可靠性评估结果的横向对比信息,并控制提示器提示DL编译器对应的各个开发代码的横向对比信息。Specifically, considering that the staff may need to make a horizontal comparison of the reliability evaluation results of multiple development codes corresponding to the DL model of the same framework type, in order to improve work efficiency and user experience, in the embodiment of the present invention, the development code library can After there is no untested development code corresponding to the framework type of the target DL model, generate horizontal comparison information of the reliability evaluation results of all tested development codes corresponding to the framework type of the target DL model, and control the prompter Prompt the horizontal comparison information of each development code corresponding to the DL compiler.

其中,横向对比信息可以包括多种内容,例如可以包括各个待测开发代码的可靠性排序等,本发明实施例在此不做限定。Wherein, the horizontal comparison information may include various contents, for example, it may include reliability ranking of each development code to be tested, etc., which is not limited in this embodiment of the present invention.

作为一种优选的实施例,判断开发代码库中是否存在与目标DL模型的框架类型对应的未经测试的开发代码之后,该DL模型精度测试方法还包括:As a preferred embodiment, after determining whether there is untested development code corresponding to the framework type of the target DL model in the development code library, the DL model accuracy testing method further includes:

若不存在,则判断DL模型库中所有的DL模型是否均已完成测试;If it does not exist, it is judged whether all the DL models in the DL model library have been tested;

若未均完成,则执行预先从DL模型库中挑选指定类型框架的DL模型的步骤。If not completed, perform the step of selecting a DL model of a specified type of frame from the DL model library in advance.

具体的,为了实现自动化的对DL模型库中包含的多个DL模型对应的开发代码的可靠性测试,本发明实施例中可以在判定开发代码库中不存在与目标DL模型的框架类型对应的未经测试的开发代码时,判断DL模型库中所有的DL模型是否均已完成测试,如果未均完成,则可以执行预先从DL模型库中挑选指定类型框架的DL模型的步骤,进一步提升了自动化程度以及工作效率。Specifically, in order to realize automated reliability testing of development codes corresponding to multiple DL models contained in the DL model library, in the embodiment of the present invention, it may be determined that there is no code corresponding to the framework type of the target DL model in the development code library. When developing code without testing, it is judged whether all DL models in the DL model library have been tested. If not, the step of selecting a DL model of a specified type of frame from the DL model library in advance can be performed to further improve the degree of automation and work efficiency.

作为一种优选的实施例,该DL模型精度测试方法还包括:As a preferred embodiment, the DL model accuracy testing method also includes:

响应于开发代码修改指令,对开发代码库中指定的开发代码进行修改;modifying the development code specified in the development code base in response to the development code modification instruction;

响应于开发代码添加指令,将指定的开发代码添加至开发代码库。In response to the development code adding instruction, the specified development code is added to the development code base.

具体了,考虑到工作人员存在对开发代码库中存在的开发代码进行修改或者向开发代码库中添加新的开发代码的需求,因此本发明实施例中提供了这两种接口,可以响应于开发代码修改指令,对开发代码库中指定的开发代码进行修改,还可以响应于开发代码添加指令,将指定的开发代码添加至开发代码库。Specifically, considering that there is a need for the staff to modify the development code existing in the development code base or add new development code to the development code base, these two interfaces are provided in the embodiment of the present invention, which can respond to the development The code modification instruction modifies the development code specified in the development code library, and may also respond to the development code adding instruction to add the specified development code to the development code library.

作为一种优选的实施例,DL编译器为端到端的深度学习编译器TVM,目标格式为JS对象简谱JSON。As a preferred embodiment, the DL compiler is an end-to-end deep learning compiler TVM, and the target format is JS object numbered musical notation JSON.

具体的,TVM是一种成熟且高效的DL编译器,其对于JSON格式文件的导入速度较快,因此选用JSON作为目标格式。Specifically, TVM is a mature and efficient DL compiler, and its import speed for JSON format files is relatively fast, so JSON is selected as the target format.

当然,除了该具体情况外,DL编译器及其对应的目标格式还可以为其他类型,本发明实施例在此不做限定。Of course, except for this specific case, the DL compiler and its corresponding target format may also be of other types, which are not limited in this embodiment of the present invention.

作为一种优选的实施例,根据预期结果以及观测结果评估待测开发代码的可靠性具体为:As a preferred embodiment, evaluating the reliability of the development code to be tested according to the expected results and observation results is specifically as follows:

基于卡方测试法,根据预期结果以及观测结果评估待测开发代码的可靠性。Based on the chi-square test method, the reliability of the developed code to be tested is evaluated according to the expected results and the observed results.

具体的,考虑到预期结果以及观测结果符合卡方检测的标准,因此本发明实施例中可以使用开发检测法,根据预期结果以及观测结果评估待测开发代码的可靠性,具体可以为:Specifically, considering that the expected results and observation results conform to the chi-square test standard, the development detection method can be used in the embodiment of the present invention to evaluate the reliability of the development code to be tested according to the expected results and observation results, which can be specifically:

其中,x2为卡方检测的检测数值,f0为观测结果,fe为预期结果。Among them, x 2 is the detection value of the chi-square test, f0 is the observed result, and f e is the expected result.

其中,当卡方检测的检测数值不大于预设阈值,该误差来源于有效数字,此时可以确认待测开发代码的算子实现无误,若检测数值大于预设阈值,则需模型阶段确认问题算子进而更正。Among them, when the detection value of chi-square detection is not greater than the preset threshold, the error comes from the effective number, and at this time it can be confirmed that the operator of the development code to be tested is implemented correctly. If the detection value is greater than the preset threshold, the problem needs to be confirmed at the model stage The operator then corrects.

具体的,预设阈值可以进行自主设定,例如可以为e-5等,本发明实施例在此不做限定。Specifically, the preset threshold can be set independently, for example, it can be e -5 , etc., which is not limited in this embodiment of the present invention.

为了更好地对本发明实施例进行说明,请参考下表1,表1为Shufflenet模型精度测试结果表。In order to better describe the embodiment of the present invention, please refer to Table 1 below, which is a table of Shufflenet model accuracy test results.

表1Table 1

请参考图3,图3为本发明提供的一种DL模型精度测试装置的结构示意图,该DL模型精度测试装置包括:Please refer to FIG. 3. FIG. 3 is a schematic structural diagram of a DL model accuracy testing device provided by the present invention. The DL model accuracy testing device includes:

第一获取模块31,用于将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果;The first acquisition module 31 is used to take the execution result of the target DL model compiled by the deep learning DL compiler in a specified type of standard hardware as the expected result;

控制模块32,用于利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;The control module 32 is used to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and obtain an executable file;

第二获取模块33,用于将可执行文件在AI芯片中的执行结果作为观测结果;The second acquisition module 33 is used to take the execution result of the executable file in the AI chip as the observation result;

评估模块34,用于根据预期结果以及观测结果评估待测开发代码的可靠性。An evaluation module 34, configured to evaluate the reliability of the developed code to be tested according to expected results and observation results.

本发明提供了一种DL模型精度测试装置,考虑到目前存在的标准硬件对于DL模型的精确执行结果可作为标准进行参考,而且进行IR转换的开发代码的可靠性可以由DL模型的执行结果体现,因此本申请可以首先得到目标DL模型在指定类型的标准硬件中的执行结果并将其作为预期结果,然后利用待测开发代码将DL编译器的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件,接着将可执行文件在AI芯片中的执行结果作为观测结果,通过预期结果与观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度。The present invention provides a DL model accuracy test device, considering that the existing standard hardware can be used as a reference for the accurate execution result of the DL model, and the reliability of the development code for IR conversion can be reflected by the execution result of the DL model , so this application can first obtain the execution result of the target DL model in the specified type of standard hardware and take it as the expected result, and then use the code to be tested to convert the original IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip , and get the executable file, and then take the execution result of the executable file in the AI chip as the observation result, and then evaluate the reliability of the code to be tested and develop through the expected result and observation result, so as to guide the design of a reliable development code, It is conducive to improving the accuracy of the DL model, that is, the DL algorithm.

对于本发明实施例提供的DL模型精度测试装置的介绍请参照前述的DL模型精度测试方法的实施例,本发明实施例在此不再赘述。For the introduction of the DL model accuracy testing device provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the DL model accuracy testing method, and the embodiment of the present invention will not be repeated here.

请参考图4,图4为本发明提供的一种DL模型精度测试设备的结构示意图,该DL模型精度测试设备包括:Please refer to FIG. 4. FIG. 4 is a schematic structural diagram of a DL model accuracy testing device provided by the present invention. The DL model accuracy testing device includes:

存储器41,用于存储计算机程序;Memory 41, used to store computer programs;

处理器42,用于执行计算机程序时实现如前述实施例中DL模型精度测试方法的步骤。The processor 42 is configured to implement the steps of the method for testing the accuracy of the DL model in the foregoing embodiments when executing the computer program.

具体的,存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机可读指令,该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。处理器执行存储器中保存的计算机程序时,可以实现以下步骤:将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果;利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;将可执行文件在AI芯片中的执行结果作为观测结果;根据预期结果以及观测结果评估待测开发代码的可靠性。Specifically, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer-readable instructions, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the non-volatile storage medium. When the processor executes the computer program stored in the memory, the following steps can be implemented: the execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware is used as the expected result; The original intermediate representation IR of the DL compiler is converted into the IR recognizable by the artificial intelligence AI chip, and the executable file is obtained; the execution result of the executable file in the AI chip is taken as the observation result; the development under test is evaluated according to the expected result and the observation result code reliability.

本发明提供了一种DL模型精度测试设备,考虑到目前存在的标准硬件对于DL模型的精确执行结果可作为标准进行参考,而且进行IR转换的开发代码的可靠性可以由DL模型的执行结果体现,因此本申请可以首先得到目标DL模型在指定类型的标准硬件中的执行结果并将其作为预期结果,然后利用待测开发代码将DL编译器的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件,接着将可执行文件在AI芯片中的执行结果作为观测结果,通过预期结果与观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度。The present invention provides a DL model accuracy testing device, considering that the existing standard hardware can be used as a reference for the accurate execution result of the DL model, and the reliability of the development code for IR conversion can be reflected by the execution result of the DL model , so this application can first obtain the execution result of the target DL model in the specified type of standard hardware and take it as the expected result, and then use the code to be tested to convert the original IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip , and get the executable file, and then take the execution result of the executable file in the AI chip as the observation result, and then evaluate the reliability of the code to be tested and develop through the expected result and observation result, so as to guide the design of a reliable development code, It is conducive to improving the accuracy of the DL model, that is, the DL algorithm.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:预先通过DL编译器将目标DL模型转换为目标格式的原始的IR;As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: converting the target DL model into the original IR in the target format through a DL compiler in advance;

将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果具体为:The execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware is the expected result:

控制DL编译器根据目标格式的原始IR对目标DL模型进行编译;Control the DL compiler to compile the target DL model according to the original IR of the target format;

将指定类型的标准硬件对编译后的目标DL模型的执行结果作为预期结果;The execution result of the compiled target DL model on the specified type of standard hardware is taken as the expected result;

利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件具体为:Use the development code to be tested to convert the original intermediate representation IR of the DL compiler into the IR recognizable by the artificial intelligence AI chip, and obtain the executable file as follows:

利用待测开发代码将DL编译器的目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件。Use the development code to be tested to convert the original IR in the target format of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:预先从DL模型库中挑选指定类型框架的DL模型作为目标DL模型;As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: pre-selecting a DL model of a specified type of frame from the DL model library as the target DL model;

通过DL编译器将目标DL模型转换为目标格式的原始的IR。The target DL model is converted to the original IR in the target format by a DL compiler.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:DL模型库中包括DL模型以及预先构建的DL模型原始IR;As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: the DL model library includes the DL model and the original IR of the pre-built DL model;

预先从DL模型库中挑选指定类型框架的DL模型作为目标DL模型具体为:Pre-select the DL model of the specified type of frame from the DL model library as the target DL model, specifically:

预先从DL模型库中挑选指定类型框架的DL模型;Pre-select the DL model of the specified type of frame from the DL model library;

判断指定类型框架的DL模型在DL模型库中是否已存在预先构建的DL模型原始IR;Determine whether the DL model of the specified type of framework already has the original IR of the pre-built DL model in the DL model library;

若存在,则执行利用待测开发代码将DL编译器的目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件的步骤;If it exists, then perform the steps of converting the original IR of the target format of the DL compiler into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and obtaining an executable file;

若不存在,通过DL编译器将目标DL模型转换为目标格式的原始的IR。If it does not exist, the target DL model is converted to the original IR in the target format by the DL compiler.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:从开发代码库中与目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码;As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: select one of the multiple candidate development codes corresponding to the framework type of the target DL model in the development code base As the development code under test;

利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;Use the development code to be tested to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file;

根据预期结果以及观测结果评估待测开发代码的可靠性之后,该DL模型精度测试方法还包括:After evaluating the reliability of the developed code to be tested according to the expected results and observation results, the DL model accuracy testing method also includes:

判断开发代码库中是否存在与目标DL模型的框架类型对应的未经测试的开发代码;Determine whether there is untested development code corresponding to the framework type of the target DL model in the development code base;

若存在,则执行从开发代码库中与目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码的步骤。If it exists, the step of selecting one as the development code to be tested from among multiple candidate development codes corresponding to the frame type of the target DL model in the development code library is performed.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:控制提示器提示待测开发代码的可靠性评估结果。As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: the control prompter prompts the reliability evaluation result of the developed code to be tested.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:若不存在,生成与目标DL模型的框架类型对应且经过测试的所有开发代码的可靠性评估结果的横向对比信息;As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: If it does not exist, generate reliability evaluations of all tested development codes corresponding to the framework type of the target DL model Horizontal comparison information of the results;

控制提示器提示DL编译器对应的各个开发代码的横向对比信息。The control prompter prompts the horizontal comparison information of each development code corresponding to the DL compiler.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:若不存在,则判断DL模型库中所有的DL模型是否均已完成测试;As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: if it does not exist, then judge whether all the DL models in the DL model library have been tested;

若未均完成,则执行预先从DL模型库中挑选指定类型框架的DL模型的步骤。If not completed, perform the step of selecting a DL model of a specified type of frame from the DL model library in advance.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:响应于开发代码修改指令,对开发代码库中指定的开发代码进行修改;As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: modify the development code specified in the development code library in response to the development code modification instruction;

响应于开发代码添加指令,将指定的开发代码添加至开发代码库。In response to the development code adding instruction, the specified development code is added to the development code base.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:DL编译器为端到端的深度学习编译器TVM,目标格式为JS对象简谱JSON。As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps can be implemented: the DL compiler is an end-to-end deep learning compiler TVM, and the target format is JS object numbered musical notation JSON.

作为一种可选的实施例,处理器执行存储器中保存的计算机子程序时,可以实现以下步骤:基于卡方测试法,根据预期结果以及观测结果评估待测开发代码的可靠性。As an optional embodiment, when the processor executes the computer subroutine stored in the memory, the following steps may be implemented: based on the chi-square test method, evaluating the reliability of the developed code to be tested according to the expected result and the observed result.

对于本发明实施例提供的DL模型精度测试设备的介绍请参照前述的DL模型精度测试方法的实施例,本发明实施例在此不再赘述。For the introduction of the DL model accuracy testing equipment provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the DL model accuracy testing method, and the embodiments of the present invention will not be repeated here.

本发明还提供了一种服务器,包括服务器本体以及与服务器本体连接的如上的DL模型精度测试设备。The present invention also provides a server, including a server body and the above DL model accuracy testing device connected to the server body.

本发明提供了一种服务器,考虑到目前存在的标准硬件对于DL模型的精确执行结果可作为标准进行参考,而且进行IR转换的开发代码的可靠性可以由DL模型的执行结果体现,因此本申请可以首先得到目标DL模型在指定类型的标准硬件中的执行结果并将其作为预期结果,然后利用待测开发代码将DL编译器的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件,接着将可执行文件在AI芯片中的执行结果作为观测结果,通过预期结果与观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度。The present invention provides a server, considering that the existing standard hardware can be used as a reference for the accurate execution results of the DL model, and the reliability of the developed code for IR conversion can be reflected by the execution results of the DL model, so the present application The execution result of the target DL model in the specified type of standard hardware can be obtained first as the expected result, and then the original IR of the DL compiler can be converted into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and the identifiable IR can be obtained. Execute the file, and then take the execution result of the executable file in the AI chip as the observation result. The reliability of the code to be tested can be evaluated through the expected result and the observation result, so as to guide the design of a reliable development code, which is conducive to improving DL The model is also the accuracy of the DL algorithm.

对于本发明实施例提供的服务器的介绍请参照前述的DL模型精度测试方法的实施例,本发明实施例在此不再赘述。For the introduction of the server provided by the embodiment of the present invention, please refer to the aforementioned embodiment of the DL model accuracy testing method, and the embodiment of the present invention will not be repeated here.

请参考图5,图5为本发明提供的一种计算机可读存储介质的结构示意图,该计算机可读存储介质50上存储有计算机程序51,计算机程序51被处理器41执行时实现如前述实施例中DL模型精度测试方法的步骤。Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of a computer-readable storage medium provided by the present invention. A computer program 51 is stored on the computer-readable storage medium 50. When the computer program 51 is executed by the processor 41, the aforementioned implementation The steps of the DL model accuracy test method in the example.

具体的,该可读存储介质可以包括:U盘、移动硬盘、只读存储器(Read-OnlyMemory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。该存储介质上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果;利用待测开发代码将DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;将可执行文件在AI芯片中的执行结果作为观测结果;根据预期结果以及观测结果评估待测开发代码的可靠性。Specifically, the readable storage medium may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., which can store various programs. The medium of the code. A computer program is stored on the storage medium, and when the computer program is executed by the processor, the following steps are implemented: the execution result of the target DL model compiled by the deep learning DL compiler in a specified type of standard hardware is taken as the expected result; The test and development code converts the original intermediate representation IR of the DL compiler into the IR recognizable by the artificial intelligence AI chip, and obtains the executable file; the execution result of the executable file in the AI chip is taken as the observation result; according to the expected result and the observation result Assess the reliability of the developed code under test.

本发明提供了一种计算机可读存储介质,考虑到目前存在的标准硬件对于DL模型的精确执行结果可作为标准进行参考,而且进行IR转换的开发代码的可靠性可以由DL模型的执行结果体现,因此本申请可以首先得到目标DL模型在指定类型的标准硬件中的执行结果并将其作为预期结果,然后利用待测开发代码将DL编译器的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件,接着将可执行文件在AI芯片中的执行结果作为观测结果,通过预期结果与观测结果便可对待测开发代码的可靠性进行评估,从而指导设计出可靠的开发代码,有利于提升DL模型也即DL算法的精度。The present invention provides a computer-readable storage medium, considering that the existing standard hardware can be used as a reference for the accurate execution results of the DL model, and the reliability of the developed code for IR conversion can be reflected by the execution results of the DL model , so this application can first obtain the execution result of the target DL model in the specified type of standard hardware and take it as the expected result, and then use the code to be tested to convert the original IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip , and get the executable file, and then take the execution result of the executable file in the AI chip as the observation result, and then evaluate the reliability of the code to be tested and develop through the expected result and observation result, so as to guide the design of a reliable development code, It is conducive to improving the accuracy of the DL model, that is, the DL algorithm.

对于本发明实施例提供的计算机可读存储介质的介绍请参照前述的DL模型精度测试方法的实施例,本发明实施例在此不再赘述。For the introduction of the computer-readable storage medium provided by the embodiment of the present invention, please refer to the foregoing embodiment of the DL model accuracy testing method, and the embodiments of the present invention will not be repeated here.

本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。还需要说明的是,在本说明书中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者设备中还存在另外的相同要素。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for relevant details, please refer to the description of the method part. It should also be noted that in this specification, relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations There is no such actual relationship or order between the operations. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements of or also include elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article or apparatus comprising that element.

对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神或范围的情况下,在其他实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention will not be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (15)

1.一种DL模型精度测试方法,其特征在于,包括:1. A DL model accuracy testing method, is characterized in that, comprises: 将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果;The execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware is taken as the expected result; 利用待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;Using the code to be tested to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file; 将所述可执行文件在所述AI芯片中的执行结果作为观测结果;Taking the execution result of the executable file in the AI chip as the observation result; 根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性。Evaluate the reliability of the developed code to be tested according to the expected result and the observed result. 2.根据权利要求1所述的DL模型精度测试方法,其特征在于,该DL模型精度测试方法还包括:2. The DL model accuracy testing method according to claim 1, wherein the DL model accuracy testing method further comprises: 预先通过所述DL编译器将目标DL模型转换为目标格式的所述原始的IR;converting the target DL model into the original IR in the target format through the DL compiler in advance; 所述将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果具体为:The execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware as the expected result is specifically: 控制所述DL编译器根据所述目标格式的原始IR对所述目标DL模型进行编译;controlling the DL compiler to compile the target DL model according to the original IR of the target format; 将指定类型的标准硬件对编译后的所述目标DL模型的执行结果作为预期结果;Taking the execution result of the compiled target DL model on the specified type of standard hardware as the expected result; 所述利用待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件具体为:The described use of the development code to be tested converts the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and the executable file obtained is specifically: 利用待测开发代码将所述DL编译器的所述目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件。The original IR of the target format of the DL compiler is converted into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and an executable file is obtained. 3.根据权利要求2所述的DL模型精度测试方法,其特征在于,所述预先通过所述DL编译器将目标DL模型转换为目标格式的所述原始的IR具体为:3. The DL model accuracy testing method according to claim 2, wherein the original IR that converts the target DL model into the target format by the DL compiler in advance is specifically: 预先从DL模型库中挑选指定类型框架的DL模型作为目标DL模型;Pre-select the DL model of the specified type of frame from the DL model library as the target DL model; 通过所述DL编译器将所述目标DL模型转换为目标格式的所述原始的IR。converting the target DL model into the original IR in target format by the DL compiler. 4.根据权利要求3所述的DL模型精度测试方法,其特征在于,所述DL模型库中包括DL模型以及预先构建的DL模型原始IR;4. The DL model accuracy testing method according to claim 3, wherein the DL model library includes DL models and pre-built DL model original IRs; 所述预先从DL模型库中挑选指定类型框架的DL模型作为目标DL模型具体为:The pre-selected DL model of a specified type of frame from the DL model library as the target DL model is specifically: 预先从DL模型库中挑选指定类型框架的DL模型;Pre-select the DL model of the specified type of frame from the DL model library; 判断所述指定类型框架的DL模型在所述DL模型库中是否已存在所述预先构建的DL模型原始IR;Judging whether the DL model of the specified type of framework already exists in the DL model library in the original IR of the pre-built DL model; 若存在,则执行所述利用待测开发代码将所述DL编译器的所述目标格式的原始IR转换为人工智能AI芯片可识别的IR,并得到可执行文件的步骤;If it exists, the original IR of the target format of the DL compiler is converted into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and the step of obtaining an executable file is performed; 若不存在,通过所述DL编译器将所述目标DL模型转换为目标格式的所述原始的IR。If not, converting the target DL model into the original IR in target format by the DL compiler. 5.根据权利要求4所述的DL模型精度测试方法,其特征在于,所述利用待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件具体为:5. The DL model accuracy testing method according to claim 4, characterized in that, the original intermediate representation IR of the DL compiler is converted into the recognizable IR of the artificial intelligence AI chip by using the development code to be tested, and obtained Executable files are: 从开发代码库中与所述目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码;Select one as the development code to be tested from a plurality of candidate development codes corresponding to the framework type of the target DL model in the development code library; 利用所述待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;Using the code to be tested to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip, and obtain an executable file; 所述根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性之后,该DL模型精度测试方法还包括:After evaluating the reliability of the developed code to be tested according to the expected result and the observed result, the DL model accuracy testing method further includes: 判断所述开发代码库中是否存在与所述目标DL模型的框架类型对应的未经测试的开发代码;Judging whether there is untested development code corresponding to the framework type of the target DL model in the development code library; 若存在,则执行所述从开发代码库中与所述目标DL模型的框架类型对应的多个备选开发代码中,选择一个作为待测开发代码的步骤。If it exists, the step of selecting one as the development code to be tested from a plurality of candidate development codes corresponding to the framework type of the target DL model in the development code base is executed. 6.根据权利要求5所述的DL模型精度测试方法,其特征在于,所述根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性之后,该DL模型精度测试方法还包括:6. The DL model accuracy testing method according to claim 5, characterized in that, after evaluating the reliability of the development code to be tested according to the expected results and the observation results, the DL model accuracy testing method further include: 控制提示器提示所述待测开发代码的可靠性评估结果。The control prompter prompts the reliability evaluation result of the development code to be tested. 7.根据权利要求6所述的DL模型精度测试方法,其特征在于,所述判断所述开发代码库中是否存在与所述目标DL模型的框架类型对应的未经测试的开发代码之后,该DL模型精度测试方法还包括:7. The DL model accuracy testing method according to claim 6, characterized in that, after determining whether there is untested development code corresponding to the frame type of the target DL model in the described development code base, the DL model accuracy testing methods also include: 若不存在,生成与所述目标DL模型的框架类型对应且经过测试的所有所述开发代码的所述可靠性评估结果的横向对比信息;If it does not exist, generate horizontal comparison information of the reliability evaluation results of all the developed codes that correspond to the framework type of the target DL model and have been tested; 控制所述提示器提示所述DL编译器对应的各个所述开发代码的所述横向对比信息。The prompter is controlled to prompt the horizontal comparison information of each of the development codes corresponding to the DL compiler. 8.根据权利要求7所述的DL模型精度测试方法,其特征在于,所述判断所述开发代码库中是否存在与所述目标DL模型的框架类型对应的未经测试的开发代码之后,该DL模型精度测试方法还包括:8. The DL model accuracy testing method according to claim 7, characterized in that, after determining whether there is untested development code corresponding to the framework type of the target DL model in the described development code base, the DL model accuracy testing methods also include: 若不存在,则判断所述DL模型库中所有的DL模型是否均已完成测试;If it does not exist, it is judged whether all the DL models in the DL model library have been tested; 若未均完成,则执行所述预先从DL模型库中挑选指定类型框架的DL模型的步骤。If not completed, the step of selecting a DL model of a specified type of frame from the DL model library in advance is performed. 9.根据权利要求5所述的DL模型精度测试方法,其特征在于,该DL模型精度测试方法还包括:9. The DL model accuracy testing method according to claim 5, wherein the DL model accuracy testing method further comprises: 响应于开发代码修改指令,对所述开发代码库中指定的所述开发代码进行修改;modifying the development code specified in the development code library in response to a development code modification instruction; 响应于开发代码添加指令,将指定的所述开发代码添加至所述开发代码库。Adding the specified development code to the development code library in response to a development code adding instruction. 10.根据权利要求2所述的DL模型精度测试方法,其特征在于,所述DL编译器为端到端的深度学习编译器TVM,所述目标格式为JS对象简谱JSON。10. The DL model accuracy testing method according to claim 2, wherein the DL compiler is an end-to-end deep learning compiler TVM, and the target format is JS object numbered musical notation JSON. 11.根据权利要求1至10任一项所述的DL模型精度测试方法,其特征在于,所述根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性具体为:11. The DL model accuracy testing method according to any one of claims 1 to 10, wherein the evaluation of the reliability of the development code to be tested according to the expected result and the observed result is specifically: 基于卡方测试法,根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性。Based on the chi-square test method, the reliability of the development code to be tested is evaluated according to the expected result and the observed result. 12.一种DL模型精度测试装置,其特征在于,包括:12. A DL model accuracy testing device, characterized in that, comprising: 第一获取模块,用于将经深度学习DL编译器编译后的目标DL模型,在指定类型的标准硬件中的执行结果作为预期结果;The first acquisition module is used to take the execution result of the target DL model compiled by the deep learning DL compiler in the specified type of standard hardware as the expected result; 控制模块,用于利用待测开发代码将所述DL编译器原始的中间表示IR转换为人工智能AI芯片可识别的IR,并得到可执行文件;The control module is used to convert the original intermediate representation IR of the DL compiler into an IR recognizable by the artificial intelligence AI chip by using the development code to be tested, and obtain an executable file; 第二获取模块,用于将所述可执行文件在所述AI芯片中的执行结果作为观测结果;The second acquisition module is used to take the execution result of the executable file in the AI chip as the observation result; 评估模块,用于根据所述预期结果以及所述观测结果评估所述待测开发代码的可靠性。An evaluation module, configured to evaluate the reliability of the developed code to be tested according to the expected result and the observed result. 13.一种DL模型精度测试设备,其特征在于,包括:13. A DL model accuracy testing device, characterized in that, comprising: 存储器,用于存储计算机程序;memory for storing computer programs; 处理器,用于执行所述计算机程序时实现如权利要求1至11任一项所述DL模型精度测试方法的步骤。A processor, configured to implement the steps of the DL model accuracy testing method according to any one of claims 1 to 11 when executing the computer program. 14.一种服务器,其特征在于,包括服务器本体以及与所述服务器本体连接的如权利要求13所述的DL模型精度测试设备。14. A server, characterized by comprising a server body and the DL model accuracy testing device according to claim 13 connected to the server body. 15.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至11任一项所述DL模型精度测试方法的步骤。15. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the DL model according to any one of claims 1 to 11 is realized The steps of the accuracy test method.
CN202310426841.8A 2023-04-20 2023-04-20 DL model precision testing method, device, equipment, server and storage medium Pending CN116450519A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310426841.8A CN116450519A (en) 2023-04-20 2023-04-20 DL model precision testing method, device, equipment, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310426841.8A CN116450519A (en) 2023-04-20 2023-04-20 DL model precision testing method, device, equipment, server and storage medium

Publications (1)

Publication Number Publication Date
CN116450519A true CN116450519A (en) 2023-07-18

Family

ID=87126996

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310426841.8A Pending CN116450519A (en) 2023-04-20 2023-04-20 DL model precision testing method, device, equipment, server and storage medium

Country Status (1)

Country Link
CN (1) CN116450519A (en)

Similar Documents

Publication Publication Date Title
KR102737026B1 (en) Automatically generating machine learning models for software tools that operate on source code
US9569342B2 (en) Test strategy for profile-guided code execution optimizers
CN111104335B (en) A C language defect detection method and device based on multi-level analysis
CN110990020A (en) A software compiling method, device, electronic device and storage medium
US20130067441A1 (en) Profile guided jit code generation
EP2706459B1 (en) Apparatus and method for validating a compiler for a reconfigurable processor
US20080307387A1 (en) Software development apparatus and method for providing performance prediction
US20110145799A1 (en) Path-sensitive dataflow analysis including path refinement
KR102333845B1 (en) Method, apparatus, device and storage medium for generating chip-based computing functions
CN112433706B (en) Compiling option tuning method and device, processor chip and server
CN112100072A (en) Static detection method, device, equipment and medium for application program codes
US8539467B2 (en) Method and data processing system for solving resource conflicts in assembler programs
CN107145446B (en) Application program APP test method, device and medium
US20090217259A1 (en) Building Operating System Images Based on Applications
US10380313B1 (en) Implementation and evaluation of designs for heterogeneous computing platforms with hardware acceleration
US7895575B2 (en) Apparatus and method for generating test driver
CN106557414A (en) Application testing system and method
CN102520984B (en) Computing method for worst time of object software in specified hardware environment
CN114490337A (en) Commissioning method, commissioning platform, equipment and storage medium
CN108959103A (en) Software Testing Method Based on BWDSP Library Function
JP2010108258A (en) Compiling method and compiling program
CN116450519A (en) DL model precision testing method, device, equipment, server and storage medium
US20110218794A1 (en) Concretization of abstracted traces
CN110716859A (en) Method for automatically pushing test cases for modified codes and related device
CN115830419A (en) Data-driven artificial intelligence technology evaluation system and method

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