@@ -65,9 +65,7 @@ def register_linker(name, linker):
6565# If a string is passed as the optimizer argument in the constructor
6666# for Mode, it will be used as the key to retrieve the real optimizer
6767# in this dictionary
68- exclude = []
69- if not config .cxx :
70- exclude = ["cxx_only" ]
68+ exclude = ["cxx_only" , "BlasOpt" ]
7169OPT_NONE = RewriteDatabaseQuery (include = [], exclude = exclude )
7270# Minimum set of rewrites needed to evaluate a function. This is needed for graphs with "dummy" Operations
7371OPT_MINIMUM = RewriteDatabaseQuery (include = ["minimum_compile" ], exclude = exclude )
@@ -445,37 +443,37 @@ def clone(self, link_kwargs=None, optimizer="", **kwargs):
445443 return new_mode
446444
447445
448- # If a string is passed as the mode argument in function or
449- # FunctionMaker, the Mode will be taken from this dictionary using the
450- # string as the key
451- # Use VM_linker to allow lazy evaluation by default.
446+ numba_exclude = [
447+ "cxx_only" ,
448+ "BlasOpt" ,
449+ "local_careduce_fusion" ,
450+ "scan_save_mem_prealloc" ,
451+ ]
452+
452453FAST_COMPILE = Mode (
453- VMLinker (use_cloop = False , c_thunks = False ),
454- RewriteDatabaseQuery (include = ["fast_compile" , "py_only" ]),
454+ NumbaLinker (),
455+ # TODO: Fast_compile should just use python code, CHANGE ME!
456+ RewriteDatabaseQuery (
457+ include = ["fast_compile" , "numba" ],
458+ exclude = numba_exclude ,
459+ ),
460+ )
461+ FAST_RUN = Mode (
462+ NumbaLinker (),
463+ RewriteDatabaseQuery (include = ["fast_run" , "numba" ], exclude = numba_exclude ),
455464)
456- if config .cxx :
457- FAST_RUN = Mode ("cvm" , "fast_run" )
458- else :
459- FAST_RUN = Mode (
460- "vm" ,
461- RewriteDatabaseQuery (include = ["fast_run" , "py_only" ]),
462- )
463-
464- C = Mode ("c" , "fast_run" )
465- C_VM = Mode ("cvm" , "fast_run" )
466465
467466NUMBA = Mode (
468467 NumbaLinker (),
469468 RewriteDatabaseQuery (
470469 include = ["fast_run" , "numba" ],
471- exclude = [
472- "cxx_only" ,
473- "BlasOpt" ,
474- "local_careduce_fusion" ,
475- "scan_save_mem_prealloc" ,
476- ],
470+ exclude = numba_exclude ,
477471 ),
478472)
473+ del numba_exclude
474+
475+ C = Mode ("c" , "fast_run" )
476+ C_VM = Mode ("cvm" , "fast_run" )
479477
480478JAX = Mode (
481479 JAXLinker (),
@@ -523,7 +521,9 @@ def clone(self, link_kwargs=None, optimizer="", **kwargs):
523521 ),
524522)
525523
526-
524+ # If a string is passed as the mode argument in function or
525+ # FunctionMaker, the Mode will be taken from this dictionary using the
526+ # string as the key
527527predefined_modes = {
528528 "FAST_COMPILE" : FAST_COMPILE ,
529529 "FAST_RUN" : FAST_RUN ,
0 commit comments