Specifying run.id shouldnt change name on resume
@@ -855,7 +855,7 @@ def init(job_type=None, dir=None, config=None, project=None, entity=None, reinit
os.environ[env.TAGS] = ",".join(tags)
if id:
os.environ[env.RUN_ID] = id
- if name is None:
+ if name is None and resume is not "must":
# We do this because of https://github.com/wandb/core/issues/2170
# to ensure that the run's name is explicitly set to match its
# id. If we don't do this and the id is eight characters long, the
@@ -864,6 +864,13 @@ def init(job_type=None, dir=None, config=None, project=None, entity=None, reinit
# In any case, if the user is explicitly setting `id` but not
# `name`, their id is probably a meaningful string that we can
# use to label the run.
+ #
+ # In the resume="must" case, we know we are resuming, so we should
+ # make sure to not set the name because it would have been set with
+ # the original run.
+ #
+ # TODO: handle "auto" resume by moving this logic later when we know
+ # if there is a resume.
name = os.environ.get(env.NAME, id) # environment variable takes precedence over this.
if name:
os.environ[env.NAME] = name
