Skip to content

Commit 14af21a

Browse files
awoll-bdaiexploy-bot
authored andcommitted
Migrate pixi to rich platforms
### What change is being made * Use [rich platforms](prefix-dev/pixi#6178) in pixi.toml * Upgrade CI workflows to pixi version 0.75.0 ### Why this change is being made Update ### Tested CI GitOrigin-RevId: 8fb5066f40de33be3ccabf12a20123878a328b3b
1 parent 7c445c0 commit 14af21a

5 files changed

Lines changed: 2964 additions & 2891 deletions

File tree

.github/actions/setup-pixi/action.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ runs:
2626
- name: Setup pixi
2727
uses: prefix-dev/setup-pixi@v0.9.6
2828
with:
29-
# Pin pixi: 0.71.x changed virtual-package/system-requirements platform
30-
# matching and breaks GPU env installs on the runner. v0.70.2 is the
31-
# oldest release that reads the current lock (format v7) and predates
32-
# that regression.
33-
pixi-version: v0.70.2
29+
pixi-version: v0.75.0
3430
frozen: ${{ inputs.frozen }}
3531
cache: ${{ inputs.cache }}
3632
environments: ${{ inputs.environments }}

control/test/testdata/test_onnx_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def forward(
119119
inputs = [v for k, v in locals().items() if k != "self"]
120120

121121
# Identity operations to keep them in the graph
122-
processed = [i * 1.0 for i in inputs]
122+
processed = [i.to(torch.float32) * 1.0 for i in inputs]
123123

124124
concatenated = torch.cat(processed, dim=1)
125125

docs/tutorial/exporter/exporter_tutorial.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,15 @@ Looking at `compute_obs()` from Step 1, the observation is computed from three s
252252
(`foo`, `bar`, `baz`) and the previous actions:
253253

254254
```python
255-
torch.cat([
256-
self.data_source.foo + 1.0,
257-
self.data_source.bar + 2.0 * self.data_source.baz,
258-
self.data_source.baz,
259-
self._actions,
260-
], dim=-1)
255+
torch.cat(
256+
[
257+
self.data_source.foo + 1.0,
258+
self.data_source.bar + 2.0 * self.data_source.baz,
259+
self.data_source.baz,
260+
self._actions,
261+
],
262+
dim=-1,
263+
)
261264
```
262265

263266
Each of these tensors needs to be declared so the exporter knows how to feed data into the ONNX
@@ -780,7 +783,10 @@ import torch
780783
from isaaclab.assets import Articulation
781784
from isaaclab.managers import SceneEntityCfg
782785

783-
from exploy.exporter.frameworks.isaaclab.derived_tensors import body_link_ang_vel_b, body_link_lin_vel_b
786+
from exploy.exporter.frameworks.isaaclab.derived_tensors import (
787+
body_link_ang_vel_b,
788+
body_link_lin_vel_b,
789+
)
784790

785791

786792
def body_lin_vel_b(env, asset_cfg=SceneEntityCfg("robot")) -> torch.Tensor:
@@ -984,7 +990,9 @@ env = Environment(data_source=data_source)
984990
exp_env = ExportableEnv(env=env)
985991
actor = Actor(num_obs=env.num_obs, num_act=env.num_act).eval()
986992

987-
assert export_and_evaluate(exp_env, actor, "policy.onnx", num_eval_episodes=1, max_eval_steps_per_episode=20)
993+
assert export_and_evaluate(
994+
exp_env, actor, "policy.onnx", num_eval_episodes=1, max_eval_steps_per_episode=20
995+
)
988996
```
989997

990998
### Environment with a torch module
@@ -996,7 +1004,9 @@ exp_env = ExportableEnv(env=env)
9961004
actor = Actor(num_obs=env.num_obs, num_act=env.num_act).eval()
9971005
exp_env.context_manager().add_module(env.module)
9981006

999-
assert export_and_evaluate(exp_env, actor, "policy_with_module.onnx", num_eval_episodes=1, max_eval_steps_per_episode=20)
1007+
assert export_and_evaluate(
1008+
exp_env, actor, "policy_with_module.onnx", num_eval_episodes=1, max_eval_steps_per_episode=20
1009+
)
10001010
```
10011011

10021012
### Environment with a torch module and an RNN actor
@@ -1014,5 +1024,7 @@ add_actor_memory(
10141024
get_hidden_states_func=actor.get_state,
10151025
)
10161026

1017-
assert export_and_evaluate(exp_env, actor, "policy_with_rnn.onnx", num_eval_episodes=1, max_eval_steps_per_episode=20)
1027+
assert export_and_evaluate(
1028+
exp_env, actor, "policy_with_rnn.onnx", num_eval_episodes=1, max_eval_steps_per_episode=20
1029+
)
10181030
```

0 commit comments

Comments
 (0)