-
Notifications
You must be signed in to change notification settings - Fork 9
Converters refactor [base implementations]: base converter architecture with registry-based algorithm detection #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: features/converters/config-updates
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 introduces a new registry-based converter architecture that replaces hardcoded conversion logic with an extensible system supporting automatic algorithm detection. The refactor standardizes the conversion of external research model checkpoints (EAGLE, HASS, etc.) into the Speculators format through a unified interface.
Key changes include:
- Implementation of a registry-based converter system with automatic algorithm detection
- Enhanced CLI interface with improved parameter handling and additional Hugging Face download options
- Refactored conversion pipeline with better error handling and validation capabilities
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/speculators/convert/entrypoints.py | Complete rewrite of the conversion entry point with new converter architecture integration |
src/speculators/convert/converters/base.py | New abstract base converter class implementing registry pattern and generic type support |
src/speculators/convert/converters/init.py | Module initialization exposing the base converter interface |
src/speculators/main.py | Enhanced CLI with improved parameter ordering, documentation, and additional download options |
pyproject.toml | Updated linting configuration to allow TC003 for typing imports |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
📦 Build Artifacts Available |
f8de1f7
to
622462c
Compare
23fe6c8
to
6e27c36
Compare
50eb873
to
a3c0f80
Compare
6e27c36
to
193edda
Compare
Signed-off-by: Mark Kurtz <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Mark Kurtz <[email protected]>
Signed-off-by: Mark Kurtz <[email protected]>
Signed-off-by: Mark Kurtz <[email protected]>
…/CLI to utilize it Signed-off-by: Mark Kurtz <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Mark Kurtz <[email protected]>
Co-authored-by: Copilot <[email protected]> Signed-off-by: Mark Kurtz <[email protected]>
Signed-off-by: Mark Kurtz <[email protected]>
193edda
to
d7918aa
Compare
…rters/base-entrypoints
Signed-off-by: Mark Kurtz <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM pending comments!
config: str | os.PathLike | PreTrainedModel | PretrainedConfig | dict | None = None, | ||
verifier: str | os.PathLike | PreTrainedModel | None = None, | ||
validate_device: str | torch.device | int | None = None, | ||
algorithm: Literal["auto", "eagle", "eagle2", "hass"] = "auto", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add eagle3
here?
algorithm_kwargs: dict | None = None, | ||
cache_dir: str | Path | None = None, | ||
force_download: bool = False, | ||
local_files_only: bool = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the rationale behind adding a local_files_only
pathway?
"The source repo/algorithm to convert from into the matching algorithm " | ||
"in Speculators" | ||
), | ||
click_type=click.Choice(["auto", "eagle", "eagle2", "hass"]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, is leaving out eagle3 intentional?
Summary
Introduces a new registry-based converter architecture for transforming external research model checkpoints into the standardized Speculators format. The refactor replaces the previous hardcoded conversion logic with an extensible, generic converter system that supports automatic algorithm detection and provides a unified interface for various speculative decoding implementations (EAGLE, HASS, etc.).
Details
SpeculatorConverter
abstract base class with registry mixin for automatic converter resolutionalgorithm="auto"
is specifiedcache_dir
,force_download
, etc.)convert_model
function to use the new converter architecturefrom __future__ import annotations
for modern type annotation supportTC003
for typing importsTest Plan