Repository: tensorflow
Issue: Build Failure with ml_dtypes 0.4.0 on Power Architecture
Labels: stat:awaiting tensorflower,type:build/install,subtype: ubuntu/linux

### Issue type

Build/Install

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

master

### Custom code

No

### OS platform and distribution

linux/ppc64le

### Mobile device

_No response_

### Python version

3.9, 3.10, 3.11,3.12

### Bazel version

6.5.2

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

When attempting to build TensorFlow on the Power architecture with ml-dtypes==0.4.0, the build fails due to an incompatibility with numpy 2.0.0rc1. On power, there is no wheel for ml_dtypes on pypi. Hence, Tensorflow build tries to build ml_dtypes from its source, which fails due to build time depencency on numpy 2.0.0rc1. https://github.com/jax-ml/ml_dtypes/blob/v0.4.0/pyproject.toml#L52.  Numpy 2.0.0rc1 is not available for any architetcure on pypi.
We had rasied this concern with ml_dtypes and they have fixed it in ml_dtypes 0.4.1 version.

To resolve this issue, we recommend updating the following files:

1. tensorflow/tools/pip_package/setup.py

Update the ml_dtypes version requirement from 0.4.0 to 0.4.1.
Current section: ml_dtypes >= 0.4.0, < 0.5.0

2. ci/official/requirements_updater/requirements.in

Update the ml_dtypes version requirement from 0.4.0 to 0.4.1.
Current section: ml_dtypes >= 0.4.0, < 0.5.0

After these changes, it should reflect in the requirements_lock.txt for different Python versions.

### Standalone code to reproduce the issue

```shell
Architecture: ppc64le (Power)
Python Version: 3.x
TensorFlow Version: master
ml_dtypes Version: 0.4.0
pip Version: 24.2

Steps to reproduce:
bazel build //tensorflow/tools/pip_package:wheel --repo_env=WHEEL_NAME=tensorflow_cpu

The error related to numpy==2.0.0rc1 will occur during the installation.
```


### Relevant log output

```shell
ERROR: /tensorflow/WORKSPACE:53:13: fetching whl_library rule //external:pypi_ml_dtypes: Traceback (most recent call last):
        File "/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/rules_python/python/private/pypi/whl_library.bzl", line 294, column 35, in _whl_library_impl
                repo_utils.execute_checked(
        File "/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/rules_python/python/private/repo_utils.bzl", line 182, column 29, in _execute_checked
                return _execute_internal(fail_on_error = True, *args, **kwargs)
        File "/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/rules_python/python/private/repo_utils.bzl", line 123, column 13, in _execute_internal
                fail((
Error in fail: repo.execute: whl_library.ResolveRequirement(pypi_ml_dtypes, ml-dtypes==0.4.0): end: failure:
  command: /root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/python_ppc64le-unknown-linux-gnu/bin/python3 -m python.private.pypi.whl_installer.wheel_installer --requirement ml-dtypes==0.4.0 --isolated --extra_pip_args "{\"arg\":[]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}"
  return code: 1
  working dir: <default: /root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi_ml_dtypes>
  timeout: 600
  environment:
PYTHONPATH="/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/rules_python:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__build:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__click:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__colorama:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__importlib_metadata:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__installer:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__more_itertools:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__packaging:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__pep517:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__pip:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__pip_tools:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__pyproject_hooks:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__setuptools:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__tomli:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__wheel:/root/.cache/bazel/_bazel_root/68a62076e91007a7908bc42a32e4cff9/external/pypi__zipp"
CPPFLAGS=""
===== stdout start =====
Collecting ml-dtypes==0.4.0 (from -r /tmp/tmpae6v73x5 (line 1))
  Using cached ml_dtypes-0.4.0.tar.gz (692 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'error'
===== stdout end =====
===== stderr start =====
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [3 lines of output]
      ERROR: Ignored the following versions that require a different python version: 1.21.2 Requires-Python >=3.7,<3.11; 1.21.3 Requires-Python >=3.7,<3.11; 1.21.4 Requires-Python >=3.7,<3.11; 1.21.5 Requires-Python >=3.7,<3.11; 1.21.6 Requires-Python >=3.7,<3.11
      ERROR: Could not find a version that satisfies the requirement numpy==2.0.0rc1 (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0, 1.13.1, 1.13.3, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0, 1.21.1, 1.22.0, 1.22.1, 1.22.2, 1.22.3, 1.22.4, 1.23.0, 1.23.1, 1.23.2, 1.23.3, 1.23.4, 1.23.5, 1.24.0, 1.24.1, 1.24.2, 1.24.3, 1.24.4, 1.25.0, 1.25.1, 1.25.2, 1.26.0, 1.26.1, 1.26.2, 1.26.3, 1.26.4, 2.0.0, 2.0.1, 2.0.2, 2.1.0rc1, 2.1.0, 2.1.1)
      ERROR: No matching distribution found for numpy==2.0.0rc1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
```