Skip to content

[TENT] Add native UB transport with bonding fixes (rebased on latest main) - #40

Open
Connor-Matthew wants to merge 42 commits into
mainfrom
ub/bonding-upstream
Open

[TENT] Add native UB transport with bonding fixes (rebased on latest main)#40
Connor-Matthew wants to merge 42 commits into
mainfrom
ub/bonding-upstream

Conversation

@Connor-Matthew

Copy link
Copy Markdown

Summary

  • Rebase/merge of ub/bonding-device-selection onto the latest LinQuick main (synced with upstream).
  • Keep both official decodeBootstrapResponse (RDMA bootstrap validation) and UB bootstrapUb APIs.
  • Same feature set as internal PR [TENT] Add native UB transport with bonding device selection fixes #38, retargeted so GitHub can auto-merge against current main for CI.

This PR is for CI only — do not merge.

Module

  • Transfer Engine (mooncake-transfer-engine)
  • CI/CD

Type of Change

  • Bug fix
  • New feature

How Has This Been Tested?

Test results:

  • Unit tests pass (await CI)
  • Manual dual-node testing done

Checklist

  • I have performed a self-review of my own code
  • Conflicts with latest main resolved (control_plane keeps RDMA + UB paths)
  • Dual-node re-verified on this tip

Made with Cursor

Le1zyCatt and others added 8 commits August 31, 2026 10:35
Avoid initializing underlying udmac* contexts alongside bonding_dev_0
by default, which can bypass UBAGG and cause cross-node LOC_ACCESS_ERR.

Co-authored-by: Cursor <cursoragent@cursor.com>
Bring over the local working-tree fixes needed for bonding_dev_0:
SET_BONDING_MODE, CTP priority/multi_path jetty config, and token_id
segment registration. Also wire topology discover_ub from ub/enable.

Co-authored-by: Cursor <cursoragent@cursor.com>
Reuse device_selection helpers in urma_adapter and install path so heuristics cannot drift, and always free token_id when unregister fails.

Co-authored-by: Cursor <cursoragent@cursor.com>
Apply clang-format-20 to changed lines in ub_transport.cpp and
urma_adapter.cpp so CI code format check passes.

Co-authored-by: Cursor <cursoragent@cursor.com>
tebench --help exits 1 under gflags; tolerate that so the UB benchmark
CLI smoke step checks help text instead of failing early under set -e.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve control_plane conflicts by keeping both official
decodeBootstrapResponse (RDMA) and UB bootstrapUb APIs.

Co-authored-by: Cursor <cursoragent@cursor.com>
Re-apply the ub-mock CLI help smoke test that was dropped while
resolving the merge onto the latest LinQuick main.

Co-authored-by: Cursor <cursoragent@cursor.com>
jacklin78911-collab and others added 3 commits August 31, 2026 15:07
ci.yml listened for every labeled event, and auto-labeler already
applies run-ci, so adding run-e2e-ci cancelled in-progress PR CI and
reran every job. Keep Build & Test on open/push and move same-SHA
retrigger to a workflow that only reacts to a human-applied run-ci
label.

Signed-off-by: staryxchen <staryxchen@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
* [Store] Introduce stateful region resource drivers

* [Store] Refine region driver recovery boundaries

* [Store] Validate CacheLib slab count

* [Store] Clarify region driver ownership contracts
Aionw and others added 15 commits August 31, 2026 17:37
* [CI/Build] Keep non-CUDA wheels CUDA-free

* [CI/Build] Run wheel smoke test under bash for CUDA scan

The non-CUDA CUDA-dependency scan uses process substitution (< <(...)),
which sh (dash) rejects at parse time, failing every wheel build
variant regardless of VARIANT_FLAG. Run the smoke test step under bash.
* Fix data copy while not on same device

* Format code

* Format code

* Fix code address comment by @staryxchen

---------

Co-authored-by: shawnding <shawnding@tencent.com>
…che-ai#3790)

* Map MOONCAKE_LOCAL_HOSTNAME to TENT rpc_server_hostname

* code format

---------

Co-authored-by: ruanzhao <ruanzhao@kingsoft.com>
…vcache-ai#3777)

* [TENT] Prefer the LAG-effective port speed from ibv_query_port_speed

* [TENT] Let tests inject verbs into RdmaContext and cover the effective-speed path

* [TENT] Hold the last effective speed over transient query failures and count them

---------

Co-authored-by: maxlisongsong <maxlisongsong@didiglobal.com>
* [Store] Add batch OpLog snapshot coordinator

* [Bugfix][Store] Fix batch snapshot coordinator races

---------

Co-authored-by: Yuchen Kou <kouyuchen@approaching.ai>
* perf(store): remove redundant per-file deletion delay

