Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade cuml from 23.06 to 23.08 in pytests and ci #353

Merged
merged 3 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_4.10.3-Linu
&& conda init

# install cuML
ARG CUML_VER=23.06
ARG CUML_VER=23.08
RUN conda install -y -c conda-forge mamba=1.4.9 libarchive && \
mamba install -y -c rapidsai -c nvidia -c conda-forge cuml=$CUML_VER python=3.9 cuda-toolkit=11.5 \
mamba install -y -c rapidsai-nightly -c nvidia -c conda-forge cuml=$CUML_VER python=3.9 cuda-toolkit=11.5 \
Copy link
Collaborator

@pxLi pxLi Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: rapids now use cuda-version pkg (https://anaconda.org/conda-forge/cuda-version/files) instead of cuda-toolkit to navigate the specific libcudf pkg (these 2 pkgs have diverged about version patterning)
https://github.com/rapidsai/cudf#conda, could try use cuda-version=11.8

Copy link
Collaborator Author

@lijinf2 lijinf2 Aug 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the comment! Cuml is still using cuda-toolkit in the release selector: https://docs.rapids.ai/install. Maybe we can stay with cuda-toolkit for now and try to use cuda-version after cuml adopts it.

Copy link
Collaborator

@pxLi pxLi Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think their page is out of date at least for 23.08 (not-released yet) rapidsai/cuml#5318 rapidsai/cudf#13615
but feel free to update it when needed

&& mamba clean --all -f -y
6 changes: 6 additions & 0 deletions python/src/spark_rapids_ml/regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ def _get_cuml_params_default(self) -> Dict[str, Any]:
return {
"algorithm": "eig",
"fit_intercept": True,
"copy_X": None,
"normalize": False,
"verbose": False,
"alpha": 0.0001,
Expand Down Expand Up @@ -498,6 +499,7 @@ def _single_fit(init_parameters: Dict[str, Any]) -> Dict[str, Any]:
"fit_intercept",
"normalize",
"verbose",
"copy_X",
]
else:
if init_parameters["l1_ratio"] == 0:
Expand Down Expand Up @@ -549,6 +551,10 @@ def _single_fit(init_parameters: Dict[str, Any]) -> Dict[str, Any]:
k: v for k, v in init_parameters.items() if k in supported_params
}

# cuml adds copy_X argument since 23.08
if "copy_X" in final_init_parameters:
final_init_parameters["copy_X"] = False

linear_regression = CumlLinearRegression(
handle=params[param_alias.handle],
output_type="cudf",
Expand Down
6 changes: 6 additions & 0 deletions python/tests/test_linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ def test_default_cuml_params() -> None:
[CumlLinearRegression, Ridge, CD], ["handle", "output_type"]
)
spark_params = LinearRegression()._get_cuml_params_default()

import cuml
from packaging import version

if version.parse(cuml.__version__) < version.parse("23.08.00"):
spark_params.pop("copy_X")
assert cuml_params == spark_params


Expand Down