Skip to content

[TF] Remove GPE-related dead code from TensorFlow. #24719

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2019

Conversation

rxwei
Copy link
Contributor

@rxwei rxwei commented May 12, 2019

This PR removes dead code from the TensorFlow library that was initially added only for GPE. For context, GPE was removed by #24418.

  • Remove _ExpressibleByTensorFlowOp.
  • Remove most @inline(__always) from TensorFlow APIs, which were added in early 2018 when GPE deabstraction was not able to recursively inline all functions that use #tfops.
  • Remove TensorSendableReceivable and its conformances, which were added in early 2018 when GPE send/receive was being developed.
  • Remove functions and protocol requirements added for scalar promotion. Scalar promotion was a feature introduced in early 2018 that was able to turn code like Tensor(x.sum()) into send/receive-free data flow in a TensorFlow graph. It was already disabled a long time ago. The following are removed:
    • Protocol requirements _getScalarOrDie(_:) and _getScalar(_:) in _TensorFlowDataTypeCompatible
    • Functions _TFGetScalarOrDie(_:) and _TFGetScalar(_:)
  • Remove functions and protocol requirements added for code hoisting for partitioning (more specifically, hoisting code before the "tensor start point" in a partitioning region). These were added in early 2018, because GPE at the time did not support send/receive, and that host-only random initializers would require send/receive if they appeared inside a partitioning region. The following are removed:
    • Protocol requirement _hoistableClosure(_:) in _TensorFlowDataTypeCompatible
    • Function _TFHoistable(_:)
  • Remove compiler-known functions for constant tensor initialization. They were used for enabling the partitioning pass to transform array literals intro Const nodes in TensorFlow graphs to avoid copies. The following are removed:
    • _TFTensorFromScalars(_:shape:)
    • _TFTensorFromScalars1D(_:)
    • _TFTensorFromScalar(_:)
    • _TFStringTensorFromStrings(_:shape:)
    • _TFStringTensorFromStrings1D(_:)
    • _TFStringTensorFromString(_:)

@rxwei rxwei added the tensorflow This is for "tensorflow" branch PRs. label May 12, 2019
@rxwei rxwei requested review from pschuh, dan-zheng and lattner May 12, 2019 04:34
@rxwei
Copy link
Contributor Author

rxwei commented May 12, 2019

@swift-ci please test tensorflow

@lattner
Copy link
Contributor

lattner commented May 12, 2019

This is all fine with me.

@rxwei rxwei merged commit eef1d49 into swiftlang:tensorflow May 12, 2019
@rxwei rxwei deleted the tf-cleanup branch May 12, 2019 05:10
eaplatanios added a commit to eaplatanios/swift-apis that referenced this pull request May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tensorflow This is for "tensorflow" branch PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants