Repository navigation
Initial Driver System - #1335
Merged
Merged
Conversation
… remote driver in prep
Cherry-picked from 98bbb835 on feature/vllm-integration. Resolved against
dev-4.x's Phase A type split:
- bridge.py: kept the shim (TransformerBridge content lives in
transformer_bridge.py now).
- sources/transformers.py: accepted the scaffold's package restructure
(transformers.py → transformers/{__init__,helpers,source}.py +
_hf_format.py).
- sources/transformers/source.py: re-applied Phase A's explicit
TransformersDriver construction in boot().
sources/vllm/source.py's boot_vllm currently sets bridge._forward_impl,
which Phase A removed. The function is dead until the next chunk lifts
it onto VLLMDriver + RemoteBridge — landing as-is so the scaffold tree is
on dev-4.x for incremental Phase B work.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Description
Initial setup of the Driver system. The goal of this new system is to make the source for the model agnostic, so we can use a multitude of different sources.
The system is made up of several new parts:
DriverProtocol– This defines what every driver must satisfyBridgeCore– Defines framework agnostic components of all bridges. Owns the hook registry, alias machinery,run_with_cache/run_with_hooks,_replay_captures, and_finalize_return.TransformerBridge(BridgeCore, HookIntrospectionMixin, nn.Module)– torch-backed. Carries the torch-specific surface:parameters(),state_dict(),generate(), weight-access properties (W_Qetc.),compatibility_mode. Constructor falls back to building aTransformersDriverif none provided.RemoteBridge(BridgeCore, HookIntrospectionMixin)- non-torch. Nonn.Moduleparentage. Requiresdriver.supported_hook_pointsnon-empty at construction;cfg.deviceisNone;forward()routes throughdriver.forward()only.model_bridge/sources/transformers.pysplit up into a package. Splits out functionality that is used by multiple bridges, allowsRemoteBridgeto import only the things it needsThere are two
Driversat present:TransformersDriver– Handles the current 3.x standard HF/torch systemVLLMDriver– Handles running aRemoteBridgefor a vLLM backend.Also added a Colab notebook. it is a 7-step end-to-end integration test (HF reference → vLLM boot → capture pipeline → greedy parity → per-hook L2 acceptance → intervention smoke → lifetime). Validated on Llama-3.2-1B (fp16), Qwen2.5-0.5B (fp16, T4), Gemma-2-2B (bf16, requires A100/L4).
Type of change
Checklist: