Skip to content
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

Relax Size Check #168

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ The data communicated are presented as key-value
index and the value might be the according `float` gradient.
1. Basic synchronization functions: \ref ps::KVWorker::Push, \ref
ps::KVWorker::Pull, and \ref ps::KVWorker::Wait
2. Dynamic length value push and pull: \ref ps::KVWorker::VPush and \ref
ps::KVWorker::VPull
3. Zero-copy versions: \ref ps::KVWorker::ZPush, \ref
ps::KVWorker::ZPull, \ref ps::KVWorker::ZVPush and \ref
ps::KVWorker::ZVPull
2. Zero-copy versions: \ref ps::KVWorker::ZPush, \ref
jasperzhong marked this conversation as resolved.
Show resolved Hide resolved
ps::KVWorker::ZPull

To support dynamic length, pull operations(`Pull` and `ZPull`), do not require the buffer(`vals`) to be the same size as the total data size of pulling down. Larger buffer is allowed while `lens` records the actual size of each key. So the reliable way to read valid message is to read the length of the actual size. If you ensure that the data size of a key does not change during push or pull, you can verify it by checking whether `lens` of the key is equal to the fixed size.

often server *i* handles the keys (feature indices) within the i-th
segment of <em>[0, uint64_max]</em>. The server node allows user-defined handles to
Expand Down
2 changes: 1 addition & 1 deletion include/ps/kv_app.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ int KVWorker<Val>::AddPullCB(
if (vals->empty()) {
vals->resize(total_val);
} else {
CHECK_EQ(vals->size(), total_val);
CHECK_GE(vals->size(), total_val);
jasperzhong marked this conversation as resolved.
Show resolved Hide resolved
}
Val* p_vals = vals->data();
int *p_lens = nullptr;
Expand Down