test_ops_all.py::test_all_vmap failed in daily version
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
[version failed]tests/st/ops
test_ops_all.py::test_all_vmap
[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 ===============================
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
感谢您的提问,您可以评论//mindspore-assistant更快获取帮助:
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 ===============================
登录 后才可以发表评论