ceres-solver

ceres-solver

Member Since 8 years ago

Experience Points
0
follower
Lessons Completed
0
follow
Best Reply Awards
1
repos
Activity
May
22
1 day ago
May
21
2 days ago
push

keir push ceres-solver/ceres-solver

keir
keir

Enable postordering when computing the sparse factorization.

Previously when using a natural ordering, we had postordering turned off. This is not a good idea. Enabling postordering will also has the possibility of improving the size of the supernodes.

Change-Id: I8c270e54751b8bed53b38a0b461f647f5c8f5640

commit sha: d09f7e9d5e3bfab2d7ec7e81fd6a55786edca17a

push time in 1 day ago
started
started time in 2 days ago
May
20
3 days ago
Activity icon
issue

mzf-guest issue comment ceres-solver/ceres-solver

mzf-guest
mzf-guest

sphinx_rtd_theme not found if pip not installed

Dear Ceres developers,

While updating the Debian Ceres package to 2.1.0 version, I've figured out that the documentation is not built due to sphinx-rtd-theme not found. The theme has been installed locally with the associated Debian package, and pip is not available.

The root of the issue is the check in cmake/FindSphinx.cmake, which uses pip.

I would suggest to run import sphinx_rtd_theme instead which works for non-pip installation.

The patch could be found here: https://salsa.debian.org/science-team/ceres-solver/-/blob/master/debian/patches/fix_sphinx_detection.patch

Content:

