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

grpc library bloat #187

Open
mcfadden8 opened this issue Jul 31, 2024 · 5 comments
Open

grpc library bloat #187

mcfadden8 opened this issue Jul 31, 2024 · 5 comments
Assignees

Comments

@mcfadden8
Copy link

I have spent the last week or so attempting to build one of our production codes with our new SCR checkpoint library that makes use of the nnfdm.a library and have run in to some issues that I think could be a pain point for some of our code teams (thus far, I am still unable to successfully build). Library bloat. More specifically, because the nnfdm api is using grpc with protobuf, this is causing us to link in 57 (not an exaggeration) additional libraries (shown below).

Does anyone know of a lighter weight way to trim down the large number of libraries? With our codes that have complicated build systems, it is not a trivial task to deal handle the larger set of libraries that seem to be required.

lib64/libabsl_bad_optional_access.a lib64/libabsl_bad_variant_access.a lib64/libabsl_base.a lib64/libabsl_city.a lib64/libabsl_civil_time.a lib64/libabsl_cord.a lib64/libabsl_cord_internal.a lib64/libabsl_cordz_functions.a lib64/libabsl_cordz_handle.a lib64/libabsl_cordz_info.a lib64/libabsl_debugging_internal.a lib64/libabsl_demangle_internal.a lib64/libabsl_exponential_biased.a lib64/libabsl_graphcycles_internal.a lib64/libabsl_hash.a lib64/libabsl_hashtablez_sampler.a lib64/libabsl_int128.a lib64/libabsl_log_severity.a lib64/libabsl_low_level_hash.a lib64/libabsl_malloc_internal.a lib64/libabsl_random_distributions.a lib64/libabsl_random_internal_platform.a lib64/libabsl_random_internal_pool_urbg.a lib64/libabsl_random_internal_randen.a lib64/libabsl_random_internal_randen_hwaes.a lib64/libabsl_random_internal_randen_hwaes_impl.a lib64/libabsl_random_internal_randen_slow.a lib64/libabsl_random_internal_seed_material.a lib64/libabsl_random_seed_gen_exception.a lib64/libabsl_random_seed_sequences.a lib64/libabsl_raw_hash_set.a lib64/libabsl_raw_logging_internal.a lib64/libabsl_spinlock_wait.a lib64/libabsl_stacktrace.a lib64/libabsl_status.a lib64/libabsl_statusor.a lib64/libabsl_str_format_internal.a lib64/libabsl_strings.a lib64/libabsl_strings_internal.a lib64/libabsl_symbolize.a lib64/libabsl_synchronization.a lib64/libabsl_throw_delegate.a lib64/libabsl_time.a lib64/libabsl_time_zone.a lib64/libprotobuf.a lib/libaddress_sorting.a lib/libcares.a lib/libcrypto.a lib/libgpr.a lib/libgrpc++.a lib/libgrpc.a lib/libgrpc++_reflection.a lib/libnnfdm.a lib/libre2.a lib/libssl.a lib/libupb.a lib/libz.`
@mcfadden8
Copy link
Author

This is likely caused by how I am building grpc (which is required since we need a later version than what is available with TOSS (if I remember correctly)).

I am hoping that I can build a much liter version of grpc since I would find it hard to believe we need everything+kitchensink

@bdevcich
Copy link
Contributor

This is likely caused by how I am building grpc (which is required since we need a later version than what is available with TOSS (if I remember correctly)).

I am hoping that I can build a much liter version of grpc since I would find it hard to believe we need everything+kitchensink

Which version is TOSS using?

@mcfadden8
Copy link
Author

I actually do not know. It is possible that it isn't even installed on rzadams. It has been so long since we last checked. @behlendorf might be able to say which version is there (if any at all).

@mcfadden8
Copy link
Author

Here is how I currently am building gRPC and nnfdm

rm -rf  /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/grpc.v1.46.3 \
        /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/nnfdm.master \
        /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/install

git clone --recurse-submodules --branch v1.46.3 --depth 1 --shallow-submodules \
    [email protected]:grpc/grpc /g/g0/martymcf/source/nnfdm.master/grpc.v1.46.3

mkdir -p /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/grpc.v1.46.3 \
cd /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/grpc.v1.46.3 \
flux run -t 120 -N1 \
  cmake -Wno-dev \
    -DCMAKE_CXX_COMPILER=/opt/rocm-6.1.2/bin/amdclang++ \
    -DCMAKE_C_COMPILER=/opt/rocm-6.1.2/bin/amdclang \
    -DCMAKE_INSTALL_PREFIX=/g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/install \
    -DgRPC_INSTALL=ON \
    -DgRPC_BUILD_TESTS=OFF \
    /g/g0/martymcf/source/nnfdm.master/grpc.v1.46.3

cd /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/grpc.v1.46.3 
flux run -t 120 -N1 make install

CMAKE_PREFIX_PATH=/g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/install \
  mkdir -p /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/nnfdm.master && \
  cd /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/nnfdm.master && \
  flux run -t 120 -N1 \
    cmake -Wno-dev -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=Off \
          -DCMAKE_CXX_COMPILER=/opt/rocm-6.1.2/bin/amdclang++ \
          -DCMAKE_C_COMPILER=/opt/rocm-6.1.2/bin/amdclang \
          -DCMAKE_INSTALL_PREFIX=/g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/install \
          /g/g0/martymcf/source/nnfdm.master/nnfdm.master/daemons/compute/lib-cpp

cd /g/g0/martymcf/libraries/nnfdm.master/toss_4_x86_64_ib_cray/nnfdm.master 
flux run -t 120 -N1 make install

@mcfadden8
Copy link
Author

Actually, I think that gRPC for C++ requires manual installation (at least according to https://grpc.io/blog/installation/)

@roehrich-hpe roehrich-hpe self-assigned this Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Open
Development

No branches or pull requests

3 participants