You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The original bug report is optuna/optuna#4404.
I tried to make a minimal reproducible example and found that checking the following code with the latest mypy takes about 1 minute.
This takes 6 s with compiled mypy 1.15.0. Adding one more term increases runtime to 18 s. The dependency (time vs number of terms) is $T \approx 3^N$ after 7-8 terms. For every relevant overload signature (3 out of 5 here), we accept all arguments. When we have 10 such overloads nested, we accept the "leaf" nodes 0 and 1 $3^{10} \approx 60,000$ times.
np.ndarray.__mul__ is an overload with 17 variants, 9 of which match NDArray[np.floating] argument, so it grows even faster.
Bug Report
The original bug report is optuna/optuna#4404.
I tried to make a minimal reproducible example and found that checking the following code with the latest mypy takes about 1 minute.
To Reproduce
Adding terms as follows seems to increase execution time exponentially.
Expected Behavior
The execution takes a few seconds.
Actual Behavior
Your Environment
mypy.ini
(and other config files): No configsThe text was updated successfully, but these errors were encountered: