Skip to content

[TE/TENT] Add adaptive RDMA congestion control core - #4197

Merged
alogfans merged 8 commits into
kvcache-ai:mainfrom
Bo-Vincent:vin/adaptive-cc-core
Oct 21, 2026
Merged

alogfans merged 8 commits into
kvcache-ai:mainfrom
Bo-Vincent:vin/adaptive-cc-core

Conversation

@Bo-Vincent

@Bo-Vincent Bo-Vincent commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Add a shared adaptive congestion-control core for future Classic TE and TENT RDMA adapters.

The core now owns only pressure tracking, byte-window admission, and generation-safe accounting. Existing transport health mechanisms remain responsible for failure detection, quarantine, cooldowns, and recovery probes. The RDMA error classifier describes failure evidence without adding another recovery policy.

  • off: bypass core accounting and admission.
  • observe: collect pressure and update windows without rejecting work.
  • enforce: apply byte-window admission and reject stale-generation handles.
  • Validate startup configuration, test permit lifetime/concurrency, and provide a CPU microbenchmark.
  • Remove the earlier draft's adaptive hard-error threshold, cooldown, and probe-window configuration. Legacy health signal fields and path-state enum values remain compatible but do not drive health transitions.

This PR does not connect the controller to either transfer path or add task status APIs. Enabling the build option alone does not throttle production transfers. Building with MOONCAKE_ENABLE_ADAPTIVE_CONGESTION_CONTROL=OFF omits the adaptive targets entirely.

Related RFC: #4162.
Complete design Draft: #4629.

Current head: 95a53f1c2454b7a0a9c2890a7441d7fe3f4487bd, based on main 1d97a1df97d5277836e0e297b03289d7a39e708d. Eight focused commits, 16 files, 2,053 additions. The six shared C++ source/header files and four test/benchmark sources match the complete integration at 1224d555 byte-for-byte.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • Mooncake Store (mooncake-store)
  • Mooncake Conductor (mooncake-conductor)
  • Reshard (mooncake-reshard)
  • Mooncake EP (mooncake-ep)
  • Mooncake PG (mooncake-pg)
  • Integration (mooncake-integration)
  • P2P Store (mooncake-p2p-store)
  • Python Wheel (mooncake-wheel)
  • Common (mooncake-common)
  • Mooncake RL (mooncake-rl)
  • CI/CD
  • Docs
  • Other

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Breaking change
  • Documentation update
  • Performance improvement
  • Other

How Has This Been Tested?

Fresh validation at the current head on 2026-10-15, using isolated Linux source/build directories with CUDA, etcd and Store disabled:

Configuration Targeted CTest results
Classic + TENT, adaptive ON 7/7
Classic-only, adaptive ON 5/5
Classic + TENT, adaptive OFF 4/4
Classic-only, adaptive OFF 2/2
  • 18/18 targeted CTest executions passed. Enabled configurations include the core, startup configuration, and RDMA classifier suites; baseline transport/configuration smoke tests also passed.
  • Both OFF build graphs omit all adaptive core/test/benchmark targets.
  • All 16 changed-file hashes match the exact commit on both build hosts.
  • Eight microbenchmark sanity runs completed: baseline/off/observe/enforce in both ON configurations. No end-to-end RDMA performance claim is made.
  • The same public-controller contract was compiled against old and new code: fatal CQ feedback caused independent quarantine/avoid in the old draft, while the new core preserved the window and allowed admission. This verifies the intentional ownership change, not a bug in the old design.
  • Independent review covers the exact core-only scope, permit accounting, modes, generation fencing, configuration, and extraction consistency.
  • Sphinx HTML build, changed-line C++ formatting, spelling and whitespace checks passed.

Test commands (dependency-cache paths omitted; repeat with USE_TENT and the adaptive option ON/OFF):

cmake -S . -B build-on-tent -G Ninja \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DWITH_STORE=OFF -DWITH_STORE_RUST=OFF -DWITH_TE=ON \
  -DUSE_TENT=ON -DUSE_CUDA=OFF -DUSE_ETCD=OFF \
  -DBUILD_UNIT_TESTS=ON -DBUILD_BENCHMARK=ON \
  -DMOONCAKE_ENABLE_ADAPTIVE_CONGESTION_CONTROL=ON

cmake --build build-on-tent -j 6 --target \
  adaptive_congestion_control_test adaptive_congestion_control_config_test \
  rdma_error_classifier_test adaptive_congestion_control_benchmark \
  transport_uint_test rdma_atomic_cap_test \
  config_lifecycle_test transfer_engine_config_override_test

ctest --test-dir build-on-tent --output-on-failure -R \
'^(adaptive_congestion_control_test|adaptive_congestion_control_config_test|rdma_error_classifier_test|transport_uint_test|rdma_atomic_cap_test|config_lifecycle_test|transfer_engine_config_override_test)$'

for mode in baseline off observe enforce; do
  build-on-tent/mooncake-transfer-engine/tests/adaptive_congestion_control_benchmark "$mode"
done

git diff --check 1d97a1df HEAD
LC_ALL=C make -C docs html

Test results:

  • Unit tests pass
  • Integration tests pass (targeted build/transport/configuration smoke tests only)
  • Manual testing done (public-core contract and microbenchmark sanity above)

Physical congestion benefits, GPU/GDR, hardware failure recovery, long-duration testing, and fresh sanitizer runs are not claimed for this core-only PR. Earlier draft test counts and performance numbers do not describe this rewritten head.

Checklist

  • I have performed a self-review of my own code
  • I have formatted my code using ./scripts/code_format.sh
  • I have run pre-commit on the files changed in this PR and all hooks pass
  • I have updated the documentation (if applicable)
  • I have added tests to prove my changes are effective
  • For changes >500 LOC: I have filed an RFC issue

PR-scoped pre-commit passed all applicable checks except whole-file CMake formatting. That hook rewrites pre-existing formatting outside this change in three existing CMake files; those unrelated rewrites were excluded. The new CMake file and new blocks are formatted. The all-hooks checkbox therefore remains unchecked.

AI Assistance Disclosure

  • No AI tools were used
  • AI tools were used (specify below)

OpenAI Codex assisted with implementation extraction, tests, independent review, documentation and validation. The human submitter remains responsible for understanding and defending all changes.

@staryxchen staryxchen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before moving forward, do we have a complete demo that we can use to validate the effects and get some results to support the benefits of this PR?

@Bo-Vincent
Bo-Vincent force-pushed the vin/adaptive-cc-core branch 2 times, most recently from c87cafc to 3786def Compare October 13, 2026 09:14
@Bo-Vincent

Copy link
Copy Markdown
Collaborator Author

Before moving forward, do we have a complete demo that we can use to validate the effects and get some results to support the benefits of this PR?

Yes. The complete implementation is available in the Draft PR for end-to-end review and validation.

@Bo-Vincent
Bo-Vincent force-pushed the vin/adaptive-cc-core branch from 3786def to 95a53f1 Compare October 15, 2026 10:01

@staryxchen staryxchen left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not review this line by line. The change is not wired into the TE or TENT transfer path, and the default build does not change existing RDMA behavior. I am fine with merging it. Please keep the follow-up changes that connect it to the transport as small as possible. @alogfans Please double-check.

@alogfans alogfans left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@alogfans
alogfans merged commit 3b08b77 into kvcache-ai:main Oct 21, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation run-ci Transfer Engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants