google / array_record

Apache License 2.0
69 stars 14 forks source link

Build for M2 Macs #85

Open Krystex opened 11 months ago

Krystex commented 11 months ago

Right now, it's not possible to install array_record on M2 Macs (got here via this repo being a dependency of keras_cv).

Are there any plans to add MacOS support? There's this pull request but I seems to be abandoned.

BeeGass commented 10 months ago

I also was having this issue. To add to what @Krystex and these issues:

Im going to put some information, maybe it can help.

Issue:

Lack of ARM64 (Apple Silicon) Compatibility for array-record

Description

I am encountering an issue with installing array-record on an ARM64 architecture (Apple Silicon Mac). My project depends on array-record, either directly or through transitive dependencies, and the lack of an ARM64-compatible version is causing installation failures.

Environment

Steps to Reproduce

  1. Attempt to install array-record version 0.5.0 on an ARM64 Mac using Poetry.

    
    • Installing array-record (0.5.0): Failed
    
    RuntimeError
    
    Unable to find installation candidates for array-record (0.5.0)
    
    at ~/Library/Application Support/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/chooser.py:73 in choose_for
       69│
       70│             links.append(link)
       71│
       72│         if not links:
    →  73│             raise RuntimeError(f"Unable to find installation candidates for {package}")
       74│
       75│         # Get the best link
       76│         chosen = max(links, key=lambda link: self._sort_key(package, link))
       77│

Cannot install array-record.

2. The installation process fails due to the unavailability of an ARM64-compatible version of array-record.

## Extra
The issue lies within etils using array-record and array-record doesnt have a distribution for the ARM64 architecture so it fails, 
https://pypi.org/project/array-record/#files

## Poetry
Here is my `.toml` for reproducability:
```toml
[tool.poetry.dependencies]
python = ">=3.9.0,<=3.9.18"
jaxtyping = "^0.2.11"
tqdm = "^4.66.1"
gin-config = "^0.5.0"

[tool.poetry.group.mltools]
optional = true

[tool.poetry.group.mltools.dependencies]
numpy = "^1.23.1"
wheel = "^0.37.0"
ml-dtypes = "0.2.0"
scipy = "^1.9.0"
einops = "^0.5.0"
wandb = "^0.13.5"

[tool.poetry.group.dataset]
optional = true

[tool.poetry.group.dataset.dependencies]
tensorflow-macos = {version = "^2.12.0", platform = "darwin"}
tensorflow-datasets = "^4.6.0"

[tool.poetry.group.torch]
optional = true

[tool.poetry.group.torch.dependencies]
torch = "^1.13.1"
torchvision = "^0.14.1"
functorch = "^1.13.1"

[tool.poetry.group.jax]
optional = true

[tool.poetry.group.jax.dependencies]
jax-metal = { version = "^0.0.4", markers = "platform_machine == 'arm64'" }
flax = "^0.5.2"
optax = "^0.1.3"
orbax = "^0.1.9"

[tool.poetry.group.jupyter]
optional = true

[tool.poetry.group.jupyter.dependencies]
notebook = "^6.4.12"
jupyter = "^1.0.0"
ipykernel = "^6.15.1"
ipython = "^8.4.0"
requests = "^2.31.0"
matplotlib = "^3.8.2"

[tool.poetry.group.additional]
optional = true

[tool.poetry.group.additional.dependencies]
black = {extras = ["jupyter"], version = "^22.6.0"}
pre-commit = "^2.20.0"
pytest = "^7.1.3"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
BeeGass commented 8 months ago

Is there a potential for this to be developed further?

vyeevani commented 2 weeks ago

I've started a new PR: https://github.com/google/array_record/pull/118. If you don't want to wait for it to get merged, you can try the releases on my fork here: https://github.com/vyeevani/array_record. There isn't huge code changes here so I'm fairly confident in it working but feel free to file issues on the PR or my fork and I'll take a look