Skip to content

Commit c1cb831

Browse files
committed
merge: integrate PR #4742 - re-introduce kvbm-kernels
Merged PR #4742 (oandreeva/kvbm-kernels) which re-introduces the KVBM kernels library after it was reverted from main. Key changes: - Added lib/kvbm-kernels with CUDA tensor kernel operations - Integrated kernels module into kvbm bindings (kept alongside v2 module) - Updated workspace to include kvbm-kernels - Added prebuilt CUDA binaries and static libraries for x86_64 - Updated vLLM Dockerfile with CUDA dev tools - Moved vectorized_copy.fatbin to kvbm-kernels library Conflicts resolved: - Cargo.toml: Added kvbm-kernels to workspace members - lib/bindings/kvbm/Cargo.toml: Added kvbm_kernels dependency to block-manager feature - lib/bindings/kvbm/src/lib.rs: Added kernels module alongside existing v2 module - lib/bindings/kvbm/python/kvbm/__init__.py: Exported both kernels and v2 modules - Cargo.lock files: Accepted PR version and will regenerate Signed-off-by: Ryan Olson <[email protected]>
2 parents 2314165 + b12d3e6 commit c1cb831

File tree

28 files changed

+3775
-37
lines changed

28 files changed

+3775
-37
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*.[Zz][Ii][Pp] binary
99
*.[Tt][Gg][Zz] binary
1010
*.fatbin binary
11+
*.a binary
1112

1213
# Exclude test data files from linguist language detection
1314
lib/llm/tests/data/** linguist-vendored

.github/workflows/pre-merge-rust.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
runs-on:
9393
group: Fastchecker
9494
strategy:
95-
matrix: { dir: ['.', 'lib/bindings/python', 'lib/runtime/examples', 'launch/dynamo-run'] }
95+
matrix: { dir: ['.', 'lib/bindings/python', 'lib/runtime/examples', 'launch/dynamo-run', 'lib/kvbm-kernels'] }
9696
permissions:
9797
contents: read
9898
steps:
@@ -117,7 +117,10 @@ jobs:
117117
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
118118
restore-keys: ${{ runner.os }}-cargo-
119119
- name: Set up Rust Toolchain Components
120-
run: rustup component add clippy
120+
run: rustup component add clippy rustfmt
121+
- name: Verify Code Formatting
122+
working-directory: ${{ matrix.dir }}
123+
run: cargo fmt -- --check
121124
- name: Run Clippy Checks
122125
working-directory: ${{ matrix.dir }}
123126
run: cargo clippy --no-deps --all-targets -- -D warnings

.sandbox/launch_vllm_with_connector.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ kv_transfer_config='{
6767
"kv_role": "kv_both",
6868
"kv_connector_module_path": "kvbm.v2.vllm.schedulers.connector",
6969
"kv_connector_extra_config": {
70-
"leader": {
71-
"cache": { "host": { "cache_size_gb": 1.0 } },
70+
"leader": {
71+
"cache": { "host": { "cache_size_gb": 4.0 } },
7272
"tokio": { "worker_threads": 2 }
7373
},
7474
"worker": {

Cargo.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ members = [
2121
"lib/nova-discovery",
2222
"lib/kvbm",
2323
"lib/kvbm-config",
24+
"lib/kvbm-kernels",
2425
]
2526
# Exclude certain packages that are slow to build and we don't ship as flagship
2627
# features from default build, but keep them in workspace for convenience.
@@ -59,6 +60,7 @@ dynamo-nova = { path = "lib/nova", version = "0.7.0" }
5960
dynamo-nova-backend = { path = "lib/nova-backend", version = "0.7.0" }
6061
dynamo-nova-discovery = { path = "lib/nova-discovery", version = "0.7.0" }
6162
dynamo-kvbm = { path = "lib/kvbm", version = "0.7.0" }
63+
dynamo-kvbm-kernels = { path = "lib/kvbm-kernels", version = "0.7.0" }
6264
dynamo-memory = { path = "lib/memory", version = "0.7.0" }
6365
dynamo-runtime = { path = "lib/runtime", version = "0.7.0" }
6466
dynamo-llm = { path = "lib/llm", version = "0.7.0" }

container/Dockerfile.vllm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,13 @@ FROM runtime AS dev
651651
ARG WORKSPACE_DIR=/workspace
652652

653653
USER root
654+
655+
# Copy additional CUDA tools needed for building kernels from source (cargo build)
656+
COPY --from=base /usr/local/cuda/bin/nvlink /usr/local/cuda/bin/nvlink
657+
COPY --from=base /usr/local/cuda/bin/crt /usr/local/cuda/bin/crt
658+
COPY --from=base /usr/local/cuda/lib64/libcudart_static.a /usr/local/cuda/lib64/
659+
COPY --from=base /usr/local/cuda/lib64/libculibos.a /usr/local/cuda/lib64/
660+
654661
# Install utilities as root
655662
RUN apt-get update -y && \
656663
apt-get install -y --no-install-recommends \

lib/bindings/kvbm/Cargo.lock

Lines changed: 22 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/bindings/kvbm/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ crate-type = ["cdylib", "rlib"]
2121

2222
[features]
2323
default = []
24-
block-manager = ["dynamo-llm/block-manager", "dep:dlpark", "dep:cudarc"]
24+
block-manager = ["dynamo-llm/block-manager", "dep:dlpark", "dep:cudarc", "dep:kvbm_kernels"]
2525

2626
[dependencies]
2727
dynamo-llm = { path = "../../llm" }
@@ -31,6 +31,7 @@ dynamo-memory = { path = "../../memory" }
3131
dynamo-nova = { path = "../../nova" }
3232
dynamo-nova-backend = { path = "../../nova-backend" }
3333
dynamo-runtime = { path = "../../runtime" }
34+
kvbm_kernels = { path = "../../kvbm-kernels", package = "dynamo-kvbm-kernels", optional = true }
3435

3536
anyhow = { version = "1" }
3637
async-stream = { version = "0.3" }
@@ -73,7 +74,7 @@ pyo3-async-runtimes = { version = "0.23.0", default-features = false, features =
7374
pythonize = "0.23"
7475

7576
dlpark = { version = "0.5", features = ["pyo3", "half"], optional = true }
76-
cudarc = { version = "0.16.2", features = ["cuda-12020"], optional = true }
77+
cudarc = { version = "0.17.1", features = ["cuda-12020"], optional = true }
7778
prometheus = "0.14.0"
7879

7980
[dev-dependencies]

lib/bindings/kvbm/python/kvbm/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# from kvbm._core import KvbmWorker as KvbmWorker
1717

1818
from kvbm._core import __version__
19+
from kvbm._core import kernels as kernels
1920
from kvbm._core import v2 as v2
2021

21-
__all__ = ["__version__", "v2"]
22+
__all__ = ["__version__", "kernels", "v2"]

0 commit comments

Comments
 (0)