Skip to content

Implement tiled kernels for CG solver#1399

Merged
thowell merged 12 commits into
google-deepmind:mainfrom
quagla:tiled-cg-solver
Jun 5, 2026
Merged

Implement tiled kernels for CG solver#1399
thowell merged 12 commits into
google-deepmind:mainfrom
quagla:tiled-cg-solver

Conversation

@quagla

@quagla quagla commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator
Benchmark Name Parallel Worlds Baseline Optimized Speedup (%)
cloth 32 1,077.51 steps/sec 1,613.63 steps/sec +49.76%
humanoid 8,192 1,506,732.57 steps/sec 1,512,146.94 steps/sec +0.36%

@quagla quagla force-pushed the tiled-cg-solver branch from 20a77d6 to 316c04c Compare June 2, 2026 19:08
@quagla quagla changed the title Implement tiled kernels for CG sole Implement tiled kernels for CG solver Jun 2, 2026
@quagla quagla requested a review from thowell June 2, 2026 19:34
@quagla quagla marked this pull request as ready for review June 3, 2026 08:30
Comment thread mujoco_warp/_src/types.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
@quagla quagla marked this pull request as draft June 3, 2026 16:05
@quagla quagla marked this pull request as ready for review June 4, 2026 10:24
@quagla quagla requested a review from thowell June 4, 2026 10:26
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py

@adenzler-nvidia adenzler-nvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice result on cloth, and I traced the CG path as functionally correct — the prev_grad/prev_Mgrad relocation, the fused solve_cg_finalize, and the reordered done-check are all equivalent to the kernels they replace.

A few cleanups I'd like before merge; inline comments cover the rest:

  • Dead kernel _solve_prev_grad_Mgrad (solver.py:3152) is no longer launched anywhere — the per-iteration prev_grad/prev_Mgrad snapshot now happens inside _solve_init_search_cg_tiled and _solve_search_update_cg_tiled. No remaining references repo-wide (only the _island variant is still used). Please remove.
  • Dead kernel _solve_beta_finalize (solver.py:3247) — its logic is now inlined into solve_cg_finalize (step 1) and it is no longer launched. Please remove.

Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/solver.py Outdated
Comment thread mujoco_warp/_src/types.py
@quagla quagla force-pushed the tiled-cg-solver branch from 2bad673 to 861325b Compare June 4, 2026 14:18
@quagla quagla requested a review from thowell June 4, 2026 14:18
@thowell thowell merged commit fa6037f into google-deepmind:main Jun 5, 2026
14 checks passed
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