Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixup no_trainer examples scripts and add more tests #16765

Merged
merged 5 commits into from
Apr 13, 2022

Conversation

muellerzr
Copy link
Contributor

Fixup no_trainer Examples and Bolster their tests

What does this add?

This changes the logging behavior inside the no_trainer scripts, slightly changes how the initial configuration is stored, and adds tests for the tracking API.

Who is it for?

Users of transformers who want to try out Accelerate quickly

Why is this needed?

I was made aware that the scripts were laggy when it came to how logs were sent to weights and biases when using the no_trainer scripts, and this was due to the step being passed in as a parameter, causing a lag in when it gets uploaded.

To follow akin to the original Accelerate scripts, these are now passed in as a "step" parameter to the overall dictionary logged via accelerate.log()

TensorBoard also does not like when Enum's are logged, so there is a manual adjustment rightr before saving the hyperparemeters to get the enum value from the LR Scheduler type.

Finally, as TensorBoard is a test requirement, I added in tests for tracking inside the no_trainer tests, as TensorBoard is also how we test that behavior in the CI in Accelerate proper.

@muellerzr muellerzr added Examples Which is related to examples in general PyTorch Anything PyTorch External Using the library with external tools (onnx, tflite, ...) labels Apr 13, 2022
@muellerzr muellerzr requested a review from sgugger April 13, 2022 18:31
@muellerzr muellerzr changed the title Fixup examples scripts and add more tests Fixup no_trainer examples scripts and add more tests Apr 13, 2022
Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

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

Looks all good to me, thanks a lot for fixing!

@muellerzr muellerzr merged commit be752d1 into main Apr 13, 2022
@muellerzr muellerzr deleted the muellerzr-tracking-bugfix branch April 13, 2022 18:40
@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented Apr 13, 2022

The documentation is not available anymore as the PR was closed or merged.

elusenji pushed a commit to elusenji/transformers that referenced this pull request Jun 12, 2022
* Change tracking to store_true

* Remove step param and use it in the log dictionary directly

* use vars(args) when passing args to init_trackers

* Include tracking tests since tensorboard is already a dep
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Examples Which is related to examples in general External Using the library with external tools (onnx, tflite, ...) PyTorch Anything PyTorch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants