Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ jobs:
test_dflash test_generate test_flash_attn_sparse test_server_unit \
test_deepseek4_unit test_feature_gate test_seq_slot_manager \
test_seq_engine_contract test_seq_batch_plan test_client_send_buffer \
test_deepseek4_page_layout test_deepseek4_paged_cache \
test_model_smoke test_batched_gdn test_concat_transpose -j$(nproc)

- name: Run C++ server unit tests
run: |
cd server/build
ctest --output-on-failure \
-R "server_unit|deepseek4_unit|feature_gate|seq_slot_manager|seq_engine_contract|seq_batch_plan|client_send_buffer|batched_gdn_cpu" \
-R "server_unit|deepseek4_unit|feature_gate|seq_slot_manager|seq_engine_contract|seq_batch_plan|client_send_buffer|deepseek4_page_layout|deepseek4_paged_cache|batched_gdn_cpu" \
--no-tests=error

- name: Populate venv with cu128 torch + setuptools
Expand Down
24 changes: 22 additions & 2 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,8 @@ add_library(dflash_common STATIC
src/deepseek4/deepseek4_loader.cpp
src/deepseek4/deepseek4_graph.cpp
src/deepseek4/deepseek4_roctx.cpp
src/deepseek4/deepseek4_paged_cache.cpp
src/deepseek4/deepseek4_seq_engine.cpp
src/deepseek4/deepseek4_backend.cpp
src/deepseek4/deepseek4_daemon.cpp
src/deepseek4/deepseek4_layer_split_adapter.cpp
Expand Down Expand Up @@ -472,7 +474,7 @@ add_library(dflash_common STATIC
src/common/draft_swa.cpp
src/common/dflash_spec_decode.cpp
src/common/concurrency/paged_kv_pool.cpp
src/qwen35/concurrency/qwen35_slot_manager.cpp
src/common/concurrency/seq_slot_manager.cpp
src/common/layer_split_backend.cpp
src/common/layer_split_runtime.cpp
src/qwen35/graph_builders.cpp
Expand Down Expand Up @@ -1426,11 +1428,29 @@ if(DFLASH27B_TESTS)
${CMAKE_CURRENT_SOURCE_DIR}/src)
list(APPEND _raw_unit_test_targets test_paged_kv_pool)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/test_deepseek4_page_layout.cpp")
add_executable(test_deepseek4_page_layout
test/test_deepseek4_page_layout.cpp)
target_include_directories(test_deepseek4_page_layout PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/include)
list(APPEND _raw_unit_test_targets test_deepseek4_page_layout)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/test_deepseek4_paged_cache.cpp")
add_executable(test_deepseek4_paged_cache
test/test_deepseek4_paged_cache.cpp
src/deepseek4/deepseek4_paged_cache.cpp)
target_compile_definitions(test_deepseek4_paged_cache PRIVATE
DFLASH_DS4_PLAN_ONLY=1)
target_include_directories(test_deepseek4_paged_cache PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src)
list(APPEND _raw_unit_test_targets test_deepseek4_paged_cache)
endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/test_seq_slot_manager.cpp")
# Host-side slot bookkeeping test (concurrent serving): no GPU.
add_executable(test_seq_slot_manager
test/test_seq_slot_manager.cpp
src/qwen35/concurrency/qwen35_slot_manager.cpp
src/common/concurrency/seq_slot_manager.cpp
src/common/concurrency/paged_kv_pool.cpp)
target_include_directories(test_seq_slot_manager PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/src)
Expand Down
6 changes: 3 additions & 3 deletions server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ See the [current six-expert Strix Halo profile](https://www.lucebox.com/blog/dee
| `--prefix-cache-slots <N>` | `32` | In-memory prefix-cache slots; `0` disables. |
| `--agent-turn-cache` | off | Extend prefix caching through generated tool calls. |
| `--prefill-cache-slots <N>` | `0` | Full-prompt cache slots. |
| `--paged-attention` | off | Enable 16-token paged KV blocks for supported Qwen targets. |
| `--max-concurrency <N>` | `1` | Maximum concurrent decode sequences; values above 1 enable paged attention. |
| `--paged-attention` | off | Enable paged KV for supported Qwen targets (16-token blocks) or DeepSeek4 on Strix Halo and R9700 plus Strix Halo (128-token pages). DeepSeek4 paged serving is AR-only. |
| `--max-concurrency <N>` | `1` | Maximum concurrent decode sequences. Qwen supports up to 64; DeepSeek4 supports up to 6. Values above 1 enable paged attention. |
| `--admission-coalesce-ms <N>` | `20` | Idle-to-busy batching window from 0 through 1000 ms. |
| `--kv-pool-tokens <N>` | auto | Shared physical K/V capacity for concurrent serving. |
| `--kv-pool-tokens <N>` | auto | Shared physical K/V capacity for concurrent serving, rounded to the backend page size. |
| `--kv-cache-dir <path>` | none | Enable persistent disk KV cache in this directory. |
| `--kv-cache-budget <MB>` | `4096` | Disk KV-cache size cap. |
| `--kv-cache-min-tokens <N>` | `512` | Minimum prefix length to persist. |
Expand Down
7 changes: 5 additions & 2 deletions server/deps/llama.cpp/ggml/src/ggml-backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2322,7 +2322,7 @@ static enum ggml_status ggml_backend_sched_compute_splits(ggml_backend_sched_t s
std::vector<int32_t> ids;
std::vector<ggml_bitset_t> used_ids;
size_t batch_staging_cursors[GGML_SCHED_MAX_BACKENDS] = {};
const bool copy_destinations_ready = sched->backends_synchronized;
const bool staging_arena_reusable = sched->backends_synchronized;
// From this point onward an early return must remain conservative: a
// backend may have accepted work even if a later split fails.
sched->backends_synchronized = false;
Expand All @@ -2344,7 +2344,10 @@ static enum ggml_status ggml_backend_sched_compute_splits(ggml_backend_sched_t s

ggml_backend_sched_split_copy_state copy_state{
sched, split_backend_id, split_backend,
copy_destinations_ready, copy_destinations_ready,
staging_arena_reusable,
// Earlier splits may have submitted work to this backend after
// the entry synchronization. Establish readiness once per split.
false,
batch_staging_cursors};

// copy the input tensors to the split backend
Expand Down
Loading
Loading