Skip to content

Commit

Permalink
disable torch.compile for windows MIC-DKFZ#2219
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianIsensee committed May 28, 2024
1 parent 5549ead commit d12a0c1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions nnunetv2/training/nnUNetTrainer/nnUNetTrainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,16 @@ def initialize(self):

def _do_i_compile(self):
# new default: compile is enabled!

# CPU compile crashes for 2D models. Not sure if we even want to support CPU compile!? Better disable
if self.device == torch.device('cpu'):
return False

# default torch.compile doesn't work on windows because there are apparently no triton wheels for it
# https://discuss.pytorch.org/t/windows-support-timeline-for-torch-compile/182268/2
if os.name == 'nt':
return False

if 'nnUNet_compile' not in os.environ.keys():
return True
else:
Expand Down

0 comments on commit d12a0c1

Please sign in to comment.