-
Notifications
You must be signed in to change notification settings - Fork 2
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
Trajopt Profiling #47
base: main
Are you sure you want to change the base?
Conversation
…for shooting methods
…th static goal and cost matrices
…ta in case we need it later
"torch>=1.13.1", | ||
"tensorboard>=2.15.1", | ||
# "torch>=1.13.1", | ||
"tensorboard>=2.13.0", # [Dec. 4, 2023] https://github.com/tensorflow/tensorflow/issues/62075#issuecomment-1808652131 |
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.
[NOTE] As it turns out, if I pin the version to 2.13.0
, the code check workflow fails. However, we know that things are broken with the most recent tensorflow
version, so we should probably not merge this yet.
"tensorflow>=2.13.0", # [Dec. 4, 2023] https://github.com/tensorflow/tensorflow/issues/62075#issuecomment-1808652131 | ||
"tensorboard-plugin-profile>=2.13.0", |
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.
See above comment about pinning versions.
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.
LGTM overall -- have a couple ideas for minor improvements to documentation but we can do this later. Bigger issue is the compatibility stuff you already noted -- not sure how to fix this but would be nice to have profiling functional eventually
fn1() | ||
|
||
# stuff we do want to specifically profile | ||
with jax.named_scope("name_of_your_choice"): |
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.
Quick q: I know TraceAnnotation
didn't work here but it's maybe good to note this here since the jax profiling tool recommends it
``` | ||
tensorboard --logdir=/dir/to/profiling/results --port <port> | ||
``` | ||
where `--port` should be some open port like `8008`. In the top right dropdown menu which should say "Inactive," scroll down and select "Profile." Select the run you'd like to analyze and under tools, the most useful tab will usually be "trace_viewer." |
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.
You might consider adding some screenshots for folks who are unfamiliar with flame charts
Tips on profiling
tensorboard
-related dependencies topyproject.toml
Profiling results:

Takeaways from the above results:
step
is simply to use fewer solver iterations and line search iterations._position
subroutine of the forward dynamics takes about 26% of the total runtime!_acceleration
subroutine takes about 11% of the total runtimeEssentially 100% of the runtime of
forward
is captured by the above operations, which should give some insight into code optimization prioritizes on themjx
side if we want to give some feedback. We should remember that the contact engine is DISABLED for this benchmark.