[DataFlow runtime] Phase B1 — TargetEngine ABC + de-EAGLE3 the target boundary#631
Merged
Merged
Conversation
… boundary
Extract a backend-agnostic `TargetEngine` ABC (modeling/target/base.py) with a
generic `capture(...)` entry point + a real `backend` tag, replacing the two
EAGLE3-/DFlash-named ABCs as the shared base:
TargetEngine
├── Eagle3TargetEngine (was Eagle3TargetModel) {HF,SGLang,Custom}
└── DFlashTargetEngine (was DFlashTargetModel) {SGLang,HF}
- `capture()` / `set_capture_layers()` are thin dispatchers onto the unchanged
`generate_eagle3_data` / `generate_dflash_data` / `set_aux_hidden_states_layers`,
so extraction is byte-identical — this PR is pure structure/naming, no logic.
- Real `backend` class attr on every leaf ("sglang"/"hf"/"custom"); the inference
adapters' health() stops reading getattr(..., "unknown").
- Generic `get_target_engine(strategy=, backend=)` factory (modeling/target/factory.py),
loaders imported lazily so `import specforge` still works without the pinned sglang
(dflash_target_model imports sglang unconditionally — kept off the eager path).
- All pre-Phase-B names (`Eagle3TargetModel`, `get_eagle3_target_model`, ...) kept as
aliases; scripts/tests untouched. `sglang_server` factory branch lands in B2.
- Add tests/test_runtime/test_target_engine_abc.py (hierarchy, backend tags, capture
dispatch, alias identity, factory dispatch).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
jiapingW
approved these changes
Jul 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase B (domain abstractions) — 1/3. Stacked on #629 (
dataflow-up-23-domino). Pure structure/naming, no behavior change.Extracts a backend-agnostic
TargetEngineABC (modeling/target/base.py) with a genericcapture()entry point + a realbackendtag, as the shared base of two sibling algorithm engines:capture()/set_capture_layers()are thin dispatchers onto the unchangedgenerate_eagle3_data/generate_dflash_data/set_aux_hidden_states_layers, so extraction is byte-identical.backendclass attr on every leaf ("sglang"/"hf"/"custom"); the inference adapters'health()stops falling back to"unknown".get_target_engine(strategy=, backend=)factory; loaders imported lazily soimport specforgestill works without the pinned sglang.Eagle3TargetModel,get_eagle3_target_model, …) — scripts/tests untouched.New test:
tests/test_runtime/test_target_engine_abc.py.Validation
Part of the Phase B stack validated together on 8×H200: full
tests/test_runtime214 OK (2 skip, 1 xfail), target-model hf-vs-sglang-vs-custom parity 2 OK (TP=2). Adversarial review over the stack: 0 confirmed defects.Plan:
docs/roadmap/domain-refactor.md§B (see #630).🤖 Generated with Claude Code