-
Notifications
You must be signed in to change notification settings - Fork 138
Added a script that clones the TF bindings. #137
Conversation
In order for other libraries to use swift-apis as a dependency, I think we should check the bindings file and the generation script into this repo like you proposed earlier. We can discuss a plan to move the binding generation out once SwiftPM supports custom commands. |
@rxwei I changed this PR to reflect this and made a corresponding PR in swiftlang/swift#25097. |
It appears the build failed. |
That's because is needs stuff from |
Sorry I had to make one more change to make this compile. It also required a change in the corresponding swiftlang/swift#25097 PR so not sure how we can test this on the CI before merging that other PR. |
FYI: For the next few hours I'll focus on helping you get the refactoring all done. Let me know which PR you'd like to trigger CI on or anything you need help with. |
That's great! Thanks a lot Richard! So, I believe that currently, swiftlang/swift#25097 and this PR are inter-connected in that none can be tested without the other one being merged. Thus, I'll first make a separate small PR on apple/swift that should let us test this independently. |
Building a toolchain now. |
I just finished compiling one locally and I get the same errors. It seems like something is wrong with |
It's surprising that the code has different behavior when migrated. Was any logic changed? |
Nevermind, I think I have pinned it down to the |
Looking into it a bit more I see that the issue is not with |
It is indeed only an issue when |
I'm wondering if e.g. this change was introduced or not. |
@eaplatanios, can you run the failing test after setting the following environment variables: It will dump a bunch of logs that should help debug a bit more. This generates a lot of logs. So, you might want to run the smallest failing test. |
There is one element in |
@rxwei @bgogul Something very weird is happening! I tried building swiftlang/swift#25097 with this PR for swift-apis. When I run the tests in apple/swift using |
Could function tracing not be working correctly when used within XCTests? |
I tried adding a separate executable target (thus avoiding XCTest) and the same issue occurs. I wonder if this has to do with any of the flags used when compiling the stdlib in apple/swift. |
I am not sure, @eaplatanios. I have cloned your setup on my desktop and I am currently building it. I will keep you posted. |
Thanks @bgogul! |
@eaplatanios I just got around to reproducing the error on my desktop.I will investigate this a bit and let you know. |
That’s great. Thanks for the update @bgogul! |
@bgogul I don't know if this helps but I've made the following observations:
This makes me think that this has to do with how the tracing functionality is compiled and wonder if any of the compiler flags in the |
Side note, but it'll be so great once we can test everything independently in swift-apis :) Every single change I make while debugging this requires me to build a new toolchain which takes forever. |
All flags we use to build stdlib/TensorFlow should be here. I can't think of any compiler flag that could change the behavior this way. It's strange. |
Yeah I saw these before and wasn't sure if they can cause any issues. I really have no idea what's wrong but it does only seem to appear whenever |
Thanks for this information. This gives me something to go with. I was completely clueless on how to debug this. ;) I am actually a bit confused now. Aren't we including the |
I believe this is the problem. I excluded the |
That’s interesting. I thought that the fact that they belong to different modules should resolve this (DeepLearning vs TensorFlow). But I guess TensorFlow is indeed imported in DeepLearning. Generally though I don’t understand these kinds of problems in Swift and how namescopes work for packages. I would expect that there should have been a compile-time error at least. |
We don't see any compiler error because they are in different modules. However, In any case, you are right that we should go ahead with the move. |
Going with #109 directly sounds good to me. |
This PR simply adds a script that clones the TF bindings in a
Bindings
subdirectory. This script must currently be invoked independently before callingswift build
if we want the bindings to be cloned. It is currently useless, but it is part of the larger move discussed in #109.@rxwei @pschuh