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

Feature/save #282

Closed
wants to merge 4 commits into from
Closed

Feature/save #282

wants to merge 4 commits into from

Conversation

vanpelt
Copy link
Contributor

@vanpelt vanpelt commented Dec 14, 2018

Saving now supports globs and specifying a policy. I added much better tests for run manager and a restore function as well to download a file in the event of resuming or pulling in weights from a different run.

Copy link
Contributor

@adrianbg adrianbg left a comment

Choose a reason for hiding this comment

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

Looks good apart from a couple Python 2 and naming issues

@@ -389,7 +392,7 @@ def summary(self):

@property
def path(self):
return [self.username, self.project, self.name]
return [str(self.username), str(self.project), str(self.name)]
Copy link
Contributor

Choose a reason for hiding this comment

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

What would these be if not strings? None?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah None

for path in glob.glob(policy["glob"]):
save_name = os.path.relpath(path, self._watch_dir)
if self._file_event_handlers.get(save_name):
del self._file_event_handlers[save_name]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it safe to just delete these? What if it's one of the event handlers that has a thread?

Could you use a clearer name than update_policy? We're in the context of a RunManager and there are a million different types of policy someone could imagine a RunManager having. IMO it should at least say something about syncing files. I think short names are good for very commonly used public-facing functions, but for this internal stuff I think it's more important to make things readable for everyone else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in feature/html

@@ -949,25 +971,42 @@ def _sync_etc(self, headless=False):

exitcode = None
try:
payload = b''
Copy link
Contributor

Choose a reason for hiding this comment

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

b'' doesn't work in Python 2. You can do six.b('').

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Python 2.7+ has support for the syntax for it.

wandb.termerror(message)
util.sentry_message(message)
break
term = res.find(b'\0')
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be six.b('\0') or something

orig = data
if isinstance(data, list):
data = ints2bytes(data)
data = json.dumps(data).encode('utf8') + b'\0'
Copy link
Contributor

Choose a reason for hiding this comment

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

six.b()

@@ -98,6 +102,21 @@ def _init_jupyter_agent(self):
def _stop_jupyter_agent(self):
self._jupyter_agent.stop()

def configure(self, options):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you call this something more specific than "configure"? Especially since it seems like this actually only does only thing and the terminology here doesn't match what it's called in RunManager.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in feature/html

@@ -340,6 +359,10 @@ def history(self):
HISTORY_FNAME, self._dir, add_callback=self._history_added)
return self._history

@property
def initial_step(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used? Is it the initial step or the current step?

@vanpelt vanpelt closed this Dec 21, 2018
@vanpelt vanpelt deleted the feature/save branch January 28, 2022 21:51
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