Skip to content

runtime/shims: wire SGLang parallel_groups, EngineAdapter & scoped compose - #406

Merged
FujitsuPolycom merged 4 commits into
mainfrom
feat/sglang-engine-adapter
Nov 30, 2026
Merged

FujitsuPolycom merged 4 commits into
mainfrom
feat/sglang-engine-adapter

Conversation

@FujitsuPolycom

Copy link
Copy Markdown
Owner

Why

Make SGLang and arbitrary Torch/NCCL containers ("oddities") first-class alongside vLLM, stop single-profile edits from churning all 43 checked-in Compose files, and fix broken MetaPathFinder chaining across vLLM shims.

What Changed

  • Wire SGLang parallel_groups (runtime/common/stock_image.py): Connect parallel_groups.py into stock_image.py (sglang_parallel_plan, sglang_parallel_problems), resolve the --pp-size > 1 refusal contradiction with unified --tp-size/--pp-size/--ep-size derivation, and make SIRCL_GID_INDEX configurable (defaulting to 3 only as fallback).
  • EngineAdapter layer (runtime/common/engine_adapter.py, serving.py, toolchain_profiles.py): Introduce EngineAdapter ABC with VllmAdapter, SglangAdapter, and GenericContainerAdapter; move experimental overrides out of core serving logic into runtime/common/experimental-overrides.json (preserving __getattr__ backward-compat aliases); add mtime-keyed caching to toolchain_profiles.canonical().
  • Atomic writes & per-profile Compose hashing (atomic_io.py, installer.py, compose.py, scripts/compose_builder/export.py): Replace write-then-chmod with atomic O_CREAT|O_EXCL + fchmod; scope source_inventory() and identity_inventory(..., profile_id=profile_id) per profile (with one-time regeneration of profiles/*/compose/*).
  • Fix MetaPathFinder chaining (integrations/vllm/{ds41_row_shard,qwen4_*,glm*}): Replace direct PathFinder.find_spec() calls with re-entrancy-guarded downstream sys.meta_path delegation so stacked import hooks compose cleanly.

Verification

  • pytest across runtime/common/, runtime/host/test_{stock_install,install_sircl}.py, integrations/vllm/{ds41_row_shard,qwen4_collectives,qwen4_prefill}, and scripts/compose_builder/test_compose_builder.py (1,357+ passed, 0 failures; incl. 57/57 compose_builder and 80/80 test_compose).
  • python scripts/generate_compose_examples.py --check, python scripts/check_repository_layout.py, python scripts/check_release_safety.py ., and ruff check all passed cleanly.

Risks / Follow-Ups

…ter, declarative overrides, and canonical cache
…xpose row-owned prefill profile/checkpoint aliases

Pass profile_id=profile_id from scripts/compose_builder/export.py to compose.identity_inventory so the browser Compose Builder engine matches compose.build deployment identities. Add ROW_OWNED_PREFILL_PROFILE and ROW_OWNED_PREFILL_CHECKPOINT to runtime/common/serving.py's backward-compatible __getattr__ aliases with test coverage in runtime/common/test_serving.py, and refresh generated Compose examples for the updated serving.py input digest.
@FujitsuPolycom
FujitsuPolycom force-pushed the feat/sglang-engine-adapter branch from 6df67ac to 09487db Compare November 30, 2026 06:03
@FujitsuPolycom
FujitsuPolycom merged commit 0e63cc1 into main Nov 30, 2026
11 checks passed
@FujitsuPolycom
FujitsuPolycom deleted the feat/sglang-engine-adapter branch November 30, 2026 06:19
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