mojolearn.set_numeric_mode#

mojolearn.set_numeric_mode(mode)#

Set the process-wide default numeric mode.

Estimators created without an explicit numeric_mode= use this mode. The starting default is the MOJOLEARN_NUMERIC_MODE environment variable, or "identical" when it is unset. The mode’s binaries are loaded immediately, so a mode that cannot be used fails here rather than at a later fit.

  • "identical" (default): in identical mode, mojolearn returns the same bits on Apple, NVIDIA and AMD GPUs.

  • "fast": the fastest arithmetic, available on Apple GPUs only; no bitwise promise.

Using a family under a mode it does not ship raises ImportError.

Parameters:

mode ({“identical”, “fast”} or None) – The new default; None keeps the current one. 'fast' is available on Apple GPUs only.

Returns:

str – The previous default.

Examples

>>> import mojolearn
>>> previous = mojolearn.set_numeric_mode("identical")