Skip to content

Dev/minimal flow #16

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

Merged
merged 10 commits into from
Aug 21, 2024
Merged

Dev/minimal flow #16

merged 10 commits into from
Aug 21, 2024

Conversation

Raalsky
Copy link
Contributor

@Raalsky Raalsky commented Aug 19, 2024

No description provided.

"""
verify_type("api_token", api_token, str)
verify_type("family", family, str)
verify_type("run_id", run_id, str)
verify_type("max_queue_size", max_queue_size, int)
verify_type("max_queue_size_exceeded_callback", max_queue_size_exceeded_callback, (Callable, type(None)))

Copy link
Contributor

Choose a reason for hiding this comment

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

we could check for > 1 here or add verify_int() with eg. positive=True argument

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, will do

@@ -51,6 +51,7 @@ def __init__(

def enqueue(self, *, operation: RunOperation) -> None:
try:
# TODO: This lock could be moved to the Run class
with self._lock:
Copy link
Contributor

Choose a reason for hiding this comment

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

Or just have OpeartionsQueue own the lock? It doesn't seem Run is using it, apart from passing to the OperationsQueue constructor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the following PRs we're making sure that no one is putting any new operations once we're operating on SyncProcess so this cannot be a part of OperationsQueue

verify_type("as_experiment", as_experiment, (str, type(None)))
verify_type("creation_time", creation_time, (datetime, type(None)))
verify_type("from_run_id", from_run_id, (str, type(None)))
verify_type("from_step", from_step, (int, float, type(None)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we make from_step obligatory when from_run_id is provided, and the other way around? Otherwise _create_run will silently ignore forking

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isin't it covered by line 128?

        if (from_run_id is not None and from_step is None) or (from_run_id is None and from_step is not None):
            raise ValueError("`from_run_id` and `from_step` must be used together.")

Comment on lines +121 to +122
new_size = size + pb_key_size(key) + proto_value.ByteSize() + 6

Copy link
Contributor

Choose a reason for hiding this comment

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

Where does the +6 come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was based on our internal previous script, an overhead for type and length definitions I think.

@@ -33,3 +62,8 @@ def make_step(number: float | int, raise_on_step_precision_loss: bool = False) -
micro = micro % m

return Step(whole=whole, micro=micro)


def pb_key_size(key: str) -> int:
Copy link
Contributor

Choose a reason for hiding this comment

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

A short explanation of how this is calculated and why would be great

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was from our previous script but I think it comes from max length assumption (10k if I remember, so 2 bytes at most for varint representation) + type definition overhead.

result = list(builder)

# then
assert len(result) > 0
Copy link
Contributor

Choose a reason for hiding this comment

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

Detail: assert len(result) > 1 would make sure we're actually generating multiple results for entries that are too large. There's another one below as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@Raalsky Raalsky requested a review from kgodlewski August 21, 2024 07:40
@Raalsky Raalsky merged commit 100a9b4 into main Aug 21, 2024
4 checks passed
@Raalsky Raalsky deleted the dev/minimal-flow branch August 21, 2024 11:45
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.

2 participants