Skip to content

Add register_tracker_class() for custom tracker registration by name#4061

Open
devangpratap wants to merge 1 commit into
huggingface:mainfrom
devangpratap:add-register-tracker-class
Open

Add register_tracker_class() for custom tracker registration by name#4061
devangpratap wants to merge 1 commit into
huggingface:mainfrom
devangpratap:add-register-tracker-class

Conversation

@devangpratap
Copy link
Copy Markdown

What does this PR do?

Adds register_tracker_class() so custom tracker classes can be passed by string name to log_with and init_trackers, matching built-in tracker behavior. Previously users had to pass pre-instantiated tracker objects.

from accelerate import Accelerator, register_tracker_class

register_tracker_class(MyTracker)
accelerator = Accelerator(log_with="my_tracker")
accelerator.init_trackers("project", init_kwargs={"my_tracker": {"key": "value"}})

Also exposed as Accelerator.register_tracker_class() per the API discussed in the issue.

Fixes #2734

Before submitting

Who can review?

@SunMarc @muellerzr

Allow custom tracker classes to be used by string name in log_with and
init_trackers, matching built-in tracker behavior. Exposed both as a
module-level function and as Accelerator.register_tracker_class().

Fixes huggingface#2734
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.

[Feature Request] Allows registering custom trackers to internal tracker type registry

1 participant