* test(store): make concurrent remove test deterministic
…on (kvcache-ai#3782)

Signed-off-by: Wang Zupeng <zupenwang@gmail.com>
The ghfast fallback used raw git fetch, which skipped checkout's
pull_request_target fork check and ran untrusted PR heads on the
privileged self-hosted job. Rewrite github.com via insteadOf and retry
the same action so network failures still use the mirror.

Signed-off-by: staryxchen <staryxchen@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ner (kvcache-ai#3718)

* [Bugfix] Refactor RDMA slice dispatch and endpoint reclaim

* Improve impl based on comments

* [TransferEngine] Avoid RDMA lifecycle gate during active handshake

* Reformat
…cache-ai#3468)

* feat: Add strict_local_numa to hard-exclude cross-NUMA RDMA rails

* Fix code address comment by @alogfans

Conflicts:
	mooncake-transfer-engine/tent/include/tent/transport/rdma/quota.h
	mooncake-transfer-engine/tent/src/transport/rdma/quota.cpp

* Fix code address comment by @staryxchen

* fix ci

---------

Co-authored-by: shawnding <shawnding@tencent.com>
…i#3582)

* [TENT] Preserve ownership after failed memory free

* fix(tent): warn when local memory free fails

---------

Co-authored-by: codex <codex@local.invalid>
Co-authored-by: Yuchen Kou <kouyuchen@approaching.ai>
…nflight token, decouple Topology from UB enable

- scanTimeouts(): after a successful quiesce fence, explicitly remove and
  release a still-present timed-out token before scheduling its retry. A
  provider-lost completion previously left the token in inflight_, so
  releaseInflight() never ran and endpoint outstanding/quota stayed charged
  until stop(), which could exhaust capacity and stall later transfers.
- Topology::discover(): drop the transport-policy discover_ub flag and keep
  discovery transport-agnostic (always attempt UB when the platform supports
  it); UbTransport activation remains gated by transports/ub/enable in the
  transport loader.
- Add regression test ProviderLostCompletionIsReclaimedAfterSuccessfulFence
  with a fake-adapter switch that makes quiesce succeed without returning the
  token, asserting inflight/quota/outstanding accounting return to zero and
  subsequent transfers still make progress.

Co-authored-by: Cursor <cursoragent@cursor.com>
Connor-Matthew and others added 14 commits September 1, 2026 22:24
Co-authored-by: Cursor <cursoragent@cursor.com>
… PORT_ACTIVE was lost (kvcache-ai#3799)

* [Bugfix][TENT] Recover paused RDMA contexts when PORT_ACTIVE is lost

A TENT RDMA context paused by IBV_EVENT_PORT_ERR only leaves DEVICE_PAUSED
from the IBV_EVENT_PORT_ACTIVE branch of applyContextEvent(). The async fd is
registered edge-triggered (EPOLLIN|EPOLLET) but handleContextEvents() consumed
exactly one ibv_async_event per epoll wakeup, so an event queued behind another
(e.g. IBV_EVENT_COMM_EST bursts) is stranded until an unrelated later event
releases it. A stranded PORT_ACTIVE leaves the context paused forever, silently
failing every transfer on that NIC (issue kvcache-ai#3523 defect C).

- handleContextEvents() now drains the whole queue (loop until EAGAIN/EWOULDBLOCK,
  retry on EINTR, propagate a real read error) instead of one event per wakeup.
- Workers::resumePausedContexts(): 1 Hz safety net on the existing monitorThread
  heartbeat. For DEVICE_PAUSED contexts it reads the port state and, when the
  hardware reports IBV_PORT_ACTIVE, runs the same recovery the event path runs.
- Recovery actions factored into Workers::activateContext() so the event and poll
  paths cannot drift apart.
- New RdmaContext::queryPortState() reads port state without touching the cached
  link speed/width (refreshLinkSpeed() diffs against them).

Tests:
- tent/tests/rdma_async_event_drain_test.cpp (wraps ibv_get_async_event, no device
  needed): all 5 cases fail on the pre-fix code.
- tent/tests/rdma_transport_test.cpp: RecoveryPollLeavesInertContextsAlone,
  QueryOnInertContextIsRejected, PollActivatesPausedContextWithLivePort.

* [Bugfix][TENT] Reduce noise from high-frequency async events

* [Bugfix][TENT] Fix formatting after upstream sync

Restore the closing brace lost while resolving the queryPortState upstream
sync, and apply the repository clang-format-20 and cmake-format rules to the
PR files. All pre-commit hooks pass on the affected files.

---------

Co-authored-by: TTThanos <yaozhong.lyz@alibaba-inc.com>
…che-ai#3763)

* [Store] Structure DistributedStorageConfig environment settings

Signed-off-by: Schatten <czhengt@qq.com>

* [Store] Separate DistributedStorageConfig from backend

Signed-off-by: Schatten <czhengt@qq.com>

---------

Signed-off-by: Schatten <czhengt@qq.com>
…#3773)

* [Store] Structure ClientMetricConfig environment settings

Signed-off-by: Schatten <czhengt@qq.com>

* [Store] Use chrono duration for client metric interval

Signed-off-by: Schatten <czhengt@qq.com>

---------

Signed-off-by: Schatten <czhengt@qq.com>
Co-authored-by: Aoi <aione.moe.dev@gmail.com>
…i#3781)

Signed-off-by: Schatten <czhengt@qq.com>
Co-authored-by: Aoi <aione.moe.dev@gmail.com>
…vcache-ai#3804)

Signed-off-by: Schatten <czhengt@qq.com>
Co-authored-by: Aoi <aione.moe.dev@gmail.com>
…vcache-ai#3820)

High-concurrency PD created 256 independent notify recv MRs per RDMA
endpoint, exhausting MR capacity while QP tables were still sparse.
Match the send path: one contiguous 256x64KiB buffer and one ibv_reg_mr,
then slice by slot.

Signed-off-by: staryxchen <staryxchen@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…complete teardown

- Add transports/ub/max_slices_per_task (default 64k) and reject requests
  whose slice count exceeds it in submitTransferTasks, bounding per-task
  memory/scheduling footprint.
- EndpointStore: treat retire() as incomplete when the endpoint does not
  reach kDestroyed, quarantine it instead of replacing it, and retry
  getOrCreate() so a same-key endpoint is not reused while cleanup is still
  in progress.
- Tests: fake adapter gains reset-failure injection; new
  EndpointStoreDoesNotReplaceEndpointWhenCleanupCannotComplete plus slice-cap
  rejection coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
…che-ai#3768)

tebench called exit() from worker threads when a transfer FAILED, so a
SIGKILL'd RDMA target made concurrent workers abort with unordered_map::at.
Return failure to main so threads can join, rank unknown statuses without
throwing, and wait on stop or pending==0 under the mutex like classic TE.

Signed-off-by: staryxchen <staryxchen@tencent.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…ache-ai#3789)

* [Store] Support 512MB hugepage size for client buffer allocation

512MiB is the PMD hugepage size on arm64 kernels running with 64K base
pages, where 2MB pages give poor TLB coverage and 1GB pages are
unavailable.

- MC_STORE_HUGEPAGE_SIZE now accepts 512MB in addition to 2MB/1GB
  (get_hugepage_size_from_env, allocate_buffer_numa_segments).
- Provide MAP_HUGE_512M / MFD_HUGE_512M fallbacks for older
  glibc/kernel headers that do not define them.
- MmapArena honors the configured hugepage size: align the pool to it,
  pass the size-specific MAP_HUGE_* flag to mmap(), and strip the size
  bits on the no-hugepage retry.
- Document 512MB in the store deployment guide.

* [Store] Use standard UAPI names MAP_HUGE_512MB/MFD_HUGE_512MB

The Linux UAPI spells these constants with a trailing 'B'
(MAP_HUGE_512MB in asm-generic/mman-common.h, MFD_HUGE_512MB in
linux/memfd.h). Guard and define the standard names so the fallbacks
only kick in on headers that genuinely lack them.
…cache-ai#3784)

* fix multi NICs spanning different NUMA nodes in TENT

* code format

* validating the caller-supplied location before overriding the probe in registerLocalMemory

* code format

* fix doubled /metadata path in config override test

* retriger ci

---------

Co-authored-by: ruanzhao <ruanzhao@kingsoft.com>
…vcache-ai#3689)

* TENT: add high-performance TCP worker scaffold

* TENT: implement high performance TCP v1

* TENT: add HP TCP configuration and integration guards

* TENT: format high-performance TCP sources

* feat(tent): complete correctness-first high-performance TCP v1

* test(tent): make HP TCP sanitizer synchronization explicit

* refactor(tent): expose high-performance TCP as hp_tcp

* docs(tent): document hp_tcp design

* fix(tent): close HP TCP correctness gaps

* refactor: trim hp_tcp to reviewable v1 core

* refactor(tent): trim hp tcp worker surface

* fix(tent): preserve hp tcp worker affinity

* refactor(tent): simplify hp_tcp v1 ownership

* Revert "refactor(tent): simplify hp_tcp v1 ownership"

This reverts commit b883c4a.

* fix(tent): harden HP TCP failure lifecycle

* perf(tent): keep HP TCP health checks lock-free

* fix(tent): close HP TCP failure and notification gaps

Preserve at-most-once writes across ambiguous failures, enforce bounded frame progress without expiring idle pooled connections, harden registration/task lifetimes, and route notifications without unsafe retries.

* refactor(tent): trim HP TCP v1 scope

* refactor(tent): tighten hp tcp v1 surface

* refactor(tent): separate hp_tcp transport sources

---------

Co-authored-by: 林李谦 <linliqian@192.168.1.5>
…/bonding-upstream

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	mooncake-transfer-engine/benchmark/tent_backend.cpp
#	mooncake-transfer-engine/benchmark/utils.cpp
@github-actions github-actions Bot added documentation Improvements or additions to documentation store Common Ascend/NPU labels Sep 2, 2026
The step only grepped static gflags help strings and never exercised
the TENT/UB path; ub-mock build and CTest already cover real coverage.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.