Skip to content

feat(runtime): separate Target service and Draft environments for PyPI - #27

Open
zhouaihui wants to merge 13 commits into
inclusionAI:mainfrom
zhouaihui:feat/pypi-ling-aspec
Open

zhouaihui wants to merge 13 commits into
inclusionAI:mainfrom
zhouaihui:feat/pypi-ling-aspec

Conversation

@zhouaihui

@zhouaihui zhouaihui commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

ling-aspec installs Draft training dependencies; ling-aspec-target installs the supported SGLang integration in an independent environment. Both automatically install the same ling-aspec-runtime, which alone owns the aspec namespace and CLI. Target keeps SGLang 0.5.21's CUTLASS 4.6.2 / Quack 0.6.4 requirements; Draft keeps 4.7.1 / 0.6.5. Dependency overrides are removed.

Start aspec target in Target, then aspec train --config run.yaml in Draft. They connect using inference.target_service.address (localhost by default); external startup requires no other environment's Python path. A versioned JSON control interface carries token requests, feature descriptions and lifecycle calls. Feature tensors retain the existing Mooncake transport, feature contracts and work identities. Draft's Plan reserves the physical GPUs; Target validates and exclusively leases those GPU sets, using a private Ray runtime for its own source processes.

Optional single-node managed-local supervision launches this same service, checks readiness and process ownership, writes its logs, and shuts down only the service it started. Only this optional supervisor needs a Target interpreter location. It uses the existing full checkpoint/resume path. Quickstart exposes --managed-target; recipe acceptance accepts explicit config overrides.

Sessions release their own workers while the external service remains available. Lost control stops admission; source buffers are retained until local read-process exit is verified. Unobservable remote readers remain retained. Existing work ownership, fallback and Evidence gates stay strict. Worker provenance comes from actual Target processes rather than the Draft installation.

aspec patch-sglang only patches/verifies supported files. Native CUDA JIT libraries use a private cached toolkit view; host drivers and installed CUDA wheels are not changed. Public guides describe the two installs and simple launch commands.

Release builds produce three version-aligned wheel/sdist pairs. Matching canonical version tags publish the audited artifacts through the GitHub pypi environment. Manual runs validate without publishing. Maintainers keep the b0 release suffix and choose each version; CI never increments it. The PyPI token must cover all three project names.

Verification

Current head: b151362.

  • Two isolated Linux/Python 3.12 environments installed the role dependencies with ordinary pip resolution. Both pip check runs pass, with the intended different CUTLASS/Quack versions and no SGLang in Draft.
  • A real two-environment probe started the public Target command, connected from a separate Draft Ray job over HTTP, verified Target interpreter/package/kernel origins, closed the session and verified the service remained available.
  • Final-head Draft CPU regression: 2,714 passed, 194 explicit skips, 51 subtests passed. Final-head Target factory/concurrency/decode CPU tests: 45 passed. GPU skips are not acceptance; the separate GPU runs below exercise the actual runtime.
  • Linux lint, documentation links, six-artifact release audit and installed-wheel metadata checks pass.
  • Independent startup passed the public eight-GPU DSpark acceptance recipe: Qwen3-8B, four Target + four Draft workers, FA4, packing, 4K limit, 256 training / 32 disjoint evaluation conversations. It trained to step four, evaluated and saved the distributed checkpoint, restored model/master weights, Adam moments and RNG exactly on all four Draft ranks, continued to step eight, evaluated, exported and passed strict native loading. Both attempts ended completed/healthy with no fallbacks or required capabilities pending. All eight session workers closed while the same Target service remained available between phases.
  • Managed-local passed the public two-GPU Qwen3-8B Quickstart with --managed-target: first four steps, full checkpoint restoration, continuation to step eight, export and strict loading. The supervisor started and stopped a distinct owned Target process for each phase. Both attempts ended completed/healthy. Eight updates validate the bounded workflow, not convergence or model quality.
  • Installed files matched every byte of the final runtime wheel (265 files) and each role wheel (four files), excluding pip-generated RECORD files. Both venvs reported ASpec code SHA 1e246018acf606d7547153a56389c4411a28054208dd3d381da61e1e68478bcc; runtime wheel SHA256 is c136319a9291456dfca4aa2e6a08ec012b2342272817d59a02d29089548b85a9. Console commands were also exercised outside the source checkout.
  • PR CI passed both jobs. The manual release workflow passed build, strict Twine metadata checks and installed-wheel smoke tests; publishing was skipped as intended.
  • The supplied H200 host reports SM90 through CUDA and NVIDIA L20X / 143771 MiB through NVML. Validation uses Torch 2.13.0+cu130, SGLang 0.5.21, existing private CUDA 13 compatibility libraries and host driver 570.148.08. GPU validation ran alongside the existing workload with mem_fraction_static=0.35; no host-wide process/Ray cleanup or driver changes were performed. No throughput or convergence claim is made.
  • Failed attempts exposed an initially insufficient SGLang memory budget and missing run/attempt environment propagation into native scheduler children. The budget was corrected explicitly; session IDs and shared-view flags are now propagated per actor. A further regression verifies dead source-process retirement after reader fencing and protects slow actor creation before heartbeats start. The failed attempts and their Evidence/logs remain preserved outside the public source tree. No production capability or acceptance gate was weakened. No version tag or PyPI upload has been triggered.

Provenance and scope

The external-service and optional supervision boundaries are inspired by SpecForge f8cc3dc; its newer capture plugin is not copied. ASpec adapts its retained TorchSpec-derived SglEngine/transport contract and preserves the existing TorchSpec and transitive AngelSpec notices and license texts.

Unverified scope: real multi-node service training, arbitrary network/host failure recovery, convergence/model quality, serving decode acceptance and actual PyPI publication. Unsupported or unverified reader reclamation fails closed.

@zhouaihui zhouaihui changed the title feat(release): publish ling-aspec beta packages to PyPI feat(packaging): publish ling-aspec with pip installation and Target setup Nov 12, 2026
@zhouaihui zhouaihui changed the title feat(packaging): publish ling-aspec with pip installation and Target setup [WIP] feat(packaging): publish ling-aspec with pip installation and Target setup Nov 12, 2026
@zhouaihui zhouaihui changed the title [WIP] feat(packaging): publish ling-aspec with pip installation and Target setup feat(packaging): publish ling-aspec with pip installation and Target setup Nov 12, 2026
@zhouaihui zhouaihui changed the title feat(packaging): publish ling-aspec with pip installation and Target setup feat(packaging): isolate Target and Draft runtimes for ling-aspec Nov 12, 2026
@zhouaihui zhouaihui changed the title feat(packaging): isolate Target and Draft runtimes for ling-aspec feat(runtime): separate Target service and Draft environments for PyPI Nov 12, 2026
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