Skip to content

fix: py-tensorflow: patch cast ambiguity with GCC in dtensor/mlir/{shape_utils,spmd_expansion}.cc#868

Merged
wdconinc merged 4 commits intodevelopfrom
fix/py-tensorflow-gcc-cast
Apr 9, 2026
Merged

fix: py-tensorflow: patch cast ambiguity with GCC in dtensor/mlir/{shape_utils,spmd_expansion}.cc#868
wdconinc merged 4 commits intodevelopfrom
fix/py-tensorflow-gcc-cast

Conversation

@wdconinc
Copy link
Copy Markdown
Contributor

@wdconinc wdconinc commented Apr 5, 2026

Briefly, what does this PR introduce?

tensorflow/dtensor/mlir/shape_utils.cc:76 uses unqualified cast<mlir::OpResult> which is ambiguous with Eigen::internal::cast under GCC. Same in tensorflow/dtensor/mlir/spmd_expansion.cc:191. This PR uses llvm::cast explicitly.

…pe_utils.cc

tensorflow/dtensor/mlir/shape_utils.cc:76 uses unqualified cast<mlir::OpResult>
which is ambiguous with Eigen::internal::cast under GCC. Use llvm::cast explicitly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 5, 2026 16:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the py-tensorflow Spack package to work around a GCC-only compilation failure in TensorFlow dtensor by explicitly qualifying an ambiguous cast<mlir::OpResult> call as llvm::cast.

Changes:

  • Keeps the existing upstream patch for TensorFlow @2.15:2.19.
  • Adds a GCC-conditional source edit for TensorFlow @2.20: to qualify cast<mlir::OpResult> as llvm::cast<mlir::OpResult>.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread spack_repo/eic/packages/py_tensorflow/package.py Outdated
Comment thread spack_repo/eic/packages/py_tensorflow/package.py
wdconinc and others added 2 commits April 5, 2026 11:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…pansion.cc

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wdconinc wdconinc changed the title fix: py-tensorflow: patch cast ambiguity with GCC in dtensor/mlir/shape_utils.cc fix: py-tensorflow: patch cast ambiguity with GCC in dtensor/mlir/{shape_utils,spmd_expansion}.cc Apr 6, 2026
…pansion.cc

GCC cannot resolve unqualified isa<mlir::TF::ResourceType> at line 224
without the llvm:: namespace prefix. Add a filter_file to qualify it,
analogous to the existing cast<> fixes in the same method.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wdconinc
Copy link
Copy Markdown
Contributor Author

wdconinc commented Apr 7, 2026

@wdconinc wdconinc requested a review from veprbl April 7, 2026 19:09
@wdconinc
Copy link
Copy Markdown
Contributor Author

wdconinc commented Apr 7, 2026

(Will upstream in due course)

@wdconinc wdconinc enabled auto-merge (squash) April 7, 2026 19:09
@wdconinc wdconinc merged commit 4255125 into develop Apr 9, 2026
6 checks passed
@wdconinc wdconinc deleted the fix/py-tensorflow-gcc-cast branch April 9, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants