From 059bfd69a88be5eaae11f3067e2cbc3b5033ceaa Mon Sep 17 00:00:00 2001 From: chentianyu03 Date: Fri, 25 Sep 2020 10:34:09 +0800 Subject: [PATCH] change wlist.json, add annotation (#27438) * modify ci api white list, add annotation * modify ci api white list, add annotation * move gpu_not_white list to wlist.json * add null line --- tools/sampcd_processor.py | 23 ++++++++------- tools/wlist.json | 62 ++++++++++++++++++++++++--------------- 2 files changed, 50 insertions(+), 35 deletions(-) diff --git a/tools/sampcd_processor.py b/tools/sampcd_processor.py index 033b4b8723a..d23c18a44e9 100644 --- a/tools/sampcd_processor.py +++ b/tools/sampcd_processor.py @@ -534,13 +534,6 @@ def get_incrementapi(): f.write('\n') -# only white on CPU -gpu_not_white = [ - "deformable_conv", "cuda_places", "CUDAPinnedPlace", "CUDAPlace", - "cuda_profiler", 'DGCMomentumOptimizer' -] - - def get_wlist(): ''' this function will get the white list of API. @@ -552,17 +545,25 @@ def get_wlist(): ''' wlist = [] wlist_file = [] + # only white on CPU + gpu_not_white = [] with open("wlist.json", 'r') as load_f: load_dict = json.load(load_f) for key in load_dict: - if key == 'wlist_file': - wlist_file = wlist_file + load_dict[key] + if key == 'wlist_dir': + for item in load_dict[key]: + wlist_file.append(item["name"]) + elif key == "gpu_not_white": + gpu_not_white = load_dict[key] + elif key == "wlist_api": + for item in load_dict[key]: + wlist.append(item["name"]) else: wlist = wlist + load_dict[key] - return wlist, wlist_file + return wlist, wlist_file, gpu_not_white -wlist, wlist_file = get_wlist() +wlist, wlist_file, gpu_not_white = get_wlist() if len(sys.argv) < 2: print("Error: inadequate number of arguments") diff --git a/tools/wlist.json b/tools/wlist.json index 5591f90da4b..0ed0b4e4069 100644 --- a/tools/wlist.json +++ b/tools/wlist.json @@ -1,11 +1,29 @@ { - "wlist_file" : [ - "../python/paddle/fluid/contrib", - "../python/paddle/verison.py", - "../python/paddle/fluid/core_avx.py", - "../python/paddle/distributed" + "wlist_dir":[ + { + "name":"../python/paddle/fluid/contrib", + "annotation":"" + }, + { + "name":"../python/paddle/verison.py", + "annotation":"" + }, + { + "name":"../python/paddle/fluid/core_avx.py", + "annotation":"" + }, + { + "name":"../python/paddle/distributed", + "annotation":"" + } ], - "wlist_inneed":[ + "wlist_api":[ + { + "name":"xxxxx", + "annotation":"not a real api, just for example" + } + ], + "wlist_temp_api":[ "append_LARS", "BuildStrategy.debug_graphviz_path", "BuildStrategy.enable_sequential_execution", @@ -63,9 +81,7 @@ "cuda_places", "CUDAPinnedPlace", "CUDAPlace", - "Program.parse_from_string" - ], - "wlist_nosample":[ + "Program.parse_from_string", "Compressor", "Compressor.config", "Compressor.run", @@ -159,13 +175,9 @@ "RNN", "BiRNN", "RNNCellBase", - "RNNCellBase.get_initial_states" - ], - "wlist_no_op_pass":[ + "RNNCellBase.get_initial_states", "gelu", - "erf" - ], - "wlist_ci_nopass":[ + "erf", "DecodeHelper", "DecodeHelper.initialize", "DecodeHelper.sample", @@ -188,9 +200,7 @@ "SampleEmbeddingHelper", "BasicDecoder", "lstm", - "partial_sum" - ], - "wlist_nopass":[ + "partial_sum", "StateCell", "StateCell.compute_state", "TrainingDecoder", @@ -242,9 +252,7 @@ "GroupNorm", "SpectralNorm", "TreeConv", - "prroi_pool" - ], - "wlist_temp":[ + "prroi_pool", "to_tensor", "ChunkEvaluator", "EditDistance", @@ -322,9 +330,7 @@ "Conv2DTranspose", "QueueDataset.local_shuffle", "save_persistables@dygraph/checkpoint.py", - "load_persistables@dygraph/checkpoint.py" - ], - "wlist_ignore":[ + "load_persistables@dygraph/checkpoint.py", "elementwise_pow", "WeightedAverage.reset", "ChunkEvaluator.eval", @@ -401,5 +407,13 @@ "LinearChainCRF.forward", "CRFDecoding.forward", "SequenceTagging.forward" + ], + "gpu_not_white":[ + "deformable_conv", + "cuda_places", + "CUDAPinnedPlace", + "CUDAPlace", + "cuda_profiler", + "DGCMomentumOptimizer" ] } -- GitLab