Skip to content

Commit

Permalink
Removed torch.compile support
Browse files Browse the repository at this point in the history
  • Loading branch information
HBakerOS committed May 14, 2023
1 parent 1b72212 commit a3d774a
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions minerva/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
# IMPORTS
# =====================================================================================================================
import os
import warnings
from contextlib import nullcontext
from pathlib import Path
from typing import (
Expand All @@ -62,7 +61,6 @@
from alive_progress import alive_bar, alive_it
from inputimeout import TimeoutOccurred, inputimeout
from nptyping import Int, NDArray
from packaging.version import Version
from torch import Tensor
from torch.nn.modules import Module
from torch.nn.parallel import DistributedDataParallel as DDP
Expand Down Expand Up @@ -416,16 +414,6 @@ def __init__(
)
self.model = MinervaDataParallel(self.model, DDP, device_ids=[gpu])

# Wraps the model in `torch.compile` to speed up computation time.
# Python 3.11+ is not yet supported though, hence the exception clause.
if Version(torch.__version__) > Version("2.0.0"): # pragma: no cover
try:
_compiled_model = torch.compile(self.model) # type: ignore[attr-defined]
assert isinstance(_compiled_model, (MinervaModel, MinervaDataParallel))
self.model = _compiled_model
except RuntimeError as err:
warnings.warn(str(err))

def init_wandb_metrics(self) -> None:
"""Setups up separate step counters for :mod:`wandb` logging of train, val, etc."""
if isinstance(self.writer, Run):
Expand Down

0 comments on commit a3d774a

Please sign in to comment.