qn_mg.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023-2024, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <cuml/common/logger.hpp>
18 #include <cuml/linear_model/qn.h>
19 
20 #include <cumlprims/opg/matrix/data.hpp>
21 #include <cumlprims/opg/matrix/part_descriptor.hpp>
22 #include <raft/core/comms.hpp>
23 
24 #include <cuda_runtime.h>
25 
26 #include <vector>
27 using namespace MLCommon;
28 
29 namespace ML {
30 namespace GLM {
31 namespace opg {
32 
40 template <typename T>
41 std::vector<T> getUniquelabelsMG(const raft::handle_t& handle,
42  Matrix::PartDescriptor& input_desc,
43  std::vector<Matrix::Data<T>*>& labels);
44 
59 template <typename T>
60 void qnFit(raft::handle_t& handle,
61  std::vector<Matrix::Data<T>*>& input_data,
62  Matrix::PartDescriptor& input_desc,
63  std::vector<Matrix::Data<T>*>& labels,
64  T* coef,
65  const qn_params& pams,
66  bool X_col_major,
67  bool standardization,
68  int n_classes,
69  T* f,
70  int* num_iters);
71 
91 template <typename T, typename I>
92 void qnFitSparse(raft::handle_t& handle,
93  std::vector<Matrix::Data<T>*>& input_values,
94  I* input_cols,
95  I* input_row_ids,
96  I X_nnz,
97  Matrix::PartDescriptor& input_desc,
98  std::vector<Matrix::Data<T>*>& labels,
99  T* coef,
100  const qn_params& pams,
101  bool standardization,
102  int n_classes,
103  T* f,
104  int* num_iters);
105 
106 }; // namespace opg
107 }; // namespace GLM
108 }; // namespace ML
Definition: kernelparams.h:21
std::vector< T > getUniquelabelsMG(const raft::handle_t &handle, Matrix::PartDescriptor &input_desc, std::vector< Matrix::Data< T > * > &labels)
Calculate unique class labels across multiple GPUs in a multi-node environment.
void qnFitSparse(raft::handle_t &handle, std::vector< Matrix::Data< T > * > &input_values, I *input_cols, I *input_row_ids, I X_nnz, Matrix::PartDescriptor &input_desc, std::vector< Matrix::Data< T > * > &labels, T *coef, const qn_params &pams, bool standardization, int n_classes, T *f, int *num_iters)
support sparse vectors (Compressed Sparse Row format) for MNMG logistic regression fit using quasi ne...
void qnFit(raft::handle_t &handle, std::vector< Matrix::Data< T > * > &input_data, Matrix::PartDescriptor &input_desc, std::vector< Matrix::Data< T > * > &labels, T *coef, const qn_params &pams, bool X_col_major, bool standardization, int n_classes, T *f, int *num_iters)
performs MNMG fit operation for the logistic regression using quasi newton methods
Definition: dbscan.hpp:30
Definition: qn.h:67