Skip to content

[MISC] Enforce autograd cases not using cuda graph#2633

Closed
erizmr wants to merge 1 commit intoGenesis-Embodied-AI:mainfrom
erizmr:mingrui/260331/fix_cuda_graph_grad
Closed

[MISC] Enforce autograd cases not using cuda graph#2633
erizmr wants to merge 1 commit intoGenesis-Embodied-AI:mainfrom
erizmr:mingrui/260331/fix_cuda_graph_grad

Conversation

@erizmr
Copy link
Copy Markdown
Contributor

@erizmr erizmr commented Apr 1, 2026

Description

Related Issue

Resolves Genesis-Embodied-AI/Genesis#

Motivation and Context

How Has This Been / Can This Be Tested?

Screenshots (if appropriate):

Checklist:

  • I read the CONTRIBUTING document.
  • I followed the Submitting Code Changes section of CONTRIBUTING document.
  • I tagged the title correctly (including BUG FIX/FEATURE/MISC/BREAKING)
  • I updated the documentation accordingly or no change is needed.
  • I tested my changes and added instructions on how to test it for reviewers.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 1, 2026

🔴 Benchmark Regression Detected ➡️ Report

is_compatible=lambda *args, **kwargs: _get_static_config(*args, **kwargs).prefer_parallel_linesearch != 1
is_compatible=lambda *args, **kwargs: (
_get_static_config(*args, **kwargs).prefer_parallel_linesearch != 1
or _get_static_config(*args, **kwargs).requires_grad
Copy link
Copy Markdown
Collaborator

@duburcqa duburcqa Apr 1, 2026

Choose a reason for hiding this comment

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

Do not change this condition. At this point, it is only about prefer_parallel_linesearch. Nothing to do with requiring grad or not. Each variant must specify its own restrictions for compatibility. Nothing more. Nothing else.

rigid_global_info,
static_rigid_sim_config,
_n_iterations: not static_rigid_sim_config.requires_grad
and static_rigid_sim_config.backend != gs.cpu
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.

Are you sure this kernel does not run on CPU? If it runs on CPU, there is no reason to exclude it here.

@func_solve_body.register(
is_compatible=lambda *args, **kwargs: _get_static_config(*args, **kwargs).prefer_parallel_linesearch != 1
is_compatible=lambda *args, **kwargs: (
_get_static_config(*args, **kwargs).prefer_parallel_linesearch != 1
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.

You must update how prefer_parallel_linesearch is computed:

def _build_static_config(self):
        prefer_parallel_linesearch = self._options.prefer_parallel_linesearch
        # FIXME: Enable gs.metal once Quadrants supports shared memory atomics on Apple Metal.
        if gs.backend in (gs.cpu, gs.metal) or self._enable_mujoco_compatibility or self.sim.options.requires_grad:
            prefer_parallel_linesearch = False

@duburcqa
Copy link
Copy Markdown
Collaborator

duburcqa commented Apr 1, 2026

Superseded by #2635

@duburcqa duburcqa closed this Apr 1, 2026
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.

2 participants