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

Fix profiling of torchax models #72

Open
wants to merge 1 commit into
base: yifeit/step-duration
Choose a base branch
from

Conversation

tengyifei
Copy link
Collaborator

@tengyifei tengyifei commented Feb 1, 2025

Since torch_xla uses hydra, the CLI for setting profile dir changed slightly. In order to profile torchax training, we refactor both to use hydra and the same config name for setting profile dir.

I didn't do that in this PR, but it will be simpler to extend the torchax trainer to train both llama and mixtral via configs later.

Tested:

  python3 torchprime/experimental/torchax_models/run.py global_batch_size=16

  tp run torchprime/experimental/torchax_models/run.py \
    global_batch_size=256 \
    model_type=405B \
    seqlen=8192 \
    use_custom_offload=True \
    use_custom_mesh=True \
    model_impl=scan \
    tp=4 \
    unroll_layers=1

Since torch_xla uses hydra, the CLI for setting profile dir changed
slightly. In order to profile torchax training, we refactor both to
use hydra and the same config name for setting profile dir.

I didn't do that in this PR, but it will be simpler to extend the
torchax trainer to train both llama and mixtral via configs later.

Tested:

  python3 torchprime/experimental/torchax_models/run.py global_batch_size=16

  tp run torchprime/experimental/torchax_models/run.py \
    global_batch_size=128 \
    model_type=405B \
    seqlen=8192 \
    use_custom_offload=True \
    use_custom_mesh=True \
    model_impl=scan \
    tp=4 \
    unroll_layers=1
@tengyifei tengyifei marked this pull request as ready for review February 1, 2025 01:45
@tengyifei tengyifei requested review from qihqi and bhavya01 February 1, 2025 01:45
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