Commit Graph

378 Commits

Author SHA1 Message Date
A. Unique TensorFlower
c9ff6b6245 Add --repo_env=USE_PYWRAP_RULES=True to linux arm64 builds.
PiperOrigin-RevId: 746206292
2025-04-10 16:03:24 -07:00
Ezekiel Calubaquib
6358e9ee9c Add python 3.13 version for wheel release job for linux, mac, win
PiperOrigin-RevId: 745744999
2025-04-09 15:12:11 -07:00
Ezekiel Calubaquib
c0093bfb21 Add python 3.13 requirements and conditions for TF
the code below creates a condition to run specific Python.h code in cpp for python3.13 as the following functions are deprecated:

_PyArg_NoKeywords (removed)
_PyObject_VisitManagedDict (renamed to PyObject_VisitManagedDict)
_PyObject_ClearManagedDict (renamed to PyObject_ClearManagedDict)

PiperOrigin-RevId: 745284443
2025-04-08 15:00:52 -07:00
Vadym Matsishevskyi
ac8c58bd16 Integrate latest pywrap rules (mac fixes and support for pybind_extension submodules, including recursive ones).
Also enable pywrap rules on MacOS

PiperOrigin-RevId: 744794481
2025-04-07 12:08:57 -07:00
A. Unique TensorFlower
8110f18355 Increase Linux arm64 wheel size limit from 250 to 255 MB.
PiperOrigin-RevId: 740867774
2025-03-26 12:51:37 -07:00
Quoc Truong
258c9c4d27 Add /usr/local/cuda/bin location to the path so ptxas and nvcc will be found.
PiperOrigin-RevId: 740502532
2025-03-25 16:05:15 -07:00
Quoc Truong
ca96adeb0d Add cuda 12.1 and cudnn 9.8 image.
PiperOrigin-RevId: 739000526
2025-03-20 18:02:41 -07:00
Vadym Matsishevskyi
198f9bc834 Fix and enable pywrap rules on Windows platform
To use new rules the project needs to be built with the following parameters (flags are already into TF's .bazelrc)
--repo_env=USE_PYWRAP_RULES=True
--@com_google_protobuf//:use_dlls=True
--@com_google_absl//absl:use_dlls

Note: if after this CL, in one of your changes you see linker errors complaining about symbols missing on windows, you most likely need to modify _pywrap_tensorflow.def file:
- remove symbols which got deleted in your CL from _pywrap_tensorflow.def if they are mentioned there
- add new symbols into _pywrap_tensorflow.def if they start getting used in one of pybind_extension modules

To make sense out of mangled windows symbol names you may use https://demangler.com/ or `undname` (on windows) or any other simillar tool.

Automatic generation of _pywrap_tensorflow.def is possible but may be potentially slow, if there is evidence that _pywrap_tensorflow.def  needs to get updated often, we'll add the automation.

PiperOrigin-RevId: 738203468
2025-03-18 17:58:54 -07:00
Michael Hudgins
b4d70f9b9b Create ml_build container for CUDA 12.8, CUDNN 9.8.
PiperOrigin-RevId: 737000408
2025-03-14 15:45:44 -07:00
Kanglan Tang
3ace43daee Install jq package in the ml build container
PiperOrigin-RevId: 735558839
2025-03-10 17:08:59 -07:00
A. Unique TensorFlower
805775fcb5 Refactor mechanisms of building TF wheel and storing TF project version.
This change introduces a uniform way of building the TF wheel and controlling the filename version suffixes.

A new repository rule `python_wheel_version_suffix_repository` provides information about project and wheel version suffixes. The final value depends on environment variables passed to Bazel command: `_ML_WHEEL_WHEEL_TYPE, _ML_WHEEL_BUILD_DATE, _ML_WHEEL_GIT_HASH, _ML_WHEEL_VERSION_SUFFIX`

`tf_version.bzl` defines the TF project version and loads the version suffix information calculated by `python_wheel_version_suffix_repository`.

The targets `//tensorflow/core/public:release_version, //tensorflow:tensorflow_bzl //tensorflow/tools/pip_package:setup_py` use the version chunks defined above.

The version of the wheel in the build rule output depends on the environment variables.

Environment variables combinations for creating wheels with different versions:
  * snapshot (default build rule behavior): `--repo_env=ML_WHEEL_TYPE=snapshot`
  * release: `--repo_env=ML_WHEEL_TYPE=release`
  * release candidate: `--repo_env=ML_WHEEL_TYPE=release --repo_env=ML_WHEEL_VERSION_SUFFIX=-rc1`
  * nightly build with date as version suffix: `--repo_env=ML_WHEEL_TYPE=nightly --repo_env=ML_WHEEL_BUILD_DATE=<YYYYmmdd>`
  * build with git data as version suffix: `--repo_env=ML_WHEEL_TYPE=custom --repo_env=ML_WHEEL_BUILD_DATE=$(git show -s --format=%as HEAD) --repo_env=ML_WHEEL_GIT_HASH=$(git rev-parse HEAD)`

PiperOrigin-RevId: 733444080
2025-03-04 14:39:12 -08:00
Madhur Karampudi
82148fc5a7 Bump linux_arm64 whl size limit from 245M to 250M, since it's failing due to over-the-limit.
PiperOrigin-RevId: 733426954
2025-03-04 13:33:12 -08:00
A. Unique TensorFlower
d8d86fb73e Move --verbose_failures option to the command that builds the first wheel.
PiperOrigin-RevId: 732948750
2025-03-03 09:29:53 -08:00
A. Unique TensorFlower
41282ff5f5 Add --verbose_failures option for building the wheel
PiperOrigin-RevId: 731910625
2025-02-27 16:44:05 -08:00
A. Unique TensorFlower
28f5dde21e Add zstd support to DecodeCompressedOp
This only allows for zstd decompression of data produced by other tools, and
does so directly inline. It would be nice to add full zstd support for reading
and writing streams of data like
https://github.com/tensorflow/tensorflow/pull/58871 did, but DecodeCompressedOp
only needs a straightforward decompress implementation (even without streaming!)
since the end result is going to be an in-memory tensor anyway.

PiperOrigin-RevId: 731749205
2025-02-27 09:34:43 -08:00
A. Unique TensorFlower
5c289f5ba2 Upgrade to Bazel 7.4.1 for TensorFlow
- Disabled Bzlmod for now before we start the migration
- Disabled cc toolchain resolution for now
- Fixed transition on `--modify_execution_info` due to https://github.com/bazelbuild/bazel/pull/16262
- Explicitly added `-Wl,-undefined,dynamic_lookup` as linkopt on macOS after https://github.com/bazelbuild/bazel/pull/16414
- Set `-force_no_whole_archive` for host features
- Addressed Windows linking issue by adding `@com_googlesource_code_re2//:__subpackages__` in `exports_filter` of `//tensorflow/python:pywrap_tensorflow_internal`
- Removed `license` attribute on cc_shared_library
- Fixed license checks

PiperOrigin-RevId: 731344894
2025-02-26 09:27:14 -08:00
Nitin Srinivasan
1535c85bfe Move immutabledict install to the Dockerfile
PiperOrigin-RevId: 730555599
2025-02-24 13:11:48 -08:00
Vladimir Belitskiy
c2a59b4cb9 Remove the Windows 2019 configs.
CI now runs completely on Windows 2022.

PiperOrigin-RevId: 729152614
2025-02-20 10:13:01 -08:00
Kanglan Tang
2b775610a7 Update libtpu installation index path
Update the libtpu installation index to https://storage.googleapis.com/libtpu-wheels/index.html, which includes both stable and nightly libtpu versions, as per the cloud libtpu team's guidance.

Also update the libtpu version in the setup.py. It starts to differ from the TF version to support JAX, and it requires manual updates for new releases for now.

PiperOrigin-RevId: 728741103
2025-02-19 11:24:29 -08:00
A. Unique TensorFlower
ca4715ea0d Increase the TF GPU wheel size to 630 MB.
PiperOrigin-RevId: 728362828
2025-02-18 14:52:46 -08:00
Quoc Truong
adf9b275b6 Create two new ml-build images. One with libcudnn9.1 and cuda 12.1 and the other one with libcudnn 9.1 and cuda 12.3.
PiperOrigin-RevId: 728316388
2025-02-18 12:42:21 -08:00
Kanglan Tang
ea72e93812 Install free threaded python3.13t to the ml_build arm64 docker image
python3.13-nogil is a free-threaded build of python3.13.

PiperOrigin-RevId: 728246352
2025-02-18 09:54:06 -08:00
Nitin Srinivasan
4d034e905e Install uv in CI Dockerfiles
uv is much faster than pip for installing Python packages.

PiperOrigin-RevId: 726336762
2025-02-12 23:11:32 -08:00
A. Unique TensorFlower
cf389e5ab7 [NCCL] Upgrade TF NCCL version to 2.25.1
PiperOrigin-RevId: 725521622
2025-02-11 01:25:34 -08:00
Vadym Matsishevskyi
1135863da1 fix GPU pywrap implementation
PiperOrigin-RevId: 724563620
2025-02-07 20:37:37 -08:00
Antonio Sanchez
c49fbe6cc0 Update ml_dtypes version and path.
The include paths for headers within the ml_dtypes package have changed.
We therefore need to adjust the TF/XLA build rules and paths to account
for this.  Also updated the pip ml_dtypes version to match.

The main ml_dtypes repo name needed to be changed to avoid
conflicts with the ml_dtypes subfolder.  The subfolder contains the main
python package that needs to be added to the PYTHON_PATH.

PiperOrigin-RevId: 723654395
2025-02-05 14:47:55 -08:00
Kanglan Tang
15596e1a8f Install free threaded python3.13t to the ml_build x86 docker image
python3.13-nogil is a free-threaded build of python3.13.

PiperOrigin-RevId: 723604422
2025-02-05 12:25:04 -08:00
Vladimir Belitskiy
89f71b6f65 Don't fail on ./dist directory having already been created.
For bisect runs.

PiperOrigin-RevId: 721481197
2025-01-30 12:38:23 -08:00
Vladimir Belitskiy
61ee094e62 Bump up arm64 Linux and Mac wheel size limits: 240M -> 245M.
PiperOrigin-RevId: 721108035
2025-01-29 14:47:18 -08:00
Vladimir Belitskiy
6ba7e4e33d Actually copy the extra wheels into the expected directory afterwards.
PiperOrigin-RevId: 720753829
2025-01-28 18:34:52 -08:00
Kanglan Tang
96c1436fee Install Python 3.13t in JAX arm64 base docker image
A free-threaded Python 3.13-nogil is now available in apt-get. Install it following the instructions at: https://py-free-threading.github.io/installing_cpython/#__tabbed_2_3.

PiperOrigin-RevId: 720335156
2025-01-27 16:04:04 -08:00
Vladimir Belitskiy
a93dc78944 Allow building identical wheels under additional names.
Currently only needed for Windows, since the same wheel is uploaded
to both tensorflow_cpu, and tensorflow PyPi repos,
but different names/metadata are needed.

PiperOrigin-RevId: 720313792
2025-01-27 14:53:36 -08:00
Vladimir Belitskiy
768059fbc5 Add the missing wheel name specification for Windows.
PiperOrigin-RevId: 720176067
2025-01-27 08:23:18 -08:00
Vladimir Belitskiy
9ab2fee32a Add a workaround for gsutil not working properly on MSYS2.
PiperOrigin-RevId: 719389902
2025-01-24 12:17:08 -08:00
Vladimir Belitskiy
7513f771aa Adjust the wheel.sh, libtensorflow.sh scripts to be Win-compatible for upload.
Temporary workaround.

PiperOrigin-RevId: 719027529
2025-01-23 15:41:59 -08:00
Vladimir Belitskiy
82ba59a646 Fix up the 2022 Win RBE config.
PiperOrigin-RevId: 718920772
2025-01-23 10:29:55 -08:00
Vladimir Belitskiy
1ae20f1e43 Add some clarifying comments for Dockerfiles.
PiperOrigin-RevId: 716675943
2025-01-17 08:35:57 -08:00
Vladimir Belitskiy
83ccbd99b7 Fix up Windows libtensorflow artifacts to have the same location/naming as the rest.
PiperOrigin-RevId: 716675474
2025-01-17 08:25:18 -08:00
A. Unique TensorFlower
30408850ee Decrease Linux CPU wheel limit size to 260M.
PiperOrigin-RevId: 715080397
2025-01-13 13:15:45 -08:00
Raviteja Gorijala
468aa55773 Increase wheel limit size up to 270M for a temporary nightlies fix.
PiperOrigin-RevId: 715072690
2025-01-13 13:07:13 -08:00
Raviteja Gorijala
e36767644f Reverts 49b2a87790
PiperOrigin-RevId: 715041088
2025-01-13 11:42:38 -08:00
Vladimir Belitskiy
0599ae19c8 Add the Windows 2022 Dockerfile.
PiperOrigin-RevId: 715023019
2025-01-13 10:59:55 -08:00
Raviteja Gorijala
49b2a87790 Increase wheel limit size up to 270M for a temporary nightlies fix.
PiperOrigin-RevId: 713733934
2025-01-09 11:25:19 -08:00
Vladimir Belitskiy
fa3b3c1a0d Update scripts/configs for Windows nightly/release builds.
`set -u` (does not allow unbound variables) has been removed from all scripts.
This is due to Docker on Windows treating variables in an env file,
set to an empty value (`MY_VAR=`), as unbound variables. Consequently,
these variables, even though they are "set", do not make it into the Docker
container at all, and various checks for those variables fail outright.

PiperOrigin-RevId: 713717958
2025-01-09 10:37:25 -08:00
A. Unique TensorFlower
a0196763b9 Increase wheel limit size up to 270M for a temporary nightlies fix.
PiperOrigin-RevId: 711436765
2025-01-02 08:58:19 -08:00
A. Unique TensorFlower
02efd1fd64 Increase wheel limit size for a temporary nightlies fix.
PiperOrigin-RevId: 710755858
2024-12-30 11:17:12 -08:00
A. Unique TensorFlower
49d80051ec Replace manyLinux compliance check action in TF wheel build rule with macros for Linux platforms.
Example of usage:

```
load(
    "@tsl//:third_party/py/py_manylinux_compliance_test.bzl",
    "verify_manylinux_compliance_test",
)

verify_manylinux_compliance_test(
    name = "manylinux_compliance_test",
    aarch64_compliance_tag = "manylinux_2_17_aarch64",
    test_tags = [
        "mac_excluded",
        "windows_excluded",
    ],
    wheel = ":wheel",
    x86_64_compliance_tag = "manylinux_2_17_x86_64",
)
```

The test target is executed only when specified in Bazel command line. The test passes if `auditwheel show` results have the compliance tag value (depends on the machine type). The test fails otherwise and prints the `auditwheel show` results.

PiperOrigin-RevId: 708024471
2024-12-19 14:17:53 -08:00
Vladimir Belitskiy
06a7f2942e Update the Dockerfile to reflect the current Docker image used.
PiperOrigin-RevId: 707965524
2024-12-19 11:09:56 -08:00
A. Unique TensorFlower
75a4b2e04f Make TF wheel API tests manual.
PiperOrigin-RevId: 707632318
2024-12-18 12:29:34 -08:00
Vadym Matsishevskyi
54d7300746 Enable pywrap rules for LinuxCPU builds
PiperOrigin-RevId: 707156066
2024-12-17 11:06:34 -08:00