Skip to content

train

Generalized Megatron noise-distillation training entrypoint.

Drives Stained Glass noise distillation on top of Megatron-Bridge. Unlike the POC (hardcoded to Qwen3 recipes), the base training config is selected by a config-provided dotted module:function path, so any Megatron-Bridge recipe that returns a ConfigContainer can be used. The student is wrapped as a noise-distillation provider (noisy student vs. clean teacher), the noise std_log metric is surfaced alongside the KD metrics, and training runs via megatron.bridge.training.distill.distill.

Configuration is a YAML file (loaded with OmegaConf) plus optional Hydra-style dotlist CLI overrides. See stainedglass_core/megatron/configs for the schema and an example. Pipeline and virtual-pipeline parallelism are unsupported.

Run under torchrun; requires the Megatron runtime (NeMo container).

Functions:

Name Description
main

Run noise-distillation training from a YAML config plus CLI overrides.

main

main() -> None

Run noise-distillation training from a YAML config plus CLI overrides.

Raises:

Type Description
FileNotFoundError

If the config file does not exist.

ValueError

If the distill block has an unknown key, required distill paths are missing, or PP != 1.