nemo_automodel.recipes.retrieval.distill_bi_encoder
nemo_automodel.recipes.retrieval.distill_bi_encoder
Module Contents
Classes
Functions
Data
API
Bases: TrainBiEncoderRecipe
Recipe for Stage-1 embedding distillation on bi-encoder backbones.
Build optimizer groups with projection params isolated before checkpoint restore.
Select the pooled student embedding for validation scoring.
RetrieverStudentWithProjection.forward returns
(pooled, projected, intermediate_outputs). The pooled embedding is the student’s
native retrieval representation (and what training’s InfoNCE terms score with), so it
is what the inherited validation loop should compare against.
Average projection gradients that are outside FSDP/DDP wrapping.
Keep the rank-local projection head replicated across DP ranks.
Read either OmegaConf-style dotted keys or nested dict/config values.
Copy HF metadata/tokenizer files needed by AutoModel.from_pretrained.
Materialize an evaluator-facing HF checkpoint from Automodel wrapper weights.
Mirror non-weight HF artifacts from the original student checkpoint.
Return the HF backbone tensors from a RetrieverStudentWithProjection checkpoint.
Entry point: load config, build the distillation recipe, and run training.