Skip to content

Commit

Permalink
Merge pull request #35 from jiaoxuewu/paddlebox
Browse files Browse the repository at this point in the history
support embex 2 and 4
  • Loading branch information
qingshui authored Feb 14, 2022
2 parents 1c603d5 + 78f584c commit f2ce0e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions paddle/fluid/framework/fleet/box_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ void BoxWrapper::PullSparse(const paddle::platform::Place& place,
CheckEmbedSizeIsValid(hidden_size - cvm_offset_, expand_embed_dim);
switch (embedx_dim_) {
EMBEDX_CASE(0, PULLSPARSE_CASE(0););
EMBEDX_CASE(2, PULLSPARSE_CASE(0););
EMBEDX_CASE(4, PULLSPARSE_CASE(0););
EMBEDX_CASE(8, PULLSPARSE_CASE(0); PULLSPARSE_CASE(1); PULLSPARSE_CASE(2);
PULLSPARSE_CASE(3); PULLSPARSE_CASE(4); PULLSPARSE_CASE(5);
PULLSPARSE_CASE(6); PULLSPARSE_CASE(7); PULLSPARSE_CASE(8);
Expand Down Expand Up @@ -514,6 +516,8 @@ void BoxWrapper::PushSparseGrad(const paddle::platform::Place& place,
CheckEmbedSizeIsValid(hidden_size - cvm_offset_, expand_embed_dim);
switch (embedx_dim_) {
EMBEDX_CASE(0, PUSHSPARSE_CASE(0););
EMBEDX_CASE(2, PUSHSPARSE_CASE(0););
EMBEDX_CASE(4, PUSHSPARSE_CASE(0););
EMBEDX_CASE(8, PUSHSPARSE_CASE(0); PUSHSPARSE_CASE(1); PUSHSPARSE_CASE(2);
PUSHSPARSE_CASE(3); PUSHSPARSE_CASE(4); PUSHSPARSE_CASE(5);
PUSHSPARSE_CASE(6); PUSHSPARSE_CASE(7); PUSHSPARSE_CASE(8);
Expand Down
4 changes: 4 additions & 0 deletions paddle/fluid/framework/fleet/box_wrapper.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,8 @@ void BoxWrapper::CopyForPull(const paddle::platform::Place& place,

switch (embedx_dim_) {
EMBEDX_CASE(0, EXPAND_EMBED_PULL_CASE(0););
EMBEDX_CASE(2, EXPAND_EMBED_PULL_CASE(0););
EMBEDX_CASE(4, EXPAND_EMBED_PULL_CASE(0););
EMBEDX_CASE(8, EXPAND_EMBED_PULL_CASE(0); EXPAND_EMBED_PULL_SHARE(1);
EXPAND_EMBED_PULL_SHARE(2); EXPAND_EMBED_PULL_SHARE(3);
EXPAND_EMBED_PULL_SHARE(4); EXPAND_EMBED_PULL_SHARE(5);
Expand Down Expand Up @@ -1553,6 +1555,8 @@ void BoxWrapper::CopyForPush(const paddle::platform::Place& place,
} break
switch (embedx_dim_) {
EMBEDX_CASE(0, EXPAND_EMBED_PUSH_CASE(0););
EMBEDX_CASE(2, EXPAND_EMBED_PUSH_CASE(0););
EMBEDX_CASE(4, EXPAND_EMBED_PUSH_CASE(0););
EMBEDX_CASE(8, EXPAND_EMBED_PUSH_CASE(0); EXPAND_EMBED_PUSH_SHARE(1);
EXPAND_EMBED_PUSH_SHARE(2); EXPAND_EMBED_PUSH_SHARE(3);
EXPAND_EMBED_PUSH_SHARE(4); EXPAND_EMBED_PUSH_SHARE(5);
Expand Down

0 comments on commit f2ce0e4

Please sign in to comment.