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

Crash when SimdComparison calls SIMD instructions #8668

Closed
xiaodai1002 opened this issue Feb 4, 2024 · 3 comments
Closed

Crash when SimdComparison calls SIMD instructions #8668

xiaodai1002 opened this issue Feb 4, 2024 · 3 comments
Labels
bug Something isn't working triage Newly created issue that needs attention.

Comments

@xiaodai1002
Copy link
Contributor

Bug description

the core stack
#0 0x950b1e5 in _mm256_loadu_si256(long long __vector(4) const*) /gcc-9.2.1/lib/gcc/x86_64-unknown-linux-gnu/9/include/avxintrin.h:922
#1 0x950b1e5 in xsimd::batch<long, xsimd::fma3xsimd::avx2 > xsimd::kernel::load_unaligned<xsimd::fma3xsimd::avx2, long, void>(long const*, xsimd::kernel::convert, xsimd::avx const&) /_build/release/_deps/xsimd-src/include/xsimd/types/../arch/./xsimd_avx.hpp:863
#2 0x950b1e5 in xsimd::batch<long, xsimd::fma3xsimd::avx2 > xsimd::batch<long, xsimd::fma3xsimd::avx2 >::
load_unaligned(long const*) /_build/release/_deps/xsimd-src/include/xsimd/types/xsimd_batch.hpp:629
#3 0x950b1e5 in loadSimdData<long int, false> /presto-native-execution/velox/velox/functions/prestosql/Comparisons.cpp:38
#4 0x950b1e5 in applySimdComparison<long int, false, false> /presto-native-execution/velox/velox/functions/prestosql/Comparisons.cpp:56
#5 0x950b1e5 in applyComparison<(facebook::velox::TypeKind)4> /presto-native-execution/velox/velox/functions/prestosql/Comparisons.cpp:152
#6 0x950b1e5 in operator() /presto-native-execution/velox/velox/functions/prestosql/Comparisons.cpp:200
#7 0x950b1e5 in apply /presto-native-execution/velox/velox/functions/prestosql/Comparisons.cpp:200

System information

System: Linux-3.10.0-327..x86_64
Arch: x86_64
C++ Compiler: /opt/rh/devtoolset-9/root/bin/g++
C++ Compiler Version: 9.3.1
C Compiler: /opt/rh/devtoolset-9/root/bin/gcc
C Compiler Version: 9.3.1

Relevant logs

No response

@xiaodai1002 xiaodai1002 added bug Something isn't working triage Newly created issue that needs attention. labels Feb 4, 2024
@kgpai
Copy link
Contributor

kgpai commented Feb 8, 2024

Can you make sure your system supports avx @xiaodai1002 ?
Can you post results of cat /proc/cpuinfo ?

@xiaodai1002
Copy link
Contributor Author

xiaodai1002 commented Feb 20, 2024

Can you make sure your system supports avx @xiaodai1002 ? Can you post results of cat /proc/cpuinfo ?

Sorry for not seeing the message in time. I have already fixed it. The diff is
diff --git a/velox/functions/prestosql/Comparisons.cpp b/velox/functions/prestosql/Comparisons.cpp
index 61dc49ced..0e2bbbdee 100644
--- a/velox/functions/prestosql/Comparisons.cpp
+++ b/velox/functions/prestosql/Comparisons.cpp
@@ -52,7 +52,7 @@ struct SimdComparator {
if constexpr (numScalarElements == 2 || numScalarElements == 4) {
for (auto i = begin; i < vectorEnd; i += 8) {
rawResult[i / 8] = 0;

  •    for (auto j = 0; j < 8 && j < vectorEnd; j += numScalarElements) {
    
  •    for (auto j = 0; j < 8 && (i + j) < vectorEnd; j += numScalarElements) {
         auto left = loadSimdData<T, isLeftConstant>(rawLhs, i + j);
         auto right = loadSimdData<T, isRightConstant>(rawRhs, i + j);
    

I want to submit a pull request, so I send a email to velox@meta.com to join velox project , but no reply received, can you help me, Thanks!

@kgpai
Copy link
Contributor

kgpai commented Feb 21, 2024

What problem are you seeing when you try and submit a pull request ?

Joe-Abraham pushed a commit to Joe-Abraham/velox that referenced this issue Jun 7, 2024
…tor#8820)

Summary:
Fixes facebookincubator#8668

Pull Request resolved: facebookincubator#8820

Reviewed By: Yuhta

Differential Revision: D54454632

Pulled By: kgpai

fbshipit-source-id: 08f6f98f151c2a7c2b80f6b414159ce49a52faca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Newly created issue that needs attention.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants