Skip to content

[BUG FIX][SOT] Fix parameter order for custom op: rms_norm_eps #3348

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

Merged
merged 3 commits into from
Aug 13, 2025

Conversation

DrRyanHuang
Copy link
Contributor

@DrRyanHuang DrRyanHuang commented Aug 12, 2025

#3145 导致开启SOT后报错:

I0812 06:00:29.505278 22138 pir_interpreter.cc:1601] New Executor is Running ...
I0812 06:00:29.506138 22138 pir_interpreter.cc:1622] pir interpreter is running by trace mode ...
terminate called after throwing an instance of 'common::enforce::EnforceNotMet'
  what():  (InvalidType) argument (position 37) must be str, but got float (at /workspace/Paddle/paddle/fluid/pybind/eager_utils.cc:244)

排查后发现,是自定义算子 append_atten 的传参问题

运行动态图是没问题的,说明PYBIND部分 custom_ops/gpu_ops/cpp_extensions.cc 的函数定义/声明是没问题的

const paddle::optional<paddle::Tensor>& k_norm_weight,
const float rms_norm_eps,
const std::string &compute_dtype, const std::string &cache_quant_type_str,

rms_norm_eps 这个 float 值传入了 compute_dtype 这个 string 的位置

来看自定义算子的定义/声明部分:

.Attrs({"compute_type: std::string",
"cache_quant_type: std::string",
"use_neox_rotary_style: bool",
"rope_3d: bool",
"max_input_length: int",
"quant_max_bound: float",
"quant_min_bound: float",
"out_linear_in_scale: float",
"encoder_block_shape_q: int",
"decoder_block_shape_q: int",
"max_partition_size: int",
"encoder_max_partition_size: int",
"speculate_max_draft_token_num: int",
"causal: bool",
"speculate_decoder: bool",
"rms_norm_eps: float"})

这里的参数顺序与 cpp_extensions.cc 中的顺序不同导致参数类型报错,本pr修改参数顺序与 cpp_extensions.cc 的对齐

cc @zyfncg @SigureMo

Copy link

paddle-bot bot commented Aug 12, 2025

Thanks for your contribution!

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 🐾

@Jiang-Jia-Jun Jiang-Jia-Jun merged commit ed6bff2 into PaddlePaddle:develop Aug 13, 2025
11 of 14 checks passed
@DrRyanHuang DrRyanHuang deleted the fix_params_order branch August 13, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants