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

Update graphsage #96

Merged
merged 11 commits into from
Sep 5, 2022
Merged

Update graphsage #96

merged 11 commits into from
Sep 5, 2022

Conversation

DesmonDay
Copy link

PR types

Performance optimization

PR changes

Others

Describe

Optimize graphsage speed

int* actual_size_array = (int*)(node_info_list + shard_len) + i * shard_len;
uint64_t* sample_array =
(uint64_t*)(actual_size_array + (shard_len + shard_len % 2) * edge_type_len) +
i * shard_len * sample_size;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么后面还有 + i * shard_len * sample_size的?

@@ -1296,7 +1296,7 @@ std::pair<uint64_t, uint64_t> GraphTable::parse_node_file(
std::string parse_node_type = vals[0].to_string();
auto it = feature_to_id.find(parse_node_type);
if (it == feature_to_id.end()) {
VLOG(0) << parse_node_type << "type error, please check";
VLOG(1) << parse_node_type << "type error, please check";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改这个是因为如果把node_type或者edge_type减少一些的话,有些type找不到,这里就会疯狂打log。

@@ -1296,7 +1296,7 @@ std::pair<uint64_t, uint64_t> GraphTable::parse_node_file(
std::string parse_node_type = vals[0].to_string();
auto it = feature_to_id.find(parse_node_type);
if (it == feature_to_id.end()) {
VLOG(0) << parse_node_type << "type error, please check";
VLOG(1) << parse_node_type << "type error, please check";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个改成1之后,报错就被隐藏了

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个主要是因为,如果我在测试删掉某个类型来跑(比如node_types和edge_types删掉一些),这块地方就会疯狂打很多很多log,打了很久log之后才开始训练。所以觉得降低log等级会比较好。

auto gpu_graph_ptr = GraphGpuWrapper::GetInstance();
auto edge_to_id = gpu_graph_ptr->edge_to_id;
int64_t all_sample_size = 0;

/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没用的话,是不是直接删掉?

Copy link
Author

@DesmonDay DesmonDay Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的,这个主要是我目前在优化的代码,我等会删掉。

@@ -293,6 +293,25 @@ struct NeighborSampleResult {
~NeighborSampleResult() {}
};

struct NeighborSampleResultV2 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥不直接掉NeighborSampleResult,而要重新弄一个NeighborSampleResultV2呢?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个也是我正在尝试的优化代码。弄成V2是因为分配的空间大小也不一样了,这里输入了一个新的参数叫edge_type_len。

@huwei02 huwei02 merged commit fe1653c into xuewujiao:gpugraph Sep 5, 2022
lxsbupt pushed a commit to lxsbupt/Paddle that referenced this pull request Nov 29, 2022
* add sample update, update reindex

* temp commit

* fix offset calc

* optimize reindex

* delete unnecessary code

* add for loop speed up

* add speed optimize

* change common_graph VLOG type

* add kernel3 update for review

* temp commit

* delete unused code
lxsbupt pushed a commit to lxsbupt/Paddle that referenced this pull request Dec 17, 2022
* add sample update, update reindex

* temp commit

* fix offset calc

* optimize reindex

* delete unnecessary code

* add for loop speed up

* add speed optimize

* change common_graph VLOG type

* add kernel3 update for review

* temp commit

* delete unused code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants