-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
add ctr table depends #36465
add ctr table depends #36465
Conversation
Thanks for your contribution! |
66f94aa
to
944a5f6
Compare
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#ifndef PADDLE_FLUID_DISTRIBUTED_COMMON_LOCAL_RANDOM_H_ |
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.
recommend using #pragma once
namespace distributed { | ||
|
||
// Get time in seconds. | ||
inline double current_realtime() { |
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.
size_t beta2_pow_index() { return beta1_pow_index() + 1; } | ||
|
||
protected: | ||
float _learning_rate; |
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.
@@ -0,0 +1,167 @@ | |||
// Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. |
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.
2020 -> 2021
|
||
public: | ||
map_type values_[CTR_SPARSE_SHARD_BUCKET_NUM]; | ||
std::hash<uint64_t> _hasher; |
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.
同上
@@ -31,8 +31,9 @@ struct PullSparseValue { | |||
feasigns_(nullptr), | |||
frequencies_(nullptr) {} | |||
|
|||
explicit PullSparseValue(std::vector<uint64_t> feasigns, | |||
std::vector<uint32_t> frequencies, int dim) { | |||
explicit PullSparseValue(std::vector<uint64_t>& feasigns, // NOLINT |
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 use nolint? can we use const& here?
@@ -0,0 +1,55 @@ | |||
/* Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. |
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.
2020->2021
|
||
auto* feature_value = shard->Init(key); | ||
feature_value->resize(vec.size()); | ||
memcpy(const_cast<float*>(feature_value->data()), vec.data(), |
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.
@@ -0,0 +1,183 @@ | |||
/*************************************************************************** |
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.
请修改为标准的license
8871af8
to
5fc488c
Compare
eb49f85
to
abd3282
Compare
paddle/fluid/distributed/ps.proto
Outdated
optional uint32 fea_dim = 4 [ default = 11 ]; | ||
optional uint32 embedx_dim = 5 [ default = 8 ]; | ||
optional uint32 embedx_threshold = 6 [ default = 10 ]; | ||
optional DownpourTableAccessorParameter downpour_accessor_param = 7; |
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.
CtrAccessorParameter
paddle/fluid/distributed/ps.proto
Outdated
repeated float weight_bounds = 4; | ||
} | ||
|
||
message SparseAdamSGDParameter { |
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.
SGDRule
namespace paddle { | ||
namespace distributed { | ||
|
||
void CtrSparseNaiveSGDRule::load_config( |
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.
去掉ctr,另外是和proto保持一致;proto里面添加注释
paddle/fluid/distributed/ps.proto
Outdated
@@ -150,3 +181,39 @@ message TableAccessorSaveParameter { | |||
optional string converter = 2; | |||
optional string deconverter = 3; | |||
} | |||
|
|||
message SparseSGDRuleParameter { |
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.
加注释,对应c++类名
std::vector<float> data_; | ||
}; | ||
|
||
class CtrValueBlock { |
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.
xxxshard
176b8f3
to
d7ee7f6
Compare
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
New features
PR changes
Others
Describe
add memory sparse table dependency: