Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
294 commits
Select commit Hold shift + click to select a range
9e496d2
Undo some leftover changes.
erikfrey Mar 5, 2025
1cda5b7
Collision Driver (#40)
adenzler-nvidia Mar 5, 2025
96de367
Refactor etc
camevor Mar 4, 2025
11ec640
move to contact distance check during contact generation
adenzler-nvidia Mar 5, 2025
71b1df4
fix pos/dist confusion
adenzler-nvidia Mar 5, 2025
dd3904f
Serial quad clipping func
camevor Mar 5, 2025
ad80fc3
[fixed] index bug in collision_functions.py (#56)
Kenny-Vilella Mar 5, 2025
9313b97
write efc_total
adenzler-nvidia Mar 5, 2025
061248f
add another comment
adenzler-nvidia Mar 5, 2025
b8ed609
add a test that verifies shapes of make_data and put_data
adenzler-nvidia Mar 5, 2025
c8518b8
Manifold_points
camevor Mar 5, 2025
2b6a807
Merge remote-tracking branch 'origin/main' into box-box
camevor Mar 5, 2025
bc00333
adjust the size of the candidate pair buckets
adenzler-nvidia Mar 5, 2025
f4d4ff0
make it correct
adenzler-nvidia Mar 5, 2025
08e446e
Remove dead code
camevor Mar 5, 2025
a84c8f9
Merge pull request #62 from adenzler-nvidia/dev/adenzler/adjust-group…
erikfrey Mar 5, 2025
acc0ccb
Merge pull request #60 from adenzler-nvidia/dev/adenzler/test-io-shapes
erikfrey Mar 5, 2025
e636c86
Merge pull request #51 from thowell/forward
erikfrey Mar 5, 2025
0342f53
Merge pull request #48 from thowell/solver
erikfrey Mar 5, 2025
53567d7
Merge pull request #50 from thowell/actuator_velocity_tile
erikfrey Mar 5, 2025
fed16b0
Autoformat & minor fixes
camevor Mar 5, 2025
6bc16b1
Merge remote-tracking branch 'upstream/main' into broadphase
thowell Mar 5, 2025
25c0c01
add margin to calculation
thowell Mar 5, 2025
6395cfe
Merge remote-tracking branch 'upstream/main' into fwd_actuation_tile
thowell Mar 5, 2025
911e627
update variable names
thowell Mar 5, 2025
653d60c
Merge remote-tracking branch 'origin/main' into faster_linesearch
erikfrey Mar 5, 2025
6b91da1
Fix parameter order.
erikfrey Mar 6, 2025
2025185
Merge pull request #54 from erikfrey/faster_linesearch
erikfrey Mar 6, 2025
2090b78
Merge pull request #52 from thowell/fwd_actuation_tile
erikfrey Mar 6, 2025
24fb43b
Introduce USE_SEPARATE_MODULES, reorder kernel definitions
eric-heiden Mar 6, 2025
845f7ff
harden tile API usage to avoid 0-length tiles.
adenzler-nvidia Mar 6, 2025
9304de0
Remove invalid wp constant
camevor Mar 6, 2025
0568a81
Workaround for struct untile()
camevor Mar 6, 2025
aef554b
Merge branch 'main' into dev/adenzler/check-dist-in-contact-functions
adenzler-nvidia Mar 6, 2025
04d7f05
revert changes in make_constraint
adenzler-nvidia Mar 6, 2025
41bc431
move to margin only test
adenzler-nvidia Mar 6, 2025
8f8ab9d
revert some unnecessary stuff
adenzler-nvidia Mar 6, 2025
e5ddfbd
Fix tiling axis function
camevor Mar 6, 2025
3ead4f7
initial tiled version
adenzler-nvidia Mar 6, 2025
b185569
Fix ruff format issues in support_test.py
erikfrey Mar 6, 2025
be7fa2b
Move box-box collision function into designated location
camevor Mar 6, 2025
a230c1c
Merge pull request #66 from erikfrey/fix_ruff
erikfrey Mar 7, 2025
e2a3e7b
Rewrite @kernel decorator using Warp's new kernel decorator
eric-heiden Mar 7, 2025
be530a4
trace option for testspeed and some updated benchmarks.
erikfrey Mar 7, 2025
7c3cfe0
Merge pull request #59 from adenzler-nvidia/dev/adenzler/check-dist-i…
erikfrey Mar 7, 2025
b52899c
Merge branch 'main' into dev/adenzler/euler-optimizations
adenzler-nvidia Mar 7, 2025
1d7d846
cleanup
adenzler-nvidia Mar 7, 2025
a44c034
cleanup
adenzler-nvidia Mar 7, 2025
4e956a2
use operators
adenzler-nvidia Mar 7, 2025
5d26d58
fix some issues
adenzler-nvidia Mar 7, 2025
04c32ee
Merge branch 'erikfrey:main' into box-box
camevor Mar 7, 2025
3a509a6
Merge pull request #68 from adenzler-nvidia/dev/adenzler/euler-optimi…
erikfrey Mar 7, 2025
a3016f5
Merge pull request #67 from erikfrey/testspeed_trace
erikfrey Mar 7, 2025
eab4705
Capsule-capsule collision (#69)
jvonmuralt Mar 7, 2025
30a5137
Merge branch 'main' of github.com:erikfrey/mjx_warp into improve-comp…
eric-heiden Mar 7, 2025
4bfa96d
Merge pull request #63 from eric-heiden/improve-compilation
erikfrey Mar 7, 2025
163eb34
Fix indentation error.
erikfrey Mar 7, 2025
2968a10
Fix ruff error.
erikfrey Mar 7, 2025
e9775f9
Merge pull request #70 from erikfrey/fix_indent
erikfrey Mar 7, 2025
fe7ad2c
fix put_data ncon initialization
thowell Mar 7, 2025
d40c546
fix put_model
thowell Mar 7, 2025
b14a169
Merge pull request #64 from adenzler-nvidia/dev/adenzler/fix-zero-til…
erikfrey Mar 7, 2025
f588847
Merge pull request #71 from thowell/io
erikfrey Mar 7, 2025
b1a307d
update nxn_broadphase
thowell Mar 7, 2025
123d7c5
_geom_filter and _geom_pair
thowell Mar 7, 2025
b37391f
remove duplicate fields
thowell Mar 7, 2025
db6115f
remove geomtype1 and geomtype2 from nxn_broadphase, fix broad_phase_t…
thowell Mar 7, 2025
45d4c91
update broadphase and update broadphase_sweep_and_prune
thowell Mar 7, 2025
647bb0f
update broad_phase_test
thowell Mar 7, 2025
b909a8a
add output type to _geom_pair
thowell Mar 7, 2025
ba7765c
Local to global for body inertia, geom, site.
erikfrey Mar 7, 2025
b237110
Fixes for site and site test.
erikfrey Mar 7, 2025
34f5e7e
Merge pull request #72 from erikfrey/local_to_global
erikfrey Mar 7, 2025
20f1fde
return if done
thowell Mar 7, 2025
cbbae4f
address pr comments from erikfrey
thowell Mar 7, 2025
f8e047e
Merge remote-tracking branch 'upstream/main' into broadphase
thowell Mar 7, 2025
04163a3
Merge pull request #53 from thowell/broadphase
erikfrey Mar 7, 2025
1462256
Latest benchmarks after n^2 broadphase.
erikfrey Mar 7, 2025
99a1829
Merge pull request #73 from erikfrey/latest_benchmarks
erikfrey Mar 8, 2025
5e12bc1
Fixes to collision driver.
erikfrey Mar 9, 2025
3f553cb
Bounds checking for plane is not squared.
erikfrey Mar 9, 2025
35ff51e
Set condim in collision driver.
erikfrey Mar 10, 2025
f787d92
MJWarp viewer and get_data_into. (#75)
erikfrey Mar 10, 2025
3136791
Add box plane intersection test (#65)
nvtw Mar 10, 2025
ebf1409
Bugfix damping index in add_damping_sum_qfrc_kernel_sparse (#76)
Kenny-Vilella Mar 10, 2025
60e9ef1
Merge remote-tracking branch 'origin/main' into box-box
camevor Mar 10, 2025
afec683
add skip input to mul_m and change context done type
thowell Mar 10, 2025
e3a7f92
Merge remote-tracking branch 'upstream/main' into solver
thowell Mar 10, 2025
865660c
Merge branch 'main' into collision_driver_fixes
erikfrey Mar 10, 2025
ade8041
merge remote-tracking branch 'upstream/main' into collision_driver_fixes
thowell Mar 10, 2025
38a7906
Helper functions; Find ref & clip faces; Use broadcast
camevor Mar 10, 2025
8a7e59a
Plane box test and a few fixes.
erikfrey Mar 10, 2025
afcca0d
Fix typo.
erikfrey Mar 10, 2025
213039a
option to visualize mujoco c simulation
thowell Mar 10, 2025
a179363
Merge pull request #74 from erikfrey/collision_driver_fixes
erikfrey Mar 10, 2025
fd99c92
check disableflags option for contact in make_constraint
thowell Mar 10, 2025
b68ad0a
Temporarily pin to MuJoCo==3.2.7
erikfrey Mar 10, 2025
f57be42
Merge pull request #79 from thowell/contact
erikfrey Mar 10, 2025
bd5d0f6
Merge pull request #78 from erikfrey/pin_mujoco
erikfrey Mar 10, 2025
7c3ce0d
Merge remote-tracking branch 'upstream/main' into viewer
thowell Mar 10, 2025
f5cdbe3
Add contacts
camevor Mar 10, 2025
d363de1
Merge branch 'erikfrey:main' into box-box
camevor Mar 10, 2025
c4f24de
Fix mistakes; Cleanup
camevor Mar 10, 2025
2fca588
Remove inline allocs from smooth.
erikfrey Mar 11, 2025
e28e6e1
Fix test_broadphase_sweep_and_prune
nvtw Mar 11, 2025
949e5a2
Remove unused code
nvtw Mar 11, 2025
ed6cdb9
Merge pull request #82 from nvtw/dev/fix_test_broadphase_sweep_and_prune
adenzler-nvidia Mar 11, 2025
4c425bb
address pr comments from erikfrey
thowell Mar 11, 2025
e5a89b7
Merge remote-tracking branch 'upstream/main' into viewer
thowell Mar 11, 2025
f2665ab
Merge pull request #80 from thowell/viewer
thowell Mar 11, 2025
ac0d95b
fix solve_m argument order
thowell Mar 11, 2025
be2639f
Merge branch 'erikfrey:main' into box-box
camevor Mar 11, 2025
353c1f9
Merge pull request #83 from thowell/solver_cg
erikfrey Mar 11, 2025
568c0ce
modify n^2 broadphase to count collisions by world
thowell Mar 11, 2025
c29267d
Merge remote-tracking branch 'origin/main' into no_alloc
erikfrey Mar 11, 2025
dba49d0
restructure solver memory
thowell Mar 11, 2025
f98f642
Merge remote-tracking branch 'upstream/main' into solver_memory
thowell Mar 11, 2025
b6bc012
ctx.Mgrad -> d.efc.Mgrad and ctx.grad -> d.efc.grad
thowell Mar 11, 2025
c31928c
Split up multiple imports.
saran-t Mar 11, 2025
298203a
Merge branch 'erikfrey:main' into box-box
camevor Mar 11, 2025
4f66219
restructure collision driver memory
thowell Mar 11, 2025
99d28ba
Merge remote-tracking branch 'upstream/main' into solver
thowell Mar 11, 2025
0e8205c
Remove inline alloc from xfrc_accumulate.
erikfrey Mar 11, 2025
b42444b
Merge pull request #86 from saran-t/fix-multi-import
erikfrey Mar 11, 2025
a440a08
Merge pull request #84 from thowell/broadphase
erikfrey Mar 11, 2025
dad5ba2
Merge pull request #85 from thowell/solver_memory
erikfrey Mar 11, 2025
3db213d
Merge remote-tracking branch 'origin/main' into no_alloc
erikfrey Mar 11, 2025
c5ca4cb
Remove extraneous debugging.
erikfrey Mar 11, 2025
9637a69
Merge pull request #81 from erikfrey/no_alloc
erikfrey Mar 11, 2025
d6fd5e3
Lower ctrl to reasonable in-range domain that produces stable physics.
erikfrey Mar 11, 2025
c48af9c
Merge pull request #87 from erikfrey/lower_ctrl
erikfrey Mar 11, 2025
e78282b
Fix package name and project properties.
erikfrey Mar 12, 2025
71af284
Respond to PR comments.
erikfrey Mar 12, 2025
53f8262
Merge pull request #88 from erikfrey/fix_name
erikfrey Mar 12, 2025
9309b9f
Jax unroll script and changes needed.
erikfrey Mar 12, 2025
6f2a6d6
Make pyproject ignore contrib dir.
erikfrey Mar 12, 2025
446da38
Fix ruff errors.
erikfrey Mar 12, 2025
05265f0
add scene to benchmark collision
thowell Mar 12, 2025
1963535
Merge remote-tracking branch 'upstream/main' into collision
thowell Mar 12, 2025
42f894e
Add missing Apache headers, AUTHORS file, and CONTRIBUTING.md file.
saran-t Mar 12, 2025
a211614
Merge pull request #92 from saran-t/fix
erikfrey Mar 12, 2025
962d05c
format files
thowell Mar 12, 2025
b1384e9
Fix errors & cleanup
camevor Mar 11, 2025
cc29950
Added plane support for the sweep and prune broad phase
nvtw Mar 13, 2025
23a5280
cleanup unused code
nvtw Mar 13, 2025
98b7b6d
Add a few more needed functions.
erikfrey Mar 13, 2025
8a811f5
Add TODO.
erikfrey Mar 13, 2025
c1d339c
Fix ruff errors.
erikfrey Mar 13, 2025
076f089
Merge pull request #89 from erikfrey/jax_unroll
erikfrey Mar 13, 2025
6cc28de
collision.xml
thowell Mar 13, 2025
5cfea25
Merge pull request #90 from thowell/collision_benchmark
thowell Mar 13, 2025
4d88660
Remove more commented out code
nvtw Mar 13, 2025
dcb2756
add todos
thowell Mar 13, 2025
f51cef1
update todo comment
thowell Mar 13, 2025
d687ea0
fix formatting
thowell Mar 13, 2025
fe4b938
unit test works again but does not est yet the plane special case
nvtw Mar 13, 2025
73118ff
Merge pull request #93 from thowell/collision
thowell Mar 13, 2025
22c5f49
restructure collision kernel
thowell Mar 13, 2025
3ec7f72
remove collision_type
thowell Mar 13, 2025
eb77a9e
update collision_functions.py
thowell Mar 13, 2025
6bfc2a0
remove group_key
thowell Mar 13, 2025
760e9ac
add function _add_geom_pair for broadphase routines
thowell Mar 13, 2025
d07a5e1
add keyframe option to testspeed
thowell Mar 13, 2025
e88a069
wp.select -> wp.where
thowell Mar 13, 2025
e14b11d
first pass at types.py
Andrew-Luo1 Mar 12, 2025
a211377
resolve conflict
Andrew-Luo1 Mar 13, 2025
9d9e142
resolve
Andrew-Luo1 Mar 13, 2025
63b128d
first pass at annotations
Andrew-Luo1 Mar 13, 2025
4a5d9bd
update to match upstream
Andrew-Luo1 Mar 13, 2025
728b09b
Merge remote-tracking branch 'upstream/main' into solver
thowell Mar 13, 2025
f0ae17b
Add collision axis test
camevor Mar 13, 2025
e289278
Bugfixes
camevor Mar 13, 2025
e3e07ac
Merge branch 'main' into box-box
camevor Mar 13, 2025
43ae934
Adapt to upstream changes
camevor Mar 13, 2025
35def45
Use wp.where
camevor Mar 13, 2025
fc34d5e
Fix test
camevor Mar 13, 2025
dc0b033
Merge pull request #98 from thowell/wp_where
erikfrey Mar 14, 2025
5a3f85d
Merge pull request #97 from thowell/keyframe
erikfrey Mar 14, 2025
330c2a2
Merge pull request #95 from thowell/narrowphase
erikfrey Mar 14, 2025
cdeabb9
Merge branch 'main' into dev/sweep_and_prune_add_plane_support
nvtw Mar 14, 2025
5ed6493
Resolve conflicts (forgot to save the file)
nvtw Mar 14, 2025
346e4ee
Sweep and prune unit test now also checks planes
nvtw Mar 14, 2025
741a340
Merge remote-tracking branch 'upstream/main' into broadphase
thowell Mar 14, 2025
104ae1e
run ruff and align shapes
Andrew-Luo1 Mar 14, 2025
3a859ea
Merge pull request #96 from thowell/broadphase
adenzler-nvidia Mar 14, 2025
a395db2
add model=unique and change block size to 32
adenzler-nvidia Mar 14, 2025
3ac1968
Merge pull request #1 from camevor/dev/adenzler/box-box-smaller-blocks
adenzler-nvidia Mar 14, 2025
05e2110
Remove double return
camevor Mar 14, 2025
36f9793
fix crb dense and add test
thowell Mar 14, 2025
88a4cd4
add todo and add type annotation to test_crb
thowell Mar 14, 2025
48af5cf
crb (dense)
thowell Mar 14, 2025
04537b8
improve crb (dense) performance
thowell Mar 14, 2025
4b88c2c
remove qM input to qM_sparse and qM_dense functions
thowell Mar 14, 2025
94fb80f
restore comment and reorganize
thowell Mar 14, 2025
3a038a2
remove space
thowell Mar 14, 2025
9066c27
Merge pull request #100 from thowell/crb
thowell Mar 14, 2025
d80c6b8
update smooth_test.py
thowell Mar 14, 2025
c093917
replace support.where with wp.where
thowell Mar 14, 2025
9927aa4
fix formatting
thowell Mar 14, 2025
d849f60
Merge pull request #102 from thowell/wp_where
erikfrey Mar 14, 2025
0ba64d0
Merge pull request #101 from thowell/smooth_test
erikfrey Mar 14, 2025
b8e82d6
Merge pull request #91 from Andrew-Luo1/main
erikfrey Mar 14, 2025
4c31fe6
modifications and updates for broadphase and tests
thowell Mar 14, 2025
a670b0e
Add support to step once in viewer.
erikfrey Mar 15, 2025
11d6b49
Allow kernel_copy to copy from jax arrays to warp arrays.
erikfrey Mar 15, 2025
cd456e8
Use bitwise comparison for contype,conaffinity check.
erikfrey Mar 15, 2025
d16df66
Remove event_scope from _linesearch.
erikfrey Mar 15, 2025
7f75c79
Merge pull request #104 from erikfrey/viewer_step
erikfrey Mar 15, 2025
a860dc9
Merge pull request #106 from erikfrey/conaffinity_fix
erikfrey Mar 15, 2025
5cd172c
update types
thowell Mar 15, 2025
168db75
nefc_total -> nefc
thowell Mar 15, 2025
018810e
remove nefc_total from types.py
thowell Mar 15, 2025
04746a8
Merge pull request #109 from thowell/nefc
erikfrey Mar 15, 2025
1842bc1
Merge pull request #108 from thowell/types
erikfrey Mar 15, 2025
6c6e6c5
Merge pull request #105 from erikfrey/kernel_copy_fix2
erikfrey Mar 15, 2025
9b25365
Add support for actuator gain/bias used in position control.
erikfrey Mar 15, 2025
bb24fcc
Add support to testspeed to measure ncon, nefc during unroll.
erikfrey Mar 15, 2025
95ebd78
Fix ruff errors.
erikfrey Mar 15, 2025
11a0512
update sap broadphase Data field names
thowell Mar 16, 2025
51727df
Merge pull request #107 from erikfrey/event_scope_fix2
erikfrey Mar 16, 2025
639902e
Address PR feedback.
erikfrey Mar 17, 2025
922c245
Merge pull request #111 from erikfrey/measure_alloc2
erikfrey Mar 17, 2025
64b7d59
Address PR feedback.
erikfrey Mar 17, 2025
3a22750
Merge pull request #110 from erikfrey/position_control
erikfrey Mar 17, 2025
344a794
Colab to train Apptronik Apollo.
erikfrey Mar 17, 2025
dacdf3c
Merge branch 'main' into dev/sweep_and_prune_add_plane_support
nvtw Mar 17, 2025
303e0e0
Merge pull request #94 from nvtw/dev/sweep_and_prune_add_plane_support
adenzler-nvidia Mar 17, 2025
3c51254
add min
adenzler-nvidia Mar 17, 2025
0871ed9
Merge pull request #2 from camevor/dev/adenzler/fix-upper-bound
camevor Mar 17, 2025
badddbd
njmax force
adenzler-nvidia Mar 17, 2025
b43c219
merge upstream/main
thowell Mar 17, 2025
4ca6785
resolve merge conflicts
thowell Mar 17, 2025
aac978c
resolve merge conflicts
thowell Mar 17, 2025
a23e716
Merge pull request #103 from thowell/broadphase
thowell Mar 17, 2025
1c9bc99
Use block size 32 and tile indexing; Remove module=unique
camevor Mar 17, 2025
5135be0
Inline collision_axis_tiled
camevor Mar 17, 2025
1d0200e
Merge pull request #3 from camevor/dev/adenzler/njmax
camevor Mar 17, 2025
15445ae
Merge pull request #113 from erikfrey/apptronik_apollo
erikfrey Mar 17, 2025
c8c775e
static iterations > 1 condition for early return
thowell Mar 17, 2025
5feaf6f
Merge remote-tracking branch 'upstream/main' into solver
thowell Mar 17, 2025
9fe014a
Default testspeed function to step.
erikfrey Mar 17, 2025
e31f342
Merge pull request #114 from erikfrey/default_function_step
erikfrey Mar 17, 2025
aa3cb1a
add todos
thowell Mar 17, 2025
13572d9
Merge pull request #77 from thowell/solver
thowell Mar 17, 2025
2afbddd
Fix typo.
erikfrey Mar 18, 2025
622239f
Merge branch 'main' into box-box
camevor Mar 18, 2025
c011cb3
Merge pull request #116 from erikfrey/fix_qcc_typo
erikfrey Mar 18, 2025
aa66ecb
Merge branch 'erikfrey:main' into box-box
camevor Mar 18, 2025
9bce800
Fix typo
camevor Mar 18, 2025
b564fe7
Fix typo; Early out if no collision
camevor Mar 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.egg-info/
env/
.history
.vscode

# Python byte-compiled / optimized / DLL files
__pycache__/
Expand Down
10 changes: 10 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This is the list of significant contributors to mjWarp.
#
# This does not necessarily list everyone who has contributed code,
# especially since many employees of one corporation may be contributing.
# To see the full list of contributors, see the revision history in
# source control.

Google LLC
NVIDIA Corporation

25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# How to Contribute

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution,
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Community Guidelines

This project follows [Google's Open Source Community
Guidelines](https://opensource.google/conduct/).
87 changes: 51 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# mjWarp
# MJWarp

MuJoCo implemented in Warp.
MuJoCo implemented in NVIDIA Warp.

# Installing for development

Expand Down Expand Up @@ -32,47 +32,62 @@ Should print out something like `XX passed in XX.XXs` at the end!
Benchmark as follows:

```bash
mjx-testspeed --function=forward --is_sparse=True --mjcf=humanoid/humanoid.xml --batch_size=8192
mjwarp-testspeed --function=step --mjcf=humanoid/humanoid.xml --batch_size=8192
```

Some relevant benchmarks on an NVIDIA GeForce RTX 4090:
To get a full trace of the physics steps (e.g. timings of the subcomponents) run the following:

## forward steps / sec (smooth dynamics only)

27 dofs per humanoid, 8k batch size.

| Num Humanoids | MJX | mjWarp dense | mjWarp sparse |
| ----------------| -------| ------------- | -------------- |
| 1 | 7.9M | 15.6M | 13.7M |
| 2 | 2.6M | 7.4M | 7.8M |
| 3 | 2.2M | 4.6M | 5.3M |
| 4 | 1.5M | 3.3M | 4.1M |
| 5 | 1.1M | ❌ | 3.2M |

# Ideas for what to try next

## 1. Unroll steps

In the Pure JAX benchmark, we can tell JAX to unroll some number of FK steps (in the benchmarks above, `unroll=4`). This has a big impact on performance. If we change `unroll` from 4 to 1, pure JAX performance at 8k batch drops from 50M to 33M steps/sec.

Is there some way that we can improve Warp performance in the same way? If I know ahead of time that I am going to call FK in a loop 1000 times, can I somehow inject unroll primitives?

## 2. Different levels of parallelism

The current approach parallelizes over body kinematic tree depth. We could go either direction: remove body parallism (fewer kernel launches), or parallelize over joints instead (more launches, more parallelism).

## 3. Tiling
```bash
mjwarp-testspeed --function=step --mjcf=humanoid/humanoid.xml --batch_size=8192 --event_trace=True
```

It looks like a thing! Should we use it? Will it help?
`humanoid.xml` has been carefully optimized for MJX in the following ways:

## 4. Quaternions
* Newton solver iterations are capped at 1, linesearch iterations capped at 4
* Only foot<>floor collisions are turned on, producing at most 8 contact points
* Adding a damping term in the Euler integrator (which invokes another `factor_m` and `solve_m`) is disabled

Why oh why did Warp make quaternions x,y,z,w? In order to be obstinate I wrote my own quaternion math. Is this slower than using the Warp quaternion primitives?
By comparing MJWarp to MJX on this model, we are comparing MJWarp to the very best that MJX can do.

## 5. `wp.static`
For many (most) MuJoCo models, particularly ones that haven't been carefully tuned, MJX will
do much worse.

Haven't tried this at all - curious to see if it helps.
## physics steps / sec

## 6. Other stuff?
NVIDIA GeForce RTX 4090, 27 dofs, ncon=8, 8k batch size.

Should I be playing with `block_dim`? Is my method for timing OK or did I misunderstand how `wp.synchronize` works? Is there something about allocating that I should be aware of? What am I not thinking of?
```
Summary for 8192 parallel rollouts

Total JIT time: 0.82 s
Total simulation time: 2.98 s
Total steps per second: 2,753,173
Total realtime factor: 13,765.87 x
Total time per step: 363.22 ns

Event trace:

step: 361.41 (MJX: 316.58 ns)
forward: 359.15
fwd_position: 52.58
kinematics: 19.36 (MJX: 16.45 ns)
com_pos: 7.80 (MJX: 12.37 ns)
crb: 12.44 (MJX: 27.91 ns)
factor_m: 6.40 (MJX: 27.48 ns)
collision: 4.07 (MJX: 1.23 ns)
make_constraint: 6.32 (MJX: 42.39 ns)
transmission: 1.30 (MJX: 3.54 ns)
fwd_velocity: 26.52
com_vel: 8.44 (MJX: 9.38 ns)
passive: 1.06 (MJX: 3.22 ns)
rne: 10.96 (MJX: 16.75 ns)
fwd_actuation: 2.74 (MJX: 3.93 ns)
fwd_acceleration: 11.90
xfrc_accumulate: 3.83 (MJX: 6.81 ns)
solve_m: 6.92 (MJX: 8.88 ns)
solve: 264.38 (MJX: 153.29 ns)
mul_m: 5.93
_linesearch_iterative: 43.15
mul_m: 3.66
euler: 1.74 (MJX: 3.78 ns)
```
5 changes: 5 additions & 0 deletions contrib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Contrib

Contrib is a home for experiments, helper scripts and other tools that are not officially part of MJWarp.

The contents of this directory are subject to change with no notice.
Loading