[swift-users] Netlib

Edward Connell ewconnell at gmail.com
Wed Oct 4 11:02:01 CDT 2017


Hi Vladimir,
To answer your questions:

1) The framework is designed to allow the easy creation of models for
training and inference. The framework is intended to be used both for
training and deployment on all platforms.

2) Yes currently only the CudaComputeService is implemented. I am only one
guy, and I didn't have the resources to implement other service types such
as Metal.

3) The same Swift code should run on iOS, if a compute service is provided
such as Metal.

I started this project when only Caffe1 existed and was hoping Apple would
be interested in my work.
While I was working on the project, Microsoft, Google, Facebook, and Amazon
invested literally thousands of man years of effort into their own
frameworks. My code is still significantly faster, but without a major
investment there is no way one guy can compete anymore. There is also no
good financial reason for an investment now, because the competing products
are free.

Apple bought Turi and is now using CoreML for deployment and private
training tools from the Turi acquisition.
At this point from a business point of view, it doesn't make sense for me
to add any more to this code base. That is why I made it publicly available
and hope it will help others.

Who knows, perhaps maybe someone will offer me an interesting job :)

Today I would suggest that if you are trying to deploy on iOS, use Caffe2
for training and CoreML for deployment. CoreML has a converter from Caffe2
to CoreML to make it easy for you.

In a side mail you mentioned that you hate Python. I don't much like python
either, and I see a lot of benefits of a pure Swift solution, particularly
for the ability to directly connect to all of the Apple UI libraries to
create advanced visualization apps.
Unfortunately all of the major toolkits are using python, including the
internal Turi tools. You can use Caffe2's C++ API if you prefer, but it's
probably in your best interest to just live with the python way of doing
things for now.

The core of all the major frameworks are written in C++, so I think the
reason python was chosen is it is much easier than C++ for running
experiments and visualization. Unfortunately deployment was an after
thought for most of the frameworks. In the Caffe2 rewrite, they made more
of an effort.

On a side note, Microsoft's CNTK defined something called BrainScript for
defining models. It appears to be very clean, concise, and superior to
python. They did a nice job. However, I read in some forums that they are
thinking of phasing it out, because the community just wants to use python.
So a better technical solution is not always the best business decision.

Good luck, Ed

On Tue, Oct 3, 2017 at 11:38 AM, Vladimir.S <svabox at gmail.com> wrote:

> On 03.10.2017 19:02, Edward Connell via swift-users wrote:
>
>> Hi All,
>> Sorry something strange happened with the first post, so I am reposting
>> this.
>>
>> I've recently wrapped up an ML framework research project that I've been
>> working on for some time.
>> It addresses a lot of difficult design problems, and works around a lot
>> of compiler bugs and Linux library deficiencies.
>>
>> It's written almost entirely in Swift 4.0 with some C and Cuda kernels.
>> Development and testing were done primarily on Ubuntu 16.04, but it will
>> also build on MacOS.
>> Linux was the primary environment, because there aren't any modern Macs
>> that can host big NVIDIA hardware
>>
>> The framework interfaces with many common C libraries such as: *Cuda,
>> cuDNN, lmdb, png, jpeg, zlib*
>>
>> Anyone in the community that is trying to work with these libraries might
>> benefit from the Swift wrapper classes and examples of successful use.
>> There are other isolated technology pieces that might be of use also.
>>
>> Other people's projects and examples helped me along the way, so I am
>> hoping that my work will help some of you as well.
>>
>> The code and overview docs are published on GitHub
>>
>> docs: https://github.com/ewconnell/Netlib/wiki <
>> https://github.com/ewconnell/Netlib/wiki>
>> code: https://github.com/ewconnell/Netlib <https://github.com/ewconnell/
>> Netlib>
>>
>>
> Ed, it looks awesome! :-) Thank you for doing this and for sharing this!
>
> I'm a beginner in ML world, so could you clarify some points please:
>
> 1. Do I understand correctly, that main purpose of your library is to
> train the model? So, then we can export structure(connections)&weights and
> use them where we need? Or also the purpose is efficient 'calculation' of
> trained model on Mac/Linux, so this could be used in production apps?
>
> 2. Currently this library has only Cuda compute service implemented,
> right? Do you plan to implement the same for Metal soon?
>
> 3. What are your plans to support iOs and its Metal? So, the same
> library/code/way could be used to train/experiment and to 'use' in apps on
> all(macOS/Linux/iOS) platforms.
>
> Thank you.
> Vladimir.
>
> Happy coding, Ed :)
>>
>>
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171004/eb3c8680/attachment.html>


More information about the swift-users mailing list