Skip to content

refactor(rlix-validation): drop unreachable per-engine contiguity loop in C6-mapping#25

Open
TianyeGGBond wants to merge 1 commit into
rlops:zhenyu/m11-mvp-testfrom
TianyeGGBond:tianye/f10-drop-dead-c6-mapping-loop
Open

refactor(rlix-validation): drop unreachable per-engine contiguity loop in C6-mapping#25
TianyeGGBond wants to merge 1 commit into
rlops:zhenyu/m11-mvp-testfrom
TianyeGGBond:tianye/f10-drop-dead-c6-mapping-loop

Conversation

@TianyeGGBond

Copy link
Copy Markdown

Context

In assert_rlix_topology, the C6-mapping check enforces that the inference device mapping is a sorted, contiguous, zero-based list, and that each engine occupies a contiguous GPU range:

infer_device_mapping = sorted(infer)
if infer_device_mapping != list(range(len(infer_device_mapping))):
    raise RuntimeError(...)                       # (1) must be exactly [0, 1, ..., n-1]
for engine_index, start in enumerate(range(0, len(infer_device_mapping), per_engine)):
    group = infer_device_mapping[start : start + per_engine]
    expected = list(range(group[0], group[0] + per_engine))
    if group != expected:                          # (2) each engine's slice must be contiguous
        raise RuntimeError(...)

Problem

Check (2) is dead code. Once check (1) passes, infer_device_mapping is exactly [0, 1, ..., n-1]. Slicing a fully-contiguous zero-based list into per_engine-sized chunks always yields contiguous ranges, so group == expected is guaranteed and the loop's raise can never fire.

Change

Remove the loop. Check (1) alone fully enforces the C6-mapping invariant. No behavioral change — the removed branch was unreachable.

🤖 Generated with Claude Code

…p in C6-mapping

The preceding check already asserts infer_device_mapping == range(len), so
every per_engine slice is contiguous by construction and the loop can never
raise. Remove the dead code.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.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