Skip to content

[pull] master from tensorflow:master - #8848

Merged
pull[bot] merged 42 commits into
Cache-Cloud:masterfrom
tensorflow:master
Sep 24, 2026
Merged

pull[bot] merged 42 commits into
Cache-Cloud:masterfrom
tensorflow:master

Conversation

@pull

@pull pull Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Cyrax321 and others added 30 commits May 8, 2026 01:13
…/python

Replace bare 'raise Exception(...)' with appropriate built-in
exception types across several modules in tensorflow/python/:

- tensorflow/python/tools/selective_registration_header_lib.py:
  Exception -> ValueError (empty input file)

- tensorflow/python/platform/benchmark.py:
  Exception -> ValueError (duplicate benchmark name)

- tensorflow/python/tpu/client/client.py:
  Exception -> RuntimeError (TPU version not available,
  worker configuration failure)

- tensorflow/python/keras/utils/data_utils.py:
  Exception -> OSError (URL fetch failures wrapping
  urllib HTTP/URL errors)

- tensorflow/python/ops/numpy_ops/tests/config.py:
  Exception -> KeyError (unrecognized config option)
  Exception -> ValueError (duplicate config definition)

Using specific exception types follows Python best practices (PEP 8)
and allows callers to catch and handle errors more precisely.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Refactor error handling in TPU client for clarity.
…dAccumulator

When computing second-order derivatives via nested tf.autodiff.ForwardAccumulator
(forward-over-forward), _CumulativeLogsumexpGrad suffered from two issues:

1. Transposing the VJP for forward-mode autodiff evaluates both branches of
   array_ops.where_v2. In the unselected branch where grad <= 0 (or grad >= 0),
   math_ops.log(0.0) evaluates to -inf, and differentiating a second time
   produces 0.0 * (1.0 / 0.0) = 0.0 * inf = NaN in _LogGrad. Guarding the log
   argument with a double-where pattern (safe_pos_grad / safe_neg_grad) and
   subtracting cumulative_logsumexp inside the where branch prevents log(0)
   and (-inf) - (-inf) = NaN when exclusive=True.
2. Under nested ForwardAccumulator execution, inner JVP callbacks execute
   before outer JVP callbacks attach outer tangents to op.outputs[0].
   Recomputing cumulative_logsumexp from op.inputs[0] ensures outer tangents
   are tracked.

Fixes #127243
Ensure tf.math.log_sigmoid preserves small finite second-derivative signals
for float64 inputs without prematurely collapsing to 0.0 due to cancellation.

Also update log_sigmoid docstring to document support for float16 and bfloat16.

Fixes #126628
… keras-team/keras, cannot merge via tensorflow/tensorflow

Drops tensorflow/python/keras/utils/data_utils.py from PR #117860 so only 4 core files remain. Keras fix will be submitted separately upstream.
Add safety check before deleting buffer in destructor.
Refactor __del__ method to safely access buffer attribute and delete it if necessary.
Removed unnecessary sys import and Python 2 compatibility check.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
`tf.experimental.numpy.sinc` evaluates `sin(pi_x) / pi_x` and selects away
from it at `x == 0` with `where`. That discarded branch is 0/0 there, and
`where` still propagates its gradient (0 * nan is nan), so the gradient at
zero came out as `nan` instead of `0`.

Substituting 1 for the denominator in the discarded branch leaves the
forward values bit-for-bit identical (the branch is never selected) while
making it finite, so its contribution is scaled to exactly 0.

Adds a regression test that fails before the change and passes after.

Related: #127226
…ent exclusions

1. Replace array_ops.ones_like(grad) with math_ops.cast(1.0, grad.dtype)
   in _CumulativeLogsumexpGrad to avoid allocating full-shape ones tensors.
2. Regenerate tensorflow/python/eager/pywrap_gradient_exclusions.cc to add
   CumulativeLogsumexp to OpGradientUnusedOutputIndices since op.outputs[0]
   is no longer read by _CumulativeLogsumexpGrad.
Per gemini-code-assist review on #127742: x_np is always float64, so
casting the expected array to x_np.dtype compared a float64 reference
against the float32 gradient under assertAllClose. Casting to
dtype.as_numpy_dtype keeps the precision strict for every tested dtype.
Use atol=1e-18 instead of 0 in testLogSigmoidSecondDerivativePreservesSmallValue
to ensure stability across different hardware architectures and precisions.
Reverts changelist 986346565

PiperOrigin-RevId: 986414211
The HLO to StableHLO import of a sub byte integer constant recomputed
`literal.element_count()` and pushed back one byte per element. The export
read one APInt per element and set the literal one multidimensional index
at a time. Both now copy the elements in bulk with unchanged per element
semantics, so large int4 constants no longer dominate the round trip.
Splats fill the literal with one std::fill. Compiled output is unchanged.

PiperOrigin-RevId: 986444398
…alDmaBenchmarks.

PiperOrigin-RevId: 986475694
tensorflower-gardener and others added 12 commits September 24, 2026 02:29
…umexp-nested-jvp

PiperOrigin-RevId: 986485736
Blocking on the destructor has a performance implication. We actually don't need to block on the destructor since the watchdog can be disarmed asynchronously inside a host callback.

PiperOrigin-RevId: 986518654
PiperOrigin-RevId: 986524446
@pull pull Bot locked and limited conversation to collaborators Sep 24, 2026
@pull pull Bot added the ⤵️ pull label Sep 24, 2026
@pull
pull Bot merged commit 96df653 into Cache-Cloud:master Sep 24, 2026
1 of 7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants