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

[REVIEW] Speeding up MNMG KNN Cl&Re testing #3052

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- PR #2906: Moving `linalg` decomp to RAFT namespaces
- PR #2996: Removing the max_depth restriction for switching to the batched backend
- PR #3004: Remove Single Process Multi GPU (SPMG) code
- PR #3052: Speeding up MNMG KNN Cl&Re testing

## Bug Fixes
- PR #2983: Fix seeding of KISS99 RNG
Expand Down
16 changes: 8 additions & 8 deletions python/cuml/test/dask/test_kneighbors_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ def dataset(request):
if len(new_x) >= request.param['n_samples']:
break
X = X[new_x]
noise = np.random.normal(0, 1.2, X.shape)
noise = np.random.normal(0, 5., X.shape)
X += noise
y = np.array(new_y)

return train_test_split(X, y, test_size=0.1)
return train_test_split(X, y, test_size=0.3)


def exact_match(output1, output2):
Expand Down Expand Up @@ -108,9 +108,9 @@ def check_probabilities(l_probas, d_probas):


@pytest.mark.parametrize("datatype", ['dask_array', 'dask_cudf'])
@pytest.mark.parametrize("n_neighbors", [1, 3, 8])
@pytest.mark.parametrize("n_parts", [2, 4, 12])
@pytest.mark.parametrize("batch_size", [128, 1024])
@pytest.mark.parametrize("n_neighbors", [8])
Copy link
Contributor

Choose a reason for hiding this comment

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

Testing the degrenerate n_neighbors=1 case to me seems important. I always like to test the extremes. What about doing mark_parametrize with a list of tuples, like:

[(1, 3, 256),
 (8, 8, 256),
 (9, 3, 128)]

Then you still only run 3 times but still examine the extremes

@pytest.mark.parametrize("n_parts", [2, 3, 8])
@pytest.mark.parametrize("batch_size", [256])
def test_predict_and_score(dataset, datatype, n_neighbors,
n_parts, batch_size, client):
X_train, X_test, y_train, y_test = dataset
Expand Down Expand Up @@ -165,9 +165,9 @@ def test_predict_and_score(dataset, datatype, n_neighbors,


@pytest.mark.parametrize("datatype", ['dask_array', 'dask_cudf'])
@pytest.mark.parametrize("n_neighbors", [1, 3, 8])
@pytest.mark.parametrize("n_parts", [2, 4, 12])
@pytest.mark.parametrize("batch_size", [128, 1024])
@pytest.mark.parametrize("n_neighbors", [8])
Copy link
Contributor

Choose a reason for hiding this comment

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

same note as above

@pytest.mark.parametrize("n_parts", [2, 3, 8])
@pytest.mark.parametrize("batch_size", [256])
def test_predict_proba(dataset, datatype, n_neighbors,
n_parts, batch_size, client):
X_train, X_test, y_train, y_test = dataset
Expand Down
10 changes: 5 additions & 5 deletions python/cuml/test/dask/test_kneighbors_regressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def dataset(request):
if len(new_x) >= request.param['n_samples']:
break
X = X[new_x]
noise = np.random.normal(0, 1.2, X.shape)
noise = np.random.normal(0, 5., X.shape)
X += noise
y = np.array(new_y, dtype=np.float32)

return train_test_split(X, y, test_size=0.1)
return train_test_split(X, y, test_size=0.3)


def exact_match(output1, output2):
Expand Down Expand Up @@ -102,9 +102,9 @@ def exact_match(output1, output2):


@pytest.mark.parametrize("datatype", ['dask_array', 'dask_cudf'])
@pytest.mark.parametrize("n_neighbors", [1, 3, 8])
@pytest.mark.parametrize("n_parts", [2, 4, 12])
@pytest.mark.parametrize("batch_size", [128, 1024])
@pytest.mark.parametrize("n_neighbors", [8])
@pytest.mark.parametrize("n_parts", [2, 3, 8])
@pytest.mark.parametrize("batch_size", [256])
def test_predict_and_score(dataset, datatype, n_neighbors,
n_parts, batch_size, client):
X_train, X_test, y_train, y_test = dataset
Expand Down