Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Improvements #745

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Documentation Improvements #745

wants to merge 4 commits into from

Conversation

aman-17
Copy link
Member

@aman-17 aman-17 commented Nov 12, 2024

Documentation Improvements

Changes Made

  • Fixed grammar and improved documentation clarity throughout.
  • Restructured training instructions for better readability.
  • Enhanced checkpoint download documentation.
    • Added new script scripts/download_checkpoints.py to automate checkpoint downloads.
    • Removed manual URL conversion by automating R2 to public URL conversion.
  • Fixed bug for loading unsharded checkpoints in scripts/train.py.
  • Improved data inspection instructions.

New Features

The new scripts/download_checkpoints.py script:

  • Automatically handles URL conversions between R2 and public formats.
  • Downloads checkpoint files with progress tracking.
  • Supports specific step selection and directory listing.

@aman-17 aman-17 added the type/documentation An issue or pull request related to documentation label Nov 12, 2024
@aman-17 aman-17 requested a review from dirkgr November 12, 2024 16:00
.gitignore Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Comment on lines 52 to 53
except requests.exceptions.RequestException:
continue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would you swallow these exceptions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, because you don't expect all files to be there? Then at least catch only 404 errors.
But better yet, list the contents of the directory in one call to check what's there, instead of making six calls every time we have to check a directory.

Copy link
Member Author

@aman-17 aman-17 Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The website does not support directory listing, so I had to manually look for ("config.yaml", "model.pt", "optim.pt", "train.pt", "model.safetensors", "optim.safetensors")

parser.add_argument('--save-dir', type=str, default='./checkpoints',
help='Base directory to save downloaded checkpoints')
parser.add_argument('--step', type=str, help='Specific step number to download (optional)')
parser.add_argument('--list-steps', action='store_true', help='List available step numbers and exit')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have a tool that can perform multiple different actions, use subcommands.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not get this.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scripts/download_checkpoints.py Outdated Show resolved Hide resolved
scripts/download_checkpoints.py Outdated Show resolved Hide resolved
scripts/train.py Outdated Show resolved Hide resolved
scripts/train.py Outdated Show resolved Hide resolved
Copy link
Member Author

@aman-17 aman-17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dirkgr Can you review this?

@@ -58,7 +55,7 @@ The core models in the OLMo family released so far are (all trained on the [Dolm
URLs to checkpoints at intermediate steps of the models' trainings can be found in the csv files under [`checkpoints/official/`](https://github.com/allenai/OLMo/blob/main/checkpoints/official). These 'directory' URLs cannot currently be directly accessed, but files within the directory are publicly accessible. These URLs can also be provided to the training script to resume training from the checkpoint (see [Training](#training)). Each checkpoint directory consists of:

- `config.yaml`: the config at that training step.
- `model.pt`, `optim.pt`, `train.pt`: model, optimizer and training state at that training step.
- `model.safetensors`, `optim.safetensors`, `train.pt`: model, optimizer and training state at that training step.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

train.safetensors? Also, for the original model we just have *.pt so we should have that format mentioned somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are going to save in .safetensors starting from OLMo-2

parser.add_argument('--save-dir', type=str, default='./checkpoints',
help='Base directory to save downloaded checkpoints')
parser.add_argument('--step', type=str, help='Specific step number to download (optional)')
parser.add_argument('--list-steps', action='store_true', help='List available step numbers and exit')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/documentation An issue or pull request related to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants