Skip to content

feat: support Python 3.11 for simulation and training - #128

Merged
wlgys8 merged 1 commit into
mainfrom
feat/python311-support
Oct 17, 2026
Merged

wlgys8 merged 1 commit into
mainfrom
feat/python311-support

Conversation

@wlgys8

@wlgys8 wlgys8 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Support Python 3.11 for simulation and training packages; keep Unitree hardware runtime and full installations on Python 3.10.
  • Add explicit Python selection to the installer, expand CI to Python 3.10/3.11, and update installation documentation.
  • Copy callable dataclass configuration defaults per instance for Python 3.11 compatibility.
  • Preserve the macOS PyPI Torch fallback through explicit platform resolution partitions in the lockfile.
  • Consolidate generic NUMA discovery and placement in motrix_rl.numa; keep FastSAC-specific collector slicing in the provider.
  • Dispatch GPU locality queries explicitly by CUDA/HIP runtime and isolate HIP PCI discovery in a subprocess with Torch-wheel library discovery.

Validation

  • prek run --all-files: passed.
  • Static Python syntax parsing and git diff --check: passed.
  • Offline lock consistency check: passed.
  • Tests were not run successfully; the local environment lacks pytest and Torch cannot import due to missing libcudnn.so.9. Subsequent work was validated statically as requested.

Limitations

  • HIP GPU behavior has not been verified on physical hardware.
  • NVIDIA NUMA discovery retains the existing NVML physical-ordinal behavior; CUDA_VISIBLE_DEVICES remapping is not addressed here.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It broadly alters cross-Python packaging, lockfile resolution, installer shell logic, CI, and a framework-wide @configclass default-copying semantics change, with the author noting the test suite was not run and HIP paths are unverified on hardware.

No open issues 🎉

What changed in this PR

This PR extends MotrixLab to support Python 3.11 for simulation and training while keeping the Unitree hardware runtime and full (--all) installs pinned to Python 3.10. It relaxes requires-python across workspace packages, adds a --python selector to install.sh with an --all/3.11 guard, expands CI to a Python 3.10/3.11 matrix, and updates installation docs in English and Chinese. It also carries two correctness-oriented refactors that 3.11 surfaced: @configclass now deep-copies callable dataclass defaults per instance (3.11 rejects unhashable mutable defaults), and generic NUMA/GPU-locality logic is consolidated into motrix_rl.numa with an explicit cuda/hip runtime dispatch (HIP PCI discovery isolated in a subprocess).

Changes:

  • Allow Python 3.11 (requires-python = ">=3.10,<3.12"), add installer/CI/doc support, and exclude Unitree on 3.11 via dependency markers and test importorskip/--ignore.
  • Fix @configclass to wrap callable dataclass defaults (e.g. reward/observation term configs) in per-instance deepcopy factories.
  • Move gpu_numa_node, spawn_placement, apply_binding, and NVML/HIP discovery into motrix_rl.numa; gpu_numa_node now dispatches explicitly on cuda/hip, keeping only select_collector_cpus in the FastSAC provider.
File Description
*/​pyproject.toml (11 pkgs) Relax requires-python to >=3.10,<3.12; keep Unitree marker-gated in test group; add macOS resolution partition.
install.sh Add validated --python option and --all/3.11 incompatibility guard; thread interpreter choice into uv sync.
.github/​workflows/​tests.yml Matrix over Python 3.10/3.11; 3.11 path uses direct uv sync and ignores Unitree tests.
motrix_env_core/​.../​config/​decorate.py Drop callable(value) skip so callable configclass defaults are deep-copied per instance.
motrix_rl/​src/​motrix_rl/​numa.py Add spawn_placement, apply_binding, NVML/HIP probes, and gpu_numa_node(device_index, runtime).
motrix_rl_builtin/​.../​async_impl/​{numa,topology,train,worker}.py Reduce provider numa.py to CPU slicing; import shared helpers; pass explicit GPU runtime.
motrix_env_core/​tests/​test_configclass.py, motrix_rl/​tests/​test_{numa,gpu_numa}.py, */​tests/​test_* Tests for configclass copy semantics, HIP probe isolation/caching, and runtime dispatch; Unitree imports made optional.
README*.md, CONTRIBUTING.md, AGENTS.md, docs/​.../​installation.md, wiki/​.../​fastsac-*.md Document dual Python support and the NUMA consolidation.

Review effort: Balanced

@wlgys8
wlgys8 force-pushed the feat/python311-support branch from 19f59f2 to 132766e Compare October 17, 2026 13:41
@wlgys8
wlgys8 requested a balanced review from Copilot October 17, 2026 14:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It spans build/CI infrastructure, a core @configclass default-copy semantics change affecting all config classes, and platform-specific NUMA/HIP code that cannot be hardware-verified, plus an undocumented Hygon install path, warranting human review.

1 open issue

Review effort: Balanced

Comment thread install.sh
@wlgys8
wlgys8 merged commit 9c9b60e into main Oct 17, 2026
12 of 13 checks passed
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