Skip to content

[DataFlow runtime] Phase B1 — TargetEngine ABC + de-EAGLE3 the target boundary#631

Merged
jiapingW merged 1 commit into
dataflow-up-16-zerocopyfrom
dataflow-up-24-target-engine
Jul 3, 2026
Merged

[DataFlow runtime] Phase B1 — TargetEngine ABC + de-EAGLE3 the target boundary#631
jiapingW merged 1 commit into
dataflow-up-16-zerocopyfrom
dataflow-up-24-target-engine

Conversation

@maocheng23

Copy link
Copy Markdown
Collaborator

Phase B (domain abstractions) — 1/3. Stacked on #629 (dataflow-up-23-domino). Pure structure/naming, no behavior change.

Extracts a backend-agnostic TargetEngine ABC (modeling/target/base.py) with a generic capture() entry point + a real backend tag, as the shared base of two sibling algorithm engines:

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.
  • Real backend class attr on every leaf ("sglang"/"hf"/"custom"); the inference adapters' health() stops falling back to "unknown".
  • Generic get_target_engine(strategy=, backend=) factory; loaders imported lazily so import specforge still works without the pinned sglang.
  • All pre-Phase-B names kept as aliases (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_runtime 214 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

… 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>
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@maocheng23 maocheng23 marked this pull request as ready for review July 1, 2026 08:22
Base automatically changed from dataflow-up-23-domino to dataflow-up-16-zerocopy July 3, 2026 01:49
@jiapingW jiapingW merged commit e94aa3f into dataflow-up-16-zerocopy Jul 3, 2026
1 check passed
@jiapingW jiapingW deleted the dataflow-up-24-target-engine branch July 3, 2026 02:03
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.

2 participants