Lightning-AI / Lightning-AI/pytorch-lightning

Save checkpoint version dirs as `version_003` so that they sort lexicographically

Open
#20,799 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature strategy: ddp
Dominant language
Python
Stars
31.4k
Forks
3.8k
Avg merge
6d 7h
Merged PRs (30d)
6

Description

Description & Motivation

Lightning saves checkpoint version dirs as version_3, version_21, etc. The problem with this is that when you do a listing, version_21 is between version_2 and version_3, making it easy to miss.

A simple solution, which is commonly used for these situations, is to name them version_002, version_003,... version_021, which solves the problem completely.

Note: If there's interest for this, this seems like a great first issue, and I'd be happy to write the patch.

Pitch

No response

Alternatives

No response

Additional context

No response

cc @lantiga @borda @justusschock

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the checkpoint-saving entry point that creates directories such as version_3 and version_21. Trace how the version number is formatted, then add coverage showing that saved directories use zero-padded names and sort lexicographically.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.