Skip to content

Commit 8563bd4

Browse files
committed
Standardize on Python 3.11 and clarify architecture-specific requirements
- Renames requirements.linux.txt to requirements.amd64.txt - Renames requirements.macos.txt to requirements.arm64.txt - Updates build scripts to use Python 3.11 for all Ubuntu versions - Updates documentation to clarify architecture-specific requirements - Simplifies Python version configuration in build scripts
1 parent 686942a commit 8563bd4

File tree

5 files changed

+342
-25
lines changed

5 files changed

+342
-25
lines changed

.github/workflows/ubuntu-postgresml-python-package.yaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,8 @@ jobs:
3636
sudo add-apt-repository -y ppa:deadsnakes/ppa
3737
sudo apt update
3838
39-
# Install specific Python versions based on Ubuntu target
40-
if [[ "$UBUNTU_VERSION" == "20.04" ]]; then
41-
sudo apt install -y python3.8 python3.8-dev python3.8-venv
42-
elif [[ "$UBUNTU_VERSION" == "22.04" ]]; then
43-
sudo apt install -y python3.10 python3.10-dev python3.10-venv
44-
elif [[ "$UBUNTU_VERSION" == "24.04" ]]; then
45-
sudo apt install -y python3.12 python3.12-dev python3.12-venv
46-
fi
39+
# Install Python 3.11 for all Ubuntu versions for better dependency compatibility
40+
sudo apt install -y python3.11 python3.11-dev python3.11-venv
4741
4842
# Ensure pip is updated
4943
python3 -m pip install --upgrade pip setuptools wheel

packages/postgresml-python/build.sh

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ deb_dir="/tmp/postgresml-python/deb-build"
77
# Parse arguments with defaults
88
export PACKAGE_VERSION=${1:-"2.10.0"}
99
export UBUNTU_VERSION=${2:-"22.04"}
10-
export PYTHON_VERSION=${3:-"3.10"}
10+
export PYTHON_VERSION=${3:-"3.11"}
1111

1212
# Handle architecture
1313
if [[ $(arch) == "x86_64" ]]; then
@@ -16,16 +16,9 @@ else
1616
export ARCH=arm64
1717
fi
1818

19-
# Map Ubuntu versions to Python versions if needed
20-
# For example: Ubuntu 20.04 uses Python 3.8 by default
21-
declare -A ubuntu_python_versions=(
22-
["20.04"]="3.8"
23-
["22.04"]="3.10"
24-
["24.04"]="3.12"
25-
)
26-
19+
# We use Python 3.11 for all Ubuntu versions for better dependency compatibility
2720
if [[ -z "$3" ]]; then
28-
PYTHON_VERSION=${ubuntu_python_versions[$UBUNTU_VERSION]:-"3.10"}
21+
PYTHON_VERSION="3.11"
2922
fi
3023

3124
rm -rf "$deb_dir"
@@ -41,18 +34,18 @@ rm "$deb_dir/release.sh"
4134
(cat ${SCRIPT_DIR}/DEBIAN/postrm | envsubst '${PGVERSION} ${PYTHON_VERSION}') > "$deb_dir/DEBIAN/postrm"
4235

4336
if [[ "$ARCH" == "amd64" ]]; then
44-
cp ${SCRIPT_DIR}/../../pgml-extension/requirements.linux.txt "$deb_dir/etc/postgresml-python/requirements.txt"
37+
# Use AMD64-specific requirements (x86_64)
38+
cp ${SCRIPT_DIR}/../../pgml-extension/requirements.amd64.txt "$deb_dir/etc/postgresml-python/requirements.txt"
4539
else
46-
cp ${SCRIPT_DIR}/../../pgml-extension/requirements.macos.txt "$deb_dir/etc/postgresml-python/requirements.txt"
40+
# Use ARM64-specific requirements (aarch64)
41+
cp ${SCRIPT_DIR}/../../pgml-extension/requirements.arm64.txt "$deb_dir/etc/postgresml-python/requirements.txt"
4742
fi
4843

4944
virtualenv --python="python${PYTHON_VERSION}" "$deb_dir/var/lib/postgresml-python/pgml-venv"
5045
source "$deb_dir/var/lib/postgresml-python/pgml-venv/bin/activate"
5146

52-
# For Python 3.12, ensure PyTorch is installed first
53-
if [[ "${PYTHON_VERSION}" == "3.12" ]]; then
54-
python -m pip install torch
55-
fi
47+
# Install PyTorch first to help with dependency resolution
48+
python -m pip install torch
5649

5750
python -m pip install -r "${deb_dir}/etc/postgresml-python/requirements.txt"
5851

