mirror of
https://github.com/elastic/eland.git
synced 2025-07-11 00:02:14 +08:00
[Backport 8.x] Upgrade PyTorch to 2.5.1 (#791)
PyTorch was upgraded to 2.5.1 in ml-cpp on the 8.18 and 9.0 branches in elastic/ml-cpp#2800
This commit is contained in:
parent
06cfa598d8
commit
55712a7dff
@ -18,7 +18,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
||||
python3 -m pip install \
|
||||
--no-cache-dir --disable-pip-version-check --extra-index-url https://download.pytorch.org/whl/cpu \
|
||||
torch==2.3.1+cpu .[all]; \
|
||||
torch==2.5.1+cpu .[all]; \
|
||||
else \
|
||||
python3 -m pip install \
|
||||
--no-cache-dir --disable-pip-version-check \
|
||||
|
@ -13,7 +13,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
|
||||
python3 -m pip install \
|
||||
--no-cache-dir --disable-pip-version-check --extra-index-url https://download.pytorch.org/whl/cpu \
|
||||
torch==2.3.1+cpu .[all]; \
|
||||
torch==2.5.1+cpu .[all]; \
|
||||
else \
|
||||
python3 -m pip install \
|
||||
--no-cache-dir --disable-pip-version-check \
|
||||
|
@ -237,13 +237,13 @@ def check_cluster_version(es_client, logger):
|
||||
)
|
||||
exit(1)
|
||||
|
||||
# PyTorch was upgraded to version 2.3.1 in 8.15.2
|
||||
# PyTorch was upgraded to version 2.5.1 in 8.18.0
|
||||
# and is incompatible with earlier versions
|
||||
if sem_ver < (8, 15, 2):
|
||||
if sem_ver < (8, 18, 0):
|
||||
import torch
|
||||
|
||||
logger.error(
|
||||
f"Eland uses PyTorch version {torch.__version__} which is incompatible with Elasticsearch versions prior to 8.15.2. Please upgrade Elasticsearch to at least version 8.15.2"
|
||||
f"Eland uses PyTorch version {torch.__version__} which is incompatible with Elasticsearch versions prior to 8.18.0. Please upgrade Elasticsearch to at least version 8.18.0"
|
||||
)
|
||||
exit(1)
|
||||
|
||||
|
2
setup.py
2
setup.py
@ -60,7 +60,7 @@ extras = {
|
||||
"lightgbm": ["lightgbm>=2,<4"],
|
||||
"pytorch": [
|
||||
"requests<3",
|
||||
"torch==2.3.1",
|
||||
"torch==2.5.1",
|
||||
"tqdm",
|
||||
"sentence-transformers>=2.1.0,<=2.7.0",
|
||||
# sentencepiece is a required dependency for the slow tokenizers
|
||||
|
@ -59,8 +59,8 @@ from tests import ES_VERSION
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.skipif(
|
||||
ES_VERSION < (8, 15, 1),
|
||||
reason="Eland uses Pytorch 2.3.1, versions of Elasticsearch prior to 8.15.1 are incompatible with PyTorch 2.3.1",
|
||||
ES_VERSION < (8, 18, 0),
|
||||
reason="Eland uses Pytorch 2.5.1, versions of Elasticsearch prior to 8.18.0 are incompatible with PyTorch 2.5.1",
|
||||
),
|
||||
pytest.mark.skipif(
|
||||
not HAS_SKLEARN, reason="This test requires 'scikit-learn' package to run"
|
||||
|
@ -39,8 +39,8 @@ from tests import ES_TEST_CLIENT, ES_VERSION
|
||||
|
||||
pytestmark = [
|
||||
pytest.mark.skipif(
|
||||
ES_VERSION < (8, 15, 2),
|
||||
reason="Eland uses Pytorch 2.3.1, versions of Elasticsearch prior to 8.15.2 are incompatible with PyTorch 2.3.1",
|
||||
ES_VERSION < (8, 18, 0),
|
||||
reason="Eland uses Pytorch 2.5.1, versions of Elasticsearch prior to 8.18.0 are incompatible with PyTorch 2.5.1",
|
||||
),
|
||||
pytest.mark.skipif(
|
||||
not HAS_SKLEARN, reason="This test requires 'scikit-learn' package to run"
|
||||
|
Loading…
x
Reference in New Issue
Block a user