Add macOS (Apple Silicon) support for the interactive demo - #2
Open
zxytim wants to merge 2 commits into
Open
Conversation
added 2 commits
July 12, 2026 02:06
- Run the motion model on MPS (auto-selected, ARDY_DEVICE override); text encoder stays on CPU. Launch with --no-compile (no TensorRT). - MPS is not thread-safe: serialize accelerator access with a shared GPU lock around model (re)loads and generation steps, and keep all session/viz state (motion, joints, contacts, reference motion, skin bind data, mesh rest poses) on CPU so the per-frame playback thread never touches the accelerator. Previously, concurrent MPS use by the playback/replan/server threads crashed the Metal driver (assertion or SIGSEGV after extended sessions). - Text encoder: load LLM2Vec from local adapter repos (TEXT_ENCODERS_DIR) with the base repointed at the ungated NousResearch mirror of Meta-Llama-3-8B-Instruct (the default meta-llama base is gated), and resolve local PEFT-adapter repos explicitly since transformers>=5 no longer follows adapter_config base_model_name_or_path when a config.json sits beside it. - Cast float64 skeleton buffers to float32 (float64 unsupported on MPS). - Skinning (lbs) follows the pose tensor's device. - run_demo_mac.sh: one-command launch; bootstraps text_encoders/ on first run (adapters gitignored).
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.
Summary
Enables the real-time interactive demo to run on macOS (Apple Silicon) using the MPS backend — no CUDA/TensorRT required. Closes #1.
Changes
Device support
ARDY_DEVICEoverride); text encoder runs on CPU. Demo launched with--no-compile(TensorRT unavailable on macOS).MPS thread-safety (fixes hard crashes)
lbs) follows the pose tensor's device.Text encoder without gated Llama access
TEXT_ENCODERS_DIR) with the base model repointed at the ungated, byte-identical mirrorNousResearch/Meta-Llama-3-8B-Instruct(the defaultmeta-llamabase is gated).llm2vec.py: transformers>=5 no longer followsadapter_config.base_model_name_or_pathwhen aconfig.jsonsits beside it.Usability
run_demo_mac.sh: one-command launch; bootstrapstext_encoders/on first run.Testing (macOS 15, M-series, 128 GB)
Notes
[trt]extra is CUDA-only; macOS installs usepip install -e ".[demo]".