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

Ygr avsr #16

Merged
merged 11 commits into from
Dec 18, 2023
Merged

Ygr avsr #16

merged 11 commits into from
Dec 18, 2023

Conversation

yanghaha0908
Copy link
Collaborator

wandb log

@@ -103,6 +136,8 @@ def main(**kwargs):
model.to("cuda")

dataset_config = generate_dataset_config(train_config, kwargs)
logger.info("dataset_config: {}".format(dataset_config))
wandb.config.update( {"dataset_config": vars(dataset_config)} )
Copy link
Collaborator

Choose a reason for hiding this comment

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

if wandb

[print(f'Key: {k}, Value: {v}') for k, v in results.items()]
[logger.info(f'Key: {k}, Value: {v}') for k, v in results.items()]

wandb.finish()
Copy link
Collaborator

Choose a reason for hiding this comment

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

if wandb


def main(**kwargs):
# Update the configuration for the training and sharding process
train_config, fsdp_config, model_config = TRAIN_CONFIG(), FSDP_CONFIG(), MODEL_CONFIG()
update_config((train_config, fsdp_config, model_config), **kwargs)

# Set wandb
wandb_config={"train_config":vars(train_config), "fsdp_config":vars(fsdp_config), "model_config":vars(model_config)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

if wandb


def main(**kwargs):
# Update the configuration for the training and sharding process
train_config, fsdp_config, model_config = TRAIN_CONFIG(), FSDP_CONFIG(), MODEL_CONFIG()
update_config((train_config, fsdp_config, model_config), **kwargs)

# Set wandb
wandb_config={"train_config":vars(train_config), "fsdp_config":vars(fsdp_config), "model_config":vars(model_config)}
wandb.init(project="project_name",name="exp_name",config=wandb_config) #记录参数
Copy link
Collaborator

Choose a reason for hiding this comment

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

set name and local path

Copy link
Collaborator

Choose a reason for hiding this comment

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

wandb.init(dir="/root/SLAM-LLM/test_wandb/",project="project_name",name="exp_name",config=wandb_config) #

@@ -95,6 +101,10 @@ def train(model, train_dataloader,eval_dataloader, tokenizer, optimizer, lr_sche

loss = loss / gradient_accumulation_steps
acc = acc / gradient_accumulation_steps

if step % train_config.log_interval == 0:
wandb.log({"train_inner/train_inner_loss":loss, "train_inner/train_inner_accuracy":acc})
Copy link
Collaborator

Choose a reason for hiding this comment

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

if wandb

@@ -133,19 +143,21 @@ def train(model, train_dataloader,eval_dataloader, tokenizer, optimizer, lr_sche
train_loss.append(train_epoch_loss)
train_acc.append(train_epoch_acc)

wandb.log({"train/train_perplexity":train_perplexity, "train/train_epoch_loss":train_epoch_loss, "train/train_epoch_acc":train_epoch_acc})
Copy link
Collaborator

Choose a reason for hiding this comment

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

if wandb


save_model_and_optimizer_sharded(model, rank, train_config)
j(model, rank, train_config)
Copy link
Collaborator

Choose a reason for hiding this comment

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

typos

val_loss.append(eval_epoch_loss)
val_prep.append(eval_ppl)
if rest:
val_acc.append(rest[0])
else:
val_acc.append(-1)

wandb.log({"valid/val_epoch_loss":eval_epoch_loss, "valid/val_perplexity":eval_ppl, "valid/best_val_loss":best_val_loss, "valid/val_accuracy":val_acc[-1]})
Copy link
Collaborator

Choose a reason for hiding this comment

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

if wandb

@ddlBoJack ddlBoJack merged commit 1636dde into main Dec 18, 2023
2 checks passed
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