Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions torchtitan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.

from importlib.metadata import version

# Import to register quantization modules.
import torchtitan.components.quantization # noqa: F401

try:
__version__ = version("torchtitan")
except Exception as e:
__version__ = "0.0.0+unknown"
8 changes: 8 additions & 0 deletions torchtitan/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,14 @@ def main(trainer_class: type[Trainer]) -> None:
trainer_class: The trainer class to instantiate (e.g., Trainer, FluxTrainer, TorchCommsTrainer)
"""
init_logger()

import torchtitan

logger.info(
"torchtitan version: %s (0.0.0 means __version__ is not defined correctly).",
torchtitan.__version__,
)

config_manager = ConfigManager()
config = config_manager.parse_args()
trainer: Trainer | None = None
Expand Down
Loading