Skip to content

refactor(interactive): Support complex graph schema#4538

Open
zhanglei1949 wants to merge 11 commits intoalibaba:mainfrom
zhanglei1949:fix-many-label
Open

refactor(interactive): Support complex graph schema#4538
zhanglei1949 wants to merge 11 commits intoalibaba:mainfrom
zhanglei1949:fix-many-label

Conversation

@zhanglei1949
Copy link
Copy Markdown
Member

@zhanglei1949 zhanglei1949 commented Feb 27, 2025

Previously we only allow less than 256 labels for vertices and edges in Interactive. In this PR, we make label_t customizable when building. And we introduce a test case to test interactive on a graph with 1000 vertex labels and 1000 edge labels.

  1. Previously we used bit manipulation to construct a unique edge label from <src_label, dst_label, edge_label> triplet. This method doesn't work if the number of labels is larger than 256. To resolve this, we introduce a hashmap in schema.h to maintain the projection from the label triplet to the unique edge_triplet_id
  std::vector<std::tuple<label_t, label_t, label_t>> e_triplet_labels_;
  std::unordered_map<std::tuple<label_t, label_t, label_t>, uint32_t,
                     boost::hash<std::tuple<label_t, label_t, label_t>>>
      e_triplet_to_index_;
  1. Add a CI.
  2. Refactor the code related

…e labels

Committed-by: xiaolei.zl@alibaba-inc.com from Dev container

Committed-by: xiaolei.zl@alibaba-inc.com from Dev container
: graph_(graph) {
edge_label_num_ = graph.schema().edge_label_num();
vertex_label_num_ = graph.schema().vertex_label_num();
indexs.resize(2 * vertex_label_num_ * vertex_label_num_ * edge_label_num_,
Copy link
Copy Markdown
Member Author

@zhanglei1949 zhanglei1949 Feb 28, 2025

Choose a reason for hiding this comment

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

Seems no need to resize to 2* csr_num? @liulx20

const std::vector<StorageStrategy>& strategies = {},
size_t max_vnum = static_cast<size_t>(1) << 32,
const std::string& description = "");
size_t max_vnum = DEFAULT_MAX_VNUM, const std::string& description = "");
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

previous 2^32 is two large when we have many kind of vertices. @liulx20

Committed-by: xiaolei.zl from Dev container
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Committed-by: xiaolei.zl from Dev container
@zhanglei1949 zhanglei1949 requested review from liulx20 and luoxiaojian and removed request for liulx20 March 3, 2025 07:44
Committed-by: xiaolei.zl from Dev container
@zhanglei1949 zhanglei1949 requested a review from liulx20 March 3, 2025 07:48
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2025

Please check the preview of the documentation changes at
https://0b20feab.graphscope-docs-preview.pages.dev

Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
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.

3 participants