Add math backend and threading observability for numerical parity#242
Open
google-labs-jules[bot] wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This Pull Request introduces backend observability features to address numerical drift issues in iterative signal processing algorithms like ICA and ASR. By capturing and reporting the specific BLAS/LAPACK implementations and threading configurations used during execution, we enable researchers to audit environment consistency and explain discrepancies across different computing infrastructures.
Rationale
EEGPrep users have reported numerical drift exceeding the 1e-5 uV parity target when moving workloads between local machines (e.g., Apple Accelerate) and HPC clusters (e.g., Intel MKL). Since these libraries handle floating-point operations differently, identifying the specific backend is critical for scientific reproducibility.
Following the principle of "observability without interference," these changes focus on providing diagnostic transparency. We chose to report the environment state rather than attempt to force specific library loading to avoid breaking system-level optimizations or requiring elevated privileges.
Key Changes
math_backend_infosection to all pipeline and report manifests. This utilizesthreadpoolctlto introspect the runtime environment and record library names, versions, and thread limits.eegprep software_infowhich provides a human-readable summary of:Technical Decisions
threadpoolctlIntegration: We selectedthreadpoolctlas the primary inspection tool because it provides a reliable, cross-platform way to detect low-level library configurations without the overhead of manual environment variable parsing.Verification Results
math_backend_infoin all generated JSON outputs.