1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
--- a/numba/tests/test_runtests.py
+++ b/numba/tests/test_runtests.py
@@ -105,7 +105,7 @@
self.assertTrue(count > 0)
return count
- tags = ['long_running', 'long_running, important']
+ tags = ['long_running', 'long_running, important', 'compiled_caching']
for tag in tags:
total = get_count(['numba.tests'])
--- a/numba/tests/support.py
+++ b/numba/tests/support.py
@@ -60,7 +60,7 @@
nrt_flags.nrt = True
-tag = testing.make_tag_decorator(['important', 'long_running'])
+tag = testing.make_tag_decorator(['important', 'long_running', 'compiled_caching'])
_32bit = sys.maxsize <= 2 ** 32
is_parfors_unsupported = _32bit
--- a/numba/tests/test_caching.py
+++ b/numba/tests/test_caching.py
@@ -24,6 +24,7 @@
run_in_new_process_caching,
skip_if_typeguard,
skip_parfors_unsupported,
+ tag,
temp_directory,
)
@@ -33,6 +34,9 @@
ipykernel = None
+compiled_caching = tag('compiled_caching')
+
+
def check_access_is_preventable():
# This exists to check whether it is possible to prevent access to
# a file/directory through the use of `chmod 500`. If a user has
@@ -286,6 +290,7 @@
class TestCache(DispatcherCacheUsecasesTest):
+ @compiled_caching
def test_caching(self):
self.check_pycache(0)
mod = self.import_module()
@@ -320,6 +325,7 @@
# Check the code runs ok from another process
self.run_in_separate_process()
+ @compiled_caching
def test_caching_nrt_pruned(self):
self.check_pycache(0)
mod = self.import_module()
@@ -333,6 +339,7 @@
self.check_pycache(3) # 1 index, 2 data
self.check_hits(f, 0, 2)
+ @compiled_caching
def test_inner_then_outer(self):
# Caching inner then outer function is ok
mod = self.import_module()
@@ -353,6 +360,7 @@
self.assertPreciseEqual(f(3.5, 2), 2.5)
self.check_pycache(6) # 2 index, 4 data
+ @compiled_caching
def test_outer_then_inner(self):
# Caching outer then inner function is ok
mod = self.import_module()
@@ -367,6 +375,7 @@
self.assertPreciseEqual(f(3.5, 2), 6.5)
self.check_pycache(5) # 2 index, 3 data
+ @compiled_caching
def test_no_caching(self):
mod = self.import_module()
@@ -403,6 +412,7 @@
self.assertIn('Cannot cache compiled function "use_big_array" '
'as it uses dynamic globals', str(w[0].message))
+ @compiled_caching
def test_ctypes(self):
# Functions using a ctypes pointer can't be cached and raise
# a warning.
@@ -421,6 +431,7 @@
str(w[0].message),
)
+ @compiled_caching
def test_closure(self):
mod = self.import_module()
@@ -437,6 +448,7 @@
self.assertPreciseEqual(f(3), 12) # 3 + 9 = 12
self.check_pycache(5) # 1 nbi, 4 nbc
+ @compiled_caching
def test_first_class_function(self):
mod = self.import_module()
f = mod.first_class_function_usecase
@@ -448,6 +460,7 @@
# with a different callback.
self.check_pycache(7)
+ @compiled_caching
def test_cache_reuse(self):
mod = self.import_module()
mod.add_usecase(2, 3)
@@ -715,6 +728,7 @@
# Turn off sequential parfor lowering
parfor.sequential_parfor_lowering = False
+ @compiled_caching
def test_caching(self):
mod = self.import_module()
self.check_pycache(0)
@@ -740,6 +754,7 @@
self.assertGreater(match_count, 0,
msg='nothing to compare')
+ @compiled_caching
def test_user_set_cpu_name(self):
self.check_pycache(0)
mod = self.import_module()
@@ -768,6 +783,7 @@
self.assertEqual(key_generic[1][1], 'generic')
self.assertEqual(key_generic[1][2], '')
+ @compiled_caching
def test_user_set_cpu_features(self):
self.check_pycache(0)
mod = self.import_module()
@@ -1048,6 +1064,7 @@
def check_module(self, mod):
mod.self_test()
+ @compiled_caching
def test_caching(self):
self.check_pycache(0)
mod = self.import_module()
--- a/numba/tests/test_parfors_caching.py
+++ b/numba/tests/test_parfors_caching.py
@@ -4,9 +4,11 @@
import numpy as np
-from numba.tests.support import skip_parfors_unsupported
+from numba.tests.support import skip_parfors_unsupported, tag
from .test_caching import DispatcherCacheUsecasesTest
+compiled_caching = tag('compiled_caching')
+
@skip_parfors_unsupported
class TestParforsCache(DispatcherCacheUsecasesTest):
@@ -32,14 +34,17 @@
self.run_in_separate_process()
+ @compiled_caching
def test_arrayexprs(self):
f = 'arrayexprs_case'
self.run_test(f)
+ @compiled_caching
def test_prange(self):
f = 'prange_case'
self.run_test(f)
+ @compiled_caching
def test_caller(self):
f = 'caller_case'
# num_funcs=3 because, there's the `caller_case()` which calls
@@ -75,6 +80,7 @@
raise AssertionError(f"process failed with code {popen.returncode}:"
f"stderr follows\n{err.decode()}\n")
+ @compiled_caching
def test_caching(self):
self.check_pycache(0)
self.run_in_separate_process(1)
--- a/numba/tests/npyufunc/test_caching.py
+++ b/numba/tests/npyufunc/test_caching.py
@@ -5,12 +5,15 @@
import numpy as np
-from numba.tests.support import capture_cache_log
+from numba.tests.support import capture_cache_log, tag
from numba.tests.test_caching import BaseCacheTest
from numba.core import config
import unittest
+compiled_caching = tag('compiled_caching')
+
+
class UfuncCacheTest(BaseCacheTest):
"""
Since the cache stats is not exposed by ufunc, we test by looking at the
@@ -135,6 +138,7 @@
class TestGUfuncCacheTest(UfuncCacheTest):
+ @compiled_caching
def test_filename_prefix(self):
mod = self.import_module()
usecase = getattr(mod, "direct_gufunc_cache_usecase")
|