From 0faf6465efdaf4784ecd50d6e6da7f87acce3b34 Mon Sep 17 00:00:00 2001 From: yuhaiyan Date: Thu, 10 Jul 2025 16:19:50 +0800 Subject: [PATCH 1/6] Update torch_npu_schema.json and Check new apis --- test/npu/test_compatibility.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/npu/test_compatibility.py b/test/npu/test_compatibility.py index 9c8dead41e..fefaf06d84 100644 --- a/test/npu/test_compatibility.py +++ b/test/npu/test_compatibility.py @@ -328,6 +328,13 @@ class TestPublicApiCompatibility(TestCase): failure_list.append(f"# {func}:") failure_list.append(f" - {func} has been deleted.") + newly_apis = set(now_funcs) - set(base_funcs) + for func in newly_apis: + failure_list.append(f"# {func}:") + failure_list.append(f" - {func} is new. Please add it to the torch_npu_schema.json") + signature = content[func]["signature"] + failure_list.append(f" - it's signature is {signature}.") + msg = "All the APIs below do not meet the compatibility guidelines. " msg += "If the change timeline has been reached, you can modify the torch_npu_schema.json to make it OK." msg += "\n\nFull list:\n" -- Gitee From 00c96962e7d6e7c4a1d11936ecd3a8a9284dea2d Mon Sep 17 00:00:00 2001 From: yuhaiyan Date: Fri, 25 Jul 2025 17:45:43 +0800 Subject: [PATCH 2/6] update test_compatibility.py and test_public_bindings.py --- test/allowlist_for_publicAPI.json | 74 +------------------------------ test/npu/test_compatibility.py | 7 ++- test/npu/test_public_bindings.py | 18 +++++++- test/torch_npu_schema.json | 51 +++++++++++++++++++++ 4 files changed, 75 insertions(+), 75 deletions(-) diff --git a/test/allowlist_for_publicAPI.json b/test/allowlist_for_publicAPI.json index a42e418424..b35a01df2f 100644 --- a/test/allowlist_for_publicAPI.json +++ b/test/allowlist_for_publicAPI.json @@ -2810,79 +2810,7 @@ "TrieNode" ], "torch_npu": [ - "_npu_dropout", - "copy_memory_", - "empty_with_format", - "empty_with_swapped_memory", - "npu_alloc_float_status", - "npu_apply_adam", - "npu_advance_step_flashattn", - "npu_batch_gather_matmul", - "npu_batch_gather_matmul_", - "npu_bert_apply_adam", - "npu_clear_float_status", - "npu_cross_entropy_loss", - "npu_format_cast_", - "npu_fusion_attention", - "npu_fusion_attention_v2", - "npu_get_float_status", - "npu_nms_rotated", - "npu_random_choice_with_mask", - "npu_rms_norm", - "npu_add_rms_norm_cast", - "npu_fused_infer_attention_score", - "npu_fused_infer_attention_v2", - "npu_mla_prolog", - "npu_mla_prolog_v2", - "npu_convert_weight_to_int4pack", - "npu_ffn", - "npu_fused_matmul", - "npu_geglu", - "npu_grouped_matmul", - "npu_quant_matmul", - "npu_quant_scatter", - "npu_scatter_nd_update_", - "npu_swiglu", - "npu_dequant_bias", - "npu_group_quant", - "npu_dynamic_quant", - "npu_dynamic_quant_asymmetric", - "npu_yolo_boxes_encode", - "npu_yolo_boxes_encode", - "npu_gemma_rms_norm", - "npu_weight_quant_batchmatmul", - "npu_transpose", - "npu_trans_quant_param", - "npu_stride_add", - "npu_sort_v2", - "npu_dtype_cast", - "npu_gelu", - "npu_gelu_backward", - "npu_all_gather_base_mm", - "npu_mm_reduce_scatter_base", - "npu_prefetch", - "npu_quant_scatter_", - "scatter_update", - "scatter_update_", - "npu_kronecker_quant", - "npu_moe_compute_expert_tokens", - "npu_moe_gating_top_k_softmax", - "npu_moe_init_routing", - "npu_group_norm_swish", - "npu_mrope", - "npu_grouped_matmul_finalize_routing", - "npu_alltoallv_gmm", - "npu_gmm_alltoallv", - "npu_nsa_compress", - "npu_nsa_compress_infer", - "npu_nsa_compress_attention", - "npu_nsa_compress_attention_infer", - "npu_nsa_select_attention", - "npu_nsa_select_attention_infer", - "npu_transpose_batchmatmul", - "npu_gather_sparse_index", - "npu_moe_distribute_combine_add_rms_norm", - "npu_moe_eplb_update_expert" + "_npu_dropout" ], "torch_npu.contrib": [ "npu_fused_attention_with_layernorm", diff --git a/test/npu/test_compatibility.py b/test/npu/test_compatibility.py index fefaf06d84..16a1dde9fa 100644 --- a/test/npu/test_compatibility.py +++ b/test/npu/test_compatibility.py @@ -135,7 +135,8 @@ def api_signature(obj, api_str, content, base_schema, failure_list): def func_in_class(obj, content, modname, elem, base_schema, failure_list): class_variables = [attribute for attribute in obj.__dict__.keys() if not attribute.startswith('__') - and callable(getattr(obj, attribute))] + and not attribute.startswith('_') + and callable(getattr(obj, attribute))] for variable in class_variables: if variable in ["_backward_cls"]: continue @@ -282,6 +283,10 @@ class TestPublicApiCompatibility(TestCase): return elem_module = getattr(obj, '__module__', None) + # the compatibility of apis from torch._ops.npu is checked in op-plugin. + if elem_module == "torch._ops.npu": + return + modname = allow_dict["being_migrated"].get(modname, modname) elem_modname_starts_with_mod = elem_module is not None and \ elem_module.startswith(modname) and \ diff --git a/test/npu/test_public_bindings.py b/test/npu/test_public_bindings.py index 5cd8208ba7..2b4a26b20a 100644 --- a/test/npu/test_public_bindings.py +++ b/test/npu/test_public_bindings.py @@ -663,6 +663,16 @@ class TestPublicBindings(TestCase): except Exception: update_allow_dict_torchair = {} warnings.warn("if you are debugging UT file in clone repo, please recursively update the torchair submodule") + + try: + file_abspath = os.path.abspath(__file__) + op_plugin_path = 'third_party/op-plugin/test/allowlist_for_publicAPI.json' + with open( + os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(file_abspath))), op_plugin_path)) as json_file_op_plugin: + allow_dict_op_plugin = json.load(json_file_op_plugin) + except Exception as e: + allow_dict_op_plugin = {} + warnings.warn(f"{e}") with open(get_file_path_2(os.path.dirname(os.path.dirname(__file__)), 'allowlist_for_publicAPI.json')) as json_file: @@ -681,7 +691,13 @@ class TestPublicBindings(TestCase): if update_allow_dict_torchair: allow_dict.update(update_allow_dict_torchair) - + + if allow_dict_op_plugin: + if "torch_npu" in allow_dict: + allow_dict["torch_npu"].extend(allow_dict_op_plugin["torch_npu"]) + else: + allow_dict.update(allow_dict_op_plugin["torch_npu"]) + def test_module(modname): try: if "__main__" in modname or \ diff --git a/test/torch_npu_schema.json b/test/torch_npu_schema.json index 2fa55c9476..d9646fe018 100644 --- a/test/torch_npu_schema.json +++ b/test/torch_npu_schema.json @@ -701,6 +701,57 @@ "torch_npu.dynamo.torchair.npu_fx_compiler.get_npu_backend": { "signature": "(*, compiler_config: torchair.configs.compiler_config.CompilerConfig = None, custom_decompositions: Dict = {})" }, + "torch_npu.profiler.profile._set_step_num_offset_for_dynamic_prof": { + "signature": "(self, step: int)" + }, + "torch_npu.profiler.experimental_config.HostSystem": { + "signature": "()" + }, + "torch_npu.utils.save_async": { + "signature": "(obj: object, f, pickle_module: Any = , pickle_protocol: int = 2, _use_new_zipfile_serialization: bool = True, _disable_byteorder_record: bool = False, model: torch.nn.modules.module.Module = None) -> None" + }, + "torch_npu.profiler.profiler.profile._set_step_num_offset_for_dynamic_prof": { + "signature": "(self, step: int)" + }, + "torch_npu.dynamo.torchair.ops.npu_fused_infer_attention_score": { + "signature": "(*args, **kwargs)" + }, + "torch_npu.npu.utils.get_uce_addr": { + "signature": "()" + }, + "torch_npu.dynamo.torchair.ops.npu_fused_infer_attention_v2": { + "signature": "(*args, **kwargs)" + }, + "torch_npu.profiler._ExperimentalConfig._check_host_sys_params": { + "signature": "(self)" + }, + "torch_npu.profiler.HostSystem": { + "signature": "()" + }, + "torch_npu.profiler.experimental_config._ExperimentalConfig._check_host_sys_params": { + "signature": "(self)" + }, + "torch_npu.dynamo.torchair.ops.npu_tagged_event_reset": { + "signature": "(event)" + }, + "torch_npu.dynamo.torchair.ops.npu_tagged_event_wait": { + "signature": "(event)" + }, + "torch_npu.utils.serialization.save_async": { + "signature": "(obj: object, f, pickle_module: Any = , pickle_protocol: int = 2, _use_new_zipfile_serialization: bool = True, _disable_byteorder_record: bool = False, model: torch.nn.modules.module.Module = None) -> None" + }, + "torch_npu.npu.NPUGraph.update": { + "signature": "(self, cpu_update_input)" + }, + "torch_npu.dynamo.torchair.ops.npu_create_tagged_external_event": { + "signature": "(tag: str)" + }, + "torch_npu.npu.graphs.NPUGraph.update": { + "signature": "(self, cpu_update_input)" + }, + "torch_npu.dynamo.torchair.ops.npu_tagged_event_record": { + "signature": "(event)" + }, "torch_npu.jit.optimize": { "signature": "(jit_mod)" }, -- Gitee From 20d7ce28e48938b0a0a6227d3b1bc5a37174bd1f Mon Sep 17 00:00:00 2001 From: yuhaiyan Date: Fri, 25 Jul 2025 18:01:01 +0800 Subject: [PATCH 3/6] fixed --- test/npu/test_public_bindings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/npu/test_public_bindings.py b/test/npu/test_public_bindings.py index 2b4a26b20a..4a6910d09d 100644 --- a/test/npu/test_public_bindings.py +++ b/test/npu/test_public_bindings.py @@ -692,7 +692,7 @@ class TestPublicBindings(TestCase): if update_allow_dict_torchair: allow_dict.update(update_allow_dict_torchair) - if allow_dict_op_plugin: + if allow_dict_op_plugin and "torch_npu" in allow_dict_op_plugin: if "torch_npu" in allow_dict: allow_dict["torch_npu"].extend(allow_dict_op_plugin["torch_npu"]) else: -- Gitee From 964482a87ba23c35813203a5a447c79db270f0ab Mon Sep 17 00:00:00 2001 From: yuhaiyan Date: Sat, 26 Jul 2025 10:54:37 +0800 Subject: [PATCH 4/6] fixed --- test/allowlist_for_publicAPI.json | 2 +- test/npu/test_compatibility.py | 1 - test/torch_npu_schema.json | 36 ------------------------------- 3 files changed, 1 insertion(+), 38 deletions(-) diff --git a/test/allowlist_for_publicAPI.json b/test/allowlist_for_publicAPI.json index b35a01df2f..cd61092e47 100644 --- a/test/allowlist_for_publicAPI.json +++ b/test/allowlist_for_publicAPI.json @@ -2810,7 +2810,7 @@ "TrieNode" ], "torch_npu": [ - "_npu_dropout" + "npu_stride_add" ], "torch_npu.contrib": [ "npu_fused_attention_with_layernorm", diff --git a/test/npu/test_compatibility.py b/test/npu/test_compatibility.py index 16a1dde9fa..dc9b905fa5 100644 --- a/test/npu/test_compatibility.py +++ b/test/npu/test_compatibility.py @@ -135,7 +135,6 @@ def api_signature(obj, api_str, content, base_schema, failure_list): def func_in_class(obj, content, modname, elem, base_schema, failure_list): class_variables = [attribute for attribute in obj.__dict__.keys() if not attribute.startswith('__') - and not attribute.startswith('_') and callable(getattr(obj, attribute))] for variable in class_variables: if variable in ["_backward_cls"]: diff --git a/test/torch_npu_schema.json b/test/torch_npu_schema.json index d9646fe018..04d416f443 100644 --- a/test/torch_npu_schema.json +++ b/test/torch_npu_schema.json @@ -875,9 +875,6 @@ "torch_npu.npu.streams.ExternalEvent.record": { "signature": "(self, stream=None)" }, - "torch_npu.npu_advance_step_flashattn": { - "signature": "(*args, **kwargs)" - }, "torch_npu.contrib.module.activations.Swish.forward": { "signature": "(self, x)" }, @@ -944,9 +941,6 @@ "torch_npu.npu.NPUGraph.replay": { "signature": "(self)" }, - "torch_npu.npu_group_norm_swish": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu.graphs.NPUGraph.capture_end": { "signature": "(self)" }, @@ -2513,9 +2507,6 @@ "torch_npu.utils.syncbatchnorm.SyncBatchNorm.backward": { "signature": "(self, grad_output)" }, - "torch_npu._npu_dropout": { - "signature": "(*args, **kwargs)" - }, "torch_npu.fast_gelu": { "signature": "(self)" }, @@ -2543,9 +2534,6 @@ "torch_npu.npu_bounding_box_encode": { "signature": "(anchor_box, ground_truth_box, means0, means1, means2, means3, stds0, stds1, stds2, stds3)" }, - "torch_npu.npu_clear_float_status": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_confusion_transpose": { "signature": "(self, perm, shape, transpose_first)" }, @@ -2576,15 +2564,9 @@ "torch_npu.npu_stride_add": { "signature": "(self, other, offset1, offset2, c1_len)" }, - "torch_npu.npu_ffn": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_format_cast": { "signature": "(self, acl_format, customize_dtype=None)" }, - "torch_npu.npu_format_cast_": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_fused_attention_score": { "signature": "(query_layer, key_layer, value_layer, attention_mask, scale, keep_prob, query_transpose=False, key_transpose=False, bmm_score_transpose_a=False, bmm_score_transpose_b=False, value_transpose=False, dx_transpose=False)" }, @@ -2639,9 +2621,6 @@ "torch_npu.npu_ps_roi_pooling": { "signature": "(self, rois, spatial_scale, group_size, output_dim)" }, - "torch_npu.npu_quant_matmul": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_quant_scatter": { "signature": "(*args, **kwargs)" }, @@ -2669,9 +2648,6 @@ "torch_npu.npu_scatter_nd_update": { "signature": "(self, indices, updates)" }, - "torch_npu.npu_scatter_nd_update_": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_sign_bits_pack": { "signature": "(self, size)" }, @@ -2693,9 +2669,6 @@ "torch_npu.npu_transpose": { "signature": "(self, perm, require_contiguous=True, out=None)" }, - "torch_npu.npu_transpose_batchmatmul": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_weight_quant_batchmatmul": { "signature": "(x, weight, antiquant_scale, antiquant_offset=None, quant_scale=None, quant_offset=None, bias=None, antiquant_group_size=0, inner_precise=0)" }, @@ -2726,9 +2699,6 @@ "torch_npu.utils.FlopsCounter.get_flops": { "signature": "(self)" }, - "torch_npu.scatter_update": { - "signature": "(*args, **kwargs)" - }, "torch_npu.scatter_update_": { "signature": "(*args, **kwargs)" }, @@ -2738,15 +2708,9 @@ "torch_npu.npu_quant_scatter_": { "signature": "(*args, **kwargs)" }, - "torch_npu.npu_prefetch": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_moe_init_routing": { "signature": "(*args, **kwargs)" }, - "torch_npu.npu_moe_gating_top_k_softmax": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_moe_finalize_routing": { "signature": "(expanded_permuted_rows, skip1, skip2, bias, scales, expanded_src_to_dst_row, export_for_source_row, drop_pad_mode=0)" }, -- Gitee From 9017c6840520a1e740953e4fae14795d60b6233c Mon Sep 17 00:00:00 2001 From: yuhaiyan Date: Sat, 26 Jul 2025 15:43:07 +0800 Subject: [PATCH 5/6] fixed --- test/allowlist_for_publicAPI.json | 4 +- test/torch_npu_schema.json | 93 ++++++------------------------- 2 files changed, 21 insertions(+), 76 deletions(-) diff --git a/test/allowlist_for_publicAPI.json b/test/allowlist_for_publicAPI.json index cd61092e47..b23da25e91 100644 --- a/test/allowlist_for_publicAPI.json +++ b/test/allowlist_for_publicAPI.json @@ -2810,7 +2810,9 @@ "TrieNode" ], "torch_npu": [ - "npu_stride_add" + "npu_stride_add", + "npu_moe_gating_top_k_softmax", + "npu_moe_init_routing" ], "torch_npu.contrib": [ "npu_fused_attention_with_layernorm", diff --git a/test/torch_npu_schema.json b/test/torch_npu_schema.json index 04d416f443..3a0a915a50 100644 --- a/test/torch_npu_schema.json +++ b/test/torch_npu_schema.json @@ -716,9 +716,6 @@ "torch_npu.dynamo.torchair.ops.npu_fused_infer_attention_score": { "signature": "(*args, **kwargs)" }, - "torch_npu.npu.utils.get_uce_addr": { - "signature": "()" - }, "torch_npu.dynamo.torchair.ops.npu_fused_infer_attention_v2": { "signature": "(*args, **kwargs)" }, @@ -731,9 +728,6 @@ "torch_npu.profiler.experimental_config._ExperimentalConfig._check_host_sys_params": { "signature": "(self)" }, - "torch_npu.dynamo.torchair.ops.npu_tagged_event_reset": { - "signature": "(event)" - }, "torch_npu.dynamo.torchair.ops.npu_tagged_event_wait": { "signature": "(event)" }, @@ -743,9 +737,6 @@ "torch_npu.npu.NPUGraph.update": { "signature": "(self, cpu_update_input)" }, - "torch_npu.dynamo.torchair.ops.npu_create_tagged_external_event": { - "signature": "(tag: str)" - }, "torch_npu.npu.graphs.NPUGraph.update": { "signature": "(self, cpu_update_input)" }, @@ -836,9 +827,6 @@ "torch_npu.npu.NPUGraph.capture_end": { "signature": "(self)" }, - "torch_npu.npu_mla_prolog": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu.MemPoolContext": { "signature": "(pool: torch_npu.npu.memory.MemPool)" }, @@ -857,9 +845,6 @@ "torch_npu.npu.graphs.NPUGraph.reset": { "signature": "(self)" }, - "torch_npu.npu_cross_entropy_loss": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu.memory.use_mem_pool": { "signature": "(pool: torch_npu.npu.memory.MemPool, device=None)" }, @@ -869,9 +854,6 @@ "torch_npu.npu.graphs.graph_task_update_begin": { "signature": "(stream, handle)" }, - "torch_npu.npu_grouped_matmul_finalize_routing": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu.streams.ExternalEvent.record": { "signature": "(self, stream=None)" }, @@ -905,15 +887,6 @@ "torch_npu.contrib.module.activations.SiLU.forward": { "signature": "(self, x)" }, - "torch_npu.empty_with_swapped_memory": { - "signature": "(*args, **kwargs)" - }, - "torch_npu.npu_gmm_alltoallv": { - "signature": "(*args, **kwargs)" - }, - "torch_npu.npu_mrope": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu.streams.Event.recorded_time": { "signature": "(self)" }, @@ -929,9 +902,6 @@ "torch_npu.npu.Event.recorded_time": { "signature": "(self)" }, - "torch_npu.npu_alltoallv_gmm": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu.graphs.NPUGraph.replay": { "signature": "(self)" }, @@ -2510,9 +2480,6 @@ "torch_npu.fast_gelu": { "signature": "(self)" }, - "torch_npu.npu_alloc_float_status": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_anchor_response_flags": { "signature": "(self, featmap_size, stride, num_base_anchors)" }, @@ -2522,9 +2489,6 @@ "torch_npu.npu_batch_nms": { "signature": "(self, scores, score_threshold, iou_threshold, max_size_per_class, max_total_size, change_coordinate_frame=False, transpose_box=False)" }, - "torch_npu.npu_bert_apply_adam": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_bmmV2": { "signature": "(self, mat2, output_sizes)" }, @@ -2540,9 +2504,6 @@ "torch_npu.npu_conv3d": { "signature": "(input_, weight, bias, stride, padding, dilation, groups)" }, - "torch_npu.npu_convert_weight_to_int4pack": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_deformable_conv2d": { "signature": "(inputs, weight, offset, bias, kernel_size, stride, padding, dilation=[1, 1, 1, 1], groups=1, deformable_groups=1, modulated=True)" }, @@ -2570,21 +2531,12 @@ "torch_npu.npu_fused_attention_score": { "signature": "(query_layer, key_layer, value_layer, attention_mask, scale, keep_prob, query_transpose=False, key_transpose=False, bmm_score_transpose_a=False, bmm_score_transpose_b=False, value_transpose=False, dx_transpose=False)" }, - "torch_npu.npu_fusion_attention": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_geglu": { "signature": "(self, dim=-1, approximate=1, activate_left=False)" }, - "torch_npu.npu_get_float_status": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_grid_assign_positive": { "signature": "(self, overlaps, box_responsible_flags, max_overlaps, argmax_overlaps, gt_max_overlaps, gt_argmax_overlaps, num_gts, pos_iou_thr, min_pos_iou, gt_max_assign_all)" }, - "torch_npu.npu_grouped_matmul": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_incre_flash_attention": { "signature": "(self, query, key, value, padding_mask, atten_mask, pse_shift, actual_seq_lengths, num_heads, scale_value, input_layout, num_key_value_heads)" }, @@ -2621,12 +2573,6 @@ "torch_npu.npu_ps_roi_pooling": { "signature": "(self, rois, spatial_scale, group_size, output_dim)" }, - "torch_npu.npu_quant_scatter": { - "signature": "(*args, **kwargs)" - }, - "torch_npu.npu_random_choice_with_mask": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_rms_norm": { "signature": "(self, gamma, epsilon=1e-06)" }, @@ -2660,12 +2606,6 @@ "torch_npu.npu_softmax_cross_entropy_with_logits": { "signature": "(self, labels)" }, - "torch_npu.npu_swiglu": { - "signature": "(*args, **kwargs)" - }, - "torch_npu.npu_trans_quant_param": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_transpose": { "signature": "(self, perm, require_contiguous=True, out=None)" }, @@ -2699,27 +2639,15 @@ "torch_npu.utils.FlopsCounter.get_flops": { "signature": "(self)" }, - "torch_npu.scatter_update_": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_quantize": { "signature": "(inputs, scales, zero_points, dtype, axis, div_mode=True)" }, - "torch_npu.npu_quant_scatter_": { - "signature": "(*args, **kwargs)" - }, - "torch_npu.npu_moe_init_routing": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_moe_finalize_routing": { "signature": "(expanded_permuted_rows, skip1, skip2, bias, scales, expanded_src_to_dst_row, export_for_source_row, drop_pad_mode=0)" }, "torch_npu.npu_moe_compute_expert_tokens": { "signature": "(sorted_experts, num_experts=1)" }, - "torch_npu.npu_mm_reduce_scatter_base": { - "signature": "(*args, **kwargs)" - }, "torch_npu.npu_group_norm_silu": { "signature": "(x, gamma, beta, group, eps=1e-05)" }, @@ -2729,18 +2657,33 @@ "torch_npu.npu_fast_gelu": { "signature": "(self)" }, - "torch_npu.npu_all_gather_base_mm": { - "signature": "(*args, **kwargs)" - }, "torch_npu.utils.set_thread_affinity": { "signature": "(core_range: List[int] = None)" }, "torch_npu.utils.reset_thread_affinity": { "signature": "()" }, + "torch_npu.npu.npu_config.set_device_limit": { + "signature": "(*args, **kwargs)" + }, + "torch_npu.npu.set_device_limit": { + "signature": "(*args, **kwargs)" + }, + "torch_npu.npu.get_device_limit": { + "signature": "(device)" + }, + "torch_npu.npu.npu_config.get_device_limit": { + "signature": "(device)" + }, "torch_npu.dynamo.torchair.scope.npu_stream_switch": { "signature": "(stream_tag: str, stream_priority: int = 0)" }, + "torch_npu.dynamo.torchair.ops.npu_record_tagged_stream":{ + "signature": "(self: torch.Tensor, tagged_stream: str)" + }, + "torch_npu.dynamo.torchair.ops.npu_create_tagged_event": { + "signature": "(tag: str)" + }, "torch_npu.dynamo.torchair.scope.npu_wait_tensor": { "signature": "(self: torch.Tensor, dependency: torch.Tensor)" }, -- Gitee From 77b459a79f5f0daa86c1b48ae7525cef8228b905 Mon Sep 17 00:00:00 2001 From: yuhaiyan Date: Mon, 28 Jul 2025 20:09:54 +0800 Subject: [PATCH 6/6] fixed --- test/allowlist_for_publicAPI.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/allowlist_for_publicAPI.json b/test/allowlist_for_publicAPI.json index b23da25e91..8c7fee4b1b 100644 --- a/test/allowlist_for_publicAPI.json +++ b/test/allowlist_for_publicAPI.json @@ -2811,6 +2811,9 @@ ], "torch_npu": [ "npu_stride_add", + "npu_group_quant", + "npu_gelu", + "npu_geglu", "npu_moe_gating_top_k_softmax", "npu_moe_init_routing" ], -- Gitee