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

C++ compilation error with v0.12.3 and AVX-512F #188

Open
ankane opened this issue Oct 3, 2022 · 2 comments
Open

C++ compilation error with v0.12.3 and AVX-512F #188

ankane opened this issue Oct 3, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@ankane
Copy link

ankane commented Oct 3, 2022

Hey @bab2min,

Hope things are good with you! I'm working on updating the Ruby gem from 0.12.2 to 0.12.3, but am running into a few errors when -march=native is set on Linux and Mac with AVX-512F. The full logs are here, but I've tried to capture the relevant parts below:

Error 1

/home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/../Utils/EigenAddonOps.hpp:162:20: error: no matching function for call to ‘p_to_f32(const type&)’
  162 |     return p_to_f32(a);
      |            ~~~~~~~~^~~
In file included from /home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/LDAModel.hpp:5,
                 from /home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/CTModel.hpp:2,
                 from /home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/CTModel.cpp:1:
/home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/../Utils/EigenAddonOps.hpp:42:32: note: candidate: ‘Eigen::internal::Packet8f Eigen::internal::p_to_f32(const Packet8i&)’
   42 |   EIGEN_STRONG_INLINE Packet8f p_to_f32(const Packet8i& a)
      |                                ^~~~~~~~
/home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/../Utils/EigenAddonOps.hpp:42:57: note:   no known conversion for argument 1 from ‘const type’ {aka ‘const __vector(16) float’} to ‘const Packet8i&’ {aka ‘const __vector(4) long long int&’}
   42 |   EIGEN_STRONG_INLINE Packet8f p_to_f32(const Packet8i& a)
      |                                         ~~~~~~~~~~~~~~~~^
In file included from /home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/LDAModel.hpp:5,
                 from /home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/CTModel.hpp:2,
                 from /home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/CTModel.cpp:1:
/home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/../Utils/EigenAddonOps.hpp:77:32: note: candidate: ‘Eigen::internal::Packet4f Eigen::internal::p_to_f32(const Packet4i&)’
   77 |   EIGEN_STRONG_INLINE Packet4f p_to_f32(const Packet4i& a)
      |                                ^~~~~~~~
/home/runner/work/tomoto-ruby/tomoto-ruby/vendor/tomotopy/src/TopicModel/../Utils/EigenAddonOps.hpp:77:57: note:   no known conversion for argument 1 from ‘const type’ {aka ‘const __vector(16) float’} to ‘const Packet4i&’ {aka ‘const Eigen::internal::eigen_packet_wrapper<__vector(2) long long int, 0>&’}
   77 |   EIGEN_STRONG_INLINE Packet4f p_to_f32(const Packet4i& a)
      |                                         ~~~~~~~~~~~~~~~~^

Error 2

/home/runner/work/tomoto-ruby/tomoto-ruby/vendor/eigen/Eigen/src/Core/CoreEvaluators.h:944:58: error: cannot convert ‘Eigen::internal::mapbase_evaluator<Eigen::Map<Eigen::Matrix<int, -1, 1>, 0, Eigen::Stride<0, 0> >, Eigen::Matrix<int, -1, 1> >::PointerType’ {aka ‘int*’} to ‘const type*’ {aka ‘const float*’}
  944 |     return internal::ploadt<PacketType, LoadMode>(m_data + index * m_innerStride.value());

Error 3

/home/runner/work/tomoto-ruby/tomoto-ruby/vendor/eigen/Eigen/src/Core/CoreEvaluators.h:245:50: error: cannot convert ‘const int*’ to ‘const type*’ {aka ‘const float*’}
  245 |     return ploadt<PacketType, LoadMode>(m_d.data + index);
      |                                         ~~~~~~~~~^~~~~~~
      |                                                  |
      |                                                  const int*

It works great without -march=native/-mfma -mavx512f.

If you have any ideas, please let me know. If not, thanks for taking the time to read!

@bab2min
Copy link
Owner

bab2min commented Oct 3, 2022

Hi @ankane,
Actually tomotopy doesn't support AVX512 yet. I'm not sure how it was compiled well at 0.12.2 version.
I'll work to support AVX512 in the next update.
Thank you for your suggestion.

@bab2min bab2min added the enhancement New feature or request label Oct 3, 2022
@bab2min bab2min self-assigned this Oct 3, 2022
@ankane
Copy link
Author

ankane commented Oct 3, 2022

That was fast. Thanks as always @bab2min!

It looks like compiling with -march=native -mno-avx512f works, so can use that for Ruby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants