Skip to content

Commit 10e1e49

Browse files
authored
[MISC] Migrate to Quadrants 0.8.0. (#2788)
1 parent 0cff5b2 commit 10e1e49

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

genesis/engine/solvers/rigid/constraint/solver.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,7 +1864,7 @@ def func_cholesky_and_solve_fused_tiled(
18641864
while j < i_d:
18651865
dot = dot + L_sh[i_d, j] * v_sh[j]
18661866
j = j + 16
1867-
dot = qd.simt.subgroup.reduce_all_add(dot, 4)
1867+
dot = qd.simt.subgroup.reduce_all_add_tiled(dot, 4)
18681868
if tid == 0:
18691869
v_sh[i_d] = (v_sh[i_d] - dot) / L_sh[i_d, i_d]
18701870
qd.simt.block.sync()
@@ -1877,7 +1877,7 @@ def func_cholesky_and_solve_fused_tiled(
18771877
while j < n_dofs:
18781878
dot = dot + L_sh[j, i_d] * v_sh[j]
18791879
j = j + 16
1880-
dot = qd.simt.subgroup.reduce_all_add(dot, 4)
1880+
dot = qd.simt.subgroup.reduce_all_add_tiled(dot, 4)
18811881
if tid == 0:
18821882
v_sh[i_d] = (v_sh[i_d] - dot) / L_sh[i_d, i_d]
18831883
qd.simt.block.sync()
@@ -2488,7 +2488,7 @@ def _func_linesearch_eval_constraints_at_n_alphas_coop(
24882488
"""Cooperative (32-lane subgroup) variant of ``_func_linesearch_eval_constraints_at_n_alphas_serial``.
24892489
24902490
All 32 lanes call this with their own ``tid``; the constraint loop is strided by 32, then each
2491-
accumulator is reduced across the warp via ``subgroup.reduce_all_add(_, 5)`` so every lane ends
2491+
accumulator is reduced across the warp via ``subgroup.reduce_all_add_tiled(_, 5)`` so every lane ends
24922492
up with identical return values. Returns the same 3 ``qd.Vector(3)``s ``(t0, t1, t2)`` as the serial inner.
24932493
"""
24942494
ne = constraint_state.n_constraints_equality[i_b]
@@ -2559,9 +2559,9 @@ def _func_linesearch_eval_constraints_at_n_alphas_coop(
25592559
# Warp-tree reduction: every lane's 9 partial sums collapse into the per-env totals; after this
25602560
# all 32 lanes hold identical scalars. The `5` is log2(32) tree levels.
25612561
for k in qd.static(range(n_alphas)):
2562-
t_0[k] = qd.simt.subgroup.reduce_all_add(t_0[k], 5)
2563-
t_1[k] = qd.simt.subgroup.reduce_all_add(t_1[k], 5)
2564-
t_2[k] = qd.simt.subgroup.reduce_all_add(t_2[k], 5)
2562+
t_0[k] = qd.simt.subgroup.reduce_all_add_tiled(t_0[k], 5)
2563+
t_1[k] = qd.simt.subgroup.reduce_all_add_tiled(t_1[k], 5)
2564+
t_2[k] = qd.simt.subgroup.reduce_all_add_tiled(t_2[k], 5)
25652565

25662566
t0 = qd.Vector([t_0[0], t_1[0], t_2[0]])
25672567
t1 = qd.Vector([t_0[1], t_1[1], t_2[1]])

genesis/engine/solvers/rigid/constraint/solver_breakdown.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def _func_update_constraint_cost_coop(
598598
static_rigid_sim_config: qd.template(),
599599
):
600600
"""Warp-per-env cooperative variant of ``_func_update_constraint_cost``: 32 lanes stride through dofs and
601-
constraints, with the final per-env scalar produced by ``subgroup.reduce_all_add``. Per-lane reads of
601+
constraints, with the final per-env scalar produced by ``subgroup.reduce_all_add_tiled``. Per-lane reads of
602602
Jaref/efc_D/active are coalesced under the [_B, len_constraints_] physical layout (i.e. when those
603603
layout-flippable constraint-state tensors were allocated with ``layout=(1, 0)``)."""
604604
_B = constraint_state.grad.shape[1]
@@ -648,8 +648,8 @@ def _func_update_constraint_cost_coop(
648648
cost_i += linear_neg * f * (-0.5 * rf - Jaref_c) + linear_pos * f * (-0.5 * rf + Jaref_c)
649649
i_c = i_c + _K
650650

651-
cost_i = qd.simt.subgroup.reduce_all_add(cost_i, 5)
652-
gauss_i = qd.simt.subgroup.reduce_all_add(gauss_i, 5)
651+
cost_i = qd.simt.subgroup.reduce_all_add_tiled(cost_i, 5)
652+
gauss_i = qd.simt.subgroup.reduce_all_add_tiled(gauss_i, 5)
653653

654654
if tid == 0:
655655
constraint_state.gauss[i_b] = gauss_i

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ readme = "README.md"
1010
requires-python = ">=3.10,<3.14"
1111
dependencies = [
1212
"psutil",
13-
"quadrants==0.7.8",
13+
"quadrants==0.8.0",
1414
"pydantic>=2.11.0",
1515
"numpy>=1.26.4",
1616
"frozendict",

0 commit comments

Comments
 (0)