-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[NPU] add momentum_op_npu and test #34082
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
Conversation
|
Thanks for your contribution! |
bf39afe to
d9e32ee
Compare
| 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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#include 这个头文件不需要?
| from test_momentum_op import calculate_momentum_by_numpy | ||
|
|
||
| paddle.enable_static() | ||
| SEED = 2021 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SEED没有用到?
| self.shape = (123, 321) | ||
| self.use_nesterov = True | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个单测文件最好也是参考 test_momentum_op.py 把里面所有的单测case尽量都加上,保证测试的coverage。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已添加其他case,NPU没有SparseMomentum相关算子,SparseMomentum相关单测未添加
qili93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| 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(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add wait here?
zhiqiu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for ShareDataWith
qili93
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
Others
PR changes
OPs
Describe
add momentum_op_npu and test