This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KFP Visualizer and SummaryWriter Fix (#119)
- Loading branch information
Showing
14 changed files
with
195 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from torch.utils.tensorboard import SummaryWriter | ||
|
||
from datasetinsights.torch_distributed import is_master | ||
|
||
|
||
class DummySummaryWriter: | ||
"""A fake summary writer that writes nothing to the disk. This writer is | ||
used when the process is not master process so that no data is written | ||
which can prevent overwriting real data. This writer mimics the | ||
SummaryWriter module in pytorch library. To see more about pytorch | ||
tensorbaord summary writer visit: | ||
https://github.com/pytorch/pytorch/blob/master/torch/utils/tensorboard/writer.py#L150 | ||
""" | ||
|
||
def __init__(self, log_dir, *args, **kwargs): | ||
self.logdir = log_dir | ||
|
||
def add_event(self, *args, **kwargs): | ||
return | ||
|
||
def add_summary(self, *args, **kwargs): | ||
return | ||
|
||
def add_graph(self, *args, **kwargs): | ||
return | ||
|
||
def add_scalar(self, *args, **kwargs): | ||
return | ||
|
||
def add_scalars(self, *args, **kwargs): | ||
return | ||
|
||
def add_histogram(self, *args, **kwargs): | ||
return | ||
|
||
def add_histogram_raw(self, *args, **kwargs): | ||
return | ||
|
||
def add_figure(self, *args, **kwargs): | ||
return | ||
|
||
def flush(self): | ||
return | ||
|
||
def close(self): | ||
return | ||
|
||
|
||
def get_summary_writer(): | ||
""" | ||
Returns summary writer for tensorboard according to the process (master/ | ||
non master) | ||
""" | ||
if is_master(): | ||
writer = SummaryWriter | ||
else: | ||
writer = DummySummaryWriter | ||
|
||
return writer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.