-
Notifications
You must be signed in to change notification settings - Fork 87
feat: optimize kv cache load/offload. #306
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
5ecd4cf
refactor: async device/host block copying, remove sync waits.
Kang-Meng 53cba85
feat: upgrade Mooncake to v0.3.6.
Kang-Meng 8452d24
refactor: change host KV cache memory layout from layer-wise to block…
Kang-Meng 1b9dd1f
feat: add layer-wise KV cache H2D copy optimization.
Kang-Meng e2fdd34
feat: implement batch prefetch from store.
Kang-Meng 7531381
feat: add dependency installation to setup script.
Kang-Meng f81bfe9
feat: add page-aligned tensor creator for host KV cache.
Kang-Meng 86c9bc0
feat: remove redundant thread pool in WorkerImpl.
Kang-Meng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule Mooncake
updated
from fb26af to be8949
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Color definitions | ||
| GREEN="\033[0;32m" | ||
| BLUE="\033[0;34m" | ||
| YELLOW="\033[0;33m" | ||
| RED="\033[0;31m" | ||
| NC="\033[0m" # No Color | ||
|
|
||
| # Configuration | ||
| REPO_ROOT=`pwd` | ||
|
|
||
| # Function to print section headers | ||
| print_section() { | ||
| echo -e "\n${BLUE}=== $1 ===${NC}" | ||
| } | ||
|
|
||
| # Function to print success messages | ||
| print_success() { | ||
| echo -e "${GREEN}✓ $1${NC}" | ||
| } | ||
|
|
||
| # Function to print error messages and exit | ||
| print_error() { | ||
| echo -e "${RED}✗ ERROR: $1${NC}" | ||
| exit 1 | ||
| } | ||
|
|
||
| # Function to check command success | ||
| check_success() { | ||
| if [ $? -ne 0 ]; then | ||
| print_error "$1" | ||
| fi | ||
| } | ||
|
|
||
| if [ $(id -u) -ne 0 ]; then | ||
| print_error "Require root permission, try sudo ./dependencies.sh" | ||
| fi | ||
|
|
||
|
|
||
| # Install yalantinglibs | ||
| print_section "Installing yalantinglibs" | ||
|
|
||
| # Check if thirdparties directory exists | ||
| if [ ! -d "${REPO_ROOT}/third_party/Mooncake/thirdparties" ]; then | ||
| mkdir -p "${REPO_ROOT}/third_party/Mooncake/thirdparties" | ||
| check_success "Failed to create Mooncake/thirdparties directory" | ||
| fi | ||
|
|
||
| # Change to thirdparties directory | ||
| cd "${REPO_ROOT}/third_party/Mooncake/thirdparties" | ||
| check_success "Failed to change to Mooncake/thirdparties directory" | ||
|
|
||
| # Check if yalantinglibs is already installed | ||
| if [ -d "yalantinglibs" ]; then | ||
| echo -e "${YELLOW}yalantinglibs directory already exists. Removing for fresh install...${NC}" | ||
| rm -rf yalantinglibs | ||
| check_success "Failed to remove existing yalantinglibs directory" | ||
| fi | ||
|
|
||
| # Clone yalantinglibs | ||
| echo "Cloning yalantinglibs from https://gitcode.com/gh_mirrors/ya/yalantinglibs.git" | ||
| git clone https://gitcode.com/gh_mirrors/ya/yalantinglibs.git | ||
| check_success "Failed to clone yalantinglibs" | ||
|
|
||
| # Build and install yalantinglibs | ||
| cd yalantinglibs | ||
| check_success "Failed to change to yalantinglibs directory" | ||
|
|
||
| # Checkout version 0.5.5 | ||
| echo "Checking out yalantinglibs version 0.5.5..." | ||
| git checkout 0.5.5 | ||
| check_success "Failed to checkout yalantinglibs version 0.5.5" | ||
|
|
||
| mkdir -p build | ||
| check_success "Failed to create build directory" | ||
|
|
||
| cd build | ||
| check_success "Failed to change to build directory" | ||
|
|
||
| echo "Configuring yalantinglibs..." | ||
| cmake .. -DBUILD_EXAMPLES=OFF -DBUILD_BENCHMARK=OFF -DBUILD_UNIT_TESTS=OFF -DYLT_ENABLE_IBV=ON | ||
| check_success "Failed to configure yalantinglibs" | ||
|
|
||
| echo "Building yalantinglibs (using $(nproc) cores)..." | ||
| cmake --build . -j$(nproc) | ||
| check_success "Failed to build yalantinglibs" | ||
|
|
||
| echo "Installing yalantinglibs..." | ||
| cmake --install . | ||
| check_success "Failed to install yalantinglibs" | ||
|
|
||
| sed -i '54s/target_link_libraries(${ylt_target_name} -libverbs)/target_link_libraries(${ylt_target_name} INTERFACE -libverbs)/' /usr/local/lib/cmake/yalantinglibs/config.cmake | ||
|
|
||
| print_success "yalantinglibs installed successfully" | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the different between
store_metadata_serverandstore_local_hostname.