[Dy2St] Make RandomRotation static comparison deterministic#78562
Merged
SigureMo merged 1 commit intoPaddlePaddle:developfrom Apr 2, 2026
Merged
Conversation
|
你的PR提交成功,感谢你对开源项目的贡献! |
Contributor
Author
|
我先自 review 过这一版了,改动只落在 结论:这次修的是 关键信息:
所以它不会掩盖真实算子 bug;如果同一个输入、同一个角度下静态/动态图旋转结果真的不一致,这个测试还是会继续失败。 |
RandomRotation static comparison deterministic
Contributor
Author
|
/re-run all-failed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Environment Adaptation
PR Types
Not User Facing
Description
This PR fixes a recurring Mac-CPU CI flake in
test_transforms_static, observed while validating #78558.The failing case is
TestRandomRotation_expand_True, which compares dynamic and static outputs withnp.testing.assert_almost_equal. The current test tries to makeRandomRotationeffectively deterministic by passing a very narrow degree range, but it still samples the angle from two different RNG paths:random.uniform(...)paddle.uniform(...)That means the test is not actually comparing the same rotation angle in the two modes. On macOS this sometimes shows up as a few mismatched edge pixels after
expand=True, causing the test to fail on one run and pass on rerun.To fix that, this PR keeps the change scoped to the test file:
FixedAngleRandomRotationhelper intest/legacy_test/test_transforms_static.pyTestRandomRotationandTestRandomRotation_expand_TrueThis does not hide a real kernel bug. It makes the test validate the intended contract more accurately: dynamic and static
RandomRotationshould match when given the same input and the same angle.是否引起精度变化
否