Skip to content

Draft mode autodetection + fixes for speculative decoding - #4490

Merged
dtrawins merged 6 commits into
mainfrom
eagle3_continuation
Sep 1, 2026
Merged

Draft mode autodetection + fixes for speculative decoding#4490
dtrawins merged 6 commits into
mainfrom
eagle3_continuation

Conversation

@mzegla

@mzegla mzegla commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI lite review requested due to automatic review settings August 31, 2026 08:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes several small adjustments around speculative decoding and text-generation deployment configuration, spanning both runtime initialization and user-facing export/graph tooling.

Changes:

  • Default the draft model device to the main model device when draft_device is not provided (legacy + continuous batching initializers).
  • Reduce verbosity in the LLM HTTP calculator by moving per-iteration logs from DEBUG to TRACE.
  • Extend graph/export tooling and demos to support auto-detected device behavior and updated OpenAI-compatible endpoint examples.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/llm/language_model/legacy/servable_initializer.cpp Falls back to main device when draft_device is empty for draft pipeline init.
src/llm/language_model/continuous_batching/servable_initializer.cpp Same draft-device fallback for continuous batching draft pipeline init.
src/llm/http_llm_calculator.cc Downgrades several high-frequency DEBUG logs to TRACE in Process().
src/graph_export/graph_export.cpp Emits draft_device in generated graph template when provided.
src/graph_export/graph_cli_parser.cpp Parses draft_device into graph settings (but CLI option wiring is incomplete).
src/capi_frontend/server_settings.hpp Adds draftDevice to text-generation graph settings.
demos/continuous_batching/speculative_decoding/README.md Updates Docker/devices guidance and pip install instructions; needs clarification for portability.
demos/continuous_batching/accuracy/README.md Updates example base URLs from /v3 to /v1.
demos/common/export_models/README.md Documents auto-detected device behavior when --target_device is omitted.
demos/common/export_models/export_model.py Makes --target_device optional and omits device/draft_device fields from generated graph when not specified.
Suppressed comments (1)

demos/continuous_batching/speculative_decoding/README.md:289

  • This paragraph suggests OVMS will auto-detect the best available device, but the Docker command above does not expose any accelerator devices to the container (so only CPU will be visible). Clarify that auto-detection is limited to devices visible inside the container and that accelerator pass-through flags are required to actually use GPU/NPU.
OVMS auto-detects the best available device at startup. To target a specific device explicitly, pass `--target_device GPU` (or `NPU`, `HETERO:GPU,CPU`, etc.) to `export_model.py` and follow the [AI accelerators guide](../../../docs/accelerators.md) for additionally required docker parameters.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +158 to +160
if (result->count("draft_device")) {
graphSettings.draftDevice = result->operator[]("draft_device").as<std::string>();
}
Comment on lines 92 to +96
```bash
docker run -d --rm -p 8000:8000 -v $(pwd)/models:/workspace:ro openvino/model_server:weekly --rest_port 8000 --config_path /workspace/config.json
docker run -d --rm --device /dev/dri --group-add $(stat -c '%g' /dev/dri/render* | head -n1) -p 8000:8000 -v $(pwd)/models:/workspace:ro openvino/model_server:weekly --rest_port 8000 --config_path /workspace/config.json
```

Running above command starts the container with no accelerators support.
To deploy on devices other than CPU, change `target_device` parameter in `export_model.py` call and follow [AI accelerators guide](../../../docs/accelerators.md) for additionally required docker parameters.
OVMS auto-detects the best available device at startup. To target a specific device explicitly, pass `--target_device GPU` (or `NPU`, `HETERO:GPU,CPU`, etc.) to `export_model.py` and follow the [AI accelerators guide](../../../docs/accelerators.md) for additionally required docker parameters.
@mzegla
mzegla force-pushed the eagle3_continuation branch from d2276c7 to 7497d63 Compare September 1, 2026 12:53
@mzegla mzegla changed the title Minor fixes for speculative decoding Draft mode autodetection + fixes for speculative decoding Sep 1, 2026
@mzegla
mzegla requested a lite review from Copilot September 1, 2026 12:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 5 comments.

Comment on lines +72 to +76
// Detects draft model strategy from model artifacts without a full model load.
// Reads last 32KB of the XML (rt_info is at the end of OV IR format) for eagle3/dflash markers.
// DFlash takes priority over EAGLE3 when both markers are present (matches GenAI's strategy selection).
// Throws std::runtime_error if the XML cannot be opened.
GenAiServableProperties::DraftModelStrategy detectDraftModelStrategy(const std::string& draftPath);
Comment thread src/graph_export/graph_cli_parser.cpp
Comment on lines 3158 to 3160
TEST_F(OvmsInferredTaskTest, positiveConfigureModeInfersTaskFromModel) {
const std::string modelPath = resolveTestModelPath("llama");
const std::filesystem::path configJson = std::filesystem::path(modelPath) / "config.json";
Comment on lines +382 to +388
docker run -d --rm $(test -d /dev/dri && echo "--device /dev/dri --group-add $(stat -c '%g' /dev/dri/render* | head -n1)") \
-p 8000:8000 -v ${HOME}/models:/models:rw openvino/model_server:weekly \
--rest_port 8000 \
--model_repository_path /models \
--source_model OpenVINO/Qwen3.8-27B-int8-ov \
--draft_model_path .
--enable_prefix_caching false
Comment on lines +394 to +399
ovms --rest_port 8000 \
--model_repository_path c:\models \
--source_model OpenVINO/Qwen3.8-27B-int8-ov \
--draft_model_path .
--enable_prefix_caching false
```
Comment thread demos/continuous_batching/speculative_decoding/README.md Outdated
@dtrawins
dtrawins merged commit 5f09c40 into main Sep 1, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants