Skip to content

Commit

Permalink
cache output of is_framework_version_supported (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
NihalHarish committed Jun 30, 2021
1 parent ea459ac commit 5592267
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions smdebug/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import socket
import urllib.parse
from enum import Enum
from functools import lru_cache
from pathlib import Path
from typing import Dict, List

Expand Down Expand Up @@ -638,6 +639,8 @@ def check_smmodelparallel_training():
return _is_using_smmodelparallel


# we need to compute the output of this fn only once since the framework type will remain constant during execution
@lru_cache(maxsize=None)
def is_framework_version_supported(framework_type):
if framework_type == FRAMEWORK.PYTORCH:
from smdebug.pytorch.utils import is_current_version_supported
Expand Down

0 comments on commit 5592267

Please sign in to comment.