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

move config folder to root and adjust options #83

Merged
merged 4 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions run_llama_train.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,15 @@ TRAINER_DIR=${1:-/home/$USER/local/torchtrain}

# use envs as local overrides for convenience
# e.g.
# LOG_RANK=0,1 NGPU=4 SP=2 ./run_llama_train.sh
# LOG_RANK=0,1 NGPU=4 ./run_llama_train.sh

MODEL=${MODEL:-"llama"}
MODEL_CONF=${MODEL_CONF:-"debugmodel"}
NGPU=${NGPU:-"8"}
PP=${PP:-"1"}
SP=${SP:-"1"}
DP=${DP:-"-1"}

# by default log just rank 0 output,
LOG_RANK=${LOG_RANK:-0}

# Change this string to a meaningful one to enable checkpoint
CHECKPOINT_FOLDER=${CHECKPOINT_FOLDER:-""}
# Please adjust this to a longer interval period. The unit of measurement is in steps.
CHECKPOINT_INTERVAL=${CHECKPOINT_INTERVAL:-5}

CONFIG_FILE=${CONFIG_FILE:-"./torchtrain/train_configs/train_config.toml"}
CONFIG_FILE=${CONFIG_FILE:-"./train_configs/debug_model.toml"}

torchrun --nproc_per_node=${NGPU} --rdzv_endpoint="localhost:5972" \
--local-ranks-filter ${LOG_RANK} --role rank --tee 3 \
Expand Down
7 changes: 4 additions & 3 deletions test/test_job_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.

import pytest
from torchtrain.config_manager import JobConfig

Expand All @@ -10,9 +13,7 @@ def test_command_line_args(self):

def test_job_config_file(self):
config = JobConfig()
config.parse_args(
["--job.config_file", "./torchtrain/train_configs/train_config.toml"]
)
config.parse_args(["--job.config_file", "./train_configs/debug_model.toml"])
assert config.model.name == "llama"

def test_job_file_does_not_exist(self):
Expand Down
1 change: 0 additions & 1 deletion torchtrain/train_configs/__init_.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TorchTrain Config.toml
[job]
dump_folder = "./torchtrain/outputs"
dump_folder = "./outputs"

[profiling]
run_profiler = true
Expand All @@ -26,8 +26,8 @@ lr = 8e-4
[training]
batch_size = 8
seq_len = 2048
warmup_pct = 0.20
max_norm = 1.0
warmup_pct = 0.20 # lr scheduler warm up
max_norm = 1.0 # grad norm clipping
steps = 10
data_parallel_degree = -1
sequence_parallel_degree = 1
Expand Down
Loading