Skip to content

Conversation

@hushenwei2000
Copy link
Contributor

@hushenwei2000 hushenwei2000 commented Aug 13, 2025

PR Category

Operator Mechanism

PR Types

Bug fixes

Description

Currently, the floor and ceil kernel exhibits different output types between PyTorch and Paddle. For instance, when the input datatype is int32, PyTorch outputs int32, whereas Paddle outputs float32. The same is ceil.

This is because floor and ceil are conducted type promotion.

This PR

  1. Deleted them from the list of requiring type promotion.
  2. Addde more datatypes support when registration.
  3. Editde documentation.

pcard-67164

@paddle-bot
Copy link

paddle-bot bot commented Aug 13, 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.

@hushenwei2000
Copy link
Contributor Author

/re-run all-failed

1 similar comment
@hushenwei2000
Copy link
Contributor Author

/re-run all-failed

@codecov-commenter
Copy link

codecov-commenter commented Aug 15, 2025

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop@f1ae790). Learn more about missing BASE report.

Files with missing lines Patch % Lines
paddle/phi/kernels/funcs/activation_functor.h 50.00% 2 Missing ⚠️

❌ Your patch status has failed because the patch coverage (83.33%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop   #74598   +/-   ##
==========================================
  Coverage           ?   83.33%           
==========================================
  Files              ?        3           
  Lines              ?       12           
  Branches           ?        0           
==========================================
  Hits               ?       10           
  Misses             ?        2           
  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.

@hushenwei2000
Copy link
Contributor Author

/re-run all-failed

Copy link
Contributor

@wanghuancoder wanghuancoder left a comment

Choose a reason for hiding this comment

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

LGTM

Returns:
Tensor. Output of Floor operator, a Tensor with shape same as input
(integer types are autocasted into float32).
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 Author

Choose a reason for hiding this comment

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

@wanghuancoder wanghuancoder merged commit 66d7f98 into PaddlePaddle:develop Aug 19, 2025
93 of 99 checks passed
Luckycheng222 pushed a commit to Luckycheng222/Paddle that referenced this pull request Aug 25, 2025
…or and paddle.ceil API (PaddlePaddle#74598)

* fix(activation_kernel.cc/cu): fix output type diff for floor/ceil kernel

* fix(test_activation_op.py): add unit test

* fix(full_kernel.cc/cu): add int8 support for full_like

* fix(activation_functor.h): fix floor/ceil functor for int dtype input

* fix(test_activation_op.py): add unit test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants