Skip to content

Commit

Permalink
add hp
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandr-Solovev committed Oct 26, 2023
1 parent 200203c commit 70f8c4c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,17 @@ static compute_result<Task> call_daal_kernel_finalize(const context_cpu& ctx,
const auto daal_nobs_matrix = interop::convert_to_daal_table<Float>(input.get_partial_n_rows());

auto result = compute_result<Task>{}.set_result_options(desc.get_result_options());
auto rows_count_global =
row_accessor<const Float>(input.get_partial_n_rows()).pull({ 0, -1 })[0];
daal_covariance::internal::Hyperparameter daal_hyperparameter;
/// the logic of block size calculation is copied from DAAL,
/// to be changed to passing the values from the performance model
std::int64_t blockSize = 140;
if (ctx.get_enabled_cpu_extensions() == dal::detail::cpu_extension::avx512) {
//const std::int64_t row_count = data.get_row_count();
//if (5000 < row_count && row_count <= 50000) {
blockSize = 1024;
//}
const std::int64_t row_count = rows_count_global;
if (5000 < row_count && row_count <= 50000) {
blockSize = 1024;
}
}
interop::status_to_exception(
daal_hyperparameter.set(daal_covariance::internal::denseUpdateStepBlockSize, blockSize));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,19 @@ static train_result<Task> call_daal_kernel_finalize_train(const context_cpu& ctx
const auto daal_eigenvalues =
interop::convert_to_daal_homogen_table(arr_eigval, 1, component_count);

auto rows_count_global =
row_accessor<const Float>(input.get_partial_n_rows()).pull({ 0, -1 })[0];
auto arr_means = array<Float>::empty(column_count);
const auto daal_means = interop::convert_to_daal_homogen_table(arr_means, 1, column_count);
daal_cov::internal::Hyperparameter daal_hyperparameter;
/// the logic of block size calculation is copied from DAAL,
/// to be changed to passing the values from the performance model
std::int64_t blockSize = 140;
if (ctx.get_enabled_cpu_extensions() == dal::detail::cpu_extension::avx512) {
//const std::int64_t row_count = data.get_row_count();
//if (5000 < row_count && row_count <= 50000) {
blockSize = 1024;
//}
const std::int64_t row_count = rows_count_global;
if (5000 < row_count && row_count <= 50000) {
blockSize = 1024;
}
}
interop::status_to_exception(
daal_hyperparameter.set(daal_cov::internal::denseUpdateStepBlockSize, blockSize));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2020 Intel Corporation
* Copyright 2023 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2020 Intel Corporation
* Copyright 2023 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down

0 comments on commit 70f8c4c

Please sign in to comment.