allenai / allenai/olmes

Consider relaxing python library dependencies to make olmes easier to install

Đang mở
#38 0 bình luận 3 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
395
Fork
105
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

I've managed to install olmes with Docker on the `pytorch/pytorch:2.8.0-cuda12.8-cudnn9-devel` base image. But it's easy to fall off the easy path if your base image is even slightly different, such as if you have an image that uses f.ex. Python 3.13, numpy>=2.0 or later than PyTorch 2.8 version.

This can make it inconvenient to use olmes with models that are developed using slightly different package version. For example, if you're on Python 3.13, using `numpy<2` means it'll be installed from source instead of official wheel binaries, and the resulting build may not perform with good performance. or installation will fail due to missing system dependencies.

How strict do the package constraints need to be? Out of curiosity (and actual need too), I made some local changes to olmo and olmes, to make it run on Python 3.13 with PyTorch 2.9 and numpy 2.x. Below are notes on what I had to do for this. (I didn't test all the features and didn't look at results too closely, just that it basic examples from the README.md file worked.)

In my own case, I have a Docker image that comes with preinstalled Python 3.13 and PyTorch 2.9 built for Python 3.13. All our ML software runs on this and we'd like to use olmes in this same environment. Switching between environments makes it difficult to do both inference and eval.

## Docker installation

Assuming you're in f.ex. ~/work/olmes, that contains modified repo checkouts of olmo and olmos.

```
docker run --network host -it --rm --user $(id -u):$(id -g) -v `pwd`:/olmes nvcr.io/nvidia/pytorch:25.12-py3

cd /olmes
export HOME=`pwd`
pip install meson-python
pip install --no-build-isolation ./olmes
```

## olmo

Remove the torch<2 constraint.
```
diff --git a/pyproject.toml b/pyproject.toml
index b40cfb5a..93a890fa 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -13,7 +13,7 @@ authors = [
requires-python = ">=3.10"
license = { file = "LICENSE" }
dependencies = [
- "numpy<2",
+ "numpy>=2",
"torch>=2.1",
"ai2-olmo-core>=1.8.0",
"omegaconf",
```

## olmes

```
diff --git a/pyproject.toml b/pyproject.toml
index b9815ce..00a9c22 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -16,17 +16,17 @@ classifiers = [
authors = [
{name = "Allen Institute for Artificial Intelligence", email = "contact@allenai.org"}
]
-requires-python = ">=3.10,<3.13"
+requires-python = ">=3.12,<3.14"
dependencies = [
- "omegaconf==2.4.0.dev3", # Workaround for parse_latex in minerva_math to work
- "antlr4-python3-runtime==4.11", # Workaround for parse_latex in minerva_math to work
- "numpy<2", # Workaround for warning messages about compiled modules
- "datasets>=3,<4", # Dataset version 4 does not support trust_remote_code=True
- "transformers>=4.55.2,<=4.57.0", # Pinned for vLLM 0.11.0
+ "omegaconf==2.3.0",
+ "antlr4-python3-runtime==4.9.3",
+ "numpy>=2", # Workaround for warning messages about compiled modules
+ "datasets", # Dataset version 4 does not support trust_remote_code=True
+ "transformers", # Pinned for vLLM 0.11.0
"ai2-olmo-core[torchao]>=2.2", # For olmo-core native evaluation
"lm_eval==0.4.3", # Pin this to review changes, but will try to update to latest version
- "torch>=2.8.0,<2.9", # Pinned for vLLM 0.11.0
- "ai2-olmo @ git+https://github.com/allenai/OLMo.git@main", # need latest main for torch>=2.4
+ "torch",
+ "ai2-olmo @ file:///olmes/olmo", # use local olmo git checkout with local changes to remove numpy constraints
"olmes-docker @ git+https://github.com/allenai/olmes-docker.git@main",
"einops", # To run MPT models
"pygsheets",
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.