Skip to content

Warning when using AOCL LibM with Python: smallest_subnormal reported as zero #26

@NitroAshi

Description

@NitroAshi

Description: When I preload libalm.so from AOCL LibM and run Python, I see warnings related to numpy.finfo for float32:

UserWarning: The value of the smallest subnormal for <class 'numpy.float32'> type is zero.

This does not happen when AOCL LibM is not preloaded.

Steps to Reproduce:

  1. LD_PRELOAD=./amd-libm-gcc/lib/libalm.so python
  2. In Python:
import numpy as np;print(np.finfo(np.float32)) 

Observed Behavior:
smallest_subnormal is reported as 0.0 instead of the expected 1.401298e-45.
Warnings appear in numpy/_core/getlimits.py.

Expected Behavior:
smallest_subnormal should match IEEE 754 for float32.

Environment:
Python 3.14 (free-threading build)
NumPy version: 2.3.5
AOCL LibM version: 5.1
OS: AlmaLinux release 8.4

Additional Notes:
Without AOCL LibM preloaded, the warnings do not occur.
This might indicate an issue with how AOCL LibM handles floating-point constants or environment setup.
This issue does not occur in builds for AOCL 4.2.0 and 5.0.0.
Observed only with AOCL 5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions