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

[lang] Merge triplets in the same position when building GPU sparse matrix #6605

Merged
merged 15 commits into from
Nov 21, 2022

Conversation

FantasyVR
Copy link
Collaborator

Issue: #2906

Brief Summary

When building GPU sparse matrix, cuSparse API requires three separated arrays: row index ptr, col index ptr, and values ptr. However, the sparse matrix builder only uses one ndarray to store all triplets, the memory layout is like: [row, col, value, row, col, value, ...]. In this pr, I retrieve all data from ndarray and merge all triplets in the same position of the sparse matrix. Then, all triplets are stored in three separate arrays. At last, these three arrays are used to build sparse matrix using cuSparse API.

@netlify
Copy link

netlify bot commented Nov 15, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit befe170
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/6378f8d875931b0008c764f0
😎 Deploy Preview https://deploy-preview-6605--docsite-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@Hanke98 Hanke98 left a comment

Choose a reason for hiding this comment

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

Thanks and LGTM! Learnt a lot from your implementation!

@FantasyVR FantasyVR merged commit fc8b6ec into taichi-dev:master Nov 21, 2022
@FantasyVR FantasyVR deleted the gpu_sm_builder branch December 22, 2022 04:04
quadpixels pushed a commit to quadpixels/taichi that referenced this pull request May 13, 2023
…atrix (taichi-dev#6605)

Issue: taichi-dev#2906 

### Brief Summary
When building GPU sparse matrix, cuSparse API requires three separated
arrays: row index ptr, col index ptr, and values ptr. However, the
sparse matrix builder only uses one ndarray to store all triplets, the
memory layout is like: [row, col, value, row, col, value, ...]. In this
pr, I retrieve all data from ndarray and merge all triplets in the same
position of the sparse matrix. Then, all triplets are stored in three
separate arrays. At last, these three arrays are used to build sparse
matrix using cuSparse API.
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