Skip to content

Inference improvements#52

Merged
tomasz-lewicki merged 24 commits intomainfrom
dev/tomasz/load-entrypoints-lazily
Mar 13, 2026
Merged

Inference improvements#52
tomasz-lewicki merged 24 commits intomainfrom
dev/tomasz/load-entrypoints-lazily

Conversation

@tomasz-lewicki
Copy link
Copy Markdown
Contributor

@tomasz-lewicki tomasz-lewicki commented Feb 13, 2026

Misc Inference code improvements

  1. Auto-detect network interface: TaskConfig.interface defaults to "auto" instead of "lo". When "auto", a new detect_robot_interface() function scans /sys/class/net/ for the first wired NIC that is operationally UP, skipping wifi/docker/veth interfaces. If no interface is found, we fallback to lo

  2. Added debug config overrides for easier testing. Specifically DebugConfig to TaskConfig with three toggles: force_upright_imu (override gravity to [0,0,-1]), force_zero_angular_velocity, and force_zero_action (hold default pose). Also added a per-joint diagnostic table (_print_joint_table) that prints q/dq/action in degrees alongside observation printing. This is super helpful for debugging policies.

  3. Freejoint detection in MuJoCo: The simulator no longer looks for a hardcoded "floating_base_joint" name. Instead it finds the freejoint by mjJNT_FREE type, and filters robot joints by joint type rather than name exclusion. This fixes compatibility with robot XMLs that don't follow this naming convention.

  4. Lazy extension entrypoint loading: holosoma.config.inference and holosoma.config.robot entry points are now loaded on first use (_load_extensions()) instead of at module import time. This helps us avoid circular imports in extensions, while preseriving the nice --help messages in core and extensions. The AnnotatedInferenceConfig is replaced by a get_annotated_inference_config() factory that triggers lazy loading before building the tyro CLI type.

  5. Suppress problematic tyro CLI fields — SceneConfig.scene_files and SceneConfig.rigid_objects are annotated with tyro.conf.Suppress to prevent opaque parser errors when users pass unrecognized CLI flags. Previously, we would somehow always get error about these fields whenever any unrecognized field would get in.

  6. Remove dead SDK code. Deleted sdk/command_sender/ and sdk/state_processor/. These were superseded by the entry-point-based sdk/__init__.py interface factory and are no longer imported anywhere. I should've deleted them in Unify the robot SDK interface #45.

  7. Added python3.12 mujoco setup scripts. I believe @kingb has a cleaner solution, though.

  8. Docker Improvements: Inference docker now mounts /dev/input (for joystick) and persists bash history across container restarts. Added evdev to setup.py dependencies.

  9. WBT observation printing: the WholeBodyTrackingPolicy now respects print_observations flag (was previously only wired in locomotion).

  10. Remove unused upper controller path in base.py policy postprocessing.

@clayrosenthal clayrosenthal added the enhancement New feature or request label Feb 17, 2026
@tomasz-lewicki tomasz-lewicki requested a review from kingb March 11, 2026 23:12
@tomasz-lewicki tomasz-lewicki changed the title [WIP] Load extension entrypoints lazily Inference improvements Mar 11, 2026
# Mount bash history in the host filesystem in order to preserve history between containers
HOLOSOMA_DEPS_DIR="$HOME/.holosoma_deps"
mkdir -p "$HOLOSOMA_DEPS_DIR"
touch "$HOLOSOMA_DEPS_DIR/bash_history"
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.

should we separate this per container/env? Like if I ran something in the inference container, do I necessarily also want that history in the retargeting or isaacsim container?

Comment thread src/holosoma_inference/holosoma_inference/run_policy.py
Comment thread src/holosoma/holosoma/simulator/mujoco/mujoco.py
Comment thread scripts/setup_mujoco_py312.sh
Comment thread src/holosoma_inference/holosoma_inference/utils/network.py Outdated
Comment thread src/holosoma_inference/holosoma_inference/utils/network.py Outdated
Copy link
Copy Markdown
Contributor

@Juyue Juyue left a comment

Choose a reason for hiding this comment

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

{2, 6, 9, 10} looks great! Great debugging features and thanks for removing dead code path.

Copy link
Copy Markdown
Contributor

@asetapen asetapen left a comment

Choose a reason for hiding this comment

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

Looks great!

Comment thread scripts/source_mujoco_py312_setup.sh Outdated
Comment thread src/holosoma_inference/holosoma_inference/policies/base.py
@tomasz-lewicki tomasz-lewicki merged commit 99fa514 into main Mar 13, 2026
12 checks passed
@clayrosenthal clayrosenthal deleted the dev/tomasz/load-entrypoints-lazily branch March 14, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants