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.
新增 unet eager 和 graph 输出对比测试
为了排除
fused_multi_head_attention_inference
原子操作的影响,attention 中先注释掉_fused_forward
相关讨论见:https://github.com/Oneflow-Inc/OneTeam/issues/1816#issuecomment-1342214821
测试运行方式:
python3 -m unittest discover -v -s tests/ -p 'test_models_unet_oneflow.py' -k UNet2DConditionModelTests.test_compare_eager_graph_output
测试思路
首先全部注释掉
tests/test_models_unet_oneflow.py
文件开头的所有环境变量设置,然后通过逐个开启,对比输出最大的 diff,来确定是哪个优化导致 eager 和 graph 输出不一致的。