feat: Add impratio to testspeed results#947
Conversation
Closes google-deepmind#947 - Add collision pairs, contacts, friction dim to testspeed summary - Matches issue requirements: friction + collision details in final output - Formatted consistently with existing timing stats
|
@zer-art thank you for contributing to mujoco warp! lets focus on just adding additionally lets add a flag please let us know if you have any questions. thanks! |
Summary of Changes1. Feature: impratio Reporting
|
|
@zer-art thanks for the update!
|
|
@thowell Done! I've reverted all changes to _src/types.py, _src/io.py, and _src/benchmark.py. I also updated testspeed.py to calculate the ratio in-place using the formula: 1.0 / (impratio_invsqrt * impratio_invsqrt). Heads up on a Mac/CPU Bug: While verifying the revert, I confirmed that the current main branch crashes on macOS because benchmark.py calls CUDA functions unconditionally. The Error: (This happens because runtime.driver_version is None on CPU devices). I plan to open a separate Issue to track this bug so we can keep this PR focused strictly on the feature. Let me know if you'd prefer I handle it differently. |
|
@zer-art thank you for the update! if you are interested in contributing an update to testspeed related to not working with cpu:
thanks! |
|
@thowell Updated! Removed the print comment and added the TODO reference as requested. |
|
thinking that we can simplify and report all of the options together, so lets:
thanks! |
impratio to testspeed results
|
@thowell Done! I've removed the extra_info flag and updated the print statement to calculate impratio using the formula you provided. |
| f" solver: {solver} cone: {cone} iterations: {iterations} {ls_str}\n" | ||
| f" integrator: {integrator} graph_conditional: {m.opt.graph_conditional}" | ||
| f" integrator: {integrator} graph_conditional: {m.opt.graph_conditional}\n" | ||
| f" impratio: {1.0 / np.square(m.opt.impratio_invsqrt.numpy()[0]):g}" |
There was a problem hiding this comment.
It stands for "general" format. I used it because impratio values can vary significantly in magnitude. :g automatically switches between fixed-point and scientific notation and removes insignificant trailing zeros, ensuring the output stays compact and readable.
|
left some minor comments and a question, otherwise lgtm. after that all that is left to do is resolve any branch conflicts. thanks! |
|
thanks @zer-art! |
Fixes #944
Summary
This PR updates
mujoco_warp/testspeed.pyto include additional simulation details in the final output report.Changes:
impratio(checked viamjm.opt.impratio).m.has_sdf_geom.Verification
I tested the changes locally using the
aloha_potscene.Command:
Output:
Checklist