Skip to content

Commit f8b4b6c

Browse files
committed
Reintroduce cache filter for large global arrays
1 parent ef149a1 commit f8b4b6c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

pytensor/link/numba/dispatch/basic.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numba
77
import numpy as np
8-
from numba import NumbaPerformanceWarning
8+
from numba import NumbaPerformanceWarning, NumbaWarning
99
from numba import njit as _njit
1010
from numba.cpython.unsafe.tuple import tuple_setitem # noqa: F401
1111

@@ -33,6 +33,18 @@
3333
category=NumbaPerformanceWarning,
3434
)
3535

36+
# Suppress large global arrays cache warning for internal functions
37+
# We have to add an ansi escape code for optional bold text by numba
38+
warnings.filterwarnings(
39+
"ignore",
40+
message=(
41+
"(\x1b\\[1m)*" # ansi escape code for bold text
42+
'Cannot cache compiled function "numba_funcified_fgraph" '
43+
"as it uses dynamic globals"
44+
),
45+
category=NumbaWarning,
46+
)
47+
3648

3749
def numba_njit(
3850
*args, fastmath=None, final_function: bool = False, **kwargs

0 commit comments

Comments
 (0)