[NPU] add momentum_op_npu and test#34082
Merged
qili93 merged 3 commits intoPaddlePaddle:developfrom Aug 11, 2021
Merged
Conversation
|
Thanks for your contribution! |
bf39afe to
d9e32ee
Compare
qili93
requested changes
Jul 15, 2021
| 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. */ | ||
| #include <string> |
| from test_momentum_op import calculate_momentum_by_numpy | ||
|
|
||
| paddle.enable_static() | ||
| SEED = 2021 |
| self.shape = (123, 321) | ||
| self.use_nesterov = True | ||
|
|
||
|
|
Contributor
There was a problem hiding this comment.
这个单测文件最好也是参考 test_momentum_op.py 把里面所有的单测case尽量都加上,保证测试的coverage。
Contributor
Author
There was a problem hiding this comment.
已添加其他case,NPU没有SparseMomentum相关算子,SparseMomentum相关单测未添加
zhiqiu
reviewed
Aug 11, 2021
Comment on lines
+2156
to
+2160
| auto &pool = platform::DeviceContextPool::Instance(); | ||
| auto devices = platform::GetSelectedNPUDevices(); | ||
| for (size_t i = 0; i < devices.size(); ++i) { | ||
| pool.Get(platform::NPUPlace(devices[i]))->Wait(); | ||
| } |
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 types
Others
PR changes
OPs
Describe
add momentum_op_npu and test