-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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] Support exporting custom config variables #1893
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Yubin, I think it's a really good idea to log some custom configurations and most of your code LGTM.
When I was testing the code, I wrote a simple test script:
`
import taichi as ti
ti.start_recording('test_record.yml')
ti.init(arch=ti.cc)
ti.record_action_config('num_particles', 8192)
n_particles = 8192
x = ti.Vector.field(2, float, n_particles)
@ti.kernel
def init():
for i in range(n_particles):
x[i] = [ti.random() * 0.4 + 0.2, ti.random() * 0.4 + 0.2]
init()
ti.stop_recording()
`
And I got:
[I 09/26/20 11:51:25.204] [action_recorder.cpp:start_recording@27] ActionRecorder: start recording to [test_record.yml]
[Taichi] Starting on arch=cc
Traceback (most recent call last):
File "test_record.py", line 4, in
ti.record_action_config('num_particles', 8192)
File "/home/ljf/playground/taichi/python/taichi/core/record.py", line 16, in record_action_config
record_action_entry('config', {'key': key, 'value': value})
File "/home/ljf/playground/taichi/python/taichi/core/record.py", line 6, in record_action_entry
ti_core.record_action_entry(name, list(contents.items()))
RuntimeError: Unexpected index
So, could you please have a look at that? Thank you very much!
152f536
to
4da92c9
Compare
Codecov Report
@@ Coverage Diff @@
## master #1893 +/- ##
==========================================
- Coverage 43.81% 43.73% -0.08%
==========================================
Files 45 45
Lines 6174 6185 +11
Branches 1097 1099 +2
==========================================
Hits 2705 2705
- Misses 3300 3311 +11
Partials 169 169
Continue to review full report at Codecov.
|
Co-authored-by: Jiafeng Liu <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! Thanks again! Learnt a lot from your code!
Related issue = #394
[Click here for the format server]
This would allows user to specify configuration direct-in-place in Python.
I need this for TaichiHub, an online playground, for customizable particle numbers & screen size.
Please merge this soon, idealy before next release.