pgml-cms/docs/open-source/pgml/developers/installation.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,36 @@ virtualenv pgml-venv && \
7171
source pgml-venv/bin/activate && \
7272
pip install -r requirements.txt
7373
```
74+
75+
PostgresML has architecture-specific requirements files:
76+
- `requirements.amd64.txt` - For x86_64/AMD64 architectures
77+
- `requirements.arm64.txt` - For ARM64/aarch64 architectures
78+
79+
When building from source, use the appropriate file for your architecture:
80+
81+
```bash
82+
# For AMD64/x86_64 systems
83+
pip install -r requirements.amd64.txt
84+
85+
# For ARM64/aarch64 systems
86+
pip install -r requirements.arm64.txt
87+
```
88+
89+
These files contain frozen dependencies that have been tested with PostgresML. We recommend using Python 3.11 for optimal compatibility with all dependencies.
7490
{% endtab %}
7591

7692
{% tab title="Globally" %}
7793
Installing Python packages globally can cause issues with your system. If you wish to proceed nonetheless, you can do so:
7894

7995
```bash
80-
pip3 install -r requirements.txt
96+
# For AMD64/x86_64 systems
97+
pip3 install -r requirements.amd64.txt
98+
99+
# For ARM64/aarch64 systems
100+
pip3 install -r requirements.arm64.txt
81101
```
102+
103+
We recommend using Python 3.11 for optimal compatibility with all dependencies.
82104
{% endtab %}
83105
{% endtabs %}
84106

pgml-extension/requirements.amd64.txt

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
accelerate==1.2.1
2+
aiohappyeyeballs==2.4.4
3+
aiohttp==3.11.11
4+
aiohttp-cors==0.7.0
5+
aiosignal==1.3.2
6+
airportsdata==20241001
7+
annotated-types==0.7.0
8+
anyio==4.8.0
9+
astor==0.8.1
10+
attrs==24.3.0
11+
auto_gptq==0.7.1
12+
bitsandbytes==0.45.0
13+
blake3==1.0.2
14+
cachetools==5.5.0
15+
catboost==1.2.7
16+
certifi==2024.12.14
17+
charset-normalizer==3.4.1
18+
click==8.1.8
19+
cloudpickle==3.1.1
20+
colorama==0.4.6
21+
coloredlogs==15.0.1
22+
colorful==0.5.6
23+
compressed-tensors==0.8.1
24+
contourpy==1.3.1
25+
ctransformers==0.2.27
26+
cycler==0.12.1
27+
datasets==3.2.0
28+
deepspeed==0.16.2
29+
depyf==0.18.0
30+
dill==0.3.8
31+
diskcache==5.6.3
32+
distlib==0.3.9
33+
distro==1.9.0
34+
einops==0.8.0
35+
evaluate==0.4.3
36+
fastapi==0.115.6
37+
filelock==3.16.1
38+
fonttools==4.55.3
39+
frozenlist==1.5.0
40+
fsspec==2024.9.0
41+
gekko==1.2.1
42+
gguf==0.10.0
43+
google-api-core==2.24.0
44+
google-auth==2.37.0
45+
googleapis-common-protos==1.66.0
46+
graphviz==0.20.3
47+
greenlet==3.1.1
48+
grpcio==1.69.0
49+
h11==0.14.0
50+
hjson==3.1.0
51+
httpcore==1.0.7
52+
httptools==0.6.4
53+
httpx==0.28.1
54+
huggingface-hub==0.27.1
55+
humanfriendly==10.0
56+
idna==3.10
57+
importlib_metadata==8.5.0
58+
iniconfig==2.0.0
59+
interegular==0.3.3
60+
Jinja2==3.1.5
61+
jiter==0.8.2
62+
joblib==1.4.2
63+
jsonpatch==1.33
64+
jsonpointer==3.0.0
65+
jsonschema==4.23.0
66+
jsonschema-specifications==2024.10.1
67+
kiwisolver==1.4.8
68+
langchain==0.3.14
69+
langchain-core==0.3.29
70+
langchain-text-splitters==0.3.5
71+
langsmith==0.2.10
72+
lark==1.2.2
73+
lightgbm==4.5.0
74+
linkify-it-py==2.0.3
75+
lm-format-enforcer==0.10.9
76+
lxml==5.3.0
77+
markdown-it-py==3.0.0
78+
MarkupSafe==3.0.2
79+
matplotlib==3.10.0
80+
mdit-py-plugins==0.4.2
81+
mdurl==0.1.2
82+
memray==1.15.0
83+
mistral_common==1.5.1
84+
mpmath==1.3.0
85+
msgpack==1.1.0
86+
msgspec==0.19.0
87+
multidict==6.1.0
88+
multiprocess==0.70.16
89+
nest-asyncio==1.6.0
90+
networkx==3.4.2
91+
ninja==1.11.1.3
92+
numpy==1.26.4
93+
nvidia-cublas-cu12==12.4.5.8
94+
nvidia-cuda-cupti-cu12==12.4.127
95+
nvidia-cuda-nvrtc-cu12==12.4.127
96+
nvidia-cuda-runtime-cu12==12.4.127
97+
nvidia-cudnn-cu12==9.1.0.70
98+
nvidia-cufft-cu12==11.2.1.3
99+
nvidia-curand-cu12==10.3.5.147
100+
nvidia-cusolver-cu12==11.6.1.9
101+
nvidia-cusparse-cu12==12.3.1.170
102+
nvidia-ml-py==12.560.30
103+
nvidia-nccl-cu12==2.21.5
104+
nvidia-nvjitlink-cu12==12.4.127
105+
nvidia-nvtx-cu12==12.4.127
106+
openai==1.59.7
107+
opencensus==0.11.4
108+
opencensus-context==0.1.3
109+
opencv-python-headless==4.10.0.84
110+
optimum==1.23.3
111+
orjson==3.10.14
112+
outlines==0.1.11
113+
outlines_core==0.1.26
114+
packaging==24.2
115+
pandas==2.2.3
116+
partial-json-parser==0.2.1.1.post5
117+
peft==0.14.0
118+
pillow==10.4.0
119+
platformdirs==4.3.6
120+
plotly==5.24.1
121+
pluggy==1.5.0
122+
portalocker==3.1.1
123+
prometheus-fastapi-instrumentator==7.0.2
124+
prometheus_client==0.21.1
125+
propcache==0.2.1
126+
proto-plus==1.25.0
127+
protobuf==5.29.3
128+
psutil==6.1.1
129+
py-cpuinfo==9.0.0
130+
py-spy==0.4.0
131+
pyarrow==18.1.0
132+
pyasn1==0.6.1
133+
pyasn1_modules==0.4.1
134+
pybind11==2.13.6
135+
pycountry==24.6.1
136+
pydantic==2.10.5
137+
pydantic_core==2.27.2
138+
Pygments==2.19.1
139+
pyparsing==3.2.1
140+
pytest==8.3.4
141+
python-dateutil==2.9.0.post0
142+
python-dotenv==1.0.1
143+
pytz==2024.2
144+
PyYAML==6.0.2
145+
pyzmq==26.2.0
146+
ray==2.40.0
147+
referencing==0.35.1
148+
regex==2024.11.6
149+
requests==2.32.3
150+
requests-toolbelt==1.0.0
151+
rich==13.9.4
152+
rouge==1.0.1
153+
rpds-py==0.22.3
154+
rsa==4.9
155+
sacrebleu==2.5.1
156+
sacremoses==0.1.1
157+
safetensors==0.5.2
158+
scikit-learn==1.6.1
159+
scipy==1.15.1
160+
sentence-transformers==3.3.1
161+
sentencepiece==0.2.0
162+
six==1.17.0
163+
smart-open==7.1.0
164+
sniffio==1.3.1
165+
SQLAlchemy==2.0.37
166+
starlette==0.41.3
167+
sympy==1.13.1
168+
tabulate==0.9.0
169+
tenacity==9.0.0
170+
textual==1.0.0
171+
threadpoolctl==3.5.0
172+
tiktoken==0.7.0
173+
tokenizers==0.21.0
174+
torch==2.5.1
175+
torchaudio==2.5.1
176+
torchvision==0.20.1
177+
tqdm==4.67.1
178+
transformers==4.48.0
179+
transformers-stream-generator==0.0.5
180+
triton==3.1.0
181+
trl==0.13.0
182+
typing_extensions==4.12.2
183+
tzdata==2024.2
184+
uc-micro-py==1.0.3
185+
urllib3==2.3.0
186+
uvicorn==0.34.0
187+
uvloop==0.21.0
188+
virtualenv==20.28.1
189+
vllm==0.6.6.post1
190+
watchfiles==1.0.4
191+
websockets==14.1
192+
wrapt==1.17.2
193+
xformers==0.0.28.post3
194+
xgboost==2.1.3
195+
xgrammar==0.1.9
196+
xxhash==3.5.0
197+
yarl==1.18.3
198+
zipp==3.21.0

0 commit comments

Comments
 (0)