Skip to content

feat(setup): a macOS/Intel checkout setup and verification path - #948

Merged
NandhaKishorM merged 1 commit into
NandhaKishorM:mainfrom
thread3d:feat/macos-intel-local-setup
Oct 5, 2026
Merged

NandhaKishorM merged 1 commit into
NandhaKishorM:mainfrom
thread3d:feat/macos-intel-local-setup

Conversation

@thread3d

@thread3d thread3d commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

A plain git clone on macOS -- Intel especially -- resolves a stack that cannot run:
PyTorch's last x86_64 wheel is 2.2.2, transformers 5.x wants torch >= 2.4, and torch
2.2.2 predates NumPy 2. This adds the pieces that pin that stack and prove it works.

  • setup_laya.sh -- idempotent venv, pinned deps (torch==2.2.2,
    transformers==4.57.6, numpy<2), editable install, the three checkpoints, and a
    verification run; every download cache stays inside the checkout.
  • the setup script and README drive the existing verify/laya_smoke_test.py, so no
    second copy of the end-to-end check is added.
  • LOCAL_SETUP.md -- the host, the pinned stack, the checkpoint manifest, what each
    verify/ harness covers, and the numbers measured on an Intel Mac Pro, CPU and MPS.
  • README -- the automatic CUDA -> MPS -> CPU order, a macOS/Intel section with the pin,
    the "Running from this checkout" path, and a doc map.
  • .gitignore -- the local artifacts the setup writes.
  • tests/test_packaging.py -- skip .hf-cache when scanning markdown, since the setup
    downloads third-party dataset cards there.

tests/test_packaging.py, test_doc_tables.py and test_env_docs.py pass, and
bash -n setup_laya.sh is clean. The latency numbers are from the AMD Radeon Pro Vega II
in that host; the script itself is not Intel-specific.

A plain `git clone` on macOS -- Intel especially -- resolves a stack that cannot run:
PyTorch's last x86_64 wheel is 2.2.2, transformers 5.x wants torch >= 2.4, and torch
2.2.2 predates NumPy 2. Add the pieces that pin it and prove it works:

* `setup_laya.sh` -- idempotent venv, pinned deps, editable install, the three
  checkpoints, and a verification run, keeping every download cache inside the checkout.
* the setup script and README drive the existing `verify/laya_smoke_test.py`, so no
  second copy of the end-to-end check is added.
* `LOCAL_SETUP.md` -- the host, the pinned stack, the checkpoint manifest, what each
  `verify/` harness covers, and the numbers measured on an Intel Mac Pro (CPU and MPS).
* README -- the automatic CUDA -> MPS -> CPU order, a macOS/Intel section with the pin,
  the "Running from this checkout" path, and a doc map.
* `.gitignore` -- the local artifacts the setup writes (`models/`, `.hf-cache/`,
  `.pip-cache/`, harness output).
* `tests/test_packaging.py` -- skip `.hf-cache` when scanning markdown, since the setup
  downloads third-party dataset cards there.
@NandhaKishorM
NandhaKishorM merged commit c8a469f into NandhaKishorM:main Oct 5, 2026
30 checks passed
@NandhaKishorM

Copy link
Copy Markdown
Owner

Merged.

The useful thing here is not the pin, it is that the pin is written down with the reason. pip install laya on an Intel Mac resolving torch 2.2.2 against a transformers that wants 2.4 is not obvious from any error message you get, and the next person hits it from scratch.

Two decisions I want to note because they are the right ones:

  • Driving the existing verify/laya_smoke_test.py from the script and the README rather than adding a second end-to-end check. A second copy would have drifted from the first.
  • Keeping every download cache inside the checkout. That is what makes the script safe to run twice and safe to delete.

I read setup_laya.sh in full before merging, since a setup script is the kind of file that gets copied without reading. It is a venv, four pinned pip installs from PyPI, an editable install of the checkout, the checkpoints, and a verification run. No curl | sh, no sudo, nothing fetched from outside PyPI and the Hub.

The tests/test_packaging.py change is right too: .hf-cache holds third-party dataset cards that the markdown scan has no business asserting on.

Merged with #940, which also touches tests/test_packaging.py, with no conflict. All 81 suites pass on the merged tree, and the ONNX extra question your #947 raises is answered over there rather than here.

thread3d added a commit to thread3d/laya that referenced this pull request Oct 6, 2026
`pip install laya[onnx]` resolves `onnx`, whose `ml-dtypes` dependency pulls NumPy 2.
torch below 2.3 is built against NumPy 1.x and raises "Numpy is not available" when it
converts a tensor against 2.x, which `predict()` needs for its final `.numpy()`. The
package declares `torch>=2.0.0`, so the extra should not force a NumPy the declared
floor cannot use.

Scope the cap with an environment marker rather than a blanket `numpy<2`: a hard upper
cap binds every `laya[onnx]` install, including the many on a current torch, and makes
the extra unresolvable next to any package that requires `numpy>=2`. The marker names
the stack this actually affects -- the macOS/Intel checkout (NandhaKishorM#948), where torch tops
out at 2.2.2 and NumPy 1.26 satisfies onnx, onnxruntime and onnxscript anyway.
@thread3d
thread3d deleted the feat/macos-intel-local-setup branch October 6, 2026 10:13
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