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

Support run trainer locally #111

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

Support run trainer locally #111

wants to merge 3 commits into from

Conversation

zpcore
Copy link
Collaborator

@zpcore zpcore commented Feb 13, 2025

Support to run train.py locally:

tp dbrun --use-hf torchprime/hf_models/train.py # huggingface run

Or

tp dbrun  torchprime/torch_xla_models/train.py 

This makes it easier to debug model code.

Currently it is still using the torch_xla from the base docker image. In the future, we may want to give the option to run with local build torch_xla.

@zpcore zpcore requested a review from tengyifei February 13, 2025 21:58
@zpcore zpcore marked this pull request as ready for review February 13, 2025 21:58
@tengyifei
Copy link
Collaborator

I usually run a model locally like this:

python3 torchprime/torch_xla_models/train.py model=llama-3-8b mesh.fsdp=8 profile_step=3 max_steps=50

Is this insufficient for your use case?

@zpcore
Copy link
Collaborator Author

zpcore commented Feb 13, 2025

I usually run a model locally like this:

python3 torchprime/torch_xla_models/train.py model=llama-3-8b mesh.fsdp=8 profile_step=3 max_steps=50

Is this insufficient for your use case?

Yes, this should also work. The thing is that I saw many permission issues when run train.py directly. This just helps to run in a container.

@@ -61,7 +61,8 @@ def buildpush(
_run(
f"{sudo_cmd} docker tag {docker_tag} {docker_url}",
)
_run(f"{sudo_cmd} docker push {docker_url}")
if torchprime_docker_tag != "local_run":
Copy link
Collaborator

Choose a reason for hiding this comment

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

This introduces a magical constant. I think it's simpler if we add a "push=True" function argument, and have the other file call this with push=False

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants