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

Backend agnostic machine learning models #962

Merged
merged 43 commits into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ff2c3e5
cpu/gpu_classes and tests
sarahyurick Dec 7, 2022
b685108
style fix
sarahyurick Dec 7, 2022
069caa8
edit tests
sarahyurick Dec 7, 2022
f2c5d87
split up tests
sarahyurick Dec 8, 2022
4eedef7
remove failing gpu xgb tests
sarahyurick Dec 8, 2022
3f64c01
Apply suggestions from code review
sarahyurick Dec 8, 2022
1077aa6
edit tests
sarahyurick Dec 9, 2022
e5a6477
style fix
sarahyurick Dec 9, 2022
549afef
minor style fix
sarahyurick Dec 9, 2022
72c37ff
ignore flake8 import errors
sarahyurick Dec 9, 2022
a300b9d
maybe?
sarahyurick Dec 9, 2022
7704ce2
fixture stuff??
sarahyurick Dec 9, 2022
ab7cc08
remove fixture stuff lol
sarahyurick Dec 9, 2022
8269e56
skip python 3.8
sarahyurick Dec 9, 2022
bbf4dc6
Merge branch 'main' into agnostic_models
sarahyurick Dec 15, 2022
e43710d
reorder logic
sarahyurick Dec 15, 2022
9f49f58
Merge branch 'main' into agnostic_models
sarahyurick Dec 16, 2022
331cee0
update cuml paths
sarahyurick Dec 16, 2022
090d5a9
Merge branch 'main' into agnostic_models
sarahyurick Jan 18, 2023
ebaa2f5
Apply suggestions from code review
sarahyurick Jan 18, 2023
88169f1
remove xfail
sarahyurick Jan 20, 2023
c0d37ac
Merge branch 'main' into agnostic_models
ayushdg Jan 23, 2023
6311a39
Merge branch 'main' into agnostic_models
ayushdg Jan 24, 2023
a0d6b15
Merge branch 'main' into agnostic_models
sarahyurick Jan 25, 2023
e3f956c
use sklearn all_estimators
sarahyurick Jan 25, 2023
d0d07cf
util function and unit test
sarahyurick Jan 25, 2023
a1a45f4
edit cpu/gpu tests
sarahyurick Jan 25, 2023
63abe98
minor test updates
sarahyurick Jan 25, 2023
66af9bd
remove sys
sarahyurick Jan 25, 2023
ad8bf0e
Apply suggestions from code review
sarahyurick Jan 26, 2023
e1ca596
gpu_timeseries fixture
sarahyurick Jan 26, 2023
f61131e
modify check_trained_models
sarahyurick Jan 26, 2023
9425286
Refactor gpu_client fixture, consolidate model tests
charlesbluca Jan 27, 2023
4a30c3c
Merge branch 'main' into agnostic_models
sarahyurick Jan 27, 2023
23022a0
add dask_cudf=None
sarahyurick Jan 27, 2023
c96d4e8
fix test_predict_with_limit_offset
sarahyurick Jan 27, 2023
bfefe83
update xgboost test
sarahyurick Jan 27, 2023
84cec59
add_boosting_classes
sarahyurick Jan 30, 2023
0721c21
Merge branch 'main' into agnostic_models
sarahyurick Jan 30, 2023
c293562
link to issue
sarahyurick Jan 30, 2023
93ff0a1
Merge branch 'main' into agnostic_models
sarahyurick Jan 30, 2023
4717bde
logistic regression error
sarahyurick Jan 31, 2023
98c42d5
fix gpu test
sarahyurick Jan 31, 2023
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
11 changes: 11 additions & 0 deletions dask_sql/physical/rel/custom/create_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from dask_sql.datacontainer import ColumnContainer, DataContainer
from dask_sql.physical.rel.base import BaseRelPlugin
from dask_sql.physical.rel.custom.ml_classes import get_cpu_classes, get_gpu_classes
from dask_sql.utils import convert_sql_kwargs, import_class
sarahyurick marked this conversation as resolved.
Show resolved Hide resolved

if TYPE_CHECKING:
Expand All @@ -14,6 +15,9 @@

logger = logging.getLogger(__name__)

cpu_classes = get_cpu_classes()
gpu_classes = get_gpu_classes()


class CreateExperimentPlugin(BaseRelPlugin):
"""
Expand Down Expand Up @@ -147,6 +151,13 @@ def convert(self, rel: "LogicalPlan", context: "dask_sql.Context") -> DataContai
y = training_df[target_column]

if model_class and experiment_class:
if type(training_df) == dd.core.DataFrame:
model_class = cpu_classes.get(model_class, model_class)
experiment_class = cpu_classes.get(experiment_class, experiment_class)
elif "cudf" in str(training_df._partition_type):
model_class = gpu_classes.get(model_class, model_class)
experiment_class = gpu_classes.get(experiment_class, experiment_class)
sarahyurick marked this conversation as resolved.
Show resolved Hide resolved

try:
ModelClass = import_class(model_class)
except ImportError:
Expand Down
10 changes: 10 additions & 0 deletions dask_sql/physical/rel/custom/create_model.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import logging
from typing import TYPE_CHECKING

import dask.dataframe as dd
sarahyurick marked this conversation as resolved.
Show resolved Hide resolved
import numpy as np
from dask import delayed

from dask_sql.datacontainer import DataContainer
from dask_sql.physical.rel.base import BaseRelPlugin
from dask_sql.physical.rel.custom.ml_classes import get_cpu_classes, get_gpu_classes
from dask_sql.utils import convert_sql_kwargs, import_class
sarahyurick marked this conversation as resolved.
Show resolved Hide resolved

if TYPE_CHECKING:
Expand All @@ -14,6 +16,9 @@

logger = logging.getLogger(__name__)

cpu_classes = get_cpu_classes()
gpu_classes = get_gpu_classes()


class CreateModelPlugin(BaseRelPlugin):
"""
Expand Down Expand Up @@ -141,6 +146,11 @@ def convert(self, rel: "LogicalPlan", context: "dask_sql.Context") -> DataContai
X = training_df
y = None

if type(training_df) == dd.core.DataFrame:
model_class = cpu_classes.get(model_class, model_class)
elif "cudf" in str(training_df._partition_type):
model_class = gpu_classes.get(model_class, model_class)
sarahyurick marked this conversation as resolved.
Show resolved Hide resolved

try:
ModelClass = import_class(model_class)
except ImportError:
Expand Down
Loading