whether the current environment has InstanceNorm3dNVFuser https://github.com/NVIDIA/apex/blob/23.05-devel/apex/normalization/instance_norm.py#L15-L16
()
| 94 | |
| 95 | |
| 96 | def has_nvfuser_instance_norm(): |
| 97 | """whether the current environment has InstanceNorm3dNVFuser |
| 98 | https://github.com/NVIDIA/apex/blob/23.05-devel/apex/normalization/instance_norm.py#L15-L16 |
| 99 | """ |
| 100 | global _has_nvfuser |
| 101 | if _has_nvfuser is not None: |
| 102 | return _has_nvfuser |
| 103 | |
| 104 | _, _has_nvfuser = optional_import("apex.normalization", name="InstanceNorm3dNVFuser") |
| 105 | if not _has_nvfuser: |
| 106 | return False |
| 107 | try: |
| 108 | import importlib |
| 109 | |
| 110 | importlib.import_module("instance_norm_nvfuser_cuda") |
| 111 | except ImportError: |
| 112 | _has_nvfuser = False |
| 113 | return _has_nvfuser |
| 114 | |
| 115 | |
| 116 | def look_up_named_module(name: str, mod, print_all_options=False): |
no test coverage detected
searching dependent graphs…