2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

 / 详情

[CT][MS][CI]<test_ops_all.py::test_all_vmap>failed in daily version

TODO
Bug-Report 成员
创建于  
2024-04-26 17:18

Describe the current behavior / 问题描述 (Mandatory / 必填)

test_ops_all.py::test_all_vmap failed in daily version

Environment / 环境信息 (Mandatory / 必填)

  • Hardware Environment(Ascend/GPU/CPU) / 硬件环境:

Please delete the backend not involved / 请删除不涉及的后端:
/device ascend/GPU/CPU/kirin/等其他芯片

  • Software Environment / 软件环境 (Mandatory / 必填):
    -- MindSpore version (e.g., 1.7.0.Bxxx) :
    -- Python version (e.g., Python 3.7.5) :
    -- OS platform and distribution (e.g., Linux Ubuntu 16.04):
    -- GCC/Compiler version (if compiled from source):

  • Excute Mode / 执行模式 (Mandatory / 必填)(PyNative/Graph):

Please delete the mode not involved / 请删除不涉及的模式:
/mode pynative
/mode graph

Related testcase / 关联用例 (Mandatory / 必填)

[version failed]tests/st/ops
test_ops_all.py::test_all_vmap

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

Describe the expected behavior / 预期结果 (Mandatory / 必填)

Related log / screenshot / 日志 / 截图 (Mandatory / 必填)

 [2024-04-25T00:19:40.761Z]         os.environ['GRAPH_OP_RUN'] = graph_level
[2024-04-25T00:19:40.761Z]         x = generate_random_input((4, 5, 6), np.float32)
[2024-04-25T00:19:40.761Z]     
[2024-04-25T00:19:40.761Z]         batch_axis = -1
[2024-04-25T00:19:40.761Z]         output = all_vmap_func(ms.Tensor(x), batch_axis)
[2024-04-25T00:19:40.761Z]         expect = _foreach_run(ms.Tensor(x), batch_axis)
[2024-04-25T00:19:40.761Z]         np.testing.assert_equal(output.asnumpy(), expect.asnumpy())
[2024-04-25T00:19:40.761Z]     
[2024-04-25T00:19:40.761Z]         batch_axis = 0
[2024-04-25T00:19:40.761Z]         output = all_vmap_func(ms.Tensor(x), batch_axis)
[2024-04-25T00:19:40.761Z]         expect = _foreach_run(ms.Tensor(x), batch_axis)
[2024-04-25T00:19:40.761Z] >       np.testing.assert_equal(output.asnumpy(), expect.asnmpy())
[2024-04-25T00:19:40.761Z] E       AttributeError: 'StubTensor' object has no attribute 'asnmpy'
[2024-04-25T00:19:40.761Z] 
[2024-04-25T00:19:40.761Z] test_ops_all.py:293: AttributeError
[2024-04-25T00:19:40.761Z] =============================== warnings summary ===============================

Special notes for this issue/备注 (Optional / 选填)

评论 (3)

陈盼妙 创建了Bug-Report
陈盼妙 添加了
 
kind/ci
标签
陈盼妙 添加了
 
v2.3.0
标签
陈盼妙 添加了
 
sig/ops
标签
陈盼妙 添加了
 
attr/function
标签
展开全部操作日志

Please assign maintainer to check this issue.
请为此issue分配处理人。
@陈盼妙

感谢您的提问,您可以评论//mindspore-assistant更快获取帮助:

  1. 如果您刚刚接触MindSpore,或许您可以在教程找到答案
  2. 如果您是资深Pytorch用户,您或许需要:
  1. 如果您遇到动态图问题,可以设置set_context(pynative_synchronize=True)查看报错栈协助定位
  2. 模型精度调优问题可参考官网调优指南
  3. 如果您反馈的是框架BUG,请确认您在ISSUE中提供了MindSpore版本、使用的后端类型(CPU、GPU、Ascend)、环境、训练的代码官方链接以及可以复现报错的代码的启动方式等必要的定位信息
  4. 如果您已经定位出问题根因,欢迎提交PR参与MindSpore开源社区,我们会尽快review

test_ops_all.py::test_all_dynamic_shape_testop[O0]
test_ops_all.py::test_all_dynamic_shape_testop[O2]

