CN114996136A - Test data determination method and device, electronic equipment and readable storage medium - Google Patents
Test data determination method and device, electronic equipment and readable storage medium Download PDFInfo
- Publication number
- CN114996136A CN114996136A CN202210640253.XA CN202210640253A CN114996136A CN 114996136 A CN114996136 A CN 114996136A CN 202210640253 A CN202210640253 A CN 202210640253A CN 114996136 A CN114996136 A CN 114996136A
- Authority
- CN
- China
- Prior art keywords
- neural network
- data
- test data
- search
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Biomedical Technology (AREA)
- Computational Linguistics (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Computer Hardware Design (AREA)
- Biophysics (AREA)
- Quality & Reliability (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
技术领域technical field
本公开涉及测试技术领域,特别涉及一种测试数据确定方法及装置、电子设备、可读存储介质。The present disclosure relates to the technical field of testing, and in particular, to a method and apparatus for determining test data, an electronic device, and a readable storage medium.
背景技术Background technique
由于神经网络处理系统的设计复杂度高,从而提高了神经网络处理系统的测试复杂度。开发者往往要在大量的神经网络中,找到会让整个神经网络处理系统出错或者性能变差的测试用例,以改进神经网络处理系统的设计。Due to the high design complexity of the neural network processing system, the testing complexity of the neural network processing system is increased. Developers often need to find test cases in a large number of neural networks that will make the entire neural network processing system fail or deteriorate in performance, so as to improve the design of the neural network processing system.
在通常的测试方法中,往往采用测试人员手动构造测试用例,例如用于对神经网络系统进行测试的测试网络,或者手动编写规则生成测试用例的方式测试整个神经网络测试系统,但通过手动构造测试用例,或者手动编写规则的测试难度较大,测试效率低。In the usual testing methods, testers are often used to manually construct test cases, such as a test network for testing neural network systems, or manually write rules to generate test cases to test the entire neural network test system, but by manually constructing tests Use cases, or tests that manually write rules are more difficult and less efficient.
发明内容SUMMARY OF THE INVENTION
本公开提供一种测试数据确定方法及装置、电子设备、可读存储介质。The present disclosure provides a test data determination method and device, an electronic device, and a readable storage medium.
第一方面,本公开提供了一种测试数据确定方法,该测试数据确定方法包括:在预定搜索空间中进行神经网络搜索,根据搜索结果确定待测试数据;通过神经网络处理系统运行待测试数据,得到待测试数据的运行结果;在运行结果为运行异常的情况下,将待测试数据确定为目标测试数据,目标测试数据用于改进神经网络处理系统。In a first aspect, the present disclosure provides a method for determining test data, the method for determining test data includes: performing a neural network search in a predetermined search space, and determining data to be tested according to the search results; running the data to be tested through a neural network processing system, The running result of the data to be tested is obtained; if the running result is abnormal, the data to be tested is determined as the target test data, and the target test data is used to improve the neural network processing system.
第二方面,本公开提供了一种测试数据确定装置,该测试数据确定装置包括:搜索模块,用于在预定的神经网络搜索空间中进行网络结构搜索,根据搜索结果确定待测试数据;运行模块,用于通过神经网络处理系统运行待测试数据,得到待测试数据的运行结果;确定模块,用于在运行结果为运行异常的情况下,将待测试数据确定为目标测试数据,目标测试数据用于改进神经网络处理系统。In a second aspect, the present disclosure provides a test data determination device, the test data determination device includes: a search module for performing a network structure search in a predetermined neural network search space, and determining the data to be tested according to the search result; an operation module , which is used to run the data to be tested through the neural network processing system to obtain the running result of the data to be tested; the determination module is used to determine the data to be tested as the target test data when the running result is abnormal. for improving neural network processing systems.
第三方面,本公开提供了一种电子设备,该电子设备包括:至少一个处理器;以及与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的一个或多个计算机程序,一个或多个所述计算机程序被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述的测试数据确定方法。In a third aspect, the present disclosure provides an electronic device, the electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores data that can be processed by the at least one processor One or more computer programs executed by the processor, the one or more computer programs being executed by the at least one processor to enable the at least one processor to perform the above-described test data determination method.
第四方面,本公开提供了一种计算机可读存储介质,其上存储有计算机程序,其中,所述计算机程序在被处理器/处理核执行时实现上述的测试数据确定方法。In a fourth aspect, the present disclosure provides a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned test data determination method when executed by a processor/processing core.
本公开所提供的实施例,能够从预定搜索空间中进行神经网络搜索以得到使神经网络处理系统运行异常的目标测试数据,从而使用该使神经网络处理系统运行异常的目标测试数据改进神经网络处理系统,有利于提高测试效率和测试覆盖率。The embodiments provided by the present disclosure can perform a neural network search from a predetermined search space to obtain target test data that causes the neural network processing system to operate abnormally, so as to use the target test data that causes the neural network processing system to operate abnormally to improve neural network processing system, which is conducive to improving test efficiency and test coverage.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or critical features of embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
附图说明Description of drawings
附图用来提供对本公开的进一步理解,并且构成说明书的一部分,与本公开的实施例一起用于解释本公开,并不构成对本公开的限制。通过参考附图对详细示例实施例进行描述,以上和其他特征和优点对本领域技术人员将变得更加显而易见,在附图中:The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification, and together with the embodiments of the present disclosure, they are used to explain the present disclosure, and are not intended to limit the present disclosure. The above and other features and advantages will become more apparent to those skilled in the art by describing detailed example embodiments with reference to the accompanying drawings, in which:
图1为本公开实施例提供的一种测试数据确定方法的流程图;1 is a flowchart of a method for determining test data according to an embodiment of the present disclosure;
图2为本公开实施例提供的神经网络架构搜索的系统框架示意图;2 is a schematic diagram of a system framework for neural network architecture search provided by an embodiment of the present disclosure;
图3为本公开示例性实施例提供的测试数据确定方法的流程示意图;3 is a schematic flowchart of a method for determining test data provided by an exemplary embodiment of the present disclosure;
图4为本公开实施例提供的一种测试数据确定装置的框图;4 is a block diagram of an apparatus for determining test data according to an embodiment of the present disclosure;
图5为本公开实施例提供的一种电子设备的框图。FIG. 5 is a block diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本领域的技术人员更好地理解本公开的技术方案,以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。In order for those skilled in the art to better understand the technical solutions of the present disclosure, the exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, and they should be considered to be exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
在不冲突的情况下,本公开各实施例及实施例中的各特征可相互组合。Various embodiments of the present disclosure and various features of the embodiments may be combined with each other without conflict.
如本文所使用的,术语“和/或”包括一个或多个相关列举条目的任何和所有组合。As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
本文所使用的术语仅用于描述特定实施例,且不意欲限制本公开。如本文所使用的,单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。还将理解的是,当本说明书中使用术语“包括”和/或“由……制成”时,指定存在特征、整体、步骤、操作、元件和/或组件,但不排除存在或添加一个或多个其它特征、整体、步骤、操作、元件、组件和/或其群组。“连接”或者“相连”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电性的连接,不管是直接的还是间接的。The terminology used herein is used to describe particular embodiments only and is not intended to limit the present disclosure. As used herein, the singular forms "a" and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that when the terms "comprising" and/or "made of" are used in this specification, the presence of features, integers, steps, operations, elements and/or components is specified, but does not preclude the presence or addition of a or multiple other features, integers, steps, operations, elements, components and/or groups thereof. Words like "connected" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.
除非另外限定,否则本文所用的所有术语(包括技术和科学术语)的含义与本领域普通技术人员通常理解的含义相同。还将理解,诸如那些在常用字典中限定的那些术语应当被解释为具有与其在相关技术以及本公开的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本文明确如此限定。Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in common dictionaries should be construed as having meanings consistent with their meanings in the context of the related art and the present disclosure, and will not be construed as having idealized or over-formal meanings, unless expressly so limited herein.
由于相关技术中越来越多神经网络加速系统(例如神经网络加速器)的产生,加速器的设计也愈发趋于复杂,很多神经网络加速系统不再只是针对单一神经网络加速,而是较为通用的支持不同的结构和算子的神经网络。这提升了整个系统(编译器和硬件设备)的设计复杂度,进而提高了测试复杂度。开发者往往要在无数种神经网络中,找到会让整个系统出错或者性能变差的目标测试数据,从而改进整个神经网络加速系统的设计,面向神经网络加速系统的测试方法变得尤为重要。Due to the emergence of more and more neural network acceleration systems (such as neural network accelerators) in related technologies, the design of accelerators has become more and more complex. Many neural network acceleration systems are no longer only for single neural network acceleration, but more general support Neural networks with different structures and operators. This increases the design complexity of the entire system (compiler and hardware devices), which in turn increases the testing complexity. Developers often need to find target test data that will make the entire system fail or deteriorate in performance in countless neural networks, so as to improve the design of the entire neural network acceleration system. The test method for the neural network acceleration system becomes particularly important.
在实际应用场景中,通常的测试方法在面对复杂的神经网络处理系统时,往往很难有高的测试覆盖率,尤其是当前众核架构的不断发展,使得神经网络处理系统的网络结构、复杂均衡等都成为影响执行性能重要的方面,这些复杂规则的组合使得手动构造测试用例变得很困难;但是采用测试人员手动构造测试用例,或者手动编写规则生成测试用例的方式测试整个系统,难度较高且测试效率低下。In practical application scenarios, when faced with complex neural network processing systems, the usual test methods are often difficult to achieve high test coverage, especially with the continuous development of the current many-core architecture, which makes the network structure, Complex balance, etc. have become important aspects that affect execution performance. The combination of these complex rules makes it difficult to manually construct test cases; however, it is difficult to test the entire system by manually constructing test cases or manually writing rules to generate test cases. high and the test is inefficient.
根据本公开实施例的测试数据确定方法,可以通过网络结构搜索来生成会使神经网络处理系统运行异常的目标测试数据,以通过目标测试数据改进整个神经网络处理系统,提高神经网络处理系统的测试效率,使用于测试神经网络处理系统的目标测试数据更加充分和完备,从而提高测试覆盖率。According to the test data determination method of the embodiment of the present disclosure, target test data that will cause abnormal operation of the neural network processing system can be generated through network structure search, so that the entire neural network processing system can be improved through the target test data, and the test of the neural network processing system can be improved. Efficiency, making the target test data used to test the neural network processing system more sufficient and complete, thereby improving the test coverage.
下面首先通过图1,描述神经网络搜索的基本流程。图1示出本公开实施例提供的神经网络搜索的系统框架示意图。The following first describes the basic flow of neural network search through Figure 1. FIG. 1 shows a schematic diagram of a system framework for neural network search provided by an embodiment of the present disclosure.
在图1中,该框架包括:搜索空间获取模块101、网络搜索模块102和模型评估模块103。通过该系统框架进行的神经网络搜索的基本流程可以包括如下步骤。In FIG. 1 , the framework includes: a search space acquisition module 101 , a network search module 102 and a model evaluation module 103 . The basic flow of neural network search through this system framework can include the following steps.
S101,通过搜索空间获取模块101预先定义一个搜索空间。S101, a search space is predefined by the search space obtaining module 101.
在该步骤中,搜索空间可以理解为是待搜索的网络结构的候选集合,即一个大致的、初始的神经网络框架。搜索空间可以用于定义神经网络搜索算法所搜索的神经网络的类型,同时也定义了如何描述神经网络结构。In this step, the search space can be understood as a candidate set of network structures to be searched, that is, a rough and initial neural network framework. The search space can be used to define the type of neural network searched by the neural network search algorithm, as well as how to describe the neural network structure.
S102,网络搜索模块102从搜索空间中搜索出一个或多个神经网络,并将搜索出的神经网络发送至模型评估模块103。S102 , the network search module 102 searches out one or more neural networks from the search space, and sends the searched neural networks to the model evaluation module 103 .
S103,模型评估模块103通过评估该搜索出的神经网络在处理深度学习问题时表现出的性能,生成该搜索出的神经网络的性能评估结果,并向网络搜索模块102返回该性能评估结果。S103 , the model evaluation module 103 generates a performance evaluation result of the searched neural network by evaluating the performance of the searched neural network when dealing with deep learning problems, and returns the performance evaluation result to the network search module 102 .
该步骤中,深度学习(Deep Learning,DL)是机器学习(Machine Learning,ML)中的用于对数据内在规律和表示层次进行学习的方法;通过神经网络处理深度学习问题,可以理解为是利用深度学习的方法,通过建立神经网络来模仿人脑的分析学习能力,解决较为复杂的模式识别问题,例如对语音、图像和文本等数据进行识别;使用性能评估指标可以用于度量神经网络在处理深度学习问题时表现出的性能,神经网络在处理深度学习问题时表现出的性能与神经网络的结构优劣密切相关,因此,可以使用性能评估指标来度量神经网络的结构优劣。In this step, deep learning (DL) is a method in machine learning (ML) for learning the inherent laws and representation levels of data; processing deep learning problems through neural networks can be understood as using The deep learning method imitates the analysis and learning ability of the human brain by establishing a neural network, and solves more complex pattern recognition problems, such as recognizing data such as speech, image and text; using performance evaluation indicators can be used to measure the performance of neural networks in processing. The performance of deep learning problems, the performance of neural networks in dealing with deep learning problems is closely related to the structural advantages and disadvantages of neural networks. Therefore, performance evaluation indicators can be used to measure the structural advantages and disadvantages of neural networks.
在该步骤中,可以使用预定搜索策略从搜索空间中搜索出神经网络结构;并使用性能评估指标来度量神经网络的结构优劣;性能评估指标包括如下指标项的至少一种:准确率、精度、速度、延时、吞吐率、计算占用率、存储占用率、并行度、功耗等。In this step, a predetermined search strategy can be used to search out the neural network structure from the search space; and a performance evaluation index can be used to measure the structure of the neural network; the performance evaluation index includes at least one of the following index items: accuracy, precision , speed, delay, throughput, computing occupancy, storage occupancy, parallelism, power consumption, etc.
S104,网络搜索模块102根据性能评估结果(例如评估得到的性能值)构建损失函数,以通过该损失函数优化网络搜索模块102中进行神经网络搜索的网络结构,如此迭代,生成评估结果更好的用于进行神经网络搜索的网络结构。S104, the network search module 102 constructs a loss function according to the performance evaluation result (for example, the performance value obtained from the evaluation), so as to optimize the network structure of the neural network search in the network search module 102 through the loss function, and iterate in this way to generate a better evaluation result. Network structure for doing neural network searches.
通过图1描述的神经网络架构搜索的基本流程可知,可以从搜索空间中搜索得到神经网络,并可以将搜索得到的神经网络作为被评估的神经网络。本公开实施例可以基于NAS网络进行神经网络架构搜索,进行神经网络搜索和性能评估,以生成会使神经网络处理系统运行异常的神经网络。It can be known from the basic flow of the neural network architecture search described in FIG. 1 that the neural network can be obtained from the search space, and the neural network obtained by the search can be used as the evaluated neural network. The embodiments of the present disclosure can perform neural network architecture search based on the NAS network, perform neural network search and performance evaluation, so as to generate a neural network that will cause abnormal operation of the neural network processing system.
图2为本公开实施例提供的一种测试数据确定方法的流程图。参照图2,该方法包括如下步骤。FIG. 2 is a flowchart of a method for determining test data according to an embodiment of the present disclosure. 2, the method includes the following steps.
S210,在预定搜索空间中进行神经网络搜索,根据搜索结果确定待测试数据。S210: Perform a neural network search in a predetermined search space, and determine the data to be tested according to the search result.
S220,通过神经网络处理系统运行待测试数据,得到待测试数据的运行结果。S220 , running the data to be tested through the neural network processing system to obtain a running result of the data to be tested.
S230,在运行结果为运行异常的情况下,将待测试数据确定为测试数据,目标测试数据用于改进神经网络处理系统。S230, in the case that the operation result is abnormal operation, determine the data to be tested as test data, and the target test data is used to improve the neural network processing system.
根据本公开的实施例的测试数据确定方法,能够在预定搜索空间中进行神经网络搜索得到使神经网络处理系统运行异常的待测试数据,从而使用该使神经网络处理系统运行异常的网络改进神经网络处理系统,提高测试效率和测试覆盖率。According to the test data determination method of the embodiment of the present disclosure, it is possible to perform a neural network search in a predetermined search space to obtain the data to be tested that causes the neural network processing system to operate abnormally, so that the neural network can be improved by using the network that causes the neural network processing system to operate abnormally. Process systems to improve test efficiency and test coverage.
在一些实施例中,步骤S210中的在预定搜索空间中进行神经网络搜索的步骤可以由搜索组件来执行;搜索组件可以实现为是神经网络;当搜索组件是神经网络时,该神经网络可以提供在给定的搜索空间中进行神经网络搜索的功能;搜索组件还可以实现为是:调用外部搜索引擎或外部搜索工具进行神经网络搜索的部件(例如搜索器)等;在本公开实施例中,搜索组件被执行测试数据确定方法的电子设备调用时,执行在预定搜索空间中进行神经网络搜索的操作。In some embodiments, the step of performing a neural network search in a predetermined search space in step S210 may be performed by a search component; the search component may be implemented as a neural network; when the search component is a neural network, the neural network may provide The function of performing neural network search in a given search space; the search component can also be implemented as: a component (such as a searcher) that invokes an external search engine or external search tool to perform neural network search, etc.; in the embodiment of the present disclosure, When the search component is called by the electronic device that executes the test data determination method, the operation of performing a neural network search in a predetermined search space is performed.
在本公开实施例中,在预定搜索空间中进行神经网络搜索而得到的搜索结果包括:神经网络模型、计算图模型、与网络结构相关的程序用例中的至少一种;本公开实施例的测试数据确定方法中,可以将搜索结果中包括的神经网络模型、计算图模型、与网络结构相关的程序用例中的至少一种作为待测试数据。也就是说,在一些实施例中,待测试数据可以包括如下项中的至少一项:神经网络模型、计算图模型、与网络结构相关的程序用例中的至少一种。In this embodiment of the present disclosure, a search result obtained by performing a neural network search in a predetermined search space includes: at least one of a neural network model, a computational graph model, and a program use case related to a network structure; the test of the embodiment of the present disclosure In the data determination method, at least one of a neural network model, a computational graph model, and a program use case related to the network structure included in the search result can be used as the data to be tested. That is, in some embodiments, the data to be tested may include at least one of the following items: at least one of a neural network model, a computational graph model, and a program use case related to a network structure.
本公开实施例的搜索空间,是预先根据神经网络处理系统的算子库和测试需求进行定义的搜索空间;其中,算子库用于指示神经网络处理系统支持的算子类型集合;测试需求至少包括如下信息项中的一种:本次系统测试所需的网络规模、本次系统测试的网络连接约束,以及从算子类型集合获取的、本次系统测试需要包含的算子类型。The search space in the embodiment of the present disclosure is a search space defined in advance according to the operator library of the neural network processing system and the test requirements; the operator library is used to indicate the set of operator types supported by the neural network processing system; the test requirements are at least It includes one of the following information items: the network scale required for this system test, the network connection constraints for this system test, and the operator type obtained from the operator type set that needs to be included in this system test.
在该实施例中,算子库与测试需求可以定义搜索空间,从该搜索空间中进行神经网络搜索,并最终搜索得到使神经网络处理系统运行异常的目标测试数据,利用得到的该目标测试数据改进神经网络处理系统,提高测试效率和测试覆盖率。In this embodiment, the operator library and the test requirements can define a search space, and the neural network search is performed from the search space, and finally the target test data that makes the neural network processing system run abnormally is obtained by searching, and the obtained target test data is used. Improve the neural network processing system to improve test efficiency and test coverage.
在一些实施例中,搜索组件包括如下神经网络中的至少一种:循环神经网络和基于进化算法的神经网络。In some embodiments, the search component includes at least one of the following neural networks: a recurrent neural network and an evolutionary algorithm-based neural network.
本公开实施例中,当搜索组件是神经网络时,可以采用循环神经网络,也可以采用例如进化算法等通用搜索算法的神经网络,本公开实施例不限制搜索组件所使用的神经网络的选取,具体可以根据实际需要确定所使用的神经网络的网络类型,本公开实施例不做具体限定。In the embodiment of the present disclosure, when the search component is a neural network, a cyclic neural network may be used, or a neural network with a general search algorithm such as an evolutionary algorithm may be used. The embodiment of the present disclosure does not limit the selection of the neural network used by the search component. Specifically, the network type of the neural network used may be determined according to actual needs, which is not specifically limited in the embodiment of the present disclosure.
在一些实施例中,神经网络处理系统包括神经网络加速系统,该神经网络加速系统包括神经网络部署设备和神经网络处理设备;在一些实施例中,神经网络部署设备可以是编译器、解释器和映射器中的至少一种;神经网络处理设备可以包括神经网络芯片或神经网络板卡等硬件设备;示例性地,神经网络芯片可以包括但不限于是:众核芯片、神经网络处理器(Neural Network Processor,NNP)、深度学习处理器(Data LearningProcessing Unit,DPU)中的至少一种。In some embodiments, the neural network processing system includes a neural network acceleration system including a neural network deployment device and a neural network processing device; in some embodiments, the neural network deployment device may be a compiler, an interpreter, and a At least one of the mappers; the neural network processing device may include hardware devices such as a neural network chip or a neural network board; exemplarily, the neural network chip may include but is not limited to: many-core chips, neural network processors (Neural At least one of Network Processor, NNP) and Deep Learning Processor (Data Learning Processing Unit, DPU).
根据本公开实施例的测试数据确定方法,可以从预定搜索空间中搜索得到使神经网络处理系统运行异常的目标测试数据,从而改进神经网络加速系统的设计,且获得使神经网络处理系统运行异常的目标测试数据的难度较低,有利于提高测试效率和测试覆盖率。According to the test data determination method of the embodiment of the present disclosure, the target test data that causes the neural network processing system to run abnormally can be searched from a predetermined search space, thereby improving the design of the neural network acceleration system, and obtaining the abnormal operation of the neural network processing system. The difficulty of the target test data is low, which is beneficial to improve the test efficiency and test coverage.
本公开实施例的测试数据确定方法可以由终端设备或服务器等电子设备执行,终端设备可以为车载设备、用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等,该方法可以通过处理器调用存储器中存储的计算机可读程序指令的方式来实现。或者,可通过服务器执行该方法。The test data determination method in the embodiment of the present disclosure may be performed by an electronic device such as a terminal device or a server, and the terminal device may be a vehicle-mounted device, a user equipment (User Equipment, UE), a mobile device, a user terminal, For personal digital assistants (Personal Digital Assistants, PDAs), handheld devices, computing devices, vehicle-mounted devices, wearable devices, etc., the method can be implemented by the processor calling the computer-readable program instructions stored in the memory. Alternatively, the method can be performed by a server.
在一些实施例中,运行异常包括:运行结果为运行失败;或者,运行结果为运行成功,且运行结果中的运行指标值小于预定的运行指标阈值。In some embodiments, the abnormal operation includes: the operation result is that the operation fails; or, the operation result is that the operation is successful, and the operation index value in the operation result is less than a predetermined operation index threshold.
在该实施例中,可以从预定搜索空间中搜索得到使神经网络处理系统运行失败或性能较差的测试数据,从而改进神经网络加速系统的设计,该方法有利于降低获得使系统运行失败或性能较差的测试数据的难度,并提高了测试效率和测试覆盖率。In this embodiment, the test data that causes the neural network processing system to fail or have poor performance can be searched from the predetermined search space, thereby improving the design of the neural network acceleration system. Difficulty with poor test data and improve test efficiency and test coverage.
在一些实施例中,运行指标值包括:系统性能指标值、系统压力指标值、系统功耗指标值和系统安全性指标值中的至少一种。In some embodiments, the operation index value includes at least one of a system performance index value, a system pressure index value, a system power consumption index value, and a system security index value.
作为示例,系统性能指标值用于评估系统性能,系统性能指标例如可以包括但不限于如下指标项的至少一种:响应时间、CPU资源利用率、内存利用率。As an example, the system performance index value is used to evaluate system performance, and the system performance index may include, but is not limited to, at least one of the following index items: response time, CPU resource utilization, and memory utilization.
作为示例,系统压力指标值用于评估系统正常使用情况下所能支持的最大负载;系统压力指标值可以包括但不限于如下指标项的至少一种:每秒处理事务(TransactionPer Second,TPS)、平均响应时间、最大响应时间、最小响应时间等。其中,每秒处理事务即每秒系统处理事务的数量,可以用于评价系统在任意给定时刻的时间事务负载;平均响应时间即每一事务执行所用的平均时间,可以用于评价测试场景下系统运行期间的性能走向;最大响应时间是指从发出指令到系统做出响应的最大时间;最小响应时间是指发出指令到系统做出响应的最少时间。As an example, the system pressure index value is used to evaluate the maximum load that the system can support under normal use; the system pressure index value may include, but is not limited to, at least one of the following index items: Transaction Per Second (TPS), Average response time, maximum response time, minimum response time, etc. Among them, the number of transactions processed per second is the number of transactions processed by the system per second, which can be used to evaluate the time transaction load of the system at any given moment; the average response time is the average time taken for each transaction to execute, which can be used to evaluate the test scenario. The performance trend of the system during operation; the maximum response time refers to the maximum time from issuing an instruction to the system responding; the minimum response time refers to the minimum time from issuing an instruction to the system responding.
作为示例,系统功耗指标值用于评估系统单位时间中所消耗的能源的数量。系统功耗指标值可以包括但不限于如下指标项的至少一种:耗电量、待机时间。As an example, the system power consumption indicator value is used to evaluate the amount of energy consumed per unit time of the system. The system power consumption index value may include, but is not limited to, at least one of the following index items: power consumption and standby time.
作为示例,系统安全性指标值用于评估系统安全性和对数据的保护程度;作为示例,系统安全性指标值可以包括但不限于如下指标项的至少一种:保密性指标(数据加密正确性、加密算法的强度等)、完整性指标(例如数据完整性)。As an example, the system security index value is used to evaluate the system security and the degree of data protection; as an example, the system security index value may include, but is not limited to, at least one of the following index items: confidentiality index (data encryption correctness , encryption algorithm strength, etc.), integrity indicators (such as data integrity).
应理解,上述系统性能指标值、系统压力指标值、系统压力指标值和系统功耗指标值还可以包括其他相应类型指标项的指标值,本公开实施例的上述具体指标项仅仅是示意性地说明。在实际应用场景中,可以根据实际需要进行自定义设置。It should be understood that the above-mentioned system performance index value, system pressure index value, system pressure index value, and system power consumption index value may also include index values of other corresponding types of index items, and the above-mentioned specific index items in the embodiments of the present disclosure are only illustrative. illustrate. In practical application scenarios, custom settings can be made according to actual needs.
在该实施例中,通过不同类型的运行指标值,可以对神经网络处理系统进行不同类型的系统测试,例如性能测试、系统压力测试、系统功耗测试、系统安全性测试中的至少一种;运行指标值的选择,可以根据对神经网络处理系统的实际测试要求进行确定,本公开实施例不做具体限定。In this embodiment, different types of system tests can be performed on the neural network processing system through different types of operating index values, such as at least one of performance tests, system stress tests, system power consumption tests, and system security tests; The selection of the operation index value may be determined according to the actual test requirements for the neural network processing system, which is not specifically limited in the embodiment of the present disclosure.
在一些实施例中,步骤S230中在运行结果为运行异常的情况下,将待测试数据确定为目标测试数据,具体可以包括:S11,若运行结果为运行失败,则确定待测试数据为目标测试数据中的出错类测试数据,以用于对神经网络处理系统进行系统调试;S12,若运行结果为运行成功,且运行结果中的运行指标值小于运行指标阈值,则确定待测试数据为目标测试数据中的性能降低类测试数据,以用于对神经网络处理系统进行系统优化。In some embodiments, in step S230, if the operation result is abnormal operation, determine the data to be tested as the target test data, which may specifically include: S11, if the operation result is that the operation fails, determine the data to be tested as the target test Error-type test data in the data is used for system debugging of the neural network processing system; S12, if the operation result is successful, and the operation index value in the operation result is less than the operation index threshold, determine the data to be tested as the target test Degraded test data in data for system optimization of neural network processing systems.
在该实施例中,在运行结果为运行异常的情况下,即可得到出错类测试数据(可称为是出错测试用例);在运行结果为运行成功但运行指标值小于运行指标阈值,即可得到性能降低类测试数据(可称为是性能降低测试用例);出错测试用例及性能降低测试用例均可以作为是神经网络处理系统运行异常的目标测试用例,以用于对神经网络处理系统进行优化,降低了获得使系统运行异常的神经网络的难度,提高测试效率和测试覆盖率。In this embodiment, if the operation result is abnormal operation, the error-type test data (which may be referred to as an error test case) can be obtained; if the operation result is that the operation is successful but the operation index value is less than the operation index threshold, it can be Obtain performance-reducing test data (which can be called performance-reducing test cases); both error test cases and performance-reducing test cases can be used as target test cases for abnormal operation of the neural network processing system to optimize the neural network processing system. , reduces the difficulty of obtaining neural networks that make the system behave abnormally, and improves test efficiency and test coverage.
在一些实施例中,网络结构搜索是基于搜索组件进行的搜索;搜索组件具有神经网络结构;该测试数据确定方法还包括:S21,在运行结果为运行成功,且运行结果中的运行指标值大于或等于预定的运行指标阈值的情况下,根据运行指标值构建搜索组件的损失函数;S22,根据损失函数,更新搜索组件的网络参数。In some embodiments, the network structure search is based on a search component; the search component has a neural network structure; the test data determination method further includes: S21, when the operation result is that the operation is successful, and the operation index value in the operation result is greater than or equal to the predetermined operating index threshold, construct a loss function of the search component according to the operating index value; S22, update the network parameters of the search component according to the loss function.
在一些实施例中,上述步骤S21中根据运行指标值构建搜索组件的损失函数的步骤,具体可以包括:S31,根据运行指标值和相应类型的运行指标阈值,确定损失函数值;S32,增加损失函数值,根据增加的损失函数值的方式构建搜索组件的损失函数;或者,具体可以包括:根据指定性能指标值的相反数构建搜索组件的损失函数,指定性能指标值大于或等于运行指标值。In some embodiments, the step of constructing the loss function of the search component according to the operation index value in the above step S21 may specifically include: S31, determining the loss function value according to the operation index value and the corresponding type of operation index threshold; S32, increasing the loss The function value is to construct the loss function of the search component according to the added loss function value; or, it may specifically include: constructing the loss function of the search component according to the inverse of the specified performance index value, and the specified performance index value is greater than or equal to the running index value.
在本公开实施例中,损失函数(Loss Function)可以用于估计搜索组件的运行结果与运行目标之间的差距,即搜索组件的运行误差。例如,搜索组件的运行结果为搜索组件每次运行得到的运行指标值,搜索组件的运行目标是搜索组件运行出错或运行指标值小于相应类型的运行指标阈值。通过增加损失函数值,可以使搜索组件运行成功的概率降低,或者可以使搜索组件的运行结果接近或达到运行指标阈值的概率降低,进而有利于提高得到出错类神经网络或性能降低类神经网络的概率。In the embodiment of the present disclosure, a loss function (Loss Function) may be used to estimate the gap between the running result of the search component and the running target, that is, the running error of the search component. For example, the operation result of the search component is the operation index value obtained each time the search component runs, and the operation target of the search component is that the search component runs in error or the operation index value is smaller than the operation index threshold of the corresponding type. By increasing the loss function value, the probability of successful operation of the search component can be reduced, or the probability of the operation result of the search component being close to or reaching the operating index threshold can be reduced, which is beneficial to improve the probability of obtaining an error-like neural network or a neural network with reduced performance. probability.
在该实施例中,利用更大的损失函数值或更高的性能指标值的相反数,可以促进NAS网络搜索得到更多性能降低类神经网络或更多出错类神经网络,加快得到使神经网络处理系统运行异常的神经网络,提高测试效率和测试覆盖率。In this embodiment, using a larger loss function value or the opposite of a higher performance index value can promote the NAS network to search to obtain more performance-decreasing neural networks or more error-like neural networks, and speed up the acquisition of better neural networks. Handle abnormal neural networks in system operation, improve test efficiency and test coverage.
根据本公开实施例的测试数据确定方法,可以通过NAS网络在预定搜索空间中进行神经网络搜索,得到使神经网络处理系统运行异常的网络,从而使用该使神经网络处理系统运行异常的网络改进神经网络处理系统,有利于降低获得使神经网络处理系统运行异常的目标测试数据的难度,提高测试效率和测试覆盖率。According to the test data determination method of the embodiment of the present disclosure, a neural network search can be performed in a predetermined search space through a NAS network to obtain a network that causes the neural network processing system to run abnormally, so that the neural network processing system can be used to improve the neural network abnormally. The network processing system is beneficial to reduce the difficulty of obtaining target test data that makes the neural network processing system run abnormally, and improve the test efficiency and test coverage.
图3示出本公开示例性实施例提供的测试数据确定方法的流程示意图。在图3中,该测试数据确定方法可以包括如下步骤:FIG. 3 shows a schematic flowchart of a test data determination method provided by an exemplary embodiment of the present disclosure. In Figure 3, the test data determination method may include the following steps:
S301,根据神经网络处理系统的算子库与测试需求定义搜索空间。S301, a search space is defined according to an operator library of a neural network processing system and a test requirement.
在该步骤中,算子库包括神经网络处理系统支持的所有算子类型,而测试需求可以包括,本次测试需要包含的算子类型、网络规模、网络连接约束等。In this step, the operator library includes all operator types supported by the neural network processing system, and the test requirements may include the operator types, network scale, network connection constraints, etc. that need to be included in this test.
S302,通过搜索组件从搜索空间中搜索神经网络,根据搜索结果确定待测试数据。S302: Search the neural network from the search space through the search component, and determine the data to be tested according to the search result.
在该步骤中,搜索组件具有神经网络结构,将搜索结果中的神经网络模型、计算图模型、与网络结构相关的程序用例中的至少一种,作为待测试数据。In this step, the search component has a neural network structure, and uses at least one of a neural network model, a computational graph model, and a program use case related to the network structure in the search result as the data to be tested.
S303,将搜索到的待测试数据输入到神经网络部署设备,通过神经网络部署设备处理搜索到的神经网络,得到经神经网络部署设备进行处理后的神经网络。S303: Input the searched data to be tested into the neural network deployment device, process the searched neural network through the neural network deployment device, and obtain a neural network processed by the neural network deployment device.
作为示例,当神经网络部署设备为编译器,则通过神经网络部署设备处理搜索到的神经网络,得到经神经网络部署设备处理后的神经网络,包括:通过编译器编译搜索到的神经网络,得到编译后的神经网络。As an example, when the neural network deployment device is a compiler, the searched neural network is processed by the neural network deployment device, and the neural network processed by the neural network deployment device is obtained, including: compiling the searched neural network through the compiler to obtain The compiled neural network.
S304,通过神经网络芯片运行经神经网络部署设备处理后的神经网络,得到运行结果。S304 , running the neural network processed by the neural network deployment device through the neural network chip to obtain the running result.
S305,判断系统运行是否出错,若运行出错,则执行步骤S306,若运行成功,则执行步骤S307。S305, it is judged whether there is an error in the operation of the system, if there is an error in the operation, step S306 is performed, and if the operation is successful, step S307 is performed.
在该步骤中,运行出错例如可以包括:运行中断、系统奔溃、界面混乱中的至少一种;运行出错还可以包括硬件或系统软件存在其他问题,具体可以根据实际测试需求进行用户自定义。In this step, the operation error may include, for example, at least one of: operation interruption, system crash, and interface confusion; the operation error may also include other problems with hardware or system software, which can be customized by the user according to actual test requirements.
S306,在运行出错的情况下,将该待测试数据作为出错类测试数据,作为出错测试用例。S306 , in the case of an error in the operation, the data to be tested is used as error-type test data as an error test case.
S307,在运行成功的情况下,判断神经网络处理系统的实际运行性能值是否低于预先定义的预期的运行性能阈值;若实际运行性能值低于预期运行性能阈值,则执行步骤S308;否则,执行步骤S309。S307, in the case of successful operation, determine whether the actual operation performance value of the neural network processing system is lower than the predefined expected operation performance threshold; if the actual operation performance value is lower than the expected operation performance threshold, execute step S308; otherwise, Step S309 is executed.
S308,在实际运行性能值低于预期的运行性能阈值的情况下,将该待测试数据作为性能降低类测试数据,即得到性能降低测试用例。S308 , in the case that the actual operating performance value is lower than the expected operating performance threshold, use the data to be tested as performance-reducing type test data, that is, obtain a performance-reducing test case.
在该步骤中,运行性能可以根据需求规格所规定的性能指标进行预定义,也可以根据测试要求进行用户自定义,本公开实施例不做具体限定。In this step, the running performance may be predefined according to the performance index specified in the requirement specification, and may also be user-defined according to the test requirement, which is not specifically limited in the embodiment of the present disclosure.
S309,在实际运行性能值大于或等于预期的运行性能阈值的情况下,计算搜索组件的神经网络结构的损失函数,利用损失函数训练该神经网络结构,得到更新的搜索组件;并执行步骤S302。S309, when the actual operating performance value is greater than or equal to the expected operating performance threshold, calculate the loss function of the neural network structure of the search component, use the loss function to train the neural network structure, and obtain an updated search component; and execute step S302.
在该步骤中,可以利用实际运行性能值的相反数,也可以根据实际运行指标值和预期的运行性能阈值,计算损失函数值,并增加该损失函数值,根据增加的损失函数值构建搜索组件的神经网络结构的损失函数;该步骤中损失函数的计算方法满足实际运行性能越高,损失函数值越大即可,以加快得到目标测试数据的速度,提高测试效率。In this step, the inverse number of the actual operating performance value can be used, or the loss function value can be calculated according to the actual operating index value and the expected operating performance threshold value, and the loss function value can be increased, and the search component can be constructed according to the increased loss function value. The loss function of the neural network structure; in this step, the calculation method of the loss function satisfies that the higher the actual running performance, the larger the loss function value, so as to speed up the speed of obtaining the target test data and improve the test efficiency.
在本发明实施例中,在步骤S309之后,迭代执行上述步骤S302-S306,以使搜索组件从搜索空间中搜索出使神经网络处理系统运行性能更差的目标测试数据,以对神经网络处理系统进行改进,提高神经网络处理系统的测试效率和测试覆盖率。In this embodiment of the present invention, after step S309, the above steps S302-S306 are iteratively executed, so that the search component searches out the target test data from the search space that makes the neural network processing system perform worse, so that the neural network processing system has poorer performance. Improvements are made to improve the test efficiency and test coverage of the neural network processing system.
在一些实施例中,在迭代执行过程中,直到满足测试结束条件时,确定测试结束,并得到使神经网络处理系统运行出错和/或运行性能下降的目标测试数据。测试结束条件可以包括:连续N次根据运行结果得到目标测试数据的数量为零,或者,得到目标测试数据的数量达到目标测试数据数量阈值。例如:出错类测试数据的数量大于或等于出错类测试数据的数量阈值,和/或,性能降低类测试数据的数量大于或等于性能降低类测试数据的数量阈值。In some embodiments, in the iterative execution process, until the test end condition is satisfied, it is determined that the test ends, and the target test data that causes the neural network processing system to run incorrectly and/or degrade the running performance is obtained. The test end condition may include: the quantity of target test data obtained according to the running result for N consecutive times is zero, or the quantity of obtained target test data reaches the threshold of the quantity of target test data. For example, the amount of error-type test data is greater than or equal to the threshold for the number of error-type test data, and/or the amount of performance-degraded test data is greater than or equal to the number of performance-degraded test data thresholds.
根据本发明实施例的测试数据确定方法,可以在预定搜索空间中进行神经网络搜索,得到使神经网络处理系统运行异常的目标测试数据,从而使用该使神经网络处理系统运行异常的目标测试数据来测试并改进神经网络处理系统,有利于降低获得使神经网络处理系统运行异常的目标测试数据的难度,提高测试效率和测试覆盖率。According to the test data determination method of the embodiment of the present invention, a neural network search can be performed in a predetermined search space to obtain target test data that causes the neural network processing system to operate abnormally, so that the target test data that causes the neural network processing system to operate abnormally can be used to Testing and improving the neural network processing system is beneficial to reduce the difficulty of obtaining target test data that makes the neural network processing system run abnormally, and improve the test efficiency and test coverage.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above-mentioned method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle and logic. Those skilled in the art can understand that, in the above method of the specific embodiment, the specific execution order of each step should be determined by its function and possible internal logic.
此外,本公开还提供了测试数据确定装置、电子设备、计算机可读存储介质,上述均可用来实现本公开提供的任一种测试数据确定方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。In addition, the present disclosure also provides a test data determination device, an electronic device, and a computer-readable storage medium, all of which can be used to implement any test data determination method provided by the present disclosure. For the corresponding technical solutions and descriptions, refer to the corresponding records in the method section. ,No longer.
图4为本公开实施例提供的一种测试数据确定装置的框图。FIG. 4 is a block diagram of an apparatus for determining test data according to an embodiment of the present disclosure.
参照图4,本公开实施例提供了一种测试数据确定装置400,该测试数据确定装置400包括如下模块。Referring to FIG. 4 , an embodiment of the present disclosure provides an
搜索模块410,用于在预定搜索空间中进行神经网络搜索,根据搜索结果确定待测试数据。The
运行模块420,用于通过神经网络处理系统运行待测试数据,得到待测试数据的运行结果。The running
确定模块430,用于在运行结果为运行异常的情况下,将待测试数据确定为目标测试数据,目标测试数据用于改进神经网络处理系统。The
在一些实施例中,运行异常包括:运行结果为运行失败;或者,运行结果为运行成功,且运行结果中的运行指标值小于预定的运行指标阈值。In some embodiments, the abnormal operation includes: the operation result is that the operation fails; or, the operation result is that the operation is successful, and the operation index value in the operation result is less than a predetermined operation index threshold.
在一些实施例中,在运行结果为运行异常的情况下,确定模块430在用于将待测试数据确定为目标测试数据时,具体可以包括:出错类测试数据确定单元,用于若运行结果为运行失败,则确定待测试数据为目标测试数据中的出错类测试数据,以用于对神经网络处理系统进行系统调试;性能降低类测试数据确定单元,用于若运行结果为运行成功,且运行结果中的运行指标值小于运行指标阈值,则确定待测试数据为目标测试数据中的性能降低类测试数据,以用于对神经网络处理系统进行系统优化。In some embodiments, when the operation result is abnormal operation, when the
在一些实施例中,在预定搜索空间中进行的神经网络搜索是基于搜索组件进行的搜索;搜索组件具有神经网络结构;测试数据确定装置400还包括:损失函数构建模块,用于在运行结果为运行成功,且运行结果中的运行指标值大于或等于预定的运行指标阈值的情况下,根据运行指标值构建搜索组件的损失函数;参数更新模块,用于根据损失函数,更新搜索组件的网络参数。In some embodiments, the neural network search performed in the predetermined search space is based on a search component; the search component has a neural network structure; the test
在一些实施例中,损失函数构建模块,在用于根据运行指标值构建NAS网络的损失函数时,具体可以用于根据运行指标值和相应类型的运行指标阈值,确定损失函数值;增加损失函数值,根据增加的损失函数值的方式构建搜索组件的损失函数;或者,具体可以用于根据指定性能指标值的相反数构建搜索组件的损失函数,指定性能指标值大于或等于运行指标值。In some embodiments, the loss function building module, when used to construct the loss function of the NAS network according to the operation index value, can be specifically used to determine the loss function value according to the operation index value and the corresponding type of operation index threshold; increase the loss function value, the loss function of the search component is constructed according to the increased loss function value; or, it can be used to construct the loss function of the search component according to the inverse of the specified performance index value, and the specified performance index value is greater than or equal to the running index value.
在一些实施例中,运行指标值包括:系统性能指标值、系统压力指标值、系统功耗指标值和系统安全性指标值中的至少一种;搜索组件包括如下神经网络中的至少一种:循环神经网络和基于进化算法的神经网络。In some embodiments, the operation index value includes at least one of a system performance index value, a system pressure index value, a system power consumption index value, and a system security index value; the search component includes at least one of the following neural networks: Recurrent Neural Networks and Evolutionary Algorithm-based Neural Networks.
在一些实施例中,神经网络部署设备包括:编译器、解释器和映射器中的至少一种;神经网络处理设备包括:神经网络芯片和神经网络板卡至少一种。In some embodiments, the neural network deployment device includes: at least one of a compiler, an interpreter, and a mapper; the neural network processing device includes: at least one of a neural network chip and a neural network board.
在一些实施例中,待测试数据包括如下项中的至少一项:神经网络模型、计算图模型、与网络结构相关的程序用例中的至少一种。In some embodiments, the data to be tested includes at least one of the following items: at least one of a neural network model, a computational graph model, and a program use case related to a network structure.
在一些实施例中,神经网络处理系统包括神经网络加速系统,神经网络加速系统包括神经网络部署设备和神经网络处理设备;搜索空间,是预先根据神经网络处理系统的算子库和测试需求进行定义的搜索空间;算子库用于指示神经网络处理系统支持的算子类型集合;测试需求至少包括如下信息项中的一种:本次系统测试所需的网络规模、本次系统测试的网络连接约束,以及从算子类型集合获取的、本次系统测试需要包含的算子类型。In some embodiments, the neural network processing system includes a neural network acceleration system, and the neural network acceleration system includes a neural network deployment device and a neural network processing device; the search space is defined in advance according to the operator library and test requirements of the neural network processing system The operator library is used to indicate the set of operator types supported by the neural network processing system; the test requirements include at least one of the following information items: the network scale required for this system test, the network connection for this system test Constraints, as well as the operator types obtained from the operator type set that need to be included in this system test.
根据本发明实施例的测试数据确定装置,能够从预定搜索空间中进行神经网络搜索得到使神经网络处理系统运行异常的目标测试数据,从而使用该使神经网络处理系统运行异常的目标测试数据改进神经网络处理系统,有利于降低获得使神经网络处理系统运行异常的目标测试数据的难度,提高测试效率和测试覆盖率。According to the test data determination device of the embodiment of the present invention, the target test data that causes the neural network processing system to operate abnormally can be obtained by performing a neural network search in a predetermined search space, so that the target test data that causes the neural network processing system to operate abnormally can be used to improve the neural network. The network processing system is beneficial to reduce the difficulty of obtaining target test data that makes the neural network processing system run abnormally, and improve the test efficiency and test coverage.
图5为本公开实施例提供的一种电子设备的框图。FIG. 5 is a block diagram of an electronic device according to an embodiment of the present disclosure.
参照图5,本公开实施例提供了一种电子设备,该电子设备包括:至少一个处理器501;以及与至少一个处理器501通信连接的存储器502;其中,存储器502存储有可被至少一个处理器501执行的一个或多个计算机程序,一个或多个计算机程序被至少一个处理器501执行,以使至少一个处理器501能够执行上述的测试数据确定方法。5, an embodiment of the present disclosure provides an electronic device, the electronic device includes: at least one
本公开实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,其中,计算机程序在被处理器/处理核执行时实现上述的测试数据确定方法。计算机可读存储介质可以是易失性或非易失性计算机可读存储介质。Embodiments of the present disclosure also provide a computer-readable storage medium on which a computer program is stored, wherein the computer program implements the above-mentioned test data determination method when executed by a processor/processing core. Computer-readable storage media can be volatile or non-volatile computer-readable storage media.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当计算机可读代码在电子设备的处理器中运行时,电子设备中的处理器执行上述测试数据确定方法。Embodiments of the present disclosure also provide a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are executed in a processor of an electronic device , the processor in the electronic device executes the above test data determination method.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读存储介质上,计算机可读存储介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。Those of ordinary skill in the art can understand that all or some of the steps in the methods disclosed above, functional modules/units in the systems, and devices can be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be composed of several physical components Components execute cooperatively. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit . Such software may be distributed on computer-readable storage media, which may include computer storage media (or non-transitory media) and communication media (or transitory media).
如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读程序指令、数据结构、程序模块或其他数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM)、、静态随机存取存储器(SRAM)、闪存或其他存储器技术、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)或其他光盘存储、磁盒、磁带、磁盘存储或其他磁存储装置、或者可以用于存储期望的信息并且可以被计算机访问的任何其他的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读程序指令、数据结构、程序模块或者诸如载波或其他传输机制之类的调制数据信号中的其他数据,并且可包括任何信息递送介质。As is known to those of ordinary skill in the art, the term computer storage media includes both volatile and non-volatile memory media implemented in any method or technology for storage of information, such as computer readable program instructions, data structures, program modules or other data. volatile, removable and non-removable media. Computer storage media include, but are not limited to, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM), static random access memory (SRAM), flash memory or other memory technologies, Portable compact disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical disk storage, magnetic cartridge, magnetic tape, magnetic disk storage or other magnetic storage device, or can be used to store desired information and can be accessed by a computer any other medium. In addition, communication media typically embodies computer readable program instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and can include any information delivery, as is well known to those of ordinary skill in the art medium.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for carrying out operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages. Source or object code written in any combination, programming languages including object-oriented programming languages - such as Smalltalk, C++, etc., and conventional procedural programming languages - such as the "C" language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server implement. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect). In some embodiments, custom electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can be personalized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the present disclosure.
这里所描述的计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product described herein may be embodied in hardware, software, or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK) and the like.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executables for implementing the specified logical function(s) instruction. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
本文已经公开了示例实施例,并且虽然采用了具体术语,但它们仅用于并仅应当被解释为一般说明性含义,并且不用于限制的目的。在一些实例中,对本领域技术人员显而易见的是,除非另外明确指出,否则可单独使用与特定实施例相结合描述的特征、特性和/或元素,或可与其他实施例相结合描述的特征、特性和/或元件组合使用。因此,本领域技术人员将理解,在不脱离由所附的权利要求阐明的本公开的范围的情况下,可进行各种形式和细节上的改变。Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should only be construed in a general descriptive sense and not for purposes of limitation. In some instances, it will be apparent to those skilled in the art that features, characteristics and/or elements described in connection with a particular embodiment may be used alone or in combination with other embodiments, unless expressly stated otherwise. Features and/or elements are used in combination. Accordingly, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the scope of the present disclosure as set forth in the appended claims.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210640253.XA CN114996136A (en) | 2022-06-08 | 2022-06-08 | Test data determination method and device, electronic equipment and readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210640253.XA CN114996136A (en) | 2022-06-08 | 2022-06-08 | Test data determination method and device, electronic equipment and readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN114996136A true CN114996136A (en) | 2022-09-02 |
Family
ID=83032553
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210640253.XA Pending CN114996136A (en) | 2022-06-08 | 2022-06-08 | Test data determination method and device, electronic equipment and readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114996136A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116627973A (en) * | 2023-05-25 | 2023-08-22 | 成都融见软件科技有限公司 | Data positioning system |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111858340A (en) * | 2020-07-23 | 2020-10-30 | 深圳慕智科技有限公司 | Deep neural network test data generation method based on stability transformation |
| CN112598063A (en) * | 2020-12-25 | 2021-04-02 | 深圳市商汤科技有限公司 | Neural network generation method and device, electronic device and storage medium |
| CN113781518A (en) * | 2021-09-10 | 2021-12-10 | 商汤集团有限公司 | Neural network structure searching method and device, electronic device and storage medium |
-
2022
- 2022-06-08 CN CN202210640253.XA patent/CN114996136A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111858340A (en) * | 2020-07-23 | 2020-10-30 | 深圳慕智科技有限公司 | Deep neural network test data generation method based on stability transformation |
| CN112598063A (en) * | 2020-12-25 | 2021-04-02 | 深圳市商汤科技有限公司 | Neural network generation method and device, electronic device and storage medium |
| CN113781518A (en) * | 2021-09-10 | 2021-12-10 | 商汤集团有限公司 | Neural network structure searching method and device, electronic device and storage medium |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116627973A (en) * | 2023-05-25 | 2023-08-22 | 成都融见软件科技有限公司 | Data positioning system |
| CN116627973B (en) * | 2023-05-25 | 2024-02-09 | 成都融见软件科技有限公司 | Data positioning system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9098352B2 (en) | Metaphor based language fuzzing of computer code | |
| US10235277B2 (en) | Method of detecting false test alarms using test step failure analysis | |
| US20160306689A1 (en) | Nexus determination in a computing device | |
| CN111563592A (en) | Method and device for generating neural network model based on hypernetwork | |
| CN112084110B (en) | Data processing method, device, equipment and storage medium | |
| CN114610608B (en) | Test case processing method, device, electronic device and storage medium | |
| US12500904B2 (en) | Artificial intelligence-based cyber training method and apparatus | |
| US10831958B2 (en) | Integrated circuit design with optimized timing constraint configuration | |
| US11853751B2 (en) | Indirect function call target identification in software | |
| CN106681905A (en) | Software testing device and software testing method thereof | |
| CN115176233B (en) | Execute tests in deterministic order | |
| CN112783513A (en) | Code risk checking method, device and equipment | |
| CN114996136A (en) | Test data determination method and device, electronic equipment and readable storage medium | |
| US8909579B2 (en) | Identifying invariant candidates based on proofs | |
| US9037916B2 (en) | Dynamic concolic execution of an application | |
| CN112988578A (en) | An automated testing method and device | |
| US8639490B2 (en) | Concretization of abstracted traces | |
| US10599797B1 (en) | System, method, and computer program product for grouping one or more failures in a formal verification | |
| EP4432095A1 (en) | Unit testing generation method and apparatus, and related device | |
| Oh et al. | A Model Independent S/W Framework for Search‐Based Software Testing | |
| CN115292178A (en) | Test data searching method, device, storage medium and terminal | |
| CN112699376A (en) | Source code logic vulnerability detection method and device, computer equipment and storage medium | |
| Chen et al. | Building very small test suites (with SNAP) | |
| CN118260209B (en) | Code testing method and device, electronic equipment and storage medium | |
| US9477800B1 (en) | System, method, and computer program product for automatically selecting a constraint solver algorithm in a design verification environment |
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 |