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

[Sparse] [lang] Add ti.activate support #1334

Merged
merged 5 commits into from
Jun 27, 2020

Conversation

archibate
Copy link
Collaborator

@archibate archibate commented Jun 25, 2020

Related issue = #1256 (comment)

[Click here for the format server]


Would you write a test for me? I'm not super familiar with sparse.

@codecov
Copy link

codecov bot commented Jun 25, 2020

Codecov Report

Merging #1334 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1334   +/-   ##
=======================================
  Coverage   85.48%   85.49%           
=======================================
  Files          19       19           
  Lines        3375     3377    +2     
  Branches      630      630           
=======================================
+ Hits         2885     2887    +2     
  Misses        358      358           
  Partials      132      132           
Impacted Files Coverage Δ
python/taichi/lang/ops.py 92.88% <100.00%> (+0.04%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a434d3...be17567. Read the comment docs.

Copy link
Member

@k-ye k-ye left a comment

Choose a reason for hiding this comment

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

Thanks! i have one nit for the test

n = 16

ptr = ti.root.pointer(ti.i, n)
ptr.dense(ti.i, n).place(x)
Copy link
Member

Choose a reason for hiding this comment

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

nit: Actually WDYT if we remove this dense layer, i.e. ptr.place(x)? If so, s[None] should be exactly how many elements in x that are activated. It makes the test more obvious?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe we want to test the behavior of multi-layer sparse, i.e. make OpenGL fake dynamic support fail to test.

Copy link
Member

@yuanming-hu yuanming-hu left a comment

Choose a reason for hiding this comment

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

Thanks! LGTM.

tests/python/test_sparse_activate.py Outdated Show resolved Hide resolved
tests/python/test_sparse_deactivate.py Outdated Show resolved Hide resolved
@archibate archibate added the LGTM label Jun 27, 2020
@archibate archibate merged commit d77ae86 into taichi-dev:master Jun 27, 2020
@yuanming-hu yuanming-hu mentioned this pull request Jun 28, 2020
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