Skip to content

Vectorize clone plan queries - #7319

Merged
ooctipus merged 1 commit into
isaac-sim:developfrom
camevor:cloner-query-vectorized
Aug 24, 2026
Merged

ooctipus merged 1 commit into
isaac-sim:developfrom
camevor:cloner-query-vectorized

Conversation

@camevor

@camevor camevor commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

Gather clone-plan env ids in one indexing step

This replaces some Python loops with vectorized numpy calls and improves startup performance.

Fixes # (issue)

Type of change

  • (Startup performance enhancement)

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that)
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

@camevor camevor self-assigned this Aug 24, 2026
@camevor
camevor requested a review from a team August 24, 2026 15:23
@github-actions github-actions Bot added the isaac-lab Related to Isaac Lab team label Aug 24, 2026

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Isaac Lab Review Bot

The private query helpers now gather populated environment IDs with tensor indexing and use a direct mask reduction to skip empty rows. The changed paths preserve row ordering and environment-ID translation, including plans whose clone mask and environment IDs reside on different devices.

  • Design and architecture: The optimization remains contained within isaaclab.cloner.query and preserves the existing ownership, nearest-template ranking, and populated_only policies. Device reconciliation is handled locally before indexing rather than imposing a new constraint on ClonePlan.
  • API: No public symbols or signatures changed. _row_env_ids continues to produce tuples of Python integers, so the observable return shapes and values of path_env_ids, iter_sources, and related consumers remain compatible. The .skip changelog fragment is appropriate for this internal performance change.
  • Implementation: The env_ids is None branch remains value-equivalent, indexed gathering preserves mask-column order, and clone_mask[row].any() is equivalent to checking whether the previously constructed environment-ID tuple was empty. Added tests cover partial and empty rows plus CPU environment IDs paired with a CUDA clone mask.

No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.

Automated review; human maintainers own approval decisions.

@greptile-apps

greptile-apps Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR vectorizes clone-plan environment-ID gathering and avoids constructing ID tuples merely to determine whether a clone-mask row is populated.

  • Gathers selected environment IDs with one tensor indexing operation while handling cross-device masks and ID tensors.
  • Uses the clone-mask row directly when filtering unpopulated source templates.
  • Adds partial-row, empty-nearer-template, and CUDA/CPU cross-device query coverage.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness or security issues identified.

The vectorized gather preserves column ordering and Python tuple results, explicitly aligns index and environment-ID devices, and the direct mask predicate remains equivalent to the previous nonempty-ID check under ClonePlan invariants.

Important Files Changed

Filename Overview
source/isaaclab/isaaclab/cloner/query.py Replaces per-element environment-ID conversion with vectorized tensor indexing and uses the clone mask directly for populated-row filtering; no correctness defect was identified.
source/isaaclab/test/cloner/test_clone_plan_algebra.py Expands query tests for partial row ownership, empty nearer templates, and CUDA-mask/CPU-environment-ID gathering.
source/isaaclab/changelog.d/clone-query-vectorized.skip Adds the package’s skip marker for this performance-only change.

Reviews (1): Last reviewed commit: "Gather clone-plan env ids in one indexin..." | Re-trigger Greptile

@ooctipus
ooctipus enabled auto-merge (squash) August 24, 2026 18:56
@ooctipus
ooctipus merged commit 2c07bbb into isaac-sim:develop Aug 24, 2026
48 of 49 checks passed
kellyguo11 added a commit that referenced this pull request Aug 26, 2026
## Description

Backports five merged `develop` PRs not already represented on
`release/3.0.0` or covered by #7300:

| Source PR | Source commit | Backport commit | Scope |
| --- | --- | --- | --- |
| #7235 | `4fa20fc8a5f` | `8110c816d0a` | Report distinct exit codes for
failed, crashed, timed-out, and startup-hung test runs. |
| #6597 | `2ae0878a266` | `68b21a60158` | Correct the stale
wheel-builder dependency-pin reference. |
| #7320 | `7ed3ad45546` | `1a775d46fcf` | Add success-driven ADR
guidance and evaluation coverage to the domain-randomization skill. |
| #7319 | `2c07bbb43a9` | `4249489a089` | Vectorize clone-plan
environment-ID queries. |
| #7316 | `a00278f0fde` | `8af682bfcb9` | Extend Core Lift and Reorient
episodes and pose-command resampling intervals. |

Each merged source commit was cherry-picked with `-x`. All five applied
without conflicts and have stable patch IDs identical to their source
commits.

#7233 is intentionally excluded because its existing backport is #7300.

## Type of change

- Bug fix
- Performance improvement
- Task configuration update
- Developer tooling improvement
- Documentation update

## Validation

- `uv run --frozen --extra test python -m pytest -q
source/isaaclab/test/cloner/test_clone_plan_algebra.py` — 85 passed.
- Validated the six representative `resolve_exit_code` outcomes,
including mixed-failure precedence.
- `uv run --no-project python tools/skills/cli.py check` — 21 skills
validated.
- `uv run --frozen --extra test python -m pytest --noconftest -q
source/isaaclab_tasks/test/core/test_lift_env_cfg.py` — 3 passed.
- Programmatic Lift/Reorient config assertions confirmed the 4–6 second
resampling interval and 12-second episode length.
- Ruff, Ruff-format, and RST hooks passed for the #7316 paths.
- The original four-PR branch passed
`ISAACLAB_CHANGELOG_BASE_REF=release/3.0.0 uv run --frozen isaaclab -f`;
#7316's source commit also passed its full formatting and changelog
validation.
- `git diff --check
kelly/kellyg/backport-remaining-develop-prs-3.0.0...HEAD` — passed for
the added #7316 commit.
- Stable patch IDs match all five merged source commits; #7316 also has
exact mode/blob parity on both affected paths.

## Screenshots

Not applicable.

## Checklist

- [x] I have read and understood the contribution guidelines.
- [x] I have run the repository formatting or focused pre-commit checks
appropriate to each source PR.
- [x] Documentation and skill guidance from the source PRs are included
unchanged.
- [x] My changes generate no new warnings.
- [x] Existing and backported tests cover the changed behavior.
- [x] Touched release-managed source packages carry their source
changelog fragments.
- [x] Source authorship and `-x` provenance are preserved.

---------

Co-authored-by: myurasov-nv <[email protected]>
Co-authored-by: AntoineRichard <[email protected]>
Co-authored-by: ooctipus <[email protected]>
Co-authored-by: camevor <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

isaac-lab Related to Isaac Lab team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants