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
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
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
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
- 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
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
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
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
`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
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