Skip to content

[checkpoint] Log native DCP async save durations - #4279

Open
ivy-zhou wants to merge 1 commit into
pr4278from
pr4279
Open

[checkpoint] Log native DCP async save durations#4279
ivy-zhou wants to merge 1 commit into
pr4278from
pr4279

Conversation

@ivy-zhou

@ivy-zhou ivy-zhou commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary:
Record native DCP asynchronous save latency from entry into dcp_save until the returned save future completes. Capture one monotonic timestamp at submission and attach a completion callback that subtracts it from the completion timestamp and emits the structured metric.

The metric measures the save future lifetime, not filesystem-only write time. The existing wait path remains responsible for surfacing save failures.

Test Plan:
env TORCH_DISABLE_ADDR2LINE=1 PYTHONPATH=/data/users/ivyzhou/torchtitan:/tmp/torchtitan_additional_packages_3e4a.nRk7S7/checkpointing:/tmp/torchtitan_additional_packages_3e4a.nRk7S7/ao:/tmp/torchtitan_additional_packages_3e4a.nRk7S7/torchtitan_runtime_deps /home/ivyzhou/local/torchtitan-venv/bin/python -m pytest tests/unit_tests/observability/test_structured_logging.py tests/unit_tests/test_checkpoint.py -q

138 passed.

Changed-file pre-commit hooks passed, including ufmt, flake8, pydoclint, codespell, and Pyrefly.


Stack created with Sapling. Best reviewed with ReviewStack.

Summary:
Record native DCP asynchronous save latency from entry into dcp_save until the returned save future completes. Capture one monotonic timestamp at submission and attach a completion callback that subtracts it from the completion timestamp and emits the structured metric.

The metric measures the save future lifetime, not filesystem-only write time. The existing wait path remains responsible for surfacing save failures.

Test Plan:
env TORCH_DISABLE_ADDR2LINE=1 PYTHONPATH=/data/users/ivyzhou/torchtitan:/tmp/torchtitan_additional_packages_3e4a.nRk7S7/checkpointing:/tmp/torchtitan_additional_packages_3e4a.nRk7S7/ao:/tmp/torchtitan_additional_packages_3e4a.nRk7S7/torchtitan_runtime_deps /home/ivyzhou/local/torchtitan-venv/bin/python -m pytest tests/unit_tests/observability/test_structured_logging.py tests/unit_tests/test_checkpoint.py -q

138 passed.

Changed-file pre-commit hooks passed, including ufmt, flake8, pydoclint, codespell, and Pyrefly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant