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

Fix single-GPU build by separating multi-GPU decomposition utils from single GPU #4645

Merged
merged 6 commits into from
Mar 30, 2022
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
2 changes: 1 addition & 1 deletion conda/recipes/libcuml/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ build:

requirements:
build:
- cmake>=3.20.1
- cmake>=3.20.1,<3.23
host:
- nccl>=2.9.9
- cudf {{ minor_version }}
Expand Down
1 change: 1 addition & 0 deletions python/cuml/decomposition/base_mg.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import cuml.internals
from cuml.common.base import Base
from raft.common.handle cimport handle_t
from cuml.decomposition.utils cimport *
from cuml.decomposition.utils_mg cimport *
from cuml.common import input_to_cuml_array
from cuml.common.opg_data_utils_mg cimport *

Expand Down
10 changes: 5 additions & 5 deletions python/cuml/decomposition/pca_mg.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,16 @@ from cython.operator cimport dereference as deref

from cuml.common.array import CumlArray
import cuml.common.opg_data_utils_mg as opg

import cuml.internals
from cuml.common.base import Base
from raft.common.handle cimport handle_t
from cuml.decomposition.utils cimport *
from cuml.common.opg_data_utils_mg cimport *

from raft.common.handle cimport handle_t

from cuml.common.base import Base
from cuml.common.opg_data_utils_mg cimport *
from cuml.decomposition import PCA
from cuml.decomposition.base_mg import BaseDecompositionMG, MGSolver
from cuml.decomposition.utils cimport *
from cuml.decomposition.utils_mg cimport *


cdef extern from "cuml/decomposition/pca_mg.hpp" namespace "ML::PCA::opg":
Expand Down
9 changes: 6 additions & 3 deletions python/cuml/decomposition/tsvd_mg.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@ from libcpp cimport bool
from libc.stdint cimport uintptr_t, uint32_t, uint64_t
from cython.operator cimport dereference as deref

import cuml.internals
from cuml.common.base import Base
from raft.common.handle cimport handle_t
from cuml.decomposition.utils cimport *

import cuml.internals
import cuml.common.opg_data_utils_mg as opg

from cuml.common.base import Base
from cuml.common.opg_data_utils_mg cimport *
from cuml.decomposition.utils cimport *
from cuml.decomposition.utils_mg cimport *

from cuml.decomposition import TruncatedSVD
from cuml.decomposition.base_mg import BaseDecompositionMG
Expand Down
15 changes: 0 additions & 15 deletions python/cuml/decomposition/utils.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,3 @@ cdef extern from "cuml/decomposition/params.hpp" namespace "ML" nogil:
cdef cppclass paramsPCA(paramsTSVD):
bool copy
bool whiten

cdef extern from "cuml/decomposition/pca_mg.hpp" namespace "ML" nogil:

ctypedef enum mg_solver "ML::mg_solver":
COV_EIG_DQ "ML::mg_solver::COV_EIG_DQ"
COV_EIG_JACOBI "ML::mg_solver::COV_EIG_JACOBI"
QR "ML::mg_solver::QR"

cdef cppclass paramsTSVDMG(paramsSolver):
size_t n_components
mg_solver algorithm # = solver::COV_EIG_DQ

cdef cppclass paramsPCAMG(paramsTSVDMG):
bool copy
bool whiten
32 changes: 32 additions & 0 deletions python/cuml/decomposition/utils_mg.pxd
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
# Copyright (c) 2022, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from libcpp cimport bool
from cuml.decomposition.utils cimport *

cdef extern from "cuml/decomposition/params.hpp" namespace "ML" nogil:

ctypedef enum mg_solver "ML::mg_solver":
COV_EIG_DQ "ML::mg_solver::COV_EIG_DQ"
COV_EIG_JACOBI "ML::mg_solver::COV_EIG_JACOBI"
QR "ML::mg_solver::QR"

cdef cppclass paramsTSVDMG(paramsSolver):
size_t n_components
mg_solver algorithm # = solver::COV_EIG_DQ

cdef cppclass paramsPCAMG(paramsTSVDMG):
bool copy
bool whiten