ParamKey (optimizer/optimizer_config.py)

OpenClaw-RL · Megatron-LM/megatron/core/optimizer/optimizer_config.py · python · Apache-2.0
ai, tag:knn-classified

Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

# Source: https://github.com/Gen-Verse/OpenClaw-RL | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
# Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

from dataclasses import dataclass, field
from typing import Callable, Optional, Tuple, Union

import torch

from ..utils import is_te_min_version


@dataclass(frozen=True, slots=True)
class ParamKey:
    """Key to group parameters by. All such grouped parameters can share an
    optimizer config specification."""

    # TODO: Can add layer_id here later.

    name: Union[str, Tuple[str]] = field(default_factory=tuple)
    """Parameter name(s)."""

    attr: Union[str, Tuple[str]] = field(default_factory=tuple)

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key