Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dy2St] pir dy2st unittest verification - Part 6 #59007

Merged
merged 6 commits into from
Nov 17, 2023

Conversation

gouzil
Copy link
Member

@gouzil gouzil commented Nov 14, 2023

PR types

Others

PR changes

Others

Description

状态 单测 错误类别 备注 报错信息
test_mobile_net API TestMobileNet 需要适配jit.api.save方法 AttributeError: 'list' object has no attribute 'type'
test_resnet_amp AMP GPU 环境,AMP 尚不支持 NotImplementedError: not implement error.
test_resnet_amp 反向 CPU 会报 paddle.Tensor.backward api 报错, 看样子是 c++ 的检查 PreconditionNotMetError: The meta data must be valid when call the mutable data function
test_resnet_v2 反向 问题同上, 注:test_in_static_mode_mkldnn在我本地跑不了, 不过应该也是挂的 问题同上
test_simnet 动转静执行器(疑似) PartialProgramLayer._append_backward_desc Type validation failed for the 0th output.
🚧 test_to_tensor: TestStatic.test_static API paddle.static.nn.fc需要适配 TypeError: The type of 'input' in fc must be (<class 'list'>, <class 'tuple'>, <class 'paddle.base.framework.Variable'>), but received <class 'paddle.base.libpaddle.pir.OpResult'>.
🚧 test_to_tensor: TestStatic.test_to_tensor_badreturn 反向(疑似) c++中断,看样子好像是销毁了正在使用的变量 F1114 22:44:45.077468 360871424 op_result_impl.cc:29] Destoryed a op_result that is still in use. The owner op type is:pd_op.full_like,反向有一个 warning(WARNING:root:input privided by inputs has no use

中间态问题记录:

test/dygraph_to_static/test_to_tensor.py文件的TestStatic.test_static单测,需要装饰@test_pir_only复现

报错信息:

Traceback (most recent call last):
  File "/Users/gouzi/Documents/git/Paddle/test/dygraph_to_static/dygraph_to_static_utils_new.py", line 86, in impl
    fn(*args, **kwargs)
  File "/Users/gouzi/Documents/git/Paddle/test/dygraph_to_static/dygraph_to_static_utils_new.py", line 126, in impl
    ir_outs = fn(*args, **kwargs)
              ^^^^^^^^^^^^^^^^^^^
  File "/Users/gouzi/Documents/git/Paddle/test/dygraph_to_static/test_to_tensor.py", line 204, in test_static
    res = exe.run(fetch_list=[x, out])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/anaconda3/envs/py311/lib/python3.11/site-packages/paddle/base/executor.py", line 1703, in run
    res = self._run_impl(
          ^^^^^^^^^^^^^^^
  File "/usr/local/anaconda3/envs/py311/lib/python3.11/site-packages/paddle/base/executor.py", line 1874, in _run_impl
    program, new_exe = self._executor_cache.get_program_and_executor(
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/anaconda3/envs/py311/lib/python3.11/site-packages/paddle/base/executor.py", line 916, in get_program_and_executor
    return self._get_cached_program_and_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/anaconda3/envs/py311/lib/python3.11/site-packages/paddle/base/executor.py", line 1040, in _get_program_and_executor
    "default": translate_to_pir(new_program.desc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: Error occured at: /Users/gouzi/Documents/git/Paddle/paddle/fluid/ir_adaptor/translator/op_translator.cc:1614 :
[op:mul_grad] Input X should not be null

相关链接:

print(
"wrong model name, please try model = MobileNetV1 or MobileNetV2"

paddle.enable_static()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改用 unique_name.guard 吧

@@ -188,7 +187,7 @@ def set_func(self):
self.func = paddle.jit.to_static(full_graph=True)(test_not_var_cast)

@test_ast_only
@test_legacy_and_pir
@test_legacy_and_pir_exe_and_pir_api
def test_cast_result(self):
self.set_func()
# breakpoint()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两行注释删掉吧

@@ -126,53 +126,54 @@ def train(conf_dict, to_static):
train process
"""
paddle.jit.enable_to_static(to_static)
paddle.enable_static()
paddle.disable_static()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同样,用 unique_name guard

conf_dict['dict_size'] = len(vocab)
conf_dict['seq_len'] = args.seq_len

net = BOW(conf_dict)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BOW 上面有 @to_static,需要拿下来

HingeLoss 可能一样,得检查下

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

注意 TestStatic 里的写法,不能用 Program,要用动态访问的形式,可以用 paddle.static.Program,否则 IrGuard 可能无法正常切换

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个改了么?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow

@paddle-bot paddle-bot bot added the contributor External developers label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants