Repository navigation
feat(setup): a macOS/Intel checkout setup and verification path - #948
Conversation
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.
|
Merged. The useful thing here is not the pin, it is that the pin is written down with the reason. Two decisions I want to note because they are the right ones:
I read The Merged with #940, which also touches |
`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.
A plain
git cloneon 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 averification run; every download cache stays inside the checkout.
verify/laya_smoke_test.py, so nosecond copy of the end-to-end check is added.
LOCAL_SETUP.md-- the host, the pinned stack, the checkpoint manifest, what eachverify/harness covers, and the numbers measured on an Intel Mac Pro, CPU and MPS.the "Running from this checkout" path, and a doc map.
.gitignore-- the local artifacts the setup writes.tests/test_packaging.py-- skip.hf-cachewhen scanning markdown, since the setupdownloads third-party dataset cards there.
tests/test_packaging.py,test_doc_tables.pyandtest_env_docs.pypass, andbash -n setup_laya.shis clean. The latency numbers are from the AMD Radeon Pro Vega IIin that host; the script itself is not Intel-specific.