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

reorg main function; add 'hpu' option w/o implementation #329

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JamesKunstle
Copy link
Contributor

The main training function needed to be broken down into smaller
functions for readability/testability.

WORLD_SIZE, LOCAL_RANK, and RANK have also been extracted and made
global constants since they are set by the administrating
multiprocessing launcher (torchrun, in our case).

HPU configuration options and checks are also added.

Signed-off-by: James Kunstle [email protected]

The `main` training function needed to be broken down into smaller
functions for readability/testability.

WORLD_SIZE, LOCAL_RANK, and RANK have also been extracted and made
global constants since they are set by the administrating
multiprocessing launcher (torchrun, in our case).

HPU configuration options and checks are also added.

Signed-off-by: James Kunstle <[email protected]>
disable_flash_attn=args.disable_flash_attn, use_dolomite=args.use_dolomite
)

tokenizer = configure_tokenizer(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would have named this setup_tokenizer but that name would shadow the imported function.

@mergify mergify bot added the ci-failure label Nov 11, 2024
@JamesKunstle JamesKunstle marked this pull request as ready for review November 11, 2024 23:23
train_loader = setup_dataloader(
dataset,
tokenizer.pad_token_id,
this happens sometimes when we have more GPUs than data to process. In this case
Copy link
Contributor Author

Choose a reason for hiding this comment

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

will fix this docstring

mock_len=args.mock_len,
)
# will try to make multipack work if possible.
sampler_type: str = "multipack"
Copy link
Member

Choose a reason for hiding this comment

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

: str here is redundant - it's inferred by the assignment

Copy link
Member

@RobotSail RobotSail left a comment

Choose a reason for hiding this comment

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

From a high level these changes look good, we'll just need to test them to verify.

Copy link

This pull request has been automatically marked as stale because it has not had activity within 90 days. It will be automatically closed if no further activity occurs within 30 days.

@github-actions github-actions bot added the stale label Feb 11, 2025
Copy link
Contributor

mergify bot commented Feb 11, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. @JamesKunstle please rebase it. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants