Skip to content

Commit 298d00d

Browse files
authored
fix: update cuda base image and base image docs (#5492)
* fix: update cuda base image and base image docs Signed-off-by: Frost Ming <[email protected]> * fix: replace xla_bridge import with backend for consistency Signed-off-by: Frost Ming <[email protected]> * fix: update expected output values for cancer model predictions Signed-off-by: Frost Ming <[email protected]> --------- Signed-off-by: Frost Ming <[email protected]>
1 parent 2ddb90e commit 298d00d

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

src/bentoml/_internal/bento/build_config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ def _convert_python_version(py_version: str | None) -> str | None:
6767
target_python_version = f"{major}.{minor}"
6868
if target_python_version != py_version:
6969
logger.warning(
70-
"BentoML will install the latest 'python%s' instead of the specified 'python%s'. To use the exact python version, use a custom docker base image. See https://docs.bentoml.com/en/latest/concepts/bento.html#custom-base-image-advanced",
70+
"BentoML will install the latest 'python%s' instead of the specified 'python%s'. "
71+
"To use the exact python version, use a custom docker base image. "
72+
"See https://docs.bentoml.com/en/latest/reference/bentoml/bento-build-options.html#docker-options-table",
7173
target_python_version,
7274
py_version,
7375
)

src/bentoml/_internal/container/frontend/dockerfile/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"supported_architectures": SUPPORTED_ARCHITECTURES,
9999
},
100100
"cuda": {
101-
"image": "nvidia/cuda:{spec_version}-cudnn8-runtime-ubuntu20.04",
101+
"image": "nvidia/cuda:{spec_version}-cudnn-runtime-ubuntu24.04",
102102
"supported_architectures": ["amd64", "arm64"],
103103
},
104104
"miniconda": {

src/bentoml/_internal/frameworks/flax.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@
2828
from flax import struct
2929
from flax.core import FrozenDict
3030
from jax._src.lib.xla_bridge import XlaBackend
31-
from jax.lib import xla_bridge
31+
from jax.extend import backend
3232

3333
from ...types import ModelSignature
3434
from .. import external_typing as ext
3535
from ..models.model import ModelSignaturesType
3636
from ..tag import Tag
3737
else:
38-
xla_bridge = LazyLoader("xla_bridge", globals(), "jax.lib.xla_bridge")
38+
backend = LazyLoader("backend", globals(), "jax.extend.backend")
3939

4040
try:
4141
from flax import linen as nn
@@ -267,7 +267,7 @@ class FlaxRunnable(bentoml.legacy.Runnable):
267267

268268
def __init__(self):
269269
super().__init__()
270-
self.device = xla_bridge.get_backend().platform
270+
self.device = backend.get_backend().platform
271271

272272
self.model, self.state_dict = load_model(bento_model, device=self.device)
273273
self.params = self.state_dict["params"]

tests/integration/frameworks/models/xgboost.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ def check_output(out: ext.NpNDArray):
6363
"predict": [
6464
Input(
6565
input_args=[np.array([cancer_data[0]])],
66-
expected=close_to([[0.9181239, 0.0818761]]),
66+
expected=close_to([[0.9075233, 0.09247671]]),
6767
),
6868
Input(
6969
input_args=[np.array([cancer_data[1]])],
70-
expected=close_to([[0.97593766, 0.02406229]]),
70+
expected=close_to([[[0.9710317, 0.02896825]]]),
7171
),
7272
],
7373
},
@@ -78,11 +78,11 @@ def check_output(out: ext.NpNDArray):
7878
"predict": [
7979
Input(
8080
input_args=[pd.DataFrame([cancer_data[0]])],
81-
expected=close_to([[0.9181239, 0.0818761]]),
81+
expected=close_to([[0.9075233, 0.09247671]]),
8282
),
8383
Input(
8484
input_args=[pd.DataFrame([cancer_data[1]])],
85-
expected=close_to([[0.97593766, 0.02406229]]),
85+
expected=close_to([[[0.9710317, 0.02896825]]]),
8686
),
8787
],
8888
},

0 commit comments

Comments
 (0)