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.

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