Shark-ML / Shark

The Shark Machine Leaning Library. See more:
http://shark-ml.github.io/Shark/
GNU Lesser General Public License v3.0
505 stars 131 forks source link

OpenBlas support #5

Closed skn123 closed 8 years ago

skn123 commented 9 years ago

I would like to submit a patch that would enable usage of OpenBlas. How do I go about doing this?

Ulfgard commented 9 years ago

Hi,

cool to see this! The easiest way is probably a pull request, then we can check it out, test and code-review this. I am really looking forward to this!

Ulfgard commented 8 years ago

Hey, what is the status about this? :)

skn123 commented 8 years ago

I am stuck at a very silly stage: I do not / am not able to send a "push_request" :( I am using Tortoise Git on windows

Ulfgard commented 8 years ago

Hi, okay, i try to help you setting this up. This might take a few minutes and as i do not use TortoiseGit i had to use all my googleFu skills :). It will be very helpful a i can give you detailed comments and see your commits etc :)

  1. on the top-right on https://github.com/Shark-ML/Shark/ , click on "fork" and fork the shark library into your account, this should lead to a fork at https://github.com/skn123/Shark
  2. next we need to point your local repository to your new fork so that you can upload your data to github: http://stackoverflow.com/questions/14503381/change-repo-url-in-tortoisegit
  3. For future usage you also want to keep our repository as your upstream reference to update your fork when needed. This link explains how that works: http://stackoverflow.com/questions/7297486/can-i-update-a-forked-project-on-git-to-the-original-master-copy
  4. after this you can just do a push to "origin" which is now your fork.
  5. on https://github.com/skn123/Shark you should see a green button with two arrows. this will create your pull request.

If you have any questions, do not hesitate to contact me!

skn123 commented 8 years ago

Wow; Now that has made my life easier. However, am I assured that any changes done in Shark-Master will also be reflected in my clone?

https://github.com/Shark-ML/Shark/pull/18

Most of the changes have been hacked from the folder "gotoblas" anyway

Ulfgard commented 8 years ago

Hej, sorry for the longer waiting time.

I took your code and tried to integrate it in our existing atlas/cblas code without duplication everything.

This can be found in pull-request #20.

Would you like to test whether this works in your local setup? i think you have to specify the CBLAS_PATH in cmake to find your installation of OpenBLAS.

regarding your question: you have to do a "git pull upstream" to get the changes in shark-master

skn123 commented 8 years ago

I will do that shortly...

skn123 commented 8 years ago

VS2015: Boost: 1.59 OpenBlas :- Latest code from GitHub

I think OpenBlas has no issues here; More related with Boost and a bug ticket filed earlier

Severity Code Description Project File Line Error C2668 'shark::size': ambiguous call to overloaded function shark F:\GItSources\Shark\src\Models\RNNet.cpp 46 Error C2668 'shark::size': ambiguous call to overloaded function shark F:\GItSources\Shark\src\Models\RNNet.cpp 42 Error C2668 'shark::size': ambiguous call to overloaded function shark F:\GItSources\Shark\src\Models\RNNet.cpp 43 Error C2668 'shark::size': ambiguous call to overloaded function shark F:\GItSources\Shark\src\Models\RNNet.cpp 47 Error C2668 'shark::size': ambiguous call to overloaded function shark F:\GItSources\Shark\src\Models\RNNet.cpp 49 Error C2668 'shark::size': ambiguous call to overloaded function shark F:\GItSources\Shark\src\Models\RNNet.cpp 93 Error C2668 'shark::size': ambiguous call to overloaded function shark F:\GItSources\Shark\src\Models\RNNet.cpp 95 Error C3203 'type': unspecialized class template can't be used as a template argument for template parameter 'T0', expected a real type shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\container\vector\detail\cpp03\preprocessed\as_vector10.hpp 62 Error C3203 'type': unspecialized class template can't be used as a template argument for template parameter 'T1', expected a real type shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\container\vector\detail\cpp03\preprocessed\as_vector10.hpp 62 Error C3203 'type': unspecialized class template can't be used as a template argument for template parameter 'T2', expected a real type shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\container\vector\detail\cpp03\preprocessed\as_vector10.hpp 62 Error C3203 'type': unspecialized class template can't be used as a template argument for template parameter 'T0', expected a real type shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\container\vector\detail\cpp03\preprocessed\as_vector10.hpp 62 Error C3203 'type': unspecialized class template can't be used as a template argument for template parameter 'T1', expected a real type shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\container\vector\detail\cpp03\preprocessed\as_vector10.hpp 62 Error C3203 'type': unspecialized class template can't be used as a template argument for template parameter 'T2', expected a real type shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\container\vector\detail\cpp03\preprocessed\as_vector10.hpp 62 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::kleeneboost::spirit::qi::alternative<boost::fusion::cons<boost::spirit::qi::sequence<boost::fusion::cons<boost::spirit::qi::any_real_parser<T,Policies,Cdr>>,boost::fusion::consboost::spirit::qi::sequence<boost::fusion::cons<boost::spirit::qi::literal_char<boost::spirit::char_encoding::standard,true,false,boost::fusion::cons<boost::spirit::qi::attrparser,boost::fusion::nil>>>,boost::fusion::nil_>>>>,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::lexeme_directive,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::alternativeboost::fusion::cons<boost::spirit::qi::eol_parser,Cdr>,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::kleeneboost::spirit::qi::sequence<boost::fusion::cons<boost::spirit::qi::alternative<boost::fusion::cons<boost::spirit::qi::any_real_parser<T,Policies,Cdr>>,boost::fusion::consboost::spirit::qi::literal_char<boost::spirit::charencoding::standard,true,false,boost::fusion::nil>>>>,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::lexeme_directive,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::alternativeboost::fusion::cons<boost::spirit::qi::eol_parser,Cdr>,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::any_int_parser<T,10,1,-1>,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::optionalboost::spirit::qi::sequence<boost::fusion::cons<boost::spirit::qi::literal_char<boost::spirit::char_encoding::standard,true,false,Cdr>>>,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37 Error C2039 'type': is not a member of 'boost::mpl::applyboost::fusion::detail::apply_transform_result<boost::spirit::traits::build_attribute_sequence<Elements,Context,boost::spirit::traits::sequence_attribute_transform,Iterator,boost::spirit::qi::domain::element_attribute>,boost::spirit::qi::kleeneboost::spirit::qi::sequence<boost::fusion::cons<boost::spirit::qi::any_uint_parser<T,10,1,-1,Cdr>>>,boost::mpl::na,boost::mpl::na,boost::mpl::na,boost::mpl::na>' shark G:\ThirdPartyLibraries_VS2015\64Bit\boost-1_59\include\boost-1_59\boost\fusion\view\transform_view\detail\value_of_impl.hpp 37

I think this relates to https://github.com/Shark-ML/Shark/issues/17

skn123 commented 8 years ago

Allright, here are my fixes Problems are in RNet.cpp size changed to shark::size As for the Boost issue; apparently, I had a previous definition -DBOOST_NO_CXX11_RVALUE_REFERENCES defined. Once I removed that, the problem did not appear

skn123 commented 8 years ago

And here is the output E:\Program_Files\VS2015\VC>G:\Binaries\VS2015\Shark\bin\Release\CVFolds.exe 0 0.0937711 1e-05 0.0883092 2e-05 0.0892161 3e-05 0.0892919 4e-05 0.0897327 5e-05 0.0909876 6e-05 0.0913523 7e-05 0.0921181 8e-05 0.092296 9e-05 0.0923556

RESULTS:

best validation error: 0.0883092 best regularization: 1e-05

So, I think you can merge your changes after an independent testing at your end

skn123 commented 8 years ago

Here is my CMake screenshot. I made my own changes to add Boost 1.59 and hdf5; but that is not relevant for this build

image

Ulfgard commented 8 years ago

thank you a lot for your help!