mirror of
https://github.com/kvcache-ai/Mooncake.git
synced 2026-11-05 01:17:55 +00:00
[GH-ISSUE #3995] [RFC] Review MC_USE_TENT=1 gaps for classic TE callers #1013
Labels
No labels
ascend
auto-closed
bug
bug
CI/Build
Common
documentation
enhancement
feature request
good first issue
help wanted
high priority
MetaX
nightly-failure
pull-request
PyTorch Backend
question
RFC
Roadmap
stale
Store
Tests
Transfer Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/Mooncake#1013
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @staryxchen on GitHub (Sep 10, 2026).
Original GitHub issue: https://github.com/kvcache-ai/Mooncake/issues/3995
Originally assigned to: @TTThanos on GitHub.
How this list was produced
Started as a static pass over:
mooncake-transfer-engine/src/transfer_engine.cpp,use_tent_branches)mooncake-integration/transfer_engine/transfer_engine_py.cpp)mooncake.engine.TransferEngineLocal runtime (2026-09-10, installed TENT wheel, 1P1D PD) then confirmed
some items and left others unverified. Status below is as of 2026-09-17
(
origin/mainc4d632888b). Please still reproduce on your tree beforetreating a remaining item as confirmed.
Why the compatibility layer
We are wiring inference engines to TENT's native APIs, but that work is
not finished. Until it is, we use the classic TE compatibility layer
(
MC_USE_TENT=1) to validate TENT runtime stability against existingcallers (PD disaggregation and others). This RFC tracks gaps in that layer.
It is not the native-API migration itself.
Summary
MC_USE_TENT=1(andMC_USE_TEV1=1) is meant to run existingmooncake::TransferEngine/mooncake.engine.TransferEnginecode on the TENTruntime. Register + sync submit/poll are wired up enough for PD KV transfer.
PD happy path works under
MC_USE_TENT=1(local 1P1D Qwen3-4B/generate200). This RFC is not a claim that PD is broken today.Most of the original P0/P1/P2 shim holes now have merged PRs. What is still
open is protocol pinning for
efa/ascend, Python sync/poll semantics, andinstallTransport()returningnullptrfor classic C/Go/EFA callers.If you find a new compatibility-layer issue, please report it on this
issue. We will add it to the work-item list.
Non-goals
(that work is separate and in progress, e.g. #4070).
installTransportunder TENT. Making the shimhonor the classic
Transport*contract so existing callers do not treat asuccessful TENT init as failure is in scope (
P1-install-transport).Work items
Priority is "if the reading holds, impact is high" — not "already on fire".
send_probeSIGSEGV (getMetadata()is null)CheckSegmentStatuswas always OK)initialize(device=...)still opened all HCAsMC_FORCE_TCP=1/protocol=tcpmay still select RDMAprotocol=efa|ascendmay no-op or look successful without that transporttransferSyncretry /CANCELEDhandling may not match TENT failoverStatus::Code(non-negative); classic callers expectERR_*priority/remote_accessiblewere dropped at the shimgetFirstBufferAddressalso calledgetMetadata()(same null deref assend_probe)installTransport()returnsnullptr; classic C/Go/EFA callers treat that as install failureResiduals on landed items
These do not reopen the row, but they are not "the original hole is gone with no leftover":
getMetadata(). #4081 closed the segment after probing, which invalidated a handle already stored in Pythonhandle_map_; #4115 stopped closing it. C++getMetadata()is stillnullptrunder TENT — any remaininggetMetadata()->sendProbecaller will still crash.CheckSegmentStatusnow probes viaprobePeerAliveByID. Python only calls it whensubmitTransferfails. Peer death that shows up asgetTransferStatusFAILED/TIMEOUTstill leaveshandle_map_intact. That leftover belongs with P1-sync-status. The unit test covers an never-opened handle, not a still-mapped handle whose RPC probe fails.forceTcp()disable HP TCP so a config with both enabled does not fail init.tentToClassicError().submitTransferstill wraps TENT failures asStatus::Context(...). No in-tree test that failed on main and passed after (#4139 checklist).remote_accessible→ TENT perms andTransferRequest::priorityon submit. PythontransferSyncdoes not setpriority(default MEDIUM). No in-tree red/green test (#4114 checklist).Still open
init(..., protocol)is now forwarded, but the TENT branch only special-cases"tcp"."efa"/"ascend"do not pin those transports. OnUSE_EFA/USE_CXIPython builds,initializestill callsinstallTransport()after init; under TENT that returnsnullptrandinitializereturns-1. #4122 is classic TE Ascend Direct selection, not this shim item.transferSyncstill retriesnumContexts()+1times; under TENTnumContexts()is hardcoded1. The poll loop handlesCOMPLETED/FAILED/TIMEOUTonly — notCANCELED— and does not evict the cached handle on poll failure."installTransport not used by TENT"and returnsnullptr. Classic contract:nullptrmeans install failed. Store already skips this viaisUsingTent()(#2596). C / Go (transfer_engine_c.h) and EFA/CXI Python do not. Proposed fix A (TENT returns a non-null sentinel; in-tree callers only null-check) is preferred over gating every caller (B) or fixing only the C shim (C). Waiting on TENT owners (@alogfans) before a PR. Related leftover from the same comment, not yet a row:freeBatchIDon a busy batch (BatchBusyvs TENT lazy sweep).Claiming
Open a PR for one open or partial work item and link it here (
Refs #3995).No maintainer ACK needed.
Please comment on this issue before you start (optional, but helps avoid
duplicate work). Done/partial rows should not grow a second overlapping PR
unless it is a documented residual.
PR title:
[TENT] ...or[Bugfix] .... The PR should explain how youverified the problem is real (repro steps, logs, or why the path is
unreachable / already safe). Include a test that failed on main under
MC_USE_TENT=1and passes after.@github-actions[bot] commented on GitHub (Sep 10, 2026):
Thanks for opening this issue, @staryxchen!
151037142A maintainer will triage this when possible. To help us respond faster, please include:
Useful links: Documentation · Contributing guide
@chlins commented on GitHub (Sep 14, 2026):
One more
use_tent_branch worth a row, found by running a classic C-API caller rather than the Python wrapper.installTransport()returnsnullptron TENT, and every classic caller that installs explicitly reads that as failure.transfer_engine.cpp:505-515: the TENT branch logs "installTransport not used by TENT" and returnsnullptrby design. Classic callers only know the classic contract, wherenullptrmeans the transport failed to install:!auto_discoverbranch (client_service.cpp:830-900):if (!transport) return INTERNAL_ERRORtransfer_engine_py.cpp:287-291, 319-323):if (!transport) return -1transfer_engine_c.cpp:55-59) passes the pointer through unchanged, so any C or Go caller that checks it fails the same wayThe Python happy path only survives because it relies on auto-discovery and never calls
installTransporton this build. Repro on currentmain(28b2355, TCP-only host): a Go caller overtransfer_engine_c.hgetsTransfer Engine 127.0.0.1:13001 started successfullyfollowed immediately by the install failure, before any register or transfer. #2596 already worked around this once for the Store client by gating onisUsingTent().Options, would like the TENT owners' preference before a PR:
isUsingTent(), as #2596 did. Correct, but every future caller has to know to do it.I lean A and can send it with a runtime check on a C-API caller under
MC_USE_TENT=1as the test. Not yet verified, blocked on the above:freeBatchIDon a busy batch (classic returnsBatchBusy, TENT'sfreeBatchdefers to a lazy sweep; callers that drain-then-free may behave differently).@0z5a commented on GitHub (Sep 15, 2026):
Hi @TTThanos , I'd like to take P2-first-buffer if it is still available.
@staryxchen commented on GitHub (Sep 15, 2026):
@alogfans What do you think?
@0z5a commented on GitHub (Sep 15, 2026):
it seems that p2-frist-buffer has already taken by @anranxia .
@RuixiangMa commented on GitHub (Sep 21, 2026):
@staryxchen @TTThanos I’d like to take ownership of P1-sync-status
@staryxchen commented on GitHub (Sep 22, 2026):
@RuixiangMa Thanks.
P1-sync-statusis already split across open PRs, all touchingtransfer_engine_py.cpp:CANCELEDas terminalPlease align with #4228 / #4241. The remaining gap from this RFC is poll-failure eviction (
FAILED/TIMEOUTstill keephandle_map_); #4109 only coverssubmitTransferfailure. If #4264 is only that leftover, please say so and drop the overlapping retry/CANCELEDbits.@RuixiangMa commented on GitHub (Sep 22, 2026):
thx, I will remove the overlapping retry, CANCELED, async-status, and retry-hint changes from #4264. The remaining scope is only cached Segment eviction after synchronous poll failure (
get*TransferStatus()error,FAILED, orTIMEOUT). This must be rebased on #4228 first: current TENT sync paths still retry once after the first attempt, so closing an evicted Segment before #4228 could leave that retry using the local stale handle. After #4228 lands, I will rebase and submit only the narrow poll-failure eviction plus its regression test. #4241 remains the owner of CANCELED handling.