[GH-ISSUE #172] [EASY_INTEGRATION] Introduce a tool with docs to support build whl file of mooncake_vllm_adaptor #83

Closed
opened 2026-10-29 21:08:54 +00:00 by bsakaguchi · 8 comments
Owner

Originally created by @maobaolong on GitHub (Mar 26, 2025).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/172

ISSUE

It is difficult and cost a lot of time to build whole mooncake project but vllm user only want to take a trial of mooncake by the mooncake_vllm_adaptor.

Suggestion

  • Release image to dockerhub by period to keep image state as new as possible
  • Supply a tool to generate whl file or other way to make it easy to install mooncake_vllm_adaptor from source.
  • Push mooncake_vllm_adaptor to pip repo
Originally created by @maobaolong on GitHub (Mar 26, 2025). Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/172 # ISSUE It is difficult and cost a lot of time to build whole mooncake project but vllm user only want to take a trial of mooncake by the `mooncake_vllm_adaptor`. # Suggestion - Release image to dockerhub by period to keep image state as new as possible - Supply a tool to generate whl file or other way to make it easy to install `mooncake_vllm_adaptor` from source. - Push `mooncake_vllm_adaptor` to pip repo
Author
Owner

@maobaolong commented on GitHub (Mar 26, 2025):

In fact, I try to build the mooncake follow this https://github.com/kvcache-ai/Mooncake/blob/main/doc/en/build.md , but failed while Install grpc.

/data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function 'void absl::synchronization_internal::GraphCycles::RemoveNode(void*)':
/data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: 'numeric_limits' is not a member of 'std'
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                          ^~~~~~~~~~~~~~
/data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before '>' token
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                                                 ^
/data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: '::max' has not been declared; did you mean 'std::max'?
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                                                    ^~~
      |                                                    std::max
In file included from /usr/include/c++/11/algorithm:62,
                 from /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:38:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
make[2]: *** [third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:76: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2980: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
<!-- gh-comment-id:2753406484 --> @maobaolong commented on GitHub (Mar 26, 2025): In fact, I try to build the mooncake follow this https://github.com/kvcache-ai/Mooncake/blob/main/doc/en/build.md , but failed while Install `grpc`. ``` /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function 'void absl::synchronization_internal::GraphCycles::RemoveNode(void*)': /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: 'numeric_limits' is not a member of 'std' 451 | if (x->version == std::numeric_limits<uint32_t>::max()) { | ^~~~~~~~~~~~~~ /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before '>' token 451 | if (x->version == std::numeric_limits<uint32_t>::max()) { | ^ /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: '::max' has not been declared; did you mean 'std::max'? 451 | if (x->version == std::numeric_limits<uint32_t>::max()) { | ^~~ | std::max In file included from /usr/include/c++/11/algorithm:62, from /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:38: /usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here 3467 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ make[2]: *** [third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:76: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:2980: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 ```
Author
Owner

@maobaolong commented on GitHub (Mar 26, 2025):

@ShangmingCai I create an issue here.

<!-- gh-comment-id:2753408253 --> @maobaolong commented on GitHub (Mar 26, 2025): @ShangmingCai I create an issue here.
Author
Owner

@ShangmingCai commented on GitHub (Mar 26, 2025):

@alogfans Can you help with this?

<!-- gh-comment-id:2753422878 --> @ShangmingCai commented on GitHub (Mar 26, 2025): @alogfans Can you help with this?
Author
Owner

@alogfans commented on GitHub (Mar 26, 2025):

@maobaolong If your OS is Ubuntu 22.04 or newer, you can fetch the grpc by apt-get.
If you need to build grpc manually, you can use two steps:

  • Build and install abseil: fetch the source code of abseil-cpp-20230802.3 from github, build and install
  • Build and install grpc (39.0.0) and use system-level abseil.
    Your GCC version should be 10.0+
<!-- gh-comment-id:2753438648 --> @alogfans commented on GitHub (Mar 26, 2025): @maobaolong If your OS is Ubuntu 22.04 or newer, you can fetch the grpc by apt-get. If you need to build grpc manually, you can use two steps: - Build and install abseil: fetch the source code of `abseil-cpp-20230802.3` from github, build and install - Build and install grpc (39.0.0) and use system-level abseil. Your GCC version should be 10.0+
Author
Owner

@maobaolong commented on GitHub (Mar 26, 2025):

@alogfans I start to my build under the docker image from you.

docker run -it --rm --entrypoint /bin/bash --privileged  --network host -v /data1:/data1 --name mooncake-0311 alogfans/mooncake
docker exec -it mooncake-0311 bash

# this step include apt install libgrpc-dev
bash dependencies.sh

# run build follow the build.md

mkdir build
cd build
cmake ..
make -j

apt-get install -y build-essential \
               cmake \
               libibverbs-dev \
               libgoogle-glog-dev \
               libgtest-dev \
               libjsoncpp-dev \
               libnuma-dev \
               libcurl4-openssl-dev \
               libhiredis-dev

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64


python3 -c "from mooncake_vllm_adaptor import MooncakeDistributedStore"Traceback (most recent call last):  File "<string>", line 1, in <module>
ImportError: /usr/lib/python3/dist-packages/mooncake_vllm_adaptor.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZTIN6google8protobuf7MessageE

So I try to step the grpc by source code under the instruction of build.md, but failed to build

git clone https://github.com/grpc/grpc.git --depth 1 --branch v1.27.x
cd grpc/
git submodule update --init
mkdir cmake-build
cd cmake-build/
cmake .. -DBUILD_SHARED_LIBS=ON \
        -DgRPC_INSTALL=ON \
        -DgRPC_BUILD_TESTS=OFF \
        -DgRPC_BUILD_CSHARP_EXT=OFF \
        -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
        -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
        -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
        -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
        -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
        -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
        -DgRPC_BACKWARDS_COMPATIBILITY_MODE=ON \
        -DgRPC_ZLIB_PROVIDER=package \
        -DgRPC_SSL_PROVIDER=package
make -j`nproc`
make install

....
Consolidate compiler generated dependencies of target absl_graphcycles_internal
[ 93%] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o
/data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function 'void absl::synchronization_internal::GraphCycles::RemoveNode(void*)':
/data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: 'numeric_limits' is not a member of 'std'
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                          ^~~~~~~~~~~~~~
/data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before '>' token
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                                                 ^
/data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: '::max' has not been declared; did you mean 'std::max'?
  451 |   if (x->version == std::numeric_limits<uint32_t>::max()) {
      |                                                    ^~~
      |                                                    std::max
In file included from /usr/include/c++/11/algorithm:62,
                 from /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:38:
/usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here
 3467 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
make[2]: *** [third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:76: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2980: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I have ensured the following, and confusing I build mooncake within your docker image and build.md, why I still failed?

  • gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
  • PRETTY_NAME="Ubuntu 22.04.4 LTS"
<!-- gh-comment-id:2753520320 --> @maobaolong commented on GitHub (Mar 26, 2025): @alogfans I start to my build under the docker image from you. ``` docker run -it --rm --entrypoint /bin/bash --privileged --network host -v /data1:/data1 --name mooncake-0311 alogfans/mooncake docker exec -it mooncake-0311 bash # this step include apt install libgrpc-dev bash dependencies.sh # run build follow the build.md mkdir build cd build cmake .. make -j apt-get install -y build-essential \ cmake \ libibverbs-dev \ libgoogle-glog-dev \ libgtest-dev \ libjsoncpp-dev \ libnuma-dev \ libcurl4-openssl-dev \ libhiredis-dev export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/cuda/lib64 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 python3 -c "from mooncake_vllm_adaptor import MooncakeDistributedStore"Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: /usr/lib/python3/dist-packages/mooncake_vllm_adaptor.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZTIN6google8protobuf7MessageE ``` So I try to step the grpc by source code under the instruction of `build.md`, but failed to build ``` git clone https://github.com/grpc/grpc.git --depth 1 --branch v1.27.x cd grpc/ git submodule update --init mkdir cmake-build cd cmake-build/ cmake .. -DBUILD_SHARED_LIBS=ON \ -DgRPC_INSTALL=ON \ -DgRPC_BUILD_TESTS=OFF \ -DgRPC_BUILD_CSHARP_EXT=OFF \ -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \ -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \ -DgRPC_BACKWARDS_COMPATIBILITY_MODE=ON \ -DgRPC_ZLIB_PROVIDER=package \ -DgRPC_SSL_PROVIDER=package make -j`nproc` make install .... Consolidate compiler generated dependencies of target absl_graphcycles_internal [ 93%] Building CXX object third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc: In member function 'void absl::synchronization_internal::GraphCycles::RemoveNode(void*)': /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:26: error: 'numeric_limits' is not a member of 'std' 451 | if (x->version == std::numeric_limits<uint32_t>::max()) { | ^~~~~~~~~~~~~~ /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:49: error: expected primary-expression before '>' token 451 | if (x->version == std::numeric_limits<uint32_t>::max()) { | ^ /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:451:52: error: '::max' has not been declared; did you mean 'std::max'? 451 | if (x->version == std::numeric_limits<uint32_t>::max()) { | ^~~ | std::max In file included from /usr/include/c++/11/algorithm:62, from /data1/projects/Mooncake/build/grpc/third_party/abseil-cpp/absl/synchronization/internal/graphcycles.cc:38: /usr/include/c++/11/bits/stl_algo.h:3467:5: note: 'std::max' declared here 3467 | max(initializer_list<_Tp> __l, _Compare __comp) | ^~~ make[2]: *** [third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/build.make:76: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/internal/graphcycles.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:2980: third_party/abseil-cpp/absl/synchronization/CMakeFiles/absl_graphcycles_internal.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 ``` I have ensured the following, and confusing I build mooncake within your docker image and `build.md`, why I still failed? - gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04) - PRETTY_NAME="Ubuntu 22.04.4 LTS"
Author
Owner

@maobaolong commented on GitHub (Mar 26, 2025):

@alogfans Thanks for your help, I clear the build folder and repeat the above step, it succeed.

BTW, how to abstract the mooncake_vllm_adaptor to a whl or a tarball so that I can install it into vllm container which have no internet and cannot build any source?

<!-- gh-comment-id:2753717284 --> @maobaolong commented on GitHub (Mar 26, 2025): @alogfans Thanks for your help, I clear the build folder and repeat the above step, it succeed. BTW, how to abstract the mooncake_vllm_adaptor to a whl or a tarball so that I can install it into vllm container which have no internet and cannot build any source?
Author
Owner

@stmatengss commented on GitHub (Mar 26, 2025):

@alogfans Thanks for your help, I clear the build folder and repeat the above step, it succeed.

BTW, how to abstract the mooncake_vllm_adaptor to a whl or a tarball so that I can install it into vllm container which have no internet and cannot build any source?

Thanks for your interest. The period release of whl installation package is on the way. As a followup, we will support installing mooncake from pip source.

<!-- gh-comment-id:2754240745 --> @stmatengss commented on GitHub (Mar 26, 2025): > [@alogfans](https://github.com/alogfans) Thanks for your help, I clear the build folder and repeat the above step, it succeed. > > BTW, how to abstract the mooncake_vllm_adaptor to a whl or a tarball so that I can install it into vllm container which have no internet and cannot build any source? Thanks for your interest. The period release of whl installation package is on the way. As a followup, we will support installing mooncake from pip source.
Author
Owner

@alogfans commented on GitHub (Apr 10, 2025):

The whl package is ready. You can retrieve it by pip install. If you encounter problems, you can build & install it manually.

<!-- gh-comment-id:2791671278 --> @alogfans commented on GitHub (Apr 10, 2025): The whl package is ready. You can retrieve it by `pip install`. If you encounter problems, you can build & install it manually.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/Mooncake#83
No description provided.