-
Notifications
You must be signed in to change notification settings - Fork 5.9k
【PIR Dist Op Reg No.19】 reg pull_box_sparse #62982
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
kangguangli
merged 23 commits into
PaddlePaddle:develop
from
enkilee:PIR-Reg-19-pull_box_sparse
May 6, 2024
Merged
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
96bdbf0
fix
enkilee 321d932
fix
enkilee 43b1dd1
fix
enkilee 2993083
fix
enkilee 2e7182a
fix
enkilee 5ec6c54
fix
enkilee 476c1cf
add test
enkilee 204cdd2
Merge branch 'develop' into PIR-Reg-19-pull_box_sparse
enkilee 3330aeb
add
enkilee 5779474
fix
enkilee a4807d8
Merge branch 'PaddlePaddle:develop' into PIR-Reg-19-pull_box_sparse
enkilee 3ec0d6d
fix
enkilee d279e81
add out
enkilee 4332e6e
Merge branch 'develop' into PIR-Reg-19-pull_box_sparse
enkilee 1b54136
fix
enkilee 4f01922
codestyle
enkilee 2d2ab35
fix
enkilee cafc986
Merge branch 'develop' into PIR-Reg-19-pull_box_sparse
enkilee 61984d4
fix backward
enkilee 8452b91
Merge branch 'PIR-Reg-19-pull_box_sparse' of https://github.com/enkil…
enkilee ec2c626
Merge branch 'PaddlePaddle:develop' into PIR-Reg-19-pull_box_sparse
enkilee 699f5d9
merge
enkilee 70d0413
Merge branch 'PaddlePaddle:develop' into PIR-Reg-19-pull_box_sparse
enkilee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Copyright (c) 2024 PaddlePaddle Authors. All Rights Reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| import unittest | ||
|
|
||
| import test_op_translator | ||
|
|
||
| import paddle | ||
| from paddle.base.layer_helper import LayerHelper | ||
|
|
||
|
|
||
| class TestPullBoxSparseOpTranslator( | ||
| test_op_translator.TestOpWithBackwardTranslator | ||
| ): | ||
| def append_op(self): | ||
| self.forward_op_type = "pull_box_sparse" | ||
| self.backward_op_type = "push_box_sparse" | ||
| ids = paddle.ones(shape=(1, 1), dtype='float32') | ||
| w = paddle.ones(shape=(1, 1), dtype='float32') | ||
| out = paddle.ones(shape=(1, 1), dtype='float32') | ||
| attrs = { | ||
| 'is_sparse': False, | ||
| 'is_distributed': False, | ||
| 'size': 1, | ||
| } | ||
| forward_helper = LayerHelper(self.forward_op_type) | ||
| forward_helper.append_op( | ||
| type=self.forward_op_type, | ||
| inputs={"W": w, "Ids": [ids]}, | ||
| outputs={"Out": [out]}, | ||
| attrs=attrs, | ||
| ) | ||
|
|
||
enkilee marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| def test_translator(self): | ||
| self.check() | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| unittest.main() | ||
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.
Uh oh!
There was an error while loading. Please reload this page.