-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-400] support string type for kvstore key in cpp-package #10792
Conversation
@mxnet-label-bot please add [kvstore, pr-awaiting-review] |
@nihui can you please look into the failing CI tests? thanks for your contribution! |
@nihui bounce... |
Hi |
@nswamy would you mind to take a look at it! Thanks |
@leleamol for review |
@leleamol Requesting a review on this PR. |
@rahul003 @cjolivier01 Can you please review this PR? Thanks |
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.
Looks good to me, except the fact that it doesn't have tests. Could you please add couple of cpp tests? You can look at these for examples : https://github.com/apache/incubator-mxnet/blob/master/tests/cpp/kvstore/gpu_topology_test.cc
new kvstore testcase added |
cpp-package/example/test_kvstore.cpp
Outdated
|
||
std::string key = "singlekeytest"; | ||
|
||
NDArray result(Shape(4), Context::cpu()); |
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.
Can you add similat test for gpu context? Or make this test configurable to run on cpu as well as gpu.
cpp-package/example/test_kvstore.cpp
Outdated
ret += (results[1].GetData()[j] == (grads[1].GetData()[j] + grads[2].GetData()[j])) ? 0 : 1; | ||
} | ||
|
||
return ret; |
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.
Thanks for adding the unit test. However, it would be helpful if you can add some logging. Especially, for the cases when the test fails.
@nihui thanks for your contribution! can you please look into the comments and failing builds? |
@nihui Can you please address comments and rebase this PR so that we can move forward with it? |
@nihui Could you please rebase this PR? |
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.
Thanks for your contribution @nihui
The rest part LGTM
Could you rebase the PR?
cpp-package/example/test_kvstore.cpp
Outdated
// initialize data | ||
std::vector<NDArray> datas(2); | ||
datas[0] = NDArray({0.f, 2.f, -3.12f, 4.f}, Shape(4), Context::cpu()); | ||
datas[1] = NDArray({0.8f, -2.f, 6.6f, 77.f}, Shape(4), Context::cpu()); |
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.
nit
datas[1] = NDArray({0.8f, -2.f, 6.6f, 77.f}, Shape(4), Context::cpu()); | |
data[1] = NDArray({0.8f, -2.f, 6.6f, 77.f}, Shape(4), Context::cpu()); |
cpp-package/example/test_kvstore.cpp
Outdated
KVStore::SetType("local"); | ||
|
||
int ret1 = test_single_key(); | ||
int ret2 = test_multiple_key(); |
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.
would it be better if adding some info to know which test case is falling?
@mxnet-label-bot update [KVStore, pr-awaiting-response] |
@nihui Thanks for your contribution! COuld you look into the comments added by @sandeep-krishnamurthy |
@nihui ping to update your PR with extra tests. |
Hi @nihui, Thank you so much for working on this. This PR is open since long time with no action. I am closing it for now. Please do reopen if closed in error and we can help you to take it to completion. |
hello, I'm unable to reopen a this closed PR. "Reopen" option is missing here. |
Reopen for you @nihui |
* support string type for kvstore key in cpp-package * make lines short * fix build * add kvstore testcase * no rand() use * fix cpplint sanity check * support string type for kvstore key in cpp-package * make lines short * fix build * print error log
gpu unittest added, which is disabled automatically on cpu-only machine |
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.
Thanks for your contribution! LGTM.
Merged. Thanks for your contribution! |
…e#10792) * Kvstore strkey (apache#2) * support string type for kvstore key in cpp-package * make lines short * fix build * add kvstore testcase * no rand() use * fix cpplint sanity check * support string type for kvstore key in cpp-package * make lines short * fix build * print error log * Update test_kvstore.cpp * update * add gpu unittest * check gpu count * fix sanity check
Description
implement string key variant for KVStore in cpp-package
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.