[2024-05-05T20:43:37.963Z] >       result = self._graph_executor.compile(obj, args, kwargs, phase, self._use_vm_mode())
[2024-05-05T20:43:37.963Z] E       TypeError: The parameters number of the function is 1, but the number of provided arguments is 3.
[2024-05-05T20:43:37.963Z] E       FunctionGraph ID : all_forward_func_2
[2024-05-05T20:43:37.963Z] E       NodeInfo: In file /home/****/mindspore/testcases/testcases/tests/st/ops/test_ops_all.py:37
[2024-05-05T20:43:37.963Z] E       def all_forward_func(x):
[2024-05-05T20:43:37.963Z] E       
[2024-05-05T20:43:37.963Z] E       ----------------------------------------------------
[2024-05-05T20:43:37.963Z] E       - C++ Call Stack: (For framework developers)
[2024-05-05T20:43:37.963Z] E       ----------------------------------------------------
[2024-05-05T20:43:37.963Z] E       mindspore/ccsrc/pipeline/jit/ps/static_analysis/stack_frame.cc:104 DoJump
[2024-05-05T20:43:37.963Z] E       
[2024-05-05T20:43:37.963Z] E       ----------------------------------------------------
[2024-05-05T20:43:37.963Z] E       - The Traceback of Net Construct Code:
[2024-05-05T20:43:37.963Z] E       ----------------------------------------------------
[2024-05-05T20:43:37.963Z] E       # 0 In file /home/****/mindspore/testcases/testcases/tests/st/ops/dynamic_shape/test_op_utils.py:88
[2024-05-05T20:43:37.963Z] E               forward_out = self.net(*args)
[2024-05-05T20:43:37.963Z] E                             ^
[2024-05-05T20:43:37.963Z] E       # 1 In file /home/****/mindspore/testcases/testcases/tests/st/ops/dynamic_shape/test_op_utils.py:77
[2024-05-05T20:43:37.963Z] E               return self.prim_func(*args)
[2024-05-05T20:43:37.963Z] E                      ^
[2024-05-05T20:43:37.963Z] E        (See file '/home/****/mindspore/testcases/testcases/tests/st/ops/rank_0/om/analyze_fail.ir' for more details. Get instructions about `analyze_fail.ir` at https://www.mindspore.cn/search?inputValue=analyze_fail.ir)
[2024-05-05T20:43:37.963Z] 
[2024-05-05T20:43:37.963Z] /home/****/.local/lib/python3.7/site-packages/mindspore/common/api.py:1613: TypeError
[2024-05-05T20:43:37.963Z] ______________________ test_all_dynamic_shape_testop[O2] _______________________
[2024-05-05T20:43:37.963Z] 
[2024-05-05T20:43:37.963Z] jit_level = 'O2'
[2024-05-05T20:43:37.963Z] 
[2024-05-05T20:43:37.963Z]     @pytest.mark.level1
[2024-05-05T20:43:37.963Z]     @pytest.mark.env_onecard
[2024-05-05T20:43:37.963Z]     @pytest.mark.parametrize('jit_level', ["O0", "O2"])
[2024-05-05T20:43:37.963Z]     @pytest.mark.platform_arm_ascend_training
[2024-05-05T20:43:37.963Z]     @pytest.mark.platform_x86_ascend_training
[2024-05-05T20:43:37.963Z]     def test_all_dynamic_shape_testop(jit_level):
[2024-05-05T20:43:37.963Z]         """
[2024-05-05T20:43:37.963Z]         Feature: Test all with dynamic shape in graph mode using TEST_OP.
[2024-05-05T20:43:37.963Z]         Description: call ops.all with valid input and index.
[2024-05-05T20:43:37.964Z]         Expectation: return the correct value.
[2024-05-05T20:43:37.964Z]         """
[2024-05-05T20:43:37.964Z]         x1 = generate_random_input((3, 4, 5), np.float32)
[2024-05-05T20:43:37.964Z]         x2 = generate_random_input((3, 7, 8, 3), np.float32)
[2024-05-05T20:43:37.964Z]         axis1 = (0, 1)
[2024-05-05T20:43:37.964Z]         axis2 = (2)
[2024-05-05T20:43:37.964Z]         keep_dims1 = True
[2024-05-05T20:43:37.964Z]         keep_dims2 = False
[2024-05-05T20:43:37.964Z]     
[2024-05-05T20:43:37.964Z]         TEST_OP(all_forward_func, [[ms.Tensor(x1), axis1, keep_dims1], [ms.Tensor(x2), axis2, keep_dims2]],
[2024-05-05T20:43:37.964Z] >               grad=True, jit_level=jit_level)
[2024-05-05T20:43:37.964Z] 
[2024-05-05T20:43:37.964Z] test_ops_all.py:257: 
[2024-05-05T20:43:37.964Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[2024-05-05T20:43:37.964Z] dynamic_shape/test_op_utils.py:529: in TEST_OP
[2024-05-05T20:43:37.964Z]     out_expect = static_net(*inputs_seq[0])
[2024-05-05T20:43:37.964Z] /home/****/.local/lib/python3.7/site-packages/mindspore/nn/cell.py:685: in __call__
[2024-05-05T20:43:37.964Z]     out = self.compile_and_run(*args, **kwargs)
[2024-05-05T20:43:37.964Z] /home/****/.local/lib/python3.7/site-packages/mindspore/nn/cell.py:1003: in compile_and_run
[2024-05-05T20:43:37.964Z]     self.compile(*args, **kwargs)
[2024-05-05T20:43:37.964Z] /home/****/.local/lib/python3.7/site-packages/mindspore/nn/cell.py:987: in compile
[2024-05-05T20:43:37.964Z]     jit_config_dict=self._jit_config_dict, **kwargs)
[2024-05-05T20:43:37.964Z] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[2024-05-05T20:43:37.964Z] 
[2024-05-05T20:43:37.964Z] self = <mindspore.common.api._CellGraphExecutor object at 0xffff2b426990>
[2024-05-05T20:43:37.964Z] obj = GradNet<
[2024-05-05T20:43:37.964Z]   (net): OpFunctionNet<>
[2024-05-05T20:43:37.964Z]   >
[2024-05-05T20:43:37.964Z] phase = 'train.1714937128562793984.281471456831248.0', do_convert = True
[2024-05-05T20:43:37.964Z] jit_config_dict = {'debug_level': 'RELEASE', 'exc_mode': 'auto', 'jit_level': 'O2', 'jit_syntax_level': ''}
[2024-05-05T20:43:37.964Z] args = (Tensor(shape=[3, 4, 5], dtype=Float32, value=
[2024-05-05T20:43:37.964Z] [[[ 1.10534966e+00, -7.41509974e-01, -9.25302655e-02, -1.42391592e-01, ...9011223e-01],
[2024-05-05T20:43:37.964Z]   [ 4.80806649e-01,  3.65594417e-01, -6.01966023e-01,  5.01127422e-01,  1.31190932e+00]]]), (0, 1), True)
[2024-05-05T20:43:37.964Z] kwargs = {}, key_id = '2814714568312481714937128562793984', key = 0
[2024-05-05T20:43:37.964Z] 
[2024-05-05T20:43:37.964Z]     def compile(self, obj, *args, phase='predict', do_convert=True, jit_config_dict=None, **kwargs):
[2024-05-05T20:43:37.964Z]         """
[2024-05-05T20:43:37.964Z]         Compiles graph.
[2024-05-05T20:43:37.964Z]     
[2024-05-05T20:43:37.964Z]         Args:
[2024-05-05T20:43:37.964Z]             obj (Function/Cell): The function or cell instance need compile.
[2024-05-05T20:43:37.964Z]             phase (str): The name of compile phase. Default: 'predict'.
[2024-05-05T20:43:37.964Z]             do_convert (bool): When set to True, convert ME graph to GE graph after compiling graph.
[2024-05-05T20:43:37.964Z]             jit_config_dict (dict): Jit config for compile. Default: ``None``.
[2024-05-05T20:43:37.964Z]             args (tuple): Args of the Cell object.
[2024-05-05T20:43:37.964Z]             kwargs (dict): Kwargs of the Cell object.
[2024-05-05T20:43:37.964Z]     
[2024-05-05T20:43:37.964Z]         Return:
[2024-05-05T20:43:37.964Z]             Str, the full phase of the cell.
[2024-05-05T20:43:37.964Z]             Bool, if the graph has been compiled before, return False, else return True.
[2024-05-05T20:43:37.964Z]         """
[2024-05-05T20:43:37.964Z]         obj.__parse_method__ = 'construct'
[2024-05-05T20:43:37.964Z]         if not hasattr(obj, obj.__parse_method__):
[2024-05-05T20:43:37.964Z]             raise AttributeError(
[2024-05-05T20:43:37.964Z]                 'The class {} dose not have method {}'.format(obj.__class__.__name__, obj.__parse_method__))
[2024-05-05T20:43:37.964Z]         key_id = str(id(obj)) + str(obj.create_time)
[2024-05-05T20:43:37.964Z]         args = get_auto_dynamic_shape_args(args, key_id)
[2024-05-05T20:43:37.964Z]     
[2024-05-05T20:43:37.964Z]         self.enable_tuple_broaden = False
[2024-05-05T20:43:37.964Z]         if hasattr(obj, "enable_tuple_broaden"):
[2024-05-05T20:43:37.964Z]             self.enable_tuple_broaden = obj.enable_tuple_broaden
[2024-05-05T20:43:37.964Z]         logger.debug(f"Convert the network: {do_convert}.")
[2024-05-05T20:43:37.964Z]         self._graph_executor.set_enable_tuple_broaden(self.enable_tuple_broaden)
[2024-05-05T20:43:37.964Z]         key = self._graph_executor.generate_arguments_key(obj, args, kwargs, self.enable_tuple_broaden)
[2024-05-05T20:43:37.965Z]         obj.arguments_key = str(key)
[2024-05-05T20:43:37.965Z]         phase = phase + '.' + str(obj.create_time) + '.' + str(id(obj)) + '.' + obj.arguments_key
[2024-05-05T20:43:37.965Z]         update_auto_dynamic_shape_phase(args, key_id, phase)
[2024-05-05T20:43:37.965Z]     
[2024-05-05T20:43:37.965Z]         if phase in obj.compile_cache and self.has_compiled(phase):
[2024-05-05T20:43:37.965Z]             logger.debug("%r graph has existed.", phase)
[2024-05-05T20:43:37.965Z]             # Release resource should be released when CompileInner won't be executed, such as cur_convert_input_
[2024-05-05T20:43:37.965Z]             # generated in generate_arguments_key.
[2024-05-05T20:43:37.965Z]             self._graph_executor.clear_compile_arguments_resource()
[2024-05-05T20:43:37.965Z]             return phase, False
[2024-05-05T20:43:37.965Z]     
[2024-05-05T20:43:37.965Z]         obj.check_names()
[2024-05-05T20:43:37.965Z]         _check_full_batch()
[2024-05-05T20:43:37.965Z]         self._set_dataset_mode(obj)
[2024-05-05T20:43:37.965Z]         self._set_compile_cache_dep_files(phase)
[2024-05-05T20:43:37.965Z]     
[2024-05-05T20:43:37.965Z]         self._graph_executor.set_weights_values(obj.parameters_dict())
[2024-05-05T20:43:37.965Z]         if jit_config_dict:
[2024-05-05T20:43:37.965Z]             self._graph_executor.set_jit_config(jit_config_dict)
[2024-05-05T20:43:37.965Z]         else:
[2024-05-05T20:43:37.965Z]             jit_config_dict = JitConfig().jit_config_dict
[2024-05-05T20:43:37.965Z]             self._graph_executor.set_jit_config(jit_config_dict)
[2024-05-05T20:43:37.965Z] >       result = self._graph_executor.compile(obj, args, kwargs, phase, self._use_vm_mode())
[2024-05-05T20:43:37.965Z] E       TypeError: The parameters number of the function is 1, but the number of provided arguments is 3.
[2024-05-05T20:43:37.965Z] E       FunctionGraph ID : all_forward_func_28
[2024-05-05T20:43:37.965Z] E       NodeInfo: In file /home/****/mindspore/testcases/testcases/tests/st/ops/test_ops_all.py:37
[2024-05-05T20:43:37.965Z] E       def all_forward_func(x):
[2024-05-05T20:43:37.965Z] E       
[2024-05-05T20:43:37.965Z] E       ----------------------------------------------------
[2024-05-05T20:43:37.965Z] E       - C++ Call Stack: (For framework developers)
[2024-05-05T20:43:37.965Z] E       ----------------------------------------------------
[2024-05-05T20:43:37.965Z] E       mindspore/ccsrc/pipeline/jit/ps/static_analysis/stack_frame.cc:104 DoJump
[2024-05-05T20:43:37.965Z] E       
[2024-05-05T20:43:37.965Z] E       ----------------------------------------------------
[2024-05-05T20:43:37.965Z] E       - The Traceback of Net Construct Code:
[2024-05-05T20:43:37.965Z] E       ----------------------------------------------------
[2024-05-05T20:43:37.965Z] E       # 0 In file /home/****/mindspore/testcases/testcases/tests/st/ops/dynamic_shape/test_op_utils.py:88
[2024-05-05T20:43:37.965Z] E               forward_out = self.net(*args)
[2024-05-05T20:43:37.965Z] E                             ^
[2024-05-05T20:43:37.965Z] E       # 1 In file /home/****/mindspore/testcases/testcases/tests/st/ops/dynamic_shape/test_op_utils.py:77
[2024-05-05T20:43:37.965Z] E               return self.prim_func(*args)
[2024-05-05T20:43:37.965Z] E                      ^
[2024-05-05T20:43:37.965Z] E        (See file '/home/****/mindspore/testcases/testcases/tests/st/ops/rank_0/om/analyze_fail.ir' for more details. Get instructions about `analyze_fail.ir` at https://www.mindspore.cn/search?inputValue=analyze_fail.ir)
[2024-05-05T20:43:37.965Z] 
[2024-05-05T20:43:37.965Z] /home/****/.local/lib/python3.7/site-packages/mindspore/common/api.py:1613: TypeError
[2024-05-05T20:43:37.965Z] =============================== warnings summary ===============================
i-robot 添加了
 
www
标签
i-robot 添加了
 
www
标签
陈盼妙 添加了
 
master
标签
陈盼妙 添加了
 
master
标签
fangwenyi 添加了关联分支master 选项
fangwenyi 添加了问题后端类型Ascend 选项
陈盼妙 添加了
 
br_base
标签
陈盼妙 添加了
 
br_base
标签
陈盼妙 添加了关联分支br_base 选项

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(2)
11046135 chen panmiao 1702868389
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore

搜索帮助