Add Isaac Lab integration spike under roboeval/integrations/isaac/ - #4
Open
arryan0112 wants to merge 1 commit into
Open
Add Isaac Lab integration spike under roboeval/integrations/isaac/#4arryan0112 wants to merge 1 commit into
arryan0112 wants to merge 1 commit into
Conversation
Wraps any single-env Isaac Lab environment (gym.make("Isaac-...-v0",
num_envs=1)) into the EnvironmentAdapter Protocol so policies can be
evaluated against Isaac Lab tasks through EvalRunner. Zero changes to
existing SDK files.
The adapter handles three Isaac-specific concerns that distinguish it
from the existing Gymnasium adapter:
1. Always-batched envs. Isaac envs subclass gym.vector.VectorEnv and
return tensors with a leading batch dimension even at num_envs=1.
The adapter slices batch_index=0 (configurable) to expose
single-episode semantics to the runner.
2. GPU tensors. Observations come back as torch.Tensor on cuda:0.
The tensor_to_numpy helper moves any tensor to CPU and converts to
numpy before it reaches the runner's JSON writer.
3. Tensor actions on the env device. Policies typically return numpy
arrays or Python scalars; the adapter wraps them in a batched torch
tensor on the env's device with the expected (num_envs, action_dim)
shape.
Vectorized eval (num_envs > 1 producing N independent rollouts) is
explicitly out of scope for this spike. The adapter accepts num_envs > 1
but only reads batch_index=0; a clear warning fires explaining the
parallelism cost. True vector eval requires SDK runner changes documented
as Phase 3+ work.
Files added:
- roboeval/integrations/isaac/__init__.py (public re-exports)
- roboeval/integrations/isaac/adapter.py (adapter + 6 default hooks
+ tensor_to_numpy helper + action shape normalization)
- roboeval/integrations/isaac/demo_rollout.py (Isaac-Cartpole-Direct-v0
manual rollout demo)
- roboeval/integrations/isaac/README.md (usage, mapping table, cloud
GPU setup workflow)
- roboeval/integrations/isaac/notes.md (design rationale, 12 known
edge cases, real-Isaac validation plan)
- roboeval/integrations/isaac/requirements.txt (Isaac Sim + Isaac Lab
install pointers; not a single pip line)
- roboeval/integrations/isaac/tests/__init__.py
- roboeval/integrations/isaac/tests/test_adapter.py (46 unit +
integration tests using mock Isaac envs; runs on Mac, no Isaac
install needed)
What's verified by the test suite:
- All 46 tests pass on Mac in 23ms via mocked Isaac envs (real torch
tensors, no Isaac dependency)
- Adapter integrates cleanly with EvalRunner + Ruleset
- info["isaac"] namespace preserved through to StepRecord
- Rich env info flows through to_serializable + JSON write
- Hook overrides work (outcome, action, info_keys, etc.)
- Multi-episode reset behavior
- Action shape normalization across 4 input shapes (scalar, 1-D array
matching action_dim, 1-D with batch shape, pre-batched 2-D tensor)
What's NOT verified (requires cloud GPU pass):
- Real Isaac-Cartpole-Direct-v0 smoke test
- GPU->CPU tensor sync against actual cuda:0 tensors
- env.device / env.sim_device attribute resolution on real Isaac
- env.reset(options=...) acceptance across Isaac task variants
See notes.md section 12 for the cloud GPU validation plan.
Validate:
python -m unittest discover -s roboeval/integrations/isaac/tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wraps any single-env Isaac Lab environment (gym.make("Isaac-...-v0", num_envs=1)) into the EnvironmentAdapter Protocol so policies can be evaluated against Isaac Lab tasks through EvalRunner. Zero changes to existing SDK files.
The adapter handles three Isaac-specific concerns that distinguish it from the existing Gymnasium adapter:
Always-batched envs. Isaac envs subclass gym.vector.VectorEnv and return tensors with a leading batch dimension even at num_envs=1. The adapter slices batch_index=0 (configurable) to expose single-episode semantics to the runner.
GPU tensors. Observations come back as torch.Tensor on cuda:0. The tensor_to_numpy helper moves any tensor to CPU and converts to numpy before it reaches the runner's JSON writer.
Tensor actions on the env device. Policies typically return numpy arrays or Python scalars; the adapter wraps them in a batched torch tensor on the env's device with the expected (num_envs, action_dim) shape.
Vectorized eval (num_envs > 1 producing N independent rollouts) is explicitly out of scope for this spike. The adapter accepts num_envs > 1 but only reads batch_index=0; a clear warning fires explaining the parallelism cost. True vector eval requires SDK runner changes.
Files added:
What's verified by the test suite:
What's NOT verified (requires cloud GPU pass):
See notes.md section 12 for the cloud GPU validation plan.
Validate:
python -m unittest discover -s roboeval/integrations/isaac/tests