Skip to content

Expose no flat block array span when host layers are bounded - #1494

Draft
jcc-google wants to merge 1 commit into
google:mainfrom
jcc-google:jcc/bounded-host-layers-explicit-pools-span
Draft

jcc-google wants to merge 1 commit into
google:mainfrom
jcc-google:jcc/bounded-host-layers-explicit-pools-span

Conversation

@jcc-google

Copy link
Copy Markdown
Contributor

Problem

With bounded host layers (num_staging_layers < num_layers), GetBlockArrayHostPointer returns nullptr on the legacy layer path but, for explicit pools (RegisterPools), still returns the pool's own storage buffer. A pool's bytes then sit in whichever host buffer its transfer leased, and storages past num_host_layers() have no buffer of their own. So ValidateChunks would reject pool-reshard chunks in any other leased buffer (Chunk out of bounds).

Split out of #1489, which fixes the full-host-mirror case (the regression hit by sglang-torchtpu PP->TP). No current user runs bounded host layers with explicit pools, so this is a latent issue in the configuration #1391 targets.

Fix

Hoist the bounded-host-layers check to the top of GetBlockArrayHostPointer, so both the layer and pool paths report no flat span and ValidateChunks defers to the per-chunk addressing.

Open question

This keeps the legacy behavior of skipping the flat check. A stricter alternative is to validate each chunk against the uuid's leased buffer. Happy to switch if preferred.

Tests

  • New PoolStagingTest.BoundedHostLayersExposeNoFlatPoolSpan (3 explicit pools, 2 host layers: every pool reports no flat span).
  • Not yet covered: a transport-level push through bounded host layers with explicit pools.

GetBlockArrayHostPointer returned nullptr for bounded host layers only on the
legacy layer path. For explicit pools it still returned the pool's own storage
buffer, although with bounded host layers a pool's bytes sit in whichever host
buffer its transfer leased (and storages past num_host_layers() have no buffer
of their own). ValidateChunks would then reject chunks in any other leased
buffer.

Hoist the bounded-host-layers check above the explicit-pools branch so both
paths report no flat span, and ValidateChunks defers to the per-chunk
addressing.

Signed-off-by: Jincheng Chen <chenjincheng@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant