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

[Misc] Add prefix sum executor to avoid multiple field allocations #6132

Merged
merged 16 commits into from
Sep 23, 2022

Conversation

YuCrazing
Copy link
Contributor

@YuCrazing YuCrazing commented Sep 22, 2022

  1. Add PrefixSumExecutor helper to avoid every prefix sum function call's memory allocation.
  2. Move parallel_sort and prefix_sum utilities from _kernels.py to algorithms.py.

Maybe we can also integrate @yuanming-hu 's CPU prefix sum into PrefixSumExecutor in the future.

@netlify
Copy link

netlify bot commented Sep 22, 2022

Deploy Preview for docsite-preview ready!

Name Link
🔨 Latest commit d588841
🔍 Latest deploy log https://app.netlify.com/sites/docsite-preview/deploys/632d1a2545bf87000bf63681
😎 Deploy Preview https://deploy-preview-6132--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.

@YuCrazing YuCrazing changed the title Add prefix sum executor to avoid multiple field allocation [Misc]Add prefix sum executor to avoid multiple field allocation Sep 22, 2022
@YuCrazing YuCrazing changed the title [Misc]Add prefix sum executor to avoid multiple field allocation [Misc] Add prefix sum executor to avoid multiple field allocation Sep 22, 2022
@YuCrazing YuCrazing changed the title [Misc] Add prefix sum executor to avoid multiple field allocation [Misc] Add prefix sum executor to avoid multiple field allocations Sep 22, 2022
tests/python/test_scan.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ailzhang ailzhang left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!
Two nits before merging:

  1. docstring ;)
  2. You probably want to track user facing APIs here https://github.com/taichi-dev/taichi/blob/master/tests/python/test_api.py#L146 to avoid accidental changes ;)

python/taichi/algorithms.py Outdated Show resolved Hide resolved
python/taichi/algorithms.py Outdated Show resolved Hide resolved
@ailzhang
Copy link
Contributor

/rebase

@taichi-gardener
Copy link
Contributor

Rebase failed, please resolve the conflicts manually.

@YuCrazing YuCrazing merged commit 507d025 into taichi-dev:master Sep 23, 2022
@YuCrazing YuCrazing deleted the yuzhang/add_prefix_sum_executor branch September 23, 2022 08:11
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