nemo_rl.models.megatron.draft.training#
Module Contents#
Classes#
Model-build operation selected by a configured draft speculator. |
|
Current EAGLE-3 draft speculator. |
Functions#
Resolve an enabled draft configuration to its speculator. |
Data#
API#
- class nemo_rl.models.megatron.draft.training.DraftSpeculator#
Bases:
typing.ProtocolModel-build operation selected by a configured draft speculator.
- build_model(
- *,
- model_provider: megatron.bridge.models.model_provider.ModelProviderMixin,
- pg_collection: megatron.core.process_groups_config.ProcessGroupCollection,
- policy_model_chunk: megatron.core.transformer.MegatronModule,
Build the draft model for the policy chunk that owns it.
- class nemo_rl.models.megatron.draft.training.Eagle3Speculator#
Current EAGLE-3 draft speculator.
- build_model(
- *,
- model_provider: megatron.bridge.models.model_provider.ModelProviderMixin,
- pg_collection: megatron.core.process_groups_config.ProcessGroupCollection,
- policy_model_chunk: megatron.core.transformer.MegatronModule,
Build the EAGLE-3 draft model with the existing implementation.
- nemo_rl.models.megatron.draft.training._SPECULATOR_FACTORIES: dict[str, type[nemo_rl.models.megatron.draft.training.Eagle3Speculator]]#
None
- nemo_rl.models.megatron.draft.training.resolve_draft_speculator(
- config: nemo_rl.models.policy.draft_config.Eagle3DraftConfig | collections.abc.Mapping[str, Any] | None,
Resolve an enabled draft configuration to its speculator.
PolicyConfigis a TypedDict, sopolicy_cfg["draft"]is only anEagle3DraftConfigbecausePolicy.__init__normalizes it in place. Coerce here as well so this stays correct for callers that build aPolicyConfigby hand and never go through that path.