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

[export] [cc] Support ti.RecordGroupHint to group launched kernels #1880

Merged
merged 6 commits into from
Sep 22, 2020

Conversation

archibate
Copy link
Collaborator

Related issue = [数据删除]

[Click here for the format server]


I need this for exporting mpm_lagrangian_forces.

@codecov
Copy link

codecov bot commented Sep 20, 2020

Codecov Report

Merging #1880 into master will increase coverage by 0.54%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1880      +/-   ##
==========================================
+ Coverage   43.25%   43.80%   +0.54%     
==========================================
  Files          44       45       +1     
  Lines        6320     6168     -152     
  Branches     1092     1097       +5     
==========================================
- Hits         2734     2702      -32     
+ Misses       3416     3297     -119     
+ Partials      170      169       -1     
Impacted Files Coverage Δ
python/taichi/cc_compose.py 0.00% <0.00%> (ø)
python/taichi/core/__init__.py 0.00% <0.00%> (ø)
python/taichi/core/record.py 0.00% <0.00%> (ø)
python/taichi/core/util.py 0.38% <ø> (+<0.01%) ⬆️
python/taichi/lang/__init__.py 42.46% <ø> (+0.01%) ⬆️
python/taichi/lang/ast_checker.py 70.58% <0.00%> (-1.64%) ⬇️
python/taichi/testing.py 75.00% <0.00%> (-0.72%) ⬇️
python/taichi/lang/linalg.py 89.33% <0.00%> (-0.67%) ⬇️
python/taichi/lang/meta.py 62.31% <0.00%> (-0.54%) ⬇️
... and 15 more

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 17c9fb7...2fd09ea. Read the comment docs.

@archibate
Copy link
Collaborator Author

@yuanming-hu I will merge this in 24 hours if you don't reject me, otherwise our work in TaichiActor will be blocked, thank for understanding.

@Hanke98
Copy link
Contributor

Hanke98 commented Sep 21, 2020

@yuanming-hu I will merge this in 24 hours if you don't reject me, otherwise our work in TaichiActor will be blocked, thank for understanding.

I am so sorry that I didn't see your request until today, I will review your code asap.

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.

Cool! I reviewed your code and I thought it is very very useful to record the launch order in group.

However, when I tried to run demo_record_group_hint.py I got:

[I 09/21/20 19:45:31.023] [action_recorder.cpp:start_recording@27] ActionRecorder: start recording to [record.yml]
[W 09/21/20 19:45:31.023] [init.py:adaptive_arch_select@552] Arch=[Arch.cc] is not supported, falling back to CPU
[Taichi] Starting on arch=x64
Traceback (most recent call last):
File "demo_record_group_hint.py", line 22, in
with ti.RecordGroupHint('my_substep'):
File "/Users/liujiafeng/playground/projects/taichi/python/taichi/core/record.py", line 33, in init
if name in recorded:
NameError: name 'recorded' is not defined

I think the variable recorded in RecordGroupHint class may be the reason. Could you please help me to run this file correctly? Thanks a lot!


class RecordGroupHint:
def __init__(self, name):
if name in recorded:
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this is correct. Maybe you should use RecordGroupHint.record or self.record here.

ZZerge branch 'record-group-hint' of github.com:archibate/taichi into record-group-hint
@archibate archibate requested a review from Hanke98 September 21, 2020 13:08
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.

Great! LGTM! Thanks for writing such useful tool! By the way, can we record kernels in group for other backends, such as metal?

@Hanke98 Hanke98 merged commit 2674a67 into taichi-dev:master Sep 22, 2020
@yuanming-hu yuanming-hu mentioned this pull request Sep 26, 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.

3 participants