KEMBAR78
[Slice]Stride Mechanism Support and Index_put optimization by changeyoung98 · Pull Request #73053 · PaddlePaddle/Paddle · GitHub
Skip to content

Conversation

@changeyoung98
Copy link
Contributor

@changeyoung98 changeyoung98 commented Jun 3, 2025

PR Category

Execute Infrastructure

PR Types

New features

Description

pcard-67164
Based on #73022
新增支持stride机制的index_elementwise_put_kernel。
TODO:

  1. 未适配CPU kernel
  2. 当前新kernel仅支持单个维度的list/tensor setitem,且不支持联合索引

@paddle-bot
Copy link

paddle-bot bot commented Jun 3, 2025

你的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.

@changeyoung98 changeyoung98 changed the title [PIR slice]Index_put [PIR slice]Stride Mechanism Support and Index_put optimization Jun 4, 2025

PADDLE_ENFORCE_LE(index.size(),
DDim::kMaxRank,
"The number of index tensors exceeds the maximum rank.");
Copy link
Contributor

Choose a reason for hiding this comment

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

补充error 类型

auto offset_calc =
funcs::make_offset_calculator_put<3>(desired_shape, strides_array);
const int64_t N = numel;
PADDLE_ENFORCE(N >= 0 && N <= std::numeric_limits<int32_t>::max(),
Copy link
Contributor

Choose a reason for hiding this comment

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

这里改成int64_t


const int64_t N = numel;
PADDLE_ENFORCE(N >= 0 && N <= std::numeric_limits<int32_t>::max(),
"N >= 0 && N <= std::numeric_limits<int32_t>::max()");
Copy link
Contributor

Choose a reason for hiding this comment

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

同时

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@changeyoung98 changeyoung98 merged commit 701cdf9 into PaddlePaddle:develop Jun 4, 2025
174 of 197 checks passed
@changeyoung98 changeyoung98 deleted the czy-indexput branch June 5, 2025 02:19
@changeyoung98 changeyoung98 changed the title [PIR slice]Stride Mechanism Support and Index_put optimization [Slice]Stride Mechanism Support and Index_put optimization Jul 4, 2025
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.

7 participants