File tree Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Expand file tree Collapse file tree 3 files changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -2198,8 +2198,8 @@ def torchdynamo_smart_context_manager(self):
2198
2198
ctx_manager = torchdynamo .optimize ("eager" )
2199
2199
elif self .args .torchdynamo == "nvfuser" :
2200
2200
ctx_manager = torchdynamo .optimize (aot_autograd_speedup_strategy )
2201
- else :
2202
- ctx_manager = contextlib . nullcontext ( )
2201
+ elif self . args . torchdynamo is not None :
2202
+ raise ValueError ( "torchdynamo training arg can be eager/nvfuser" )
2203
2203
return ctx_manager
2204
2204
2205
2205
def autocast_smart_context_manager (self ):
Original file line number Diff line number Diff line change @@ -377,12 +377,7 @@ def is_torch_tpu_available():
377
377
378
378
379
379
def is_torchdynamo_available ():
380
- try :
381
- import torchdynamo
382
-
383
- return True
384
- except ImportError :
385
- return False
380
+ return importlib .util .find_spec ("torchdynamo" ) is not None
386
381
387
382
388
383
def is_datasets_available ():
Original file line number Diff line number Diff line change @@ -1598,7 +1598,6 @@ def test_fp16_full_eval(self):
1598
1598
@require_torch_gpu
1599
1599
@require_torchdynamo
1600
1600
def test_torchdynamo_full_eval (self ):
1601
- debug = 0
1602
1601
n_gpus = get_gpu_count ()
1603
1602
1604
1603
bs = 8
You can’t perform that action at this time.
0 commit comments