-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[TF] TensorFlow/TensorFlowCore Refactoring #24261
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
Conversation
…ork currently from outside stdlib.
This is where a One hack you can try is to skip the ones whose parameter indices are |
I looked into this earlier today but it didn't seem to be called at all before the error is thrown.
I actually considered that but wasn't sure what the implications are. Could that break auto-diff? |
Some of my earlier debugging told me that |
Ok I am trying that now. Also, I was wondering why we need the |
Not quite. The standard library Maybe |
Btw, the hacky fix works and now all tests defined using I'll commit the fixes by tomorrow noon. It all seems to work now locally, including building and using the toolchain. |
@rxwei All changes are pushed now in this PR and in tensorflow/swift-apis#109 . All tests pass on my machine, both for the Swift compiler and for |
That's awesome! |
I think the best way to go about this PR is to first review and merge tensorflow/swift-apis#109 and tensorflow/swift-bindings#26 and then I can update the checkout commits here so that all tests can be run on the CI server. |
@rxwei After making the changes we discussed I run into issues with the following tests:
I spent some time trying to debug them but didn't figure out a workaround. I just pushed all changes here and in the paired |
What are the issues you ran into? Could you paste the test log into a gist and share it? |
@rxwei there’s a few errors about the SIL not being what expected. The log is really big due to printing the whole SIL I think. Do you want me to share all of it or is there an easy way to find the relevant parts? |
@rxwei Full gist is here: https://gist.github.com/eaplatanios/b9a8ff1a881ad70dbe5b7ae805a9f3d5 |
Thanks! I see that those GPE tests are very brittle. Our team is starting a discussion about what to do with GPE this week. How about putting this on hold and discussing it in Wednesday's meeting? |
Sounds good. I believe it would be very useful to decide where GPE fits in, in the current design. |
Sounds good. |
This PR is part of the following "PR family":
This set of PRs splits the current
TensorFlow
module of stdlib in two parts:TensorFlowCore
: Contains the core operations related to the interaction betweenTensorFlow
and the Swift compiler (i.e., compiler runtime, tensor handle, tensor shape, and tensor data types).TensorFlow
: Contains all APIs defined by Swift for TensorFlow. This includes all functions that wrap TensorFlow ops, as well as the contents of thetensorflow/swift-bindings
andtensorflow/swift-apis
repositories.This results in the main benefit that all compiler logic remains part of the Swift compiler repository, while all API-related code lies in the
tensorflow/swift-apis
repository. The separation toTensorFlowCore
andTensorFlow
further allows all code in the APIs repository to be independently compiled and tested, without needing to be part of the compiler repository (which is the current case).Alternatives Considered
tensorflow/swift-apis
results in the code in that repository not being independently compilable and testable. It can only be compiled while compiling the Swift stdlib.tensorflow/swift-apis
has the main disadvantage that whenever changes are made to the compiler, changes will also have to be made to the APIs repository. Ideally, we would like to reduce that to the minimum and I believe that the current approach achieves that.Current Status
The following tests currently fail on my machine:
TensorFlow/integration.swift
TensorFlow/retain_release.swift
I had to keep a few uses of
@inline(__always)
intensorflow/swift-apis
in order to make the partitioning tests pass.Questions
@inline(__always)
is not used anywhere? The main issue these tests cause is that we cannot currently switch to usingeager
mode for the raw op bindings. More generally, we cannot currently move away from using#tfop
as many of these tests rely on that.CompilerRuntime.swift
are outdated / have become redundant now that GPE is not supported. Should we clean that up at some point?Comments
This set of PRs also includes the changes introduced in:
@rxwei @dan-zheng @pschuh