Skip to content
Open
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: 3 additions & 1 deletion cpp/src/svm/kernelcache.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,9 @@ class KernelCache {
*/
void InitWorkingSet(const int* ws_idx)
{
ASSERT(cache_state != CacheState::WS_INITIALIZED, "Working set has already been initialized!");
// A block solve can produce no coefficient updates, in which case full-tile batching is
// skipped and the previous working set remains initialized. Replacing it is safe because
// no cache update is in progress.
ASSERT(cache_state != CacheState::BATCHING_INITIALIZED, "Previous batching step incomplete!");
this->ws_idx = ws_idx;
if (svmType == EPSILON_SVR) {
Expand Down
11 changes: 11 additions & 0 deletions python/cuml/tests/test_svm.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,17 @@ def test_svr_skl_cmp(params, dataset, n_rows, n_cols):
compare_svr(cuSVR, sklSVR, X_test, y_test)


def test_svr_poly_zero_delta_working_set():
X = np.arange(5, dtype=np.float32).reshape(-1, 1)
y = np.arange(5, dtype=np.float32)

model = cu_svm.SVR(kernel="poly", degree=10).fit(X, y)
pred = np.asarray(model.predict(np.array([[2.0]], dtype=np.float32)))

assert pred.shape == (1,)
assert np.isfinite(pred).all()


def test_svr_skl_cmp_weighted():
"""Compare to Sklearn SVR, use sample weights"""
X, y = make_regression(
Expand Down
Loading