--- a/cmake/FindSphinx.cmake
+++ b/cmake/FindSphinx.cmake
@@ -50,7 +50,7 @@
   if(PYTHONINTERP_FOUND)
     # Check for sphinx theme dependency for documentation
     execute_process(
-      COMMAND ${PYTHON_EXECUTABLE} -m pip show sphinx-rtd-theme
+      COMMAND ${PYTHON_EXECUTABLE} -c "import sphinx_rtd_theme"
       RESULT_VARIABLE SPHINX_RTD_THEME
       OUTPUT_QUIET
       ERROR_QUIET

Thanks, François

mzf-guest
mzf-guest

Hi @sandwichmaker!

Thanks for the prompt answer. All the patches in the debian/patches folder have the Forwarded: not-needed header which mean that they are Debian specific patches that should not be forwarded upstream. You can still review them in case of they may be useful for other specific usages.

Just let you know that Debian maintainers must forward the patches to upstream authors. This is in the Debian Social Contract "We will give back to the free software community": https://www.debian.org/social_contract.en.html So you should be directly contacted by Debian maintainers when a patch is relevant for upstream. This is what's happening right now :smile:

Best, François

Activity icon
issue

sandwichmaker issue comment ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

sphinx_rtd_theme not found if pip not installed

Dear Ceres developers,

While updating the Debian Ceres package to 2.1.0 version, I've figured out that the documentation is not built due to sphinx-rtd-theme not found. The theme has been installed locally with the associated Debian package, and pip is not available.

The root of the issue is the check in cmake/FindSphinx.cmake, which uses pip.

I would suggest to run import sphinx_rtd_theme instead which works for non-pip installation.

The patch could be found here: https://salsa.debian.org/science-team/ceres-solver/-/blob/master/debian/patches/fix_sphinx_detection.patch

Content:

--- a/cmake/FindSphinx.cmake
+++ b/cmake/FindSphinx.cmake
@@ -50,7 +50,7 @@
   if(PYTHONINTERP_FOUND)
     # Check for sphinx theme dependency for documentation
     execute_process(
-      COMMAND ${PYTHON_EXECUTABLE} -m pip show sphinx-rtd-theme
+      COMMAND ${PYTHON_EXECUTABLE} -c "import sphinx_rtd_theme"
       RESULT_VARIABLE SPHINX_RTD_THEME
       OUTPUT_QUIET
       ERROR_QUIET

Thanks, François

sandwichmaker
sandwichmaker

@mzf-guest I am curious about the other patches in that directory, are any of those also worth fixing upstream?

Activity icon
issue

sandwichmaker issue comment ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

sphinx_rtd_theme not found if pip not installed

Dear Ceres developers,

While updating the Debian Ceres package to 2.1.0 version, I've figured out that the documentation is not built due to sphinx-rtd-theme not found. The theme has been installed locally with the associated Debian package, and pip is not available.

The root of the issue is the check in cmake/FindSphinx.cmake, which uses pip.

I would suggest to run import sphinx_rtd_theme instead which works for non-pip installation.

The patch could be found here: https://salsa.debian.org/science-team/ceres-solver/-/blob/master/debian/patches/fix_sphinx_detection.patch

Content:

--- a/cmake/FindSphinx.cmake
+++ b/cmake/FindSphinx.cmake
@@ -50,7 +50,7 @@
   if(PYTHONINTERP_FOUND)
     # Check for sphinx theme dependency for documentation
     execute_process(
-      COMMAND ${PYTHON_EXECUTABLE} -m pip show sphinx-rtd-theme
+      COMMAND ${PYTHON_EXECUTABLE} -c "import sphinx_rtd_theme"
       RESULT_VARIABLE SPHINX_RTD_THEME
       OUTPUT_QUIET
       ERROR_QUIET

Thanks, François

sandwichmaker
sandwichmaker
Activity icon
issue

mzf-guest issue ceres-solver/ceres-solver

mzf-guest
mzf-guest

sphinx_rtd_theme not found if pip not installed

Dear Ceres developers,

While updating the Debian Ceres package to 2.1.0 version, I've figured out that the documentation is not built due to sphinx-rtd-theme not found. The theme has been installed locally with the associated Debian package, and pip is not available.

The root of the issue is the check in cmake/FindSphinx.cmake, which uses pip.

I would suggest to run import sphinx_rtd_theme instead which works for non-pip installation.

The patch could be found here: https://salsa.debian.org/science-team/ceres-solver/-/blob/master/debian/patches/fix_sphinx_detection.patch

Content:

--- a/cmake/FindSphinx.cmake
+++ b/cmake/FindSphinx.cmake
@@ -50,7 +50,7 @@
   if(PYTHONINTERP_FOUND)
     # Check for sphinx theme dependency for documentation
     execute_process(
-      COMMAND ${PYTHON_EXECUTABLE} -m pip show sphinx-rtd-theme
+      COMMAND ${PYTHON_EXECUTABLE} -c "import sphinx_rtd_theme"
       RESULT_VARIABLE SPHINX_RTD_THEME
       OUTPUT_QUIET
       ERROR_QUIET

Thanks, François

Activity icon
issue

sergiud issue comment ceres-solver/ceres-solver

sergiud
sergiud

Windows CI is broken.

cc: @sergiud

sergiud
sergiud

Ah yes. Sounds reasonable.

Activity icon
issue

sandwichmaker issue comment ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Windows CI is broken.

cc: @sergiud

sandwichmaker
sandwichmaker

Thats fair, my suggestion was only meant as a stop gap while FindSuiteSparse.cmake is modified.

Activity icon
issue

sergiud issue comment ceres-solver/ceres-solver

sergiud
sergiud

Windows CI is broken.

cc: @sergiud

sergiud
sergiud

CERES_NO_METIS is an option, yes but not really necessary. METIS detection/availability indicator needs to be added to CMake SuiteSparse as well. Ideally, we synchronize to further ensure compatibility between FindSuiteSparse.cmake and CMake support for SuiteSparse.

I suggest adding a Partition component to find_package (SuiteSparse). Its presence will indicate whether CHOLMOD was compiled with METIS support.

Activity icon
issue

sandwichmaker issue comment ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Windows CI is broken.

cc: @sergiud

sandwichmaker
sandwichmaker

So for now just add a CERES_NO_METIS to the build? @alexsmac is planning on adding metis detection to the suitesparse cmake files.

Activity icon
issue

sergiud issue comment ceres-solver/ceres-solver

sergiud
sergiud

Windows CI is broken.

cc: @sergiud

sergiud
sergiud

SuiteSparse on Windows is built without METIS whereas Ceres assumes METIS is available. Fixing the issue requires some adjustments of the CMake support for SuiteSparse as well as refactoring in Ceres directly since there's no METIS detection mechanism yet.

Activity icon
fork

stslinux forked ceres-solver/ceres-solver

⚡ A large scale non-linear optimization library
stslinux Updated
fork time in 2 days ago
started
started time in 3 days ago
May
19
4 days ago
push

keir push ceres-solver/ceres-solver

keir
keir

Unbreak the build on MacOS

Change-Id: I9144a84842baf1921b8d5808983d8d4e7cde747a

commit sha: 9b34ecef1cb879603ce5e6c2af9a55ac7215daa0

push time in 3 days ago
Activity icon
issue

sandwichmaker issue ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Add nested dessection based fill-reducing ordering when using CX_SPARSE

The matlab code that ships with CXSparse contains a MATLAB implementation of nested dissection using some of the lower level routines in CXSparse. One would have to port that to c/c++ and call it for this to work.

Activity icon
issue

sandwichmaker issue ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Add support for Metis based nested dissection when using EIGEN_SPARSE

Nested Dissection is available as an unsupported module in Eigen.

Activity icon
issue

sandwichmaker issue ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Add support for Nested Dissection when using ACCELERATE_SPARSE

Activity icon
issue

sandwichmaker issue ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Add support for nested dissection based orderings to sparse cholesky

Support for METIS and possibly mongoose.

cc: @NeroBurner

Activity icon
issue

sandwichmaker issue ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Using ceres and GTSAM at the same time, the program is stuck in the update function of the gtsam optimizer and cannot jump out.

Hello, I implemented a SLAM algorithm based on factor graph optimization on ubuntu18.04. I used GTSAM4.0.0 and ceres2.0.0 in one node at the same time. After compiling, when the algorithm is executed to the update( of the isam optimizer in gtsam ) function, it will be stuck in the update function and cannot be jumped out, as if it has fallen into an infinite loop, but the program does not report an error. If ceres is not compiled, the update function of gtsam can be used normally. Do you know what is the reason for this, or how to avoid it.

Activity icon
issue

sandwichmaker issue ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Bazel build does not include all relevant .cc files

Using the built-in BUILD file, the listing of tiles in bazel/ceres.bzl is incorrect and yields a library that is missing several destructor implementations (CostFunction, EvaluationCallback, IterationCallback) and some classes: DenseQR

Local patching yielded the following diff:

diff --git a/bazel/ceres.bzl b/bazel/ceres.bzl
index fad2754f..c76e23ae 100644
--- a/bazel/ceres.bzl
+++ b/bazel/ceres.bzl
@@ -32,8 +32,8 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
     "accelerate_sparse.cc",
     "array_utils.cc",
     "block_evaluate_preparer.cc",
-    "block_jacobian_writer.cc",
     "block_jacobi_preconditioner.cc",
+    "block_jacobian_writer.cc",
     "block_random_access_dense_matrix.cc",
     "block_random_access_diagonal_matrix.cc",
     "block_random_access_matrix.cc",
@@ -53,10 +53,13 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
     "context_impl.cc",
     "coordinate_descent_minimizer.cc",
     "corrector.cc",
+    "cost_function.cc",
     "covariance.cc",
     "covariance_impl.cc",
+    "cxsparse.cc",
     "dense_cholesky.cc",
     "dense_normal_cholesky_solver.cc",
+    "dense_qr.cc",
     "dense_qr_solver.cc",
     "dense_sparse_matrix.cc",
     "detect_structure.cc",
@@ -65,25 +68,30 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
     "dynamic_compressed_row_sparse_matrix.cc",
     "dynamic_sparse_normal_cholesky_solver.cc",
     "eigensparse.cc",
+    "evaluation_callback.cc",
     "evaluator.cc",
     "file.cc",
+    "first_order_function.cc",
+    "float_cxsparse.cc",
+    "float_suitesparse.cc",
     "function_sample.cc",
     "gradient_checker.cc",
     "gradient_checking_cost_function.cc",
     "gradient_problem.cc",
     "gradient_problem_solver.cc",
-    "is_close.cc",
     "implicit_schur_complement.cc",
     "inner_product_computer.cc",
+    "is_close.cc",
+    "iteration_callback.cc",
     "iterative_refiner.cc",
     "iterative_schur_complement_solver.cc",
     "levenberg_marquardt_strategy.cc",
     "line_search.cc",
     "line_search_direction.cc",
     "line_search_minimizer.cc",
+    "line_search_preprocessor.cc",
     "linear_least_squares_problems.cc",
     "linear_operator.cc",
-    "line_search_preprocessor.cc",
     "linear_solver.cc",
     "local_parameterization.cc",
     "loss_function.cc",
@@ -92,6 +100,7 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
     "minimizer.cc",
     "normal_prior.cc",
     "parallel_for_cxx.cc",
+    "parallel_for_nothreads.cc",
     "parallel_for_openmp.cc",
     "parallel_utils.cc",
     "parameter_block_ordering.cc",
Activity icon
issue

sandwichmaker issue comment ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

Bazel build does not include all relevant .cc files

Using the built-in BUILD file, the listing of tiles in bazel/ceres.bzl is incorrect and yields a library that is missing several destructor implementations (CostFunction, EvaluationCallback, IterationCallback) and some classes: DenseQR

Local patching yielded the following diff:

diff --git a/bazel/ceres.bzl b/bazel/ceres.bzl
index fad2754f..c76e23ae 100644
--- a/bazel/ceres.bzl
+++ b/bazel/ceres.bzl
@@ -32,8 +32,8 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
     "accelerate_sparse.cc",
     "array_utils.cc",
     "block_evaluate_preparer.cc",
-    "block_jacobian_writer.cc",
     "block_jacobi_preconditioner.cc",
+    "block_jacobian_writer.cc",
     "block_random_access_dense_matrix.cc",
     "block_random_access_diagonal_matrix.cc",
     "block_random_access_matrix.cc",
@@ -53,10 +53,13 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
     "context_impl.cc",
     "coordinate_descent_minimizer.cc",
     "corrector.cc",
+    "cost_function.cc",
     "covariance.cc",
     "covariance_impl.cc",
+    "cxsparse.cc",
     "dense_cholesky.cc",
     "dense_normal_cholesky_solver.cc",
+    "dense_qr.cc",
     "dense_qr_solver.cc",
     "dense_sparse_matrix.cc",
     "detect_structure.cc",
@@ -65,25 +68,30 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
     "dynamic_compressed_row_sparse_matrix.cc",
     "dynamic_sparse_normal_cholesky_solver.cc",
     "eigensparse.cc",
+    "evaluation_callback.cc",
     "evaluator.cc",
     "file.cc",
+    "first_order_function.cc",
+    "float_cxsparse.cc",
+    "float_suitesparse.cc",
     "function_sample.cc",
     "gradient_checker.cc",
     "gradient_checking_cost_function.cc",
     "gradient_problem.cc",
     "gradient_problem_solver.cc",
-    "is_close.cc",
     "implicit_schur_complement.cc",
     "inner_product_computer.cc",
+    "is_close.cc",
+    "iteration_callback.cc",
     "iterative_refiner.cc",
     "iterative_schur_complement_solver.cc",
     "levenberg_marquardt_strategy.cc",
     "line_search.cc",
     "line_search_direction.cc",
     "line_search_minimizer.cc",
+    "line_search_preprocessor.cc",
     "linear_least_squares_problems.cc",
     "linear_operator.cc",
-    "line_search_preprocessor.cc",
     "linear_solver.cc",
     "local_parameterization.cc",
     "loss_function.cc",
@@ -92,6 +100,7 @@ CERES_SRCS = ["internal/ceres/" + filename for filename in [
     "minimizer.cc",
     "normal_prior.cc",
     "parallel_for_cxx.cc",
+    "parallel_for_nothreads.cc",
     "parallel_for_openmp.cc",
     "parallel_utils.cc",
     "parameter_block_ordering.cc",
sandwichmaker
sandwichmaker

This is fixed at head now. sorry for taking so long.

push

keir push ceres-solver/ceres-solver

keir
keir

Remove Solver::Options::use_postordering

This was an ill-advised and complicated to interpret option which offers nothing particularly useful.

Change-Id: Ia7741ed62ef977c96fa52299a884e404bee659ac

commit sha: 8ba8fbb173db5a1e01feeafe875c1f04839fd97b

push time in 3 days ago
push

keir push ceres-solver/ceres-solver

keir
keir

Fix the ceres.bzl to add missing cc files.

Thanks to [email protected] for pointing this out and offering a fix.

Also add a TODO about an odd loop in covariance_impl.cc which was revealed as I was testing the bazel build

https: //github.com/ceres-solver/ceres-solver/issues/800 Change-Id: I87d17155ee43ea2a52b8031177d6b3ac5ae1460a

commit sha: 30b4d5df354ee2fc286b936a948a322b66aff9c5

push time in 3 days ago
Activity icon
issue

joydeep-b issue comment ceres-solver/ceres-solver

joydeep-b
joydeep-b

build error!!

Hey, When I build ceres, I got a trouble as follows:

CMake Error at internal/ceres/CMakeLists.txt:145 (add_test): Error evaluating generator expression:

$<TARGET_FILE:cuda_dense_cholesky_test>

No target "cuda_dense_cholesky_test"

totally having no idea, please give me a hand !

joydeep-b
joydeep-b

Interesting. The target is defined in internal/ceres/CMakeLists.txt:465.

Yes, @feiyu12138 could you please share the output of running cmake?

Activity icon
issue

sandwichmaker issue comment ceres-solver/ceres-solver

sandwichmaker
sandwichmaker

build error!!

Hey, When I build ceres, I got a trouble as follows:

CMake Error at internal/ceres/CMakeLists.txt:145 (add_test): Error evaluating generator expression:

$<TARGET_FILE:cuda_dense_cholesky_test>

No target "cuda_dense_cholesky_test"

totally having no idea, please give me a hand !

sandwichmaker
sandwichmaker

cc: @joydeep-b can you share what your cmake configuration log looks like?

push

keir push ceres-solver/ceres-solver

keir
keir

Add Nested Dissection based fill reducing ordering

With this change, the user can now choose between Approximate Minimum Degree and Nested Dissection as a fill reducing algorithm when using a sparse direct factorization based linear solver like SPARSE_NORMAL_CHOLESKY or SPARSE_SCHUR.

Currenly only SUITE_SPARSE is supported. It requires that SuiteSparse be compiled with Metis support enabled.

On most problems AMD is still the better choice, but in some cases like the grid3D dataset from https://lucacarlone.mit.edu/datasets/ the solution time with AMD is 57s and with NESDIS 38 on my M1 Mac.

On some other problems at Google we have observed speedups of 10x, there is also a corresponding decrease in the total amount of memory used.

This patch is based on the original work done by NeroBurner in https://ceres-solver-review.googlesource.com/c/ceres-solver/+/20580

  1. Add a new enum to the public api LinearSolverOrderingType and a setting Solver::Options::linear_solver_ordering_type.
  2. TrustRegionPreprocessor had some complicated logic which determined when linear solvers should reorder their matrices on their own and not this has been refactored into a more readable function that lives inside reorder_program.h/cc.
  3. Plumbing in reorder_program.cc and trust_region_processor.cc to use nested dissection.
  4. Update bundle_adjuster.cc to use nested dissection.

Change-Id: I388b027934f86c58b4da2b65a4fa5204ea73bf40

commit sha: 39ec5e8f99c595226ab3cd760d4945e61c31fc57

push time in 3 days ago
Previous