megatron
Megatron / NeMo integration for Stained Glass noise training.
This subpackage ports the Stained Glass noise-distillation stack onto NVIDIA
Megatron-Core / Megatron-Bridge. It targets the NeMo container runtime
(nvcr.io/nvidia/nemo:26.06.00); the heavy Megatron dependencies are provided
by that image rather than installed from PyPI (see Dockerfile.megatron and
requirements/megatron.txt).
Supported topology: tensor parallel (TP) + context parallel (CP). Pipeline parallel (PP) is not supported.
Importing this subpackage is always safe, even without the Megatron runtime:
heavy imports are deferred (PEP 562) until a Megatron-backed symbol is accessed,
at which point a clear ImportError is raised if the runtime is missing.
Use is_megatron_available to probe the environment without triggering an
error.
Functions:
| Name | Description |
|---|---|
is_megatron_available |
Return whether the Megatron/NeMo runtime is available in this environment. |
missing_modules |
Return the required Megatron modules that are not importable here. |
require_megatron |
Raise a helpful error if the Megatron/NeMo runtime is unavailable. |
__dir__
¶
Return the package's public attributes, including lazy exports.
Returns:
| Type | Description |
|---|---|
list[str]
|
The sorted union of eagerly-defined names and lazy export names. |
__getattr__
¶
Lazily import Megatron-backed public symbols (PEP 562).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
The attribute being accessed on this package. |
required |
Returns:
| Type | Description |
|---|---|
Any
|
The requested attribute, imported from its backing submodule. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If the symbol requires the Megatron runtime and it is unavailable. |
AttributeError
|
If |
is_megatron_available
¶
Return whether the Megatron/NeMo runtime is available in this environment.
Returns:
| Type | Description |
|---|---|
bool
|
|
missing_modules
¶
Return the required Megatron modules that are not importable here.
Returns:
| Type | Description |
|---|---|
tuple[str, ...]
|
The subset of |
tuple[str, ...]
|
current environment, in declaration order. |
require_megatron
¶
Raise a helpful error if the Megatron/NeMo runtime is unavailable.
Raises:
| Type | Description |
|---|---|
ImportError
|
If any module in |