Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
75885f7
remove setuptools
andersendsa Apr 25, 2026
e1a319a
Fix stack overflow in DebugFileIO::RecursiveCreateDir for relative de…
somtri Aug 3, 2026
cda67a5
Use TF_ASSERT_OK for DeleteRecursively in relative-dump-root test
somtri Aug 3, 2026
e829051
Make relative-dump-root test independent of ambient CWD
somtri Aug 6, 2026
72763bf
Bump setuptools in /ci/official/requirements_updater/numpy1_requirements
dependabot[bot] Aug 11, 2026
3324abe
Raise a clear error for a symbolic index on a captured eager TensorArray
vishwakt Aug 21, 2026
ee13838
Extend the symbolic input check to gather, scatter and split
vishwakt Aug 21, 2026
8c1d199
Add missing strict dep for the tensor array ops test
vishwakt Aug 23, 2026
e01523f
Fix TF_SYSTEM_LIBS linker failures with pywrap rules (fixes #126093)
ankitxvx Aug 25, 2026
61d8336
Address review comments: fix docstring typo, add -lgoogle_cloud_cpp_s…
ankitxvx Aug 25, 2026
27d1b04
Validate axis bounds in np.moveaxis
kaivalya-cyber Aug 26, 2026
9bbe90f
Relocate tf_system_libs_linkopts to platform abstraction layer
ankitxvx Aug 27, 2026
b562e1b
Merge master into fix-eager-tensorarray-graph-capture-error
vishwakt Aug 27, 2026
9226828
Fix presubmit failure by reverting platform layer relocation
ankitxvx Aug 28, 2026
54a0044
Handle symbolic axes in moveaxis validation
kaivalya-cyber Aug 28, 2026
7da397d
Fix error message typo in np.diff for negative n
kaivalya-cyber Aug 28, 2026
9608ede
Convert the input before inferring axes in the N-D FFT ops
Nishuuzz Aug 28, 2026
65993ab
Check for a negative feature length in the context parsers
elsh04 Aug 28, 2026
ac0ca56
Fix internal presubmit by moving tf_system_libs_linkopts to OSS defau…
ankitxvx Aug 28, 2026
afe6350
Fix internal presubmit by wrapping pywrap_library
ankitxvx Aug 29, 2026
9155469
Correct np.diff negative n error message
kaivalya-cyber Aug 30, 2026
9d59e7d
Validate atrous_conv2d input ranks
kaivalya-cyber Aug 19, 2026
a78ab1b
Add atrous_conv2d invalid filter rank test
kaivalya-cyber Aug 19, 2026
51d1a92
Update atrous conv rank test expectation
kaivalya-cyber Aug 29, 2026
850481f
Guard moveaxis static permutation path
kaivalya-cyber Aug 30, 2026
b5ea52f
Remove duplicate moveaxis axis conversion
kaivalya-cyber Aug 30, 2026
a7be347
Clean up whitespace in tensorflow.bzl for Copybara
ankitxvx Aug 30, 2026
c80a1ad
Update google-ml-infra/bap pin in remaining workflows
akuegel Aug 31, 2026
55b34d9
Expand low-precision support for data movement and elementwise ops on…
akuegel Aug 31, 2026
9e66e8c
Automated Code Change
tensorflower-gardener Aug 31, 2026
af85362
Merge pull request #125799 from vishwakt:fix-eager-tensorarray-graph-…
tensorflower-gardener Aug 31, 2026
0758e1c
Merge pull request #125613 from kaivalya-cyber:fix/atrous-conv2d-rank…
tensorflower-gardener Aug 31, 2026
61216d9
Merge pull request #126112 from ankitxvx:fix-tf-system-libs-pywrap
tensorflower-gardener Aug 31, 2026
a2f7ae4
PR #48044: [ROCm] Use AMD device descriptions in perf model tests
nurmukhametov Aug 31, 2026
c808938
Re-enable ynn_fusion_test
dsharletg Aug 31, 2026
98fe4cb
Automated Code Change
tensorflower-gardener Aug 31, 2026
20b6096
Migrate pass constructors in kernel_creator (NFC)
akuegel Aug 31, 2026
a162572
Merge pull request #126350 from endorphin13:parse-context-negative-count
tensorflower-gardener Aug 31, 2026
4049311
Merge pull request #123786 from tensorflow:dependabot/pip/ci/official…
tensorflower-gardener Aug 31, 2026
7d739e2
Merge pull request #126198 from kaivalya-cyber:fix/np-swapaxes-moveax…
tensorflower-gardener Aug 31, 2026
6e4d1dc
Merge pull request #126323 from kaivalya-cyber:fix/np-diff-error-message
tensorflower-gardener Aug 31, 2026
97d5d66
Merge pull request #124609 from somtri:fix-123114-recursive-createdir…
tensorflower-gardener Aug 31, 2026
dacd670
Merge pull request #116901 from andersendsa:remove_setuptools
tensorflower-gardener Aug 31, 2026
b0e2b3a
Merge pull request #126334 from Nishuuzz:fftnd-convert-before-axes
tensorflower-gardener Aug 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ portpicker == 1.6.0
scipy >= 1.13.0, < 1.15.0
requests >= 2.33.0
packaging==23.2
setuptools==78.1.1
setuptools==83.0.0
jax==0.4.7
zstandard==0.23.0
# The dependencies below are needed for TF wheel testing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,9 +953,9 @@ zstandard==0.25.0 \
# via -r ci/official/requirements_updater/requirements.in

# The following packages are considered to be unsafe in a requirements file:
setuptools==78.1.1 \
--hash=sha256:c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561 \
--hash=sha256:fcc17fd9cd898242f6b4adfaca46137a9edef687f43e6f78469692a5e70d851d
setuptools==83.0.0 \
--hash=sha256:025bccbbf0fa05b6192bc64ae1e7b16e001fd6d6d4d5de03c97b1c1ade523bef \
--hash=sha256:29b23c360f22f414dc7336bb39178cc7bcbf6021ed2733cde173f09dba19abb3
# via
# -r ci/official/requirements_updater/requirements.in
# tb-nightly
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,9 @@ zstandard==0.25.0 \
# via -r ci/official/requirements_updater/requirements.in

# The following packages are considered to be unsafe in a requirements file:
setuptools==78.1.1 \
--hash=sha256:c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561 \
--hash=sha256:fcc17fd9cd898242f6b4adfaca46137a9edef687f43e6f78469692a5e70d851d
setuptools==83.0.0 \
--hash=sha256:025bccbbf0fa05b6192bc64ae1e7b16e001fd6d6d4d5de03c97b1c1ade523bef \
--hash=sha256:29b23c360f22f414dc7336bb39178cc7bcbf6021ed2733cde173f09dba19abb3
# via
# -r ci/official/requirements_updater/requirements.in
# tb-nightly
Original file line number Diff line number Diff line change
Expand Up @@ -952,9 +952,9 @@ zstandard==0.25.0 \
# via -r ci/official/requirements_updater/requirements.in

# The following packages are considered to be unsafe in a requirements file:
setuptools==78.1.1 \
--hash=sha256:c3a9c4211ff4c309edb8b8c4f1cbfa7ae324c4ba9f91ff254e3d305b9fd54561 \
--hash=sha256:fcc17fd9cd898242f6b4adfaca46137a9edef687f43e6f78469692a5e70d851d
setuptools==83.0.0 \
--hash=sha256:025bccbbf0fa05b6192bc64ae1e7b16e001fd6d6d4d5de03c97b1c1ade523bef \
--hash=sha256:29b23c360f22f414dc7336bb39178cc7bcbf6021ed2733cde173f09dba19abb3
# via
# -r ci/official/requirements_updater/requirements.in
# tb-nightly
10 changes: 6 additions & 4 deletions tensorflow/compiler/mlir/tools/kernel_gen/kernel_creator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ absl::Status LowerHlotoLoops(mlir::ModuleOp module,
mlir::kernel_gen::transforms::CreateBufferReusePass());
// Approximate Tanh using standard operations.
pm.addNestedPass<FuncOp>(
::mlir::mhlo::createLegalizeTrigonometricToApproximationPass());
::mlir::mhlo::createLegalizeTanhToApproximationPass());
// Transform the Linalg ops inside of the loop nest into parallel loops.
pm.addNestedPass<FuncOp>(::mlir::createConvertLinalgToParallelLoopsPass());

Expand Down Expand Up @@ -295,7 +295,7 @@ absl::Status LowerLoopsToGPU(mlir::ModuleOp module, bool index_64bit,
pm.addNestedPass<FuncOp>(mlir::bufferization::createPromoteBuffersToStackPass(
[](Value alloc) { return IsSmallAlloc(alloc); }));
// Free all temporaries,
pm.addNestedPass<FuncOp>(mlir::deallocation::createBufferDeallocationPass());
pm.addNestedPass<FuncOp>(mlir::deallocation::createBufferDeallocation());
pm.addPass(mlir::createCanonicalizerPass());
pm.addNestedPass<FuncOp>(::mlir::createConvertLinalgToLoopsPass());

Expand Down Expand Up @@ -359,9 +359,11 @@ absl::Status LowerKernelBodiesToLowLevelIr(mlir::ModuleOp module,
auto& kernelPm = pm.nest<::mlir::gpu::GPUModuleOp>();
kernelPm.addPass(::mlir::createSCFToControlFlowPass());
#if TENSORFLOW_USE_ROCM
kernelPm.addPass(mlir::createGpuKernelToRocdlPass(architecture));
mlir::GpuKernelToROCDLPassOptions options;
options.chipset = architecture;
kernelPm.addPass(mlir::createGpuKernelToROCDLPass(options));
#elif GOOGLE_CUDA
kernelPm.addPass(mlir::createGpuKernelToNvvmPass());
kernelPm.addPass(mlir::createGpuKernelToNVVMPass());
kernelPm.addPass(mlir::NVVM::createNVVMOptimizeForTargetPass());
#endif
// Remove all location information to prevent a debug build.
Expand Down
8 changes: 8 additions & 0 deletions tensorflow/core/debug/debug_io_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,14 @@ absl::Status DebugFileIO::DumpTensorToEventFile(
}

absl::Status DebugFileIO::RecursiveCreateDir(Env* env, const std::string& dir) {
if (dir.empty()) {
// io::Dirname() returns "" for any path with no '/' component; this is
// a fixed point (Dirname("") == ""). It means there is no parent
// directory left to create: any remaining path is relative to the
// current working directory. Stop here instead of recursing forever.
return absl::OkStatus();
}

if (env->FileExists(dir).ok() && env->IsDirectory(dir).ok()) {
// The path already exists as a directory. Return OK right away.
return absl::OkStatus();
Expand Down
91 changes: 91 additions & 0 deletions tensorflow/core/debug/debug_io_utils_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,17 @@ limitations under the License.

#include "tensorflow/core/debug/debug_io_utils.h"

#include <cstdio>
#include <cstdlib>
#include <memory>
#include <unordered_set>

#if defined(PLATFORM_WINDOWS)
#include <direct.h>
#else
#include <unistd.h>
#endif

#include "absl/synchronization/notification.h"
#include "tensorflow/core/debug/debug_callback_registry.h"
#include "tensorflow/core/debug/debug_node_key.h"
Expand All @@ -32,11 +39,41 @@ limitations under the License.
#include "tensorflow/core/lib/io/path.h"
#include "tensorflow/core/lib/strings/str_util.h"
#include "tensorflow/core/platform/env.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/util/event.pb.h"

namespace tensorflow {
namespace {

#if defined(PLATFORM_WINDOWS)
#define TFDBG_GETCWD _getcwd
#define TFDBG_CHDIR _chdir
#else
#define TFDBG_GETCWD getcwd
#define TFDBG_CHDIR chdir
#endif

// Temporarily changes the process's current working directory for the
// lifetime of this object, then restores the original directory. Used by
// tests that must exercise a bare relative (slash-less) path argument, which
// otherwise depends on whatever the test runner's ambient CWD happens to be.
class ScopedChdir {
public:
explicit ScopedChdir(const std::string& new_dir) {
char buf[FILENAME_MAX];
CHECK(TFDBG_GETCWD(buf, sizeof(buf)) != nullptr);
old_dir_ = buf;
CHECK_EQ(0, TFDBG_CHDIR(new_dir.c_str()));
}
~ScopedChdir() { (void)TFDBG_CHDIR(old_dir_.c_str()); }

private:
std::string old_dir_;
};

#undef TFDBG_GETCWD
#undef TFDBG_CHDIR

class DebugIOUtilsTest : public ::testing::Test {
public:
void Initialize() {
Expand Down Expand Up @@ -151,6 +188,60 @@ TEST_F(DebugIOUtilsTest, DumpFloatTensorToFileSunnyDay) {
ASSERT_EQ(0, undeleted_dirs);
}

TEST_F(DebugIOUtilsTest, DumpTensorToDirWithRelativeDumpRootSunnyDay) {
Initialize();
// Run inside a directory guaranteed to be writable, so the relative-path
// dump below doesn't depend on whatever the test runner's ambient current
// working directory happens to be.
ScopedChdir scoped_chdir(testing::TmpDir());

// A relative directory with no path separator at all. io::Dirname() on a
// path like this returns "", and DebugFileIO::RecursiveCreateDir used to
// recurse on that empty result forever instead of treating it as "no
// parent directory left to create" (see GitHub issue #123114).
const std::string test_dir = "tfdbg_relative_dump_root_test";
if (env_->FileExists(test_dir).ok()) {
int64_t undeleted_files = 0;
int64_t undeleted_dirs = 0;
TF_ASSERT_OK(
env_->DeleteRecursively(test_dir, &undeleted_files, &undeleted_dirs));
}

const uint64_t wall_time = env_->NowMicros();
const DebugNodeKey kDebugNodeKey("/job:localhost/replica:0/task:0/cpu:0",
"foo/bar/qux/tensor_a", 0, "DebugIdentity");

std::string dump_file_path;
TF_ASSERT_OK(DebugFileIO::DumpTensorToDir(
kDebugNodeKey, *tensor_a_, wall_time, test_dir, &dump_file_path));

// Read the file into a Event proto.
Event event;
TF_ASSERT_OK(ReadEventFromFile(dump_file_path, &event));

ASSERT_GE(wall_time, event.wall_time());
ASSERT_EQ(1, event.summary().value().size());
ASSERT_EQ(kDebugNodeKey.debug_node_name,
event.summary().value(0).node_name());

Tensor a_prime(DT_FLOAT);
ASSERT_TRUE(a_prime.FromProto(event.summary().value(0).tensor()));

// Verify tensor shape and value.
ASSERT_EQ(tensor_a_->shape(), a_prime.shape());
for (int i = 0; i < a_prime.flat<float>().size(); ++i) {
ASSERT_EQ(tensor_a_->flat<float>()(i), a_prime.flat<float>()(i));
}

// Tear down temporary file and directories.
int64_t undeleted_files = 0;
int64_t undeleted_dirs = 0;
TF_ASSERT_OK(
env_->DeleteRecursively(test_dir, &undeleted_files, &undeleted_dirs));
ASSERT_EQ(0, undeleted_files);
ASSERT_EQ(0, undeleted_dirs);
}

TEST_F(DebugIOUtilsTest, DumpStringTensorToFileSunnyDay) {
Initialize();

Expand Down
30 changes: 26 additions & 4 deletions tensorflow/core/util/example_proto_fast_parsing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2372,7 +2372,15 @@ absl::Status ParseContextDenseFeatures(
reinterpret_cast<const uint8_t*>(feature_proto.data()),
feature_proto.size());
EnableAliasing(&stream);
num_elements += ParseFeature(dtype, &stream, &out, &out_offset);
const int num_added = ParseFeature(dtype, &stream, &out, &out_offset);
if (num_added < 0) {
// This should be unreachable -- we already scanned the feature in
// GetContextFeatureLengths, and it hasn't changed since then.
return absl::InvalidArgumentError(
absl::StrCat("Error in context feature ", c.feature_name,
" in example ", ExampleName(example_names, e)));
}
num_elements += num_added;
}
if (num_elements != data_max_elements) {
return absl::InvalidArgumentError(
Expand Down Expand Up @@ -2422,10 +2430,17 @@ absl::Status ParseContextSparseFeatures(
reinterpret_cast<const uint8_t*>(feature_proto.data()),
feature_proto.size());
EnableAliasing(&stream);
size_t num_added =
int num_added =
ParseFeature(dtype, &stream, &out_values, &out_values_offset);
if (num_added < 0) {
// This should be unreachable -- we already scanned the feature in
// GetContextFeatureLengths, and it hasn't changed since then.
return absl::InvalidArgumentError(
absl::StrCat("Error in context feature ", c.feature_name,
" in example ", ExampleName(example_names, e)));
}
num_elements += num_added;
max_num_cols = std::max(max_num_cols, num_added);
max_num_cols = std::max(max_num_cols, static_cast<size_t>(num_added));
for (int i = 0; i < num_added; i++) {
if (is_batch) *out_indices++ = e;
*out_indices++ = i;
Expand Down Expand Up @@ -2492,8 +2507,15 @@ absl::Status ParseContextRaggedFeatures(
reinterpret_cast<const uint8_t*>(feature_proto.data()),
feature_proto.size());
EnableAliasing(&stream);
size_t num_added =
int num_added =
ParseFeature(dtype, &stream, &out_values, &out_values_offset);
if (num_added < 0) {
// This should be unreachable -- we already scanned the feature in
// GetContextFeatureLengths, and it hasn't changed since then.
return absl::InvalidArgumentError(
absl::StrCat("Error in context feature ", c.feature_name,
" in example ", ExampleName(example_names, e)));
}
split += num_added;
}
if (int32_splits) {
Expand Down
20 changes: 19 additions & 1 deletion tensorflow/python/kernel_tests/nn_ops/atrous_conv2d_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@ def testAtrousConv2DInvalid(self):
padding="SAME")
self.evaluate(op)

def testAtrousConv2DInvalidInputRank(self):
with self.assertRaisesRegex(ValueError, "rank 4"):
nn_ops.atrous_conv2d(
value=np.ones([10]),
filters=np.ones([1, 1, 1, 1]),
rate=1,
padding="SAME",
)

def testAtrousConv2DInvalidFilterRank(self):
with self.assertRaisesRegex(ValueError, "rank 4"):
nn_ops.atrous_conv2d(
value=np.ones([1, 1, 1, 1]),
filters=np.ones([10]),
rate=1,
padding="SAME",
)


class AtrousConv2DTransposeTest(test.TestCase):

Expand Down Expand Up @@ -250,7 +268,7 @@ def testAtrousDepthwiseConv2DForward(self):
def testInvalidInputRank(self):
value = array_ops.zeros([10], dtype=dtypes.float32)
filters = array_ops.zeros([5, 5, 1, 8], dtype=dtypes.float32)
with self.assertRaisesRegex(ValueError, "rank at least 3"):
with self.assertRaisesRegex(ValueError, "rank 4"):
nn_ops.atrous_conv2d(value, filters, rate=1, padding="VALID")


Expand Down
21 changes: 21 additions & 0 deletions tensorflow/python/kernel_tests/signal/fft_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from tensorflow.python.eager import context
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import errors
from tensorflow.python.framework import ops
from tensorflow.python.framework import test_util
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import gen_spectral_ops
Expand Down Expand Up @@ -470,6 +471,16 @@ def test_grad_random(self, rank, extra_dims, np_type):
self._check_grad_complex(self._tf_ifft_for_rank(rank), re, im,
rtol=tol, atol=tol)

def testNDOpsAcceptNonTensorInput(self):
# The axes used to be inferred from the input before it was converted to
# a tensor, so a plain Python list raised AttributeError rather than
# being accepted like the equivalent tensor. Build the ops in a graph so
# this does not depend on an FFTND/IFFTND kernel being registered.
x = [[1.0, 2.0], [3.0, 4.0]]
with ops.Graph().as_default():
self.assertIsNotNone(fft_ops.fftnd(x))
self.assertIsNotNone(fft_ops.ifftnd(x))


@test_util.run_all_in_graph_and_eager_modes
class RFFTOpsTest(BaseFFTOpsTest, parameterized.TestCase):
Expand Down Expand Up @@ -523,6 +534,16 @@ def testIRFFTWrongLengthRaisesBeforeNegativeLastLength(self):
with self.assertRaisesRegex(ValueError, "Dimension must be 2 but is 1"):
fft_ops.irfftnd(x, fft_length=[-5])

def testNDOpsAcceptNonTensorInput(self):
# The axes used to be inferred from the input before it was converted to
# a tensor, so a plain Python list raised AttributeError rather than
# being accepted like the equivalent tensor. Build the ops in a graph so
# this does not depend on an RFFTND/IRFFTND kernel being registered.
x = [[1.0, 2.0], [3.0, 4.0]]
with ops.Graph().as_default():
self.assertIsNotNone(fft_ops.rfftnd(x))
self.assertIsNotNone(fft_ops.irfftnd(x))

def _np_fftn(self, x, fft_length=None, axes=None, norm=None):
return np.fft.rfftn(x, s=fft_length, axes=axes, norm=norm)

Expand Down
1 change: 1 addition & 0 deletions tensorflow/python/ops/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3844,6 +3844,7 @@ py_test(
deps = [
":array_ops",
":tensor_array_ops",
":variables",
"//tensorflow/python/eager:def_function",
"//tensorflow/python/framework:constant_op",
"//tensorflow/python/framework:dtypes",
Expand Down
9 changes: 7 additions & 2 deletions tensorflow/python/ops/nn_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,8 +1912,9 @@ def atrous_conv2d(value, filters, rate, padding, name=None):
[batch, height, width, out_channels].

Raises:
ValueError: If input/output depth does not match `filters`' shape, or if
padding is other than `'VALID'` or `'SAME'`.
ValueError: If input/output depth does not match `filters`' shape, if
`value` or `filters` is not rank 4, or if padding is other than
`'VALID'` or `'SAME'`.

References:
Multi-Scale Context Aggregation by Dilated Convolutions:
Expand All @@ -1932,6 +1933,10 @@ def atrous_conv2d(value, filters, rate, padding, name=None):
(https://ieeexplore.ieee.org/abstract/document/6738831)
([pdf](https://arxiv.org/pdf/1302.1700.pdf))
"""
value = ops.convert_to_tensor(value, name="value")
filters = ops.convert_to_tensor(filters, name="filters")
value.shape.assert_has_rank(4)
filters.shape.assert_has_rank(4)
return convolution(
input=value,
filter=filters,
Expand Down
Loading
Loading