diff --git a/api/ccapi/include/layer.h b/api/ccapi/include/layer.h index 3aa6150af6..9eb884a88a 100644 --- a/api/ccapi/include/layer.h +++ b/api/ccapi/include/layer.h @@ -108,8 +108,8 @@ enum LayerType { LAYER_UPSAMPLE2D, /**< Upsample 2D Layer type */ LAYER_RMSNORM = ML_TRAIN_LAYER_TYPE_RMSNORM, /**, TransposeLayerCl::type, ml::train::LayerType::LAYER_TRANSPOSE); - + cc.registerFactory(nntrainer::createLayer, CustomLMHeadLayerCl::type, ml::train::LayerType::LAYER_LM_HEAD); diff --git a/nntrainer/layers/cl_layers/addition_layer_cl.h b/nntrainer/layers/cl_layers/addition_layer_cl.h index e5ad7c91cf..a2b8f55f67 100644 --- a/nntrainer/layers/cl_layers/addition_layer_cl.h +++ b/nntrainer/layers/cl_layers/addition_layer_cl.h @@ -35,7 +35,7 @@ class AdditionLayerCL : public Layer { /** * @brief Destructor of Addition Layer */ - ~AdditionLayerCL() {}; + ~AdditionLayerCL(){}; /** * @brief Move constructor of AdditionLayer. diff --git a/nntrainer/layers/cl_layers/custom_vocab_selection.cpp b/nntrainer/layers/cl_layers/custom_vocab_selection.cpp index 4b25bebb74..171942be99 100644 --- a/nntrainer/layers/cl_layers/custom_vocab_selection.cpp +++ b/nntrainer/layers/cl_layers/custom_vocab_selection.cpp @@ -32,21 +32,6 @@ nntrainer::VocabSelectionNNTrainer::VocabSelectionNNTrainer( this->lshBits = lshBlockNum * lshBlockSize; this->lshData = std::vector(this->vocabCnt * lshBlockNum); - // for (unsigned int i = 0; i < vocabCnt; ++i) { - // for (unsigned int j = 0; j < lshBlockNum; ++j) { - // unsigned int actualSize = std::min(lshBlockSize, hiddenSize - - // (int)j * lshBlockSize); lshDataBlock d; for (unsigned int k = 0; k - // < actualSize; ++k) { - // d[k] = weights.getValue<_FP16>(0, 0, i, j * lshBlockSize + k) > - // 0 ? 1 : 0; - // } - // for (unsigned int k = actualSize; k < lshBlockSize; ++k) { - // d[k] = 0; - // } - // this->lshData[i * lshBlockNum + j] = d; - // } - // } - for (unsigned int i = 0; i < lshBlockNum; ++i) { unsigned int actualSize = std::min(lshBlockSize, hiddenSize - (int)i * lshBlockSize); diff --git a/nntrainer/layers/cl_layers/custom_vocab_selection.h b/nntrainer/layers/cl_layers/custom_vocab_selection.h index af3536d105..4334679397 100644 --- a/nntrainer/layers/cl_layers/custom_vocab_selection.h +++ b/nntrainer/layers/cl_layers/custom_vocab_selection.h @@ -93,7 +93,7 @@ class VocabSelectionNNTrainer : public VocabSelection { /** * @brief Destructor of VocabSelectionNNTrainer class */ - ~VocabSelectionNNTrainer() {}; + ~VocabSelectionNNTrainer(){}; }; } // namespace nntrainer diff --git a/nntrainer/layers/cl_layers/lm_head_layer_cl.h b/nntrainer/layers/cl_layers/lm_head_layer_cl.h index f22e4195de..6378c6f778 100644 --- a/nntrainer/layers/cl_layers/lm_head_layer_cl.h +++ b/nntrainer/layers/cl_layers/lm_head_layer_cl.h @@ -80,7 +80,10 @@ class CustomLMHeadLayerCl : public LayerImpl { */ void finalize(nntrainer::InitLayerContext &context) override; - void initialize(nntrainer::RunLayerContext &context) override { + /** + * @copydoc Layer::intialize(RunLayerContext &context) + */ + void initialize(nntrainer::RunLayerContext &context) { auto use_vocab_selection = std::get(custom_lm_head_props).get(); @@ -123,7 +126,7 @@ class CustomLMHeadLayerCl : public LayerImpl { * @copydoc Layer::exportTo(Exporter &exporter, ExportMethods method) */ void exportTo(nntrainer::Exporter &exporter, - const ml::train::ExportMethods &method) const override {}; + const ml::train::ExportMethods &method) const override{}; /** * @copydoc Layer::getType()