Inconstant results with multi-thread solver

39 views
Skip to first unread message

Weipeng Xu

unread,
Aug 20, 2016, 5:30:00 AM8/20/16
to Ceres Solver
Dear all,

I've got a problem while using multi-thread in Ceres: The outputs of the solver are not constant, even given the same initialization, when I set option.num_threads > 1.
I was wondering what's the reason for this, and how to solve it.

Best,
Weipeng

Sameer Agarwal

unread,
Aug 20, 2016, 9:53:56 AM8/20/16
to Ceres Solver
Wiepeng,
The problem is that floating point operations give different results depending on the order in which you perform the operations due to round off and conditioning.

Sameer


--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/e24e3f5d-48b5-40dd-b5bf-ba1389aa3dad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Weipeng Xu

unread,
Aug 20, 2016, 12:25:37 PM8/20/16
to Ceres Solver
Hi Sameer,

thank you for your answer. It seems that the result with "num_thread = 1" is much better than those out of the multi-thread manner. Does this mean that I have to sacrifice speed for better performance, vice versa?


Best,
Weipeng

Sameer Agarwal

unread,
Aug 20, 2016, 12:31:17 PM8/20/16
to Ceres Solver

Speed for determinism yes.
This is also indicative that your problem is poorly conditioned. Scaling the problem to be better behaved will reduce this problem.


--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.

Weipeng Xu

unread,
Aug 20, 2016, 12:34:00 PM8/20/16
to Ceres Solver
I see. Thank you.
Reply all
Reply to author
Forward
0 new messages