S4TF is Dead, Long live SwiftTorch?

Hey all it seems that Swift for Tensorflow is now in archive mode. Since the FastAI project builds on pytorch, would there be any interest in a Swift Torch based library?

There is a C++ api for pytorch

Additionally C++ interoperability with swift is currently in an in progress state.

Seems like the original rational behind using the swift language still hold valid, would people be interested in developing SwiftAI on top of the LibTorch C++ backend ?

TLDR
Is there interest for this?
Are there any reasons not to?
Have the reasons for adopting swift changed?

I suppose this partially depends on the future direction of FastAI + Swift.

1 Like

I don’t think there would be interest in that.

The main interest in s4tf from fastai was the possible ability to write fast kernels in the host language. At this moment, the marginal benefits of native host language support for kernels do not offset the additional compiler infrastructure costs and the costs of filling the language ecosystem gaps. Even if the compiler tech was there, you could always meta-program it from python.

I digress. Swift for PyTorch.

Don’t worry, it’s getting resurrected and the new S4TF will be epic. First-class GPU acceleration on every device in existence, not just NVIDIA GPUs.

2 Likes

Source?

It’s a work in progress at this point, but I’ve enabled it to build on the newest Swift toolchain and jumped from TensorFlow 2.4 (where it left off) to the recent TensorFlow 2.8. Documentation of how to use it will come after I finish rewriting Swift-Colab.

It has a new home because Google officially rejected my (many) attempts to make PRs to their repositories:

For cross-platform GPU acceleration, I’m planning to cut and paste an entirely custom backend that replaces the C API of TensorFlow. That’s going to take more time than patching up existing bugs and writing documentation, so I don’t expect that to be out soon. Still, it’s the end goal.

3 Likes