@@ -61,9 +61,8 @@ def register_linker(name, linker):
61
61
# If a string is passed as the optimizer argument in the constructor
62
62
# for Mode, it will be used as the key to retrieve the real optimizer
63
63
# in this dictionary
64
- exclude = []
65
- if not config .cxx :
66
- exclude = ["cxx_only" ]
64
+
65
+ exclude = ["cxx_only" , "BlasOpt" ]
67
66
OPT_NONE = RewriteDatabaseQuery (include = [], exclude = exclude )
68
67
# Even if multiple merge optimizer call will be there, this shouldn't
69
68
# impact performance.
@@ -437,16 +436,20 @@ def clone(self, link_kwargs=None, optimizer="", **kwargs):
437
436
# string as the key
438
437
# Use VM_linker to allow lazy evaluation by default.
439
438
FAST_COMPILE = Mode (
440
- VMLinker (use_cloop = False , c_thunks = False ),
441
- RewriteDatabaseQuery (include = ["fast_compile" , "py_only" ]),
439
+ NumbaLinker (),
440
+ # TODO: Fast_compile should just use python code, CHANGE ME!
441
+ RewriteDatabaseQuery (
442
+ include = ["fast_compile" , "numba" ],
443
+ exclude = ["cxx_only" , "BlasOpt" , "local_careduce_fusion" ],
444
+ ),
445
+ )
446
+ FAST_RUN = Mode (
447
+ NumbaLinker (),
448
+ RewriteDatabaseQuery (
449
+ include = ["fast_run" , "numba" ],
450
+ exclude = ["cxx_only" , "BlasOpt" , "local_careduce_fusion" ],
451
+ ),
442
452
)
443
- if config .cxx :
444
- FAST_RUN = Mode ("cvm" , "fast_run" )
445
- else :
446
- FAST_RUN = Mode (
447
- "vm" ,
448
- RewriteDatabaseQuery (include = ["fast_run" , "py_only" ]),
449
- )
450
453
451
454
JAX = Mode (
452
455
JAXLinker (),
@@ -512,7 +515,7 @@ def get_mode(orig_string):
512
515
# NanGuardMode use its own linker.
513
516
ret = NanGuardMode (True , True , True , optimizer = config .optimizer )
514
517
else :
515
- # TODO: Can't we look up the name and invoke it rather than using eval here ?
518
+ # TODO: Get rid of this? Or refactor ?
516
519
ret = eval (string + "(linker=config.linker, optimizer=config.optimizer)" )
517
520
elif string in predefined_modes :
518
521
ret = predefined_modes [string ]
@@ -541,6 +544,7 @@ def register_mode(name, mode):
541
544
Add a `Mode` which can be referred to by `name` in `function`.
542
545
543
546
"""
547
+ # TODO: Remove me
544
548
if name in predefined_modes :
545
549
raise ValueError (f"Mode name already taken: { name } " )
546
550
predefined_modes [name ] = mode
0 commit comments