[Feature Enhancement] Generate prologue unittest for auto-debugger. #515
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Category
Feature Enhancement
Description
实现
fixed-start模式下,auto-debugger工具最后的单测生成。假设最终定位到[0, N-1]子图测试精度满足要求、[0, N]子图测试精度不满足,嫌疑算子在N位置。单测中构造三个paddle.nn.Layer:PrologueLayer,包含子图[0, N-1]SuspectLayer,包含子图[N-1, N]TestModel,由PrologueLayer+SuspectLayer两个子模块构成单测中构造两种测试模式:
test_separated,单独执行PrologueLayer和SuspectLayer:reference硬件上PrologueLayer,保存PrologueLayer的结果,作为SuspectLayer的输入SuspectLayer,保存SuspectLayer的结果,作为最终的测试结果target硬件上reference硬件上PrologueLayer的计算结果,作为SuspectLayer的输入SuspectLayer,保存SuspectLayer的结果,作为最终的测试结果reference硬件上SuspectLayer的计算结果,二者进行对比test_combined,执行由PrologueLayer和SuspectLayer构成的TestModelreference硬件上TestModel,保存计算结果target硬件上TestModel,作为最终的测试结果reference硬件上TestModel的计算结果,二者进行对比注意:该PR依赖PaddlePaddle/Athena#20
生成的单测示例如下: