mozilla / translations

The code, training pipeline, and models that power Firefox Translations
https://mozilla.github.io/translations/
Mozilla Public License 2.0
154 stars 33 forks source link

Add an author field #578

Closed eu9ene closed 4 months ago

eu9ene commented 5 months ago

We should be able to identify the author of an experiment. Currently, it's always moz-translations-wandb-bot because of the service token we use. Let's find a way to either change this one or use another field.

eu9ene commented 5 months ago

@bhearsum I wonder if there's a way to pull a secret based on the author of the task. Then instead of using our service token we could use personal tokens to automatically identify authors in w&B.

Screenshot 2024-05-08 at 9 48 37 AM
bhearsum commented 5 months ago

There's no technical reason we can't do that. The secrets are defined in the task definitions: https://github.com/mozilla/firefox-translations-training/blob/c4b0d121985d84ed88aefc966df0ffbb1431a3ed/taskcluster/kinds/train-backwards/kind.yml#L70

The person who triggered the task (whether by opening a PR, making a push, or triggering an action) is available in config.params["owner"] in the transforms. So we could either substitute that into the secret in a transform, or add the secret entirely in a transform.

We'd likely want some way to gracefully handle the secret not existing. That could be checking for existence before adding it to the task definition (and fallback to disabling or a default), or it could be done somewhere in the payload. Eg: if the secret doesn't exist we implicitly disable publication.

eu9ene commented 5 months ago

Ok, ideally we should do tricks with tokens because it turned out W&B has some nice filters like "show only my work" based on this Author field and I don't see an API to override that.

La0 commented 4 months ago

After discussion there will not be multiple tokens.

We can add a new tag on the run, with format author:<owner> where <owner> comes from the run configuration as mentionned by @bhearsum above.

gregtatum commented 4 months ago

I'm happy with this solution.