Skip to content

[Fix] Read TensorCast's WORLD placement under its current names - #41805

Merged
ch-wan merged 1 commit into
mainfrom
cheng/hot-fix/tensorcast-world-placement
Sep 30, 2026
Merged

ch-wan merged 1 commit into
mainfrom
cheng/hot-fix/tensorcast-world-placement

Conversation

@ch-wan

@ch-wan ch-wan commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

This PR is part of a stack (oldest at bottom):

Motivation

When no placement is passed in, the TensorCast host allocator reads get_parallel().world_rank and get_parallel().world_size. Those names had already been split into launch_world_rank / launch_world_size when the backend landed, so both production paths (TensorcastStore.__init__ and get_tensorcast_host_allocator_from_runtime) raise AttributeError. The package's own TensorCast tests miss this: they replace get_parallel with a namespace that carries the old names.

Modifications

  • Read launch_world_rank / launch_world_size, and give the in-package test stubs the same names.
  • Add a census to test_runtime_context.py: every get_parallel().<name> read in the package, direct or through a name bound to the context, must name a declared parallel field. The one remaining read of an undeclared name, the KV-shard control plane's enable flag (mem_cache/page_interleave.py, currently unreachable), is listed with its reason. The census fails once that read goes away, so the exception cannot go stale.

Accuracy Tests

Not applicable: no model output changes.

  • On main, the census reports exactly the two TensorCast reads; on this PR it passes.
  • test/registered/unit at this PR's head, compared with main: no new failures.
  • Not run: the TensorCast package tests (they need tensorcast installed).

Speed Tests and Profiling

Not applicable.

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): 🚫 Run #36772466190
Latest PR Test (Extra): 🚫 Run #36772465602
Latest PR Test (AMD ROCm 10): 🚫 Run #36772465942

@github-actions github-actions Bot added the hicache Hierarchical Caching for SGLang label Sep 30, 2026
@ch-wan
ch-wan force-pushed the cheng/hot-fix/tensorcast-world-placement branch from 96e0a09 to f573c0e Compare September 30, 2026 04:24
The TensorCast host allocator read `get_parallel().world_rank` and
`world_size` when no placement is passed. Those names had been split into
`launch_world_rank` / `launch_world_size` before the backend landed, so
both production paths (`TensorcastStore.__init__` and
`get_tensorcast_host_allocator_from_runtime`) raised AttributeError. The
package's TensorCast tests did not notice because they replace
`get_parallel` with a namespace carrying the old names.

Read the two names under their current spelling, and add a census over
the whole package: every `get_parallel().<name>` read, directly or
through a name bound to the context, must name a declared parallel
field. On the parent it reports exactly these two reads. The one read of
an undeclared name that remains, the KV-shard control plane's enable
flag, is listed with its reason, and the census fails once it is no
longer read.
@ch-wan
ch-wan force-pushed the cheng/hot-fix/tensorcast-world-placement branch from f573c0e to eed1566 Compare September 30, 2026 20:24
@ch-wan
ch-wan merged commit e27b6e0 into main Sep 30, 2026
9 of 19 checks passed
@ch-wan
ch-wan deleted the cheng/hot-fix/tensorcast-world-placement branch September 30, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hicache Hierarchical Caching for SGLang

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant