Skip to content

Conversation

@Glencsa
Copy link
Contributor

@Glencsa Glencsa commented Jun 20, 2025

@paddle-bot
Copy link

paddle-bot bot commented Jun 20, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Jun 20, 2025
@luotao1
Copy link
Contributor

luotao1 commented Jun 20, 2025

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Jun 20, 2025
@Glencsa
Copy link
Contributor Author

Glencsa commented Jun 23, 2025

/re-run all-failed

// build input data class
std::vector<int64_t> x_shape = {64, 64, 64};
std::vector<int64_t> indice_shape = {32};
std::vector<int64_t> value_shape = {32};
Copy link
Contributor

Choose a reason for hiding this comment

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

in this case, if value_shape=[32, 64], can run normally on single device, but can run normally on multi device? especially dims_mapping of x is {-1, 0, 1}
tips: After using this spmd rule, the local shape will be: x_shape=[64, 64, 32], indice_shape=([32], [32]), value_shape=[32, 64], Can index_put operator will run successfully?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I fix this situation(value_shape greater than 1) in next commit.

x_ndim,
indices_size));

PADDLE_ENFORCE_EQ(value_ndim,
Copy link
Contributor

@jeff41404 jeff41404 Jun 23, 2025

Choose a reason for hiding this comment

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

According to the definition of the index_put operator, it can support value_ndim greater than 1. This restriction cannot be applied as it can be verified through the following code:

x = paddle.zeros([4, 4, 4]) value = paddle.ones([4, 4]) # can support value_ndim > 1(meet certain conditions) # value = paddle.arange(16).reshape([4, 4]).astype("float32") ix1 = paddle.to_tensor([0,1,2,3]) ix2 = paddle.to_tensor([0,1,2,3]) indices=(ix1,ix2) out = paddle.index_put(x,indices,value) print(out) # can run normally
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, I have removed this restriction.

@Glencsa
Copy link
Contributor Author

Glencsa commented Jun 23, 2025

/re-run all-failed

@Glencsa
Copy link
Contributor Author

Glencsa commented Jun 26, 2025

/re-run all-failed

}
} else { // indices_size = x_ndim
for (int i = 0; i < x_ndim; i++) {
x_dims_mapping[i] = -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

the branch of else only handles the case of indices_size = x_ndim? can it be merged into the above branch, so we do not need to distinguish between if and else

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your suggestion, I removed the if and else in this code block.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (develop@51d2cf4). Learn more about missing BASE report.

Additional details and impacted files
@@ Coverage Diff @@ ## develop #73486 +/- ## =========================================== Coverage ? 100.00% =========================================== Files ? 1 Lines ? 122 Branches ? 0 =========================================== Hits ? 122 Misses ? 0 Partials ? 0 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
Copy link
Contributor

@jeff41404 jeff41404 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit 31656c9 into PaddlePaddle:develop Jul 2, 2025
52 of 55 checks passed
@Glencsa Glencsa deleted the index_put branch July 2, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 skip-ci: approval

5 participants