Skip to content

refactor(hicache): flatten L2 transfer execution - #34793

Merged
cctry merged 1 commit into
sgl-project:mainfrom
cctry:oss/l2-transfer-consolidation
Aug 16, 2026
Merged

cctry merged 1 commit into
sgl-project:mainfrom
cctry:oss/l2-transfer-consolidation

Conversation

@cctry

@cctry cctry commented Aug 14, 2026 •

Copy link
Copy Markdown
Collaborator

Resolve device↔host work into flat L2Transfer commands so the executor and host-pool group no longer recursively dispatch pool transfers, without changing cache behavior.

Boundary

class L2Transfer(NamedTuple):
    host_pool: Any
    device_pool: Any
    host_indices: torch.Tensor
    device_indices: torch.Tensor
    layer_mapper: Optional[Callable[[int], Optional[int]]] = None
    is_draft: bool = False

L2TransferEngine(io_backend).submit_device_to_host(
    transfers: list[L2Transfer],
) -> TransferCompletion

L2TransferEngine(io_backend).submit_host_to_device(
    transfers: list[L2Transfer],
    *,
    layer_num: int,
    start_event=None,
    on_layer_done=None,
) -> TransferCompletion

Ownership

  • Controllers: allocation, queues, acknowledgements, layer mapping, and PoolTransfer resolution.
  • Engine: execute already-resolved device↔host commands and retain index tensors on its streams.
  • Host pools: move bytes for one concrete pool.
  • Storage/L3 and tree lifecycle: unchanged.

Result

  • One flat execution boundary for base and hybrid caches.
  • No nested transfer dispatch in L2TransferEngine or HostPoolGroup.
  • Existing concatenated per-pool index tensors continue to feed the same C++/JIT kernels.

Validation

  • 2,124 tests run: 1,092 passed, 1,032 skipped, 0 failures.
  • Compileall, diff check, and all applicable pre-commit hooks pass.

CI States

Latest PR Test (Base): ❌ Run #31927917622
Latest PR Test (Extra): ❌ Run #31927917545

@cctry

cctry commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Aug 14, 2026
@cctry
cctry force-pushed the oss/l2-transfer-consolidation branch from 12ca9db to d094d75 Compare August 16, 2026 04:58
@cctry
cctry merged commit 8922bb9 into sgl-project:main Aug 16, 2026
214 of 236 checks passed
saturn-acc pushed a commit to saturn-acc/sglang that referenced this pull request Aug 16, 2026
danielchristiancazares pushed a commit to danielchristiancazares/sglang that referenced this pull request Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fastfail hicache Hierarchical Caching for SGLang run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant