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

fix bug to add large tensor support #308

Merged
merged 2 commits into from
Mar 14, 2024
Merged

Conversation

kaixuanliu
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Mar 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 86.40%. Comparing base (0ae8cdf) to head (ec46153).

Files Patch % Lines
pyg_lib/csrc/ops/cpu/radix_sort.h 0.00% 11 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
- Coverage   86.47%   86.40%   -0.08%     
==========================================
  Files          35       35              
  Lines        1213     1214       +1     
==========================================
  Hits         1049     1049              
- Misses        164      165       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kaixuanliu
Copy link
Contributor Author

kaixuanliu commented Mar 14, 2024

I ran into an error as I define a very large sparse tensor in the following code,
`import torch
import torch_sparse

num_edges = 7982968874
num_src_nodes = 264388606
edge_id = torch.arange(num_edges, dtype=torch.int64)
node_sizes = (num_src_nodes + 1, num_src_nodes + 1)
row = torch.randint(num_src_nodes, (num_edges, ), dtype=torch.int64)
col = torch.randint(num_src_nodes, (num_edges, ), dtype=torch.int64)
adj_t = torch_sparse.SparseTensor(
row=row, col=col, value=edge_id, sparse_sizes=node_sizes
)`

It will crash in the former implementation due to incorrect data type conversion, this PR solved this kind of data overflow

@rusty1s
Copy link
Member

rusty1s commented Mar 14, 2024

Thank you:)

@rusty1s rusty1s merged commit 0228406 into pyg-team:master Mar 14, 2024
11 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants