Skip to content

Commit

Permalink
Merge pull request #8471 from niboshi/ignore-cupy-performance-warning
Browse files Browse the repository at this point in the history
Ignore `cupy.util.PerformanceWarning` in pytest
  • Loading branch information
mergify[bot] committed Nov 21, 2019
2 parents 5c9e69e + a627350 commit 7d453db
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chainer/backends/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@
from cupy.cuda import Event # type: ignore # NOQA
from cupy.cuda import Stream # type: ignore # NOQA

# Alias for ignoring the warning in setup.cfg
from cupy.util import PerformanceWarning as _PerformanceWarning # NOQA

available = True
except Exception as e:
_resolution_error = e
Expand Down Expand Up @@ -107,6 +110,10 @@ class Stream(object): # type: ignore # for type testing
# for `xp is chainer.backends.cuda.cupy` to always work
cupy = object()

# Dummy class for ignoring cupy.util.PerformanceWarning in setup.cfg.
class _PerformanceWarning(Warning):
pass


if available:
_cudnn_disabled_by_user = int(os.environ.get('CHAINER_CUDNN', '1')) == 0
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ filterwarnings =
ignore:ChainerX core binary is built in debug mode:UserWarning
ignore:Accelerate has been detected as a NumPy backend library:UserWarning:chainer[.*]
ignore::chainer.warnings.PerformanceWarning
ignore::chainer.backends.cuda._PerformanceWarning
ignore::FutureWarning:chainer\.utils\.experimental
# NumPy<1.11
ignore:in the future np\.array_split will retain the shape of arrays with a zero size:FutureWarning:numpy\.lib\.shape_base
Expand Down

0 comments on commit 7d453db

Please sign in to comment.