Skip to content

Conversation

@constracktor
Copy link
Member

Adding HPX backend on hpx::for_each and hpx::experimental::for_loop
Includes:

  • train, predict with HPX backend
  • tests for HPX backend

@breyerml
Copy link
Member

breyerml commented Nov 8, 2024

Missing changes:

  • add the HPX CSVM to the Python bindings and update the Python bindings README accordingly.
  • add HPX to the CMake install components
  • add HPX as CMake preset
  • update the README to add the HPX backend
  • add the HPX header to the .clang-format file and reformat all files accordingly
  • add the HPX directories to the docs/resources/dirs.dox file
  • add the HPX namespace documentation to the core.hpp file
  • add HPX as possible backend to the detail/cmd/parser_train.hpp and detail/cmd/parser_predict.hpp backend variable documentation
  • add the HPX backend flag to the TEST_P(ParserTrainBackend, parsing) and TEST_P(ParserPredictBackend, parsing) tests

@constracktor constracktor force-pushed the hpx_start branch 2 times, most recently from ecb1323 to e305450 Compare November 9, 2024 11:24
@constracktor
Copy link
Member Author

@breyerml I think except formatting the code with clang-format I checked everything on the list.

@breyerml
Copy link
Member

@breyerml I think except formatting the code with clang-format I checked everything on the list.

I've updated the develop branch with an auto-formatting workflow. Please rebase this branch and fix the formatting errors accordingy.

@breyerml
Copy link
Member

What would be the minimum HPX version that we need that supports all used features?

@breyerml
Copy link
Member

	3967 - HPXCSVM.blas_level_3_kernel_explicit (Failed)
	3968 - HPXCSVM.calculate_w (Failed)
	5409 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/linear.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)0> >> (Failed)
	5410 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/linear.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)0> >> (Failed)
	5411 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/linear.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)0> >> (Failed)
	5412 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/polynomial.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)1> >> (Failed)
	5413 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/polynomial.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)1> >> (Failed)
	5414 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/polynomial.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)1> >> (Failed)
	5415 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/rbf.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)2> >> (Failed)
	5416 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/rbf.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)2> >> (Failed)
	5417 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/rbf.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)2> >> (Failed)
	5418 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/sigmoid.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)3> >> (Failed)
	5419 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/sigmoid.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)3> >> (Failed)
	5420 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/sigmoid.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)3> >> (Failed)
	5421 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/laplacian.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)4> >> (Failed)
	5422 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/laplacian.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)4> >> (Failed)
	5423 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/laplacian.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)4> >> (Failed)
	5424 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/chi_squared.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)5> >> (Failed)
	5425 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/chi_squared.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)5> >> (Failed)
	5426 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/chi_squared.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)5> >> (Failed)

With HPX 1.9.1 and GCC 12.2.0 all these tests fail due to a Segmentation Fault.

@breyerml
Copy link
Member

/data/scratch/breyerml/PLSSVM_hpx/docs/resources/dirs.dox:333: warning: No matching directory found for command \dir include/plssvm/backends/hpx/
/data/scratch/breyerml/PLSSVM_hpx/docs/resources/dirs.dox:345: warning: No matching directory found for command \dir include/plssvm/backends/hpx/detail/
/data/scratch/breyerml/PLSSVM_hpx/docs/resources/dirs.dox:357: warning: No matching directory found for command \dir include/plssvm/backends/hpx/kernel/
/data/scratch/breyerml/PLSSVM_hpx/docs/resources/dirs.dox:369: warning: No matching directory found for command \dir include/plssvm/backends/hpx/kernel/cg_explicit/
/data/scratch/breyerml/PLSSVM_hpx/docs/resources/dirs.dox:381: warning: No matching directory found for command \dir include/plssvm/backends/hpx/kernel/cg_implicit/

When enabling the documentation target, these warnings appear -> the directory names should be HPX instead of hpx.

Additionally, please document the constructor and destructor for the scope_guard struct.

@breyerml
Copy link
Member

HPX is missing in the cmake/plssvm/plssvmConfig.cmake.in file.

@breyerml
Copy link
Member

HPX requires a call to the respective initialization functions. How is this or can this be handled in the Python bindings?

@constracktor
Copy link
Member Author

What would be the minimum HPX version that we need that supports all used features?

HPX version 1.9.0 since hpx::post was introduced here. We could try to use something different to support older versions. But I do not think that is necessary.

@breyerml
Copy link
Member

What would be the minimum HPX version that we need that supports all used features?

HPX version 1.9.0 since hpx::post was introduced here. We could try to use something different to support older versions. But I do not think that is necessary.

Does it make sense than to change find_package(HPX) to find_package(HPX 1.9.0) if this is support by HPX's CMake integration?

@constracktor
Copy link
Member Author

	3967 - HPXCSVM.blas_level_3_kernel_explicit (Failed)
	3968 - HPXCSVM.calculate_w (Failed)
	5409 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/linear.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)0> >> (Failed)
	5410 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/linear.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)0> >> (Failed)
	5411 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/linear.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)0> >> (Failed)
	5412 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/polynomial.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)1> >> (Failed)
	5413 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/polynomial.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)1> >> (Failed)
	5414 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/polynomial.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)1> >> (Failed)
	5415 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/rbf.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)2> >> (Failed)
	5416 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/rbf.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)2> >> (Failed)
	5417 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/rbf.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)2> >> (Failed)
	5418 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/sigmoid.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)3> >> (Failed)
	5419 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/sigmoid.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)3> >> (Failed)
	5420 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/sigmoid.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)3> >> (Failed)
	5421 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/laplacian.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)4> >> (Failed)
	5422 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/laplacian.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)4> >> (Failed)
	5423 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/laplacian.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)4> >> (Failed)
	5424 - HPXCSVMKernelFunction.assemble_kernel_matrix_explicit<HPXCSVMKernelFunction/chi_squared.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)5> >> (Failed)
	5425 - HPXCSVMKernelFunction.blas_level_3_kernel_implicit<HPXCSVMKernelFunction/chi_squared.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)5> >> (Failed)
	5426 - HPXCSVMKernelFunction.predict_values<HPXCSVMKernelFunction/chi_squared.  # TypeParam = util::test_parameter<util::type_list<>,util::value_list<(plssvm::kernel_function_type)5> >> (Failed)

With HPX 1.9.1 and GCC 12.2.0 all these tests fail due to a Segmentation Fault.

This is related to the hpx::execution::par(_unseq) policy. When using hpx::execution::seq all tests pass. However, the parallel execution policy does not segfault for the plssvm-train(predict) executables.

@constracktor constracktor force-pushed the hpx_start branch 4 times, most recently from 225ea27 to 292f889 Compare November 13, 2024 21:15
@constracktor
Copy link
Member Author

@breyerml I think except formatting the code with clang-format I checked everything on the list.

I've updated the develop branch with an auto-formatting workflow. Please rebase this branch and fix the formatting errors accordingy.

Code is now formatted. The git patch artifact works like a charm!

@constracktor
Copy link
Member Author

HPX requires a call to the respective initialization functions. How is this or can this be handled in the Python bindings?

HPX runtime functionalities are added to the new environment.hpp dummy structure.

@breyerml breyerml merged commit 385b9b4 into SC-SGS:develop Nov 28, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants