Commit 55e0dae3 authored by Francisc Bungiu's avatar Francisc Bungiu Committed by Facebook GitHub Bot
Browse files

Use different signpost id for each checkpoint

Summary:
Use different signpost so they don't get deduplicated in minion.

Pull Request resolved: https://github.com/facebookresearch/d2go/pull/669

Reviewed By: wat3rBro

Differential Revision: D59226344

fbshipit-source-id: c1356feadbc1b63220a1abdd8cc079723b230e42
parent 040a7167
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
import logging import logging
import uuid import uuid
from contextlib import ContextDecorator from contextlib import ContextDecorator
from typing import Optional
from d2go.checkpoint.log_checkpoint import log_checkpoint from d2go.checkpoint.log_checkpoint import log_checkpoint
...@@ -16,10 +17,11 @@ class instrument_checkpoint(ContextDecorator): ...@@ -16,10 +17,11 @@ class instrument_checkpoint(ContextDecorator):
checkpoint_type: str, checkpoint_type: str,
) -> None: ) -> None:
super().__init__() super().__init__()
self.unique_id = uuid.uuid1().int >> 97 self.unique_id: Optional[int] = None
self.checkpoint_type = checkpoint_type self.checkpoint_type = checkpoint_type
def __enter__(self) -> "instrument_checkpoint": def __enter__(self) -> "instrument_checkpoint":
self.unique_id = uuid.uuid1().int >> 97
log_checkpoint( log_checkpoint(
checkpoint_type=self.checkpoint_type, checkpoint_type=self.checkpoint_type,
unique_id=self.unique_id, unique_id=self.unique_id,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment