tools

Modules

modelopt.torch.puzzletron.tools.checkpoint_utils

Utilities for loading and initializing PyTorch model checkpoints (AnyModel / HF layouts).

modelopt.torch.puzzletron.tools.checkpoint_utils_hf

Utilities for loading and saving Hugging Face-format checkpoints (AutoConfig + optional block_configs).

modelopt.torch.puzzletron.tools.common

modelopt.torch.puzzletron.tools.hydra_utils

Utilities for hydra config initialization.

modelopt.torch.puzzletron.tools.kd_model

Knowledge distillation loss functions.

modelopt.torch.puzzletron.tools.logger

modelopt.torch.puzzletron.tools.post_init_sparse

modelopt.torch.puzzletron.tools.robust_json

Provides a robust JSON encoder that can handle various types of objects, including dataclasses, paths, enums, namespaces, and functions.

modelopt.torch.puzzletron.tools.sharded_checkpoint_utils

Provides utilities for distributed loading, saving, and manipulation of large language model checkpoints across multiple GPUs/processes.

modelopt.torch.puzzletron.tools.validate_model

Provides a function to validate a model.

modelopt.torch.puzzletron.tools.validate_puzzle_with_multi_replacements

Validates puzzle solutions by applying layer replacements and evaluating model performance.

modelopt.torch.puzzletron.tools.validation_utils

Utility functions for validating models and extracting hidden states and similarity metrics.