Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suppressed UserWarning: TORCH_CUDA_ARCH_LIST #3160

Merged
merged 4 commits into from
Jan 7, 2025
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions nncf/torch/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import enum
import os
import textwrap
import warnings
from abc import ABC
from abc import abstractmethod
from multiprocessing.context import TimeoutError as MPTimeoutError
Expand Down Expand Up @@ -46,7 +47,6 @@ def get_build_directory_for_extension(name: str) -> Path:
build_dir.mkdir(parents=True, exist_ok=True)
return build_dir


class ExtensionLoader(ABC):
@classmethod
@abstractmethod
Expand Down Expand Up @@ -98,9 +98,11 @@ def get(self, fn_name: str) -> Callable:

with extension_is_loading_info_log(self._loader.name()):
try:
pool = ThreadPool(processes=1)
async_result = pool.apply_async(self._loader.load)
self._loaded_namespace = async_result.get(timeout=timeout)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message="TORCH_CUDA_ARCH_LIST is not set")
pool = ThreadPool(processes=1)
async_result = pool.apply_async(self._loader.load)
self._loaded_namespace = async_result.get(timeout=timeout)
except MPTimeoutError as error:
msg = textwrap.dedent(
f"""\
Expand Down
Loading