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

HDDS-10477. Make Rocksdb tools native lib compatible with all chipset with the same arch #6341

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hadoop-hdds/rocks-native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@
<arg line="${project.build.directory}/rocksdb/rocksdb-${rocksdb.version}"/>
</exec>
<exec executable="make" dir="${project.build.directory}/rocksdb/rocksdb-${rocksdb.version}" failonerror="true">
<arg line="PORTABLE=1"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RocksDB does not use PORTABLE=0 so there is still some information missing as to what is the build setup.
For now pushing this in makes sense as we are seeing crashes for missing AVX4 but we still need to continue looking into what is the lowest common set of instruction set the build should support or at least quantify the performance impact. @swamirishi can you open a follow up Jira? Also, how was this change tested?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .so from the publicly distributed rocksdbjni-7.7.3.jar doesn't seem to be AVX or AVX2 optimized:

$ elfx86exts librocksdbjni-linux64.so 
File format and CPU architecture: Elf, X86_64
MODE64 (call)
CMOV (cmovbe)
SSE1 (movups)
SSE2 (movdqa)
BMI (tzcnt)
BMI2 (shlx)
Instruction set extensions used: BMI, BMI2, CMOV, MODE64, SSE1, SSE2
CPU Generation: Haswell

<arg line="DEBUG_LEVEL=0"/>
<arg line="EXTRA_CXXFLAGS='-fPIC -D_GLIBCXX_USE_CXX11_ABI=0'"/>
<arg line="-j${system.numCores}"/>
Expand Down
4 changes: 2 additions & 2 deletions hadoop-hdds/rocks-native/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

cmake_minimum_required(VERSION 2.8)
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why no optimization at all? This is different that specifying the instruction sets. Can you look into add_compile_options(-msse2) ? I am not sure no optimization == chipset instructions to be used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not really aware of this, but let me check this out and get back on this.

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -O0")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -O0")
project(ozone_native)
set(CMAKE_BUILD_TYPE Release)
find_package(JNI REQUIRED)
Expand Down