Skip to content

Commit

Permalink
Remove hard tensorboardX requirement (#1571)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffra authored Nov 18, 2021
1 parent e3c2d7b commit a90497e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion deepspeed/runtime/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from torch.optim import Optimizer
from torch.optim.lr_scheduler import _LRScheduler
from torch.distributed.distributed_c10d import _get_global_rank
from tensorboardX import SummaryWriter

from typing import Callable, Dict, Optional, Union, Iterable

Expand Down Expand Up @@ -533,6 +532,16 @@ def get_summary_writer(
log_dir = os.path.join(base, summary_writer_dir_name, name)

os.makedirs(log_dir, exist_ok=True)
try:
# torch.utils.tensorboard will fail if `tensorboard` is not available,
# see their docs for more details: https://pytorch.org/docs/1.8.0/tensorboard.html
import tensorboard
except ImportError:
print(
'If you want to use tensorboard logging please `pip install tensorboard`'
)
raise
from torch.utils.tensorboard import SummaryWriter

return SummaryWriter(log_dir=log_dir)

Expand Down
1 change: 0 additions & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
torch
tqdm
tensorboardX==1.8
ninja
numpy
psutil
Expand Down

0 comments on commit a90497e

Please sign in to comment.