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 single gpu stat logging #99

Merged
merged 2 commits into from
Mar 2, 2023
Merged

Conversation

thejaminator
Copy link
Collaborator

Seems like we were forgetting to log the stats if the user selected to use a gpu.

So the csv output would be empty with only the columns e.g.

layer,train_loss,loss,acc,cal_acc,auroc,lr_auroc,lr_acc

@@ -181,6 +181,7 @@ def train(cfg: RunConfig, out_dir: Optional[Path]):
device=devices[0],
out_dir=out_dir,
)
writer.writerow([L - i] + [f"{s:.4f}" for s in layer_stat])
Copy link
Collaborator Author

@thejaminator thejaminator Mar 1, 2023

Choose a reason for hiding this comment

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

i'll like to refactor this reporter functions so that they give back something like a EvalCSVResult.

from elk.training.reporter import EvalResult


class EvalCSVResult:
    layer: int
    train_loss: float
    eval_result: EvalResult
    # Only available if reporting baseline
    lr_auroc: Optional[float]
    # Only available if reporting baseline
    lr_acc: Optional[float]

and then another function does the responsbility of writing to a CSV / rounding to 4 d.p
but i'll do that in another MR :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds good, could you make a new issue for this?

@AlexWan0 AlexWan0 self-assigned this Mar 2, 2023
@AlexWan0
Copy link
Collaborator

AlexWan0 commented Mar 2, 2023

Lgtm, thanks for the PR!

@AlexWan0 AlexWan0 merged commit 5d1e8c0 into EleutherAI:main Mar 2, 2023
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.

None yet

2 participants