optimize_wrong_information by zty-king · Pull Request #76813 · PaddlePaddle/Paddle

@zty-king

PR Category

User Experience

PR Types

Others

Description

优化丰富FC的报错、警告信息

@zty-king

@paddle-bot

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@zty-king

… optimize_wrong_information

@codecov-commenter

xingmingyyj

Choose a reason for hiding this comment

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

希望可以在解析AOA失败的时候把用户提供的AOA给暴露出来。一个实现思路是,把最原始的(用户输入的aoa statements)作为一个attribute,挂在Macro处理后的aoa statements上,如果报错可以找这个属性,把他打印出来。

end_idx = idx + 3
if end_idx < len(tokens) - 1:
assert tokens[end_idx].value == ","
assert tokens[end_idx].value == ",", (

Choose a reason for hiding this comment

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

这个可不可以直接把aoa stmt打印出来

and tokens[idx + 3].type == TokenType.NUMBER
and tokens[idx + 4].type == TokenType.RBRACKET
), (
f"The array macro format is incorrect which is must be like: NAME[START:END], but now the format is {tokens[idx].value}{tokens[idx + 1].value}:{tokens[idx + 3].value}{tokens[idx + 4].value}."

Choose a reason for hiding this comment

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

同上

)
assert num_key_value_groups and num_key_value_groups > 0, (
"num_key_value_groups must be positive."
"num_key_value_groups must be positive.(got: {num_key_value_groups})."

Choose a reason for hiding this comment

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

"num_key_value_groups must be positive.(got: {num_key_value_groups})."
f"num_key_value_groups must be positive.(got: {num_key_value_groups})."
f"num_key_value_groups must be positive (got: {num_key_value_groups})"
)
assert fused_qkv_pos is not None, "No fused_qkv tag found in expression."
assert fused_qkv_pos is not None, (

Choose a reason for hiding this comment

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

这个也希望把aoa stmt直接打出来

f"Missing keys:{missing_keys}, check whether the checkpoint is complete."
)

unexpected_keys = set(tensor_key_list) - set(state_dict_param_names)

Choose a reason for hiding this comment

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

建议 每个key单独一行 前后加一个醒目的界符

)

unexpected_keys = set(tensor_key_list) - set(state_dict_param_names)
if len(unexpected_keys) > 0:

Choose a reason for hiding this comment

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

同上

xingmingyyj

None,
)
assert name_with_layer_id_offset, "No $LAYER_ID_OFFSET found in NAME tokens"
assert name_with_layer_id_offset, (

Choose a reason for hiding this comment

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

LAYER_ID,EXPERT_ID等匹配的Macro,如果匹配到了空的结果,往往是不符合预期的,这时希望给一个警告,同时把最原始的AOA statement打印出来,ID什么也没匹配到,可能不符合原始预期。

@zty-king

… optimize_wrong_information

@zty-king

@zty-king

希望可以在解析AOA失败的时候把用户提供的AOA给暴露出来。一个实现思路是,把最原始的(用户输入的aoa statements)作为一个attribute,挂在Macro处理后的aoa statements上,如果报错可以找这个属性,把他打印出来。

为实现这一目的,目前开发了一个AOAtraceback类,追溯信息的打印效果如下:
image

@zty-king

… optimize_wrong_information

@zty-king

… optimize_wrong_information

@zty-king

1 similar comment

@zty-king

From00

Choose a reason for hiding this comment

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

LGTM

@zty-king zty-king deleted the optimize_wrong_information branch

January 8, 2026 08:36