Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Interpretml Interpret Cpu 64

From Leeroopedia


Knowledge Sources
Domains Machine_Learning, EBM_Core
Last Updated 2026-02-07 12:00 GMT

Overview

Implements the scalar CPU fallback for 64-bit floating-point EBM computations, processing one sample at a time without SIMD acceleration.

Description

The cpu_64.cpp file defines the Cpu_64_Float and Cpu_64_Int wrapper types that use plain C++ scalar operations (double and uint64_t respectively) to process one sample at a time. This is the baseline compute implementation that works on all platforms without any SIMD instruction requirements. The Cpu_64_Int has k_cSIMDShift=0, giving k_cSIMDPack=1, and uses AccelerationFlags_NONE. Despite being the slowest compute path, it serves as the reference implementation and fallback when neither AVX2 nor AVX-512 are available. The file defines the same operator interface as the SIMD variants, enabling the templated objective and bin-summing code to compile identically regardless of the underlying compute type.

Usage

Used as the fallback compute path when no SIMD acceleration is available, or for the CPU-specific objective wrapper that handles non-SIMD tasks like metric finishing and target checking. Always compiled and available as the baseline implementation.

Code Reference

Source Location

Signature

struct Cpu_64_Int final {
   using T = uint64_t;
   using TPack = uint64_t;
   static constexpr AccelerationFlags k_zone = AccelerationFlags_NONE;
   static constexpr int k_cSIMDShift = 0;
   static constexpr int k_cSIMDPack = 1 << k_cSIMDShift; // 1

   inline static Cpu_64_Int Load(const T* const a) noexcept;
   inline void Store(T* const a) const noexcept;
   inline static Cpu_64_Int LoadBytes(const uint8_t* const a) noexcept;
   template<typename TFunc, typename... TArgs>
   static inline void Execute(const TFunc& func, const TArgs&... args) noexcept;
   inline static Cpu_64_Int MakeIndexes() noexcept;
};

struct Cpu_64_Float final { ... };

template<bool bNegateInput, bool bNaNPossible, bool bUnderflowPossible, bool bOverflowPossible>
inline Cpu_64_Float Exp(const Cpu_64_Float& val) noexcept;

template<bool bNegateOutput, bool bNaNPossible, bool bNegativePossible,
    bool bZeroPossible, bool bPositiveInfinityPossible>
inline Cpu_64_Float Log(const Cpu_64_Float& val) noexcept;

I/O Contract

Type Description
Cpu_64_Float Scalar double wrapper
Cpu_64_Int Scalar uint64_t wrapper
k_cSIMDPack 1 (processes 1 sample per operation)
k_zone AccelerationFlags_NONE (no SIMD)

Usage Examples

# Called internally via native bindings
from interpret.glassbox import ExplainableBoostingClassifier
ebm = ExplainableBoostingClassifier()
ebm.fit(X, y)  # Falls back to CPU 64-bit scalar path when no SIMD available

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment