Skip to content

Commit

Permalink
Move data to gpu before training
Browse files Browse the repository at this point in the history
  • Loading branch information
avolkov-intel committed Oct 10, 2023
1 parent 5efce33 commit 2606a2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@ static train_result<Task> call_dal_kernel(const context_gpu& ctx,
//const Float tol = desc.get_tol();
//const std::int64_t maxiter = desc.get_max_iter();

// TODO: add check if the dataset can be moved to gpu
// Move data to gpu
pr::ndarray<Float, 2> data_nd = pr::table2ndarray<Float>(queue, data, sycl::usm::alloc::device);
table data_gpu = homogen_table::wrap(data_nd.flatten(queue, {}), sample_count, feature_count);

pr::LogLossFunction<Float> loss_func =
pr::LogLossFunction(queue, data, responses_nd, L2, fit_intercept, bsize);
pr::LogLossFunction(queue, data_gpu, responses_nd, L2, fit_intercept, bsize);

auto opt_ptr = get_optimizer<Float, Task>(desc);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ void run(sycl::queue& q) {
const auto y_test_filename = get_data_path("df_binary_classification_test_label.csv");

auto tm1 = std::chrono::steady_clock::now();
;

std::cout << "Loading dataset... ";

Expand Down

0 comments on commit 2606a2a

Please sign in to comment.