Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving to Eigen #5

Open
bchretien opened this issue Mar 9, 2016 · 6 comments
Open

Moving to Eigen #5

bchretien opened this issue Mar 9, 2016 · 6 comments

Comments

@bchretien
Copy link
Member

The subject of SCH's port to Eigen was raised yesterday, so here's an issue to keep track of any related information (cc @francois-keith ). IIRC, this was not investigated much more because of a possible impact on performance (the benchmark_eigen branch is still available).

@francois-keith
Copy link
Member

I had a version a bit more advanced than the one in the benchmark_eigen, that I rebased on the current jrl-umi3218/sch-core/master here:
https://github.com/francois-keith/sch-core/tree/eigen3

Be aware that the shared_tests must also be updated. I didn't push on https://github.com/jrl-umi3218/sch-shared-tests, so you'll have to pull it manually (or import the commit into this repo).
francois-keith/sch-shared-tests@c81bf19

Please note that one all the eigen-related optimizations may not have been added in the commit francois-keith/sch-core@ccf05008f2a759, and that one of the unit test is failing because of a precision issue.

(Edit: correct markdown)

@gergondet
Copy link
Member

To ease the test/development of this branch I've pushed a eigen3 branch on both sch-core and sch-shared-tests. example 2 is failing on eigen3 but I'm not sure why (when I run the test itself I don't get any errors)

For the moment, the difference in performance is significant.

This is what I get on my machine for sch-core master branch:

Running tests...
/usr/bin/ctest --force-new-ctest-process 
Test project /tmp/sch-core/build
    Start 1: example0
1/7 Test #1: example0 .........................   Passed    0.00 sec
    Start 2: example1
2/7 Test #2: example1 .........................   Passed    0.00 sec
    Start 3: example2
3/7 Test #3: example2 .........................   Passed    0.02 sec
    Start 4: test_animation
4/7 Test #4: test_animation ...................   Passed    1.74 sec
    Start 5: test_precision
5/7 Test #5: test_precision ...................   Passed    1.65 sec
    Start 6: test_general
6/7 Test #6: test_general .....................   Passed    0.02 sec
    Start 7: test_random
7/7 Test #7: test_random ......................   Passed   27.62 sec

100% tests passed, 0 tests failed out of 7

Total Test time (real) =  31.05 sec

And on the eigen3 branch

Running tests...
/usr/bin/ctest --force-new-ctest-process 
Test project /home/gergondet/devel-src/multi-contact/sch-core/build
    Start 1: example0
1/7 Test #1: example0 .........................   Passed    0.00 sec
    Start 2: example1
2/7 Test #2: example1 .........................***Failed    0.00 sec
    Start 3: example2
3/7 Test #3: example2 .........................   Passed    0.02 sec
    Start 4: test_animation
4/7 Test #4: test_animation ...................   Passed    3.59 sec
    Start 5: test_precision
5/7 Test #5: test_precision ...................   Passed    3.65 sec
    Start 6: test_general
6/7 Test #6: test_general .....................   Passed    0.02 sec
    Start 7: test_random
7/7 Test #7: test_random ......................   Passed   83.43 sec

86% tests passed, 1 tests failed out of 7

Total Test time (real) =  90.72 sec

The following tests FAILED:
          2 - example1 (Failed)
Errors while running CTest

Both were built using CMAKE_BUILD_TYPE=Release and no further options.

@gergondet
Copy link
Member

See also, the travis build on eigen3 branch (with a more explicit error on example2):

https://travis-ci.org/jrl-umi3218/sch-core/builds/114952762

And the latest master build:

https://travis-ci.org/jrl-umi3218/sch-core/builds/94802666

This exhibits similar performance differences.

@bchretien
Copy link
Member Author

A quick comparison with valgrind/perf may help pinpoint which matrix operation leads to such differences.

@gergondet
Copy link
Member

After running further tests, the difference in performance mainly comes down to differences in IO performance for Eigen and sch own matrix type. See this simple benchmark.

I disable the OUTPUT_FILE feature by default in shared-tests since the files are not used for the tests and I get comparable results on my machine for both branches.

Finer tests are required to know estimate the performance impact (if any).

@bchretien also evoked the idea of checking sch-core code for FPE, this might give more information to go one way or the other

@gergondet
Copy link
Member

I've cleaned up the eigen3 branch quite a bit.

  • No FPE (except for FP_INEXACT) there is one than can be triggered on the random test if rand() returns 0
  • On my machine I don't see any meaningful difference between the two branches but the travis build is saying otherwise :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants