已合并
算子黑名单批量删除 #6180
AtomGit-Bot创建于 2024年3月19日
算子黑名单批量删除 #6180
已合并
AtomGit-Bot创建于 2024年3月19日
refs/pull/6180/head合入到master
18 个文件变更+0-44
MPyTorch/built-in/cv/classification/Shufflenetv2_for_PyTorch/8p_main_med.py+0-3
@@ -631,7 +631,4 @@ def get_pytorch_val_loader(data_path, batch_size, workers=5, _worker_init_fn=Non
631 631 
632 632 
633if __name__ == '__main__':633if __name__ == '__main__':
634- option = {}
635- option["NPU_FUZZY_COMPILE_BLACKLIST"] = "BNTrainingUpdate"
636- torch.npu.set_option(option)
637 main()634 main()
MPyTorch/built-in/cv/detection/ABINet_for_PyTorch/tools/train.py+0-3
@@ -35,9 +35,6 @@ from mmocr.utils import (collect_env, get_root_logger, is_2dlist,
35import torch_npu35import torch_npu
36from torch_npu.contrib import transfer_to_npu36from torch_npu.contrib import transfer_to_npu
37 37 
38-option = {}
39-option["NPU_FUZZY_COMPILE_BLACKLIST"] = "MaskedFill"
40-torch.npu.set_option(option)
41torch.npu.set_compile_mode(jit_compile=False)38torch.npu.set_compile_mode(jit_compile=False)
42 39 
43 40 
MPyTorch/built-in/cv/detection/Faster_Mask_RCNN_for_PyTorch/tools/train_net.py+0-2
@@ -199,8 +199,6 @@ if __name__ == "__main__":
199 option = {'ACL_PRECISION_MODE': 'allow_fp32_to_fp16'}199 option = {'ACL_PRECISION_MODE': 'allow_fp32_to_fp16'}
200 if os.getenv('ALLOW_HF32', False):200 if os.getenv('ALLOW_HF32', False):
201 option = {'ACL_PRECISION_MODE': 'must_keep_origin_dtype'}201 option = {'ACL_PRECISION_MODE': 'must_keep_origin_dtype'}
202- # LogSoftmaxV2算子在二进制下有精度问题,添加至黑名单规避
203- option['NPU_FUZZY_COMPILE_BLACKLIST'] = 'LogSoftmaxV2'
204 torch_npu.npu.set_option(option)202 torch_npu.npu.set_option(option)
205 203
206 launch(204 launch(
MPyTorch/built-in/cv/detection/YOLOV4_ID0396_for_PyTorch/test.py+0-3
@@ -313,9 +313,6 @@ if __name__ == '__main__':
313 print(opt)313 print(opt)
314 314 
315 torch.npu.set_compile_mode(jit_compile=False)315 torch.npu.set_compile_mode(jit_compile=False)
316- option = dict()
317- option["NPU_FUZZY_COMPILE_BLACKLIST"] = "Identity"
318- torch.npu.set_option(option)
319 if opt.task in ['val', 'test']: # run normally316 if opt.task in ['val', 'test']: # run normally
320 test(opt.data,317 test(opt.data,
321 opt.weights,318 opt.weights,
MPyTorch/built-in/foundation/CodeGeeX2/ptuning/main.py+0-3
@@ -34,9 +34,6 @@ import deepspeed_npu
34from torch_npu.contrib import transfer_to_npu34from torch_npu.contrib import transfer_to_npu
35 35 
36torch.npu.set_compile_mode(jit_compile=True)36torch.npu.set_compile_mode(jit_compile=True)
37-option = {"NPU_FUZZY_COMPILE_BLACKLIST":"Tril,LayerNormGrad"}
38-torch.npu.set_option(option)
39- 
40 37 
41import transformers38import transformers
42from transformers import (39from transformers import (
MPyTorch/built-in/foundation/CodeGeeX2/ptuning/main_without_tokenizer.py+0-2
@@ -76,8 +76,6 @@ def main():
76 model_args, data_args, training_args = parser.parse_args_into_dataclasses()76 model_args, data_args, training_args = parser.parse_args_into_dataclasses()
77 if training_args.do_train:77 if training_args.do_train:
78 torch.npu.set_compile_mode(jit_compile=True)78 torch.npu.set_compile_mode(jit_compile=True)
79- option = {"NPU_FUZZY_COMPILE_BLACKLIST": "Tril,LayerNormGrad"}
80- torch.npu.set_option(option)
81 79 
82 if training_args.do_predict:80 if training_args.do_predict:
83 training_args.local_rank = -181 training_args.local_rank = -1
MPyTorch/built-in/foundation/GPT-NeoX/train.py+0-2
@@ -28,8 +28,6 @@ if __name__ == "__main__":
28 28 
29 use_jit_compile = os.getenv('JIT_COMPILE', 'False').lower() in ['true', '1']29 use_jit_compile = os.getenv('JIT_COMPILE', 'False').lower() in ['true', '1']
30 torch.npu.set_compile_mode(jit_compile=use_jit_compile)30 torch.npu.set_compile_mode(jit_compile=use_jit_compile)
31- option = {"NPU_FUZZY_COMPILE_BLACKLIST": "Tril,SoftmaxV2,LayerNormGrad", "MM_BMM_ND_ENABLE": 'enable'}
32- torch.npu.set_option(option)
33 neox_args = NeoXArgs.consume_neox_args()31 neox_args = NeoXArgs.consume_neox_args()
34 neox_args.configure_distributed_args()32 neox_args.configure_distributed_args()
35 neox_args.build_tokenizer() # tokenizer needs to be build in training in order to set the padding vocab33 neox_args.build_tokenizer() # tokenizer needs to be build in training in order to set the padding vocab
MPyTorch/built-in/nlp/mBART_ID2372_for_PyTorch/fairseq_cli/generate.py+0-1
@@ -60,7 +60,6 @@ def _main(args, output_file):
60 option={}60 option={}
61 option['ACL_OP_SELECT_IMPL_MODE'] = 'high_performance'61 option['ACL_OP_SELECT_IMPL_MODE'] = 'high_performance'
62 option['ACL_OPTYPELIST_FOR_IMPLMODE'] = 'LayerNorm'62 option['ACL_OPTYPELIST_FOR_IMPLMODE'] = 'LayerNorm'
63- option['NPU_FUZZY_COMPILE_BLACKLIST'] = 'MultiHeadAttention,MultiHeadAttentionGrad'
64 torch.npu.set_option(option)63 torch.npu.set_option(option)
65 utils.import_user_module(args)64 utils.import_user_module(args)
66 65 
MPyTorch/built-in/nlp/mBART_ID2372_for_PyTorch/fairseq_cli/train.py+0-1
@@ -61,7 +61,6 @@ def main(args):
61 option = {}61 option = {}
62 option['ACL_OP_SELECT_IMPL_MODE'] = 'high_performance'62 option['ACL_OP_SELECT_IMPL_MODE'] = 'high_performance'
63 option['ACL_OPTYPELIST_FOR_IMPLMODE'] = 'LayerNorm'63 option['ACL_OPTYPELIST_FOR_IMPLMODE'] = 'LayerNorm'
64- option['NPU_FUZZY_COMPILE_BLACKLIST'] = 'MultiHeadAttention,MultiHeadAttentionGrad'
65 torch.npu.set_option(option)64 torch.npu.set_option(option)
66 if args.distributed_world_size == 1:65 if args.distributed_world_size == 1:
67 torch.npu.set_device('npu:{}'.format(args.npu_id))66 torch.npu.set_device('npu:{}'.format(args.npu_id))
MPyTorch/built-in/others/LayoutXLM_for_PyTorch/examples/run_xfun_re.py+0-2
@@ -76,8 +76,6 @@ elif os.getenv('ALLOW_FP32', False):
76 torch.npu.matmul.allow_hf32 = False76 torch.npu.matmul.allow_hf32 = False
77torch.npu.set_compile_mode(jit_compile=False)77torch.npu.set_compile_mode(jit_compile=False)
78option = {}78option = {}
79-# 二进制场景下,这三个算子前后存在大量aicpu上的transdata,性能较差;加入黑名单后性能提升明显
80-option["NPU_FUZZY_COMPILE_BLACKLIST"] = "Conv2DBackpropFilter,Conv2DBackpropInput,Conv2D"
81option["MM_BMM_ND_ENABLE"] = 'disable'79option["MM_BMM_ND_ENABLE"] = 'disable'
82torch.npu.set_option(option)80torch.npu.set_option(option)
83 81 
MPyTorch/built-in/others/LayoutXLM_for_PyTorch/examples/run_xfun_ser.py+0-1
@@ -84,7 +84,6 @@ elif os.getenv('ALLOW_FP32', False):
84 torch.npu.matmul.allow_hf32 = False84 torch.npu.matmul.allow_hf32 = False
85torch.npu.set_compile_mode(jit_compile=False)85torch.npu.set_compile_mode(jit_compile=False)
86option = {}86option = {}
87-option["NPU_FUZZY_COMPILE_BLACKLIST"] = "Conv2DBackpropFilter,Conv2DBackpropInput,Conv2D"
88option["MM_BMM_ND_ENABLE"] = 'disable'87option["MM_BMM_ND_ENABLE"] = 'disable'
89torch.npu.set_option(option)88torch.npu.set_option(option)
90 89 
MPyTorch/built-in/rl/MAPPO_for_PyTorch/onpolicy/scripts/train/train_mpe.py+0-1
@@ -191,7 +191,6 @@ if __name__ == "__main__":
191 torch_npu.npu.set_compile_mode(jit_compile=False)191 torch_npu.npu.set_compile_mode(jit_compile=False)
192 # TODO: DynamicGRUV2 now not support fp32192 # TODO: DynamicGRUV2 now not support fp32
193 option = {}193 option = {}
194- option["NPU_FUZZY_COMPILE_BLACKLIST"] = "DynamicGRUV2"
195 option["ACL_PRECISION_MODE"] = "allow_fp32_to_fp16"194 option["ACL_PRECISION_MODE"] = "allow_fp32_to_fp16"
196 torch.npu.set_option(option)195 torch.npu.set_option(option)
197 main(sys.argv[1:])196 main(sys.argv[1:])
MPyTorch/contrib/audio/Tacotron2_for_PyTorch/train.py+0-3
@@ -601,7 +601,4 @@ def load_tensor(name, device):
601 601 
602if __name__ == '__main__':602if __name__ == '__main__':
603 torch.npu.set_compile_mode(jit_compile=False)603 torch.npu.set_compile_mode(jit_compile=False)
604- option = {}
605- option['NPU_FUZZY_COMPILE_BLACKLIST'] = 'DynamicRNN,DynamicRNNV2'
606- torch.npu.set_option(option)
607 main()604 main()
MPyTorch/contrib/cv/detection/SSD-Resnet/train.py+0-4
@@ -496,8 +496,4 @@ def main():
496 496 
497 497 
498if __name__ == "__main__":498if __name__ == "__main__":
499- option = {}
500- option["NPU_FUZZY_COMPILE_BLACKLIST"] = '''BNTrainingReduce,BNTrainingReduceGrad,
501- BNTrainingUpdate,BNTrainingUpdateGrad'''
502- torch.npu.set_option(option)
503 main()499 main()
MPyTorch/contrib/cv/detection/SSD/tools/test.py+0-3
@@ -215,7 +215,4 @@ def main():
215 215 
216 216 
217if __name__ == '__main__':217if __name__ == '__main__':
218- option = {}
219- option["NPU_FUZZY_COMPILE_BLACKLIST"] = "BatchMultiClassNonMaxSuppression"
220- torch.npu.set_option(option)
221 main()218 main()
MPyTorch/contrib/cv/detection/SSD/tools/train.py+0-3
@@ -197,7 +197,4 @@ def main():
197 197 
198if __name__ == '__main__':198if __name__ == '__main__':
199 torch_npu.npu.set_compile_mode(jit_compile=False)199 torch_npu.npu.set_compile_mode(jit_compile=False)
200- option = {}
201- option["NPU_FUZZY_COMPILE_BLACKLIST"] = "BatchMultiClassNonMaxSuppression"
202- torch.npu.set_option(option)
203 main()200 main()
MPyTorch/dev/cv/image_classification/ATS_ID2682_for_PyTorch/examples/cats_and_dogs.py+0-3
@@ -82,9 +82,6 @@ import os
82import apex82import apex
83#模糊编译83#模糊编译
84torch.npu.set_start_fuzz_compile_step(3)84torch.npu.set_start_fuzz_compile_step(3)
85-option = {}
86-option["NPU_FUZZY_COMPILE_BLACKLIST"] = "LayerNormGrad"
87-torch.npu.set_option(option)
88try:85try:
89 from apex import amp86 from apex import amp
90except:87except:
MPyTorch/dev/cv/image_classification/FasterRCNN_ID0100_for_PyTorch/tools/train_net.py+0-4
@@ -54,10 +54,6 @@ from detectron2.evaluation import (
54 verify_results,54 verify_results,
55)55)
56from detectron2.modeling import GeneralizedRCNNWithTTA56from detectron2.modeling import GeneralizedRCNNWithTTA
57-#算子黑名单
58-option = {}
59-option["NPU_FUZZY_COMPILE_BLACKLIST"] = "NMSWithMask,BatchMultiClassNonMaxSuppression,AxpyV2"
60-torch.npu.set_option(option)
61class Trainer(DefaultTrainer):57class Trainer(DefaultTrainer):
62 """58 """
63 We use the "DefaultTrainer" which contains pre-defined default logic for59 We use the "DefaultTrainer" which contains pre-defined default logic for