News for hackers. Stuff that matters.
Re:Developer preview of TensorFlow Lite by rajatmonga on Tuesday November 14, 2017 @04:19PM (#15699231)
TensorFlow Lite is TensorFlow’s lightweight solution for mobile and embedded devices! TensorFlow has always run on many platforms, from racks of servers to tiny devices, but as the adoption of machine learning models has grown over the last few years, so has the need to deploy them on mobile and embedded devices. TensorFlow Lite enables low-latency inference of on-device machine learning models.

Looking forward to your feedback as you try it out.

Re:Developer preview of TensorFlow Lite by linuxkerneldev on Tuesday November 14, 2017 @06:16PM (#15700177)
> Looking forward to your feedback as you try it out.

Thanks Rajat. We use typical Cortex-A9/A7 SoCs running plain Linux rather than Android. We would use it for inference.

1. Platform choice

Why make TFL Android/iOS only? TF works on plain Linux. TFL even uses NDK and it would appear the inference part could work on plain Linux.

2. Performance

I did not find any info on performance of TensorFlow Lite. Mainly interested in inference performance. The tag "low-latency inference" catches my eye, just want to know how low is low latency here? milliseconds?

Re:Developer preview of TensorFlow Lite by rajatmonga on Wednesday November 15, 2017 @01:49AM (#15701914)
1. The code is standard C/C++ with minimal dependencies so it should be buildable on even non-standard platforms. Linux is easy.

2. The interpreter is more optimized for being low overhead and the kernels are better optimized especially for ARM CPUs currently. While model performance varies by model - we have seen significant improvements on most models going from TensorFlow to TensorFlow Lite. We'll share benchmarks soon.

Re:Developer preview of TensorFlow Lite by linuxkerneldev on Wednesday November 15, 2017 @07:49AM (#15703360)
> The code is standard C/C++ with minimal dependencies so it should be buildable on even non-standard platforms. Linux is easy.

Glad to hear that Rajat. Since it is easy as you say, I look forward to your upcoming release with Linux as standard. :-)

Re:Developer preview of TensorFlow Lite by jonnycowboy on Tuesday November 14, 2017 @08:34PM (#15700851)
Also interested in answers to these two questions, as well as OpenCL performance in vanilla linux (iMX6 and above).
Re:Developer preview of TensorFlow Lite by azinman2 on Tuesday November 14, 2017 @06:54PM (#15700389)
Will CoreML (or any hardware acceleration) on iOS be supported?
Re:Developer preview of TensorFlow Lite by sarasuec on Wednesday November 15, 2017 @12:59PM (#15705939)
We want to provide a great experience across all our supported platforms, and are exploring ways to provide a simpler experience with good acceleration on iOS as well.
Re:Developer preview of TensorFlow Lite by zitterbewegung on Tuesday November 14, 2017 @05:03PM (#15699620)
Woah this is cool. I’ve been waiting for this since you announced it. I was thinking about benchmarking it against other solutions . What do you think about other similar frameworks like coreml ?
Re:Developer preview of TensorFlow Lite by blackguardx on Tuesday November 14, 2017 @04:31PM (#15699335)
What tradeoffs did you make compared to the original?
Re:Developer preview of TensorFlow Lite by rajatmonga on Tuesday November 14, 2017 @04:39PM (#15699417)
A few tradeoffs we had to make:

- As mentioned below - flatbuffers makes the startup time faster while trading off some flexibility

- Smaller code size means trading off dependency on some libraries and broader support vs writing more things from scratch more focused on the user cases people care about

Re:Developer preview of TensorFlow Lite by om42 on Tuesday November 14, 2017 @09:50PM (#15701127)
Do you have performance/memory comparisons from using flatbuffer vs protobuf in TF? A quick writeup with how switching effected performance would be really interesting :)
Re:Developer preview of TensorFlow Lite by puzzle on Tuesday November 14, 2017 @05:38PM (#15699881)
Flatbuffers also uses less memory.
Re:Developer preview of TensorFlow Lite by puzzle on Tuesday November 14, 2017 @04:32PM (#15699349)
Using FlatBuffers, for one?
Re:Developer preview of TensorFlow Lite by sandGorgon on Wednesday November 15, 2017 @02:34AM (#15702079)
Hi, I have written about this before ( https://news.ycombinator.com/item?id=15595689 ) , but are there serialization fixes between cloud training and mobile ?

We have had huge issues in trying to figure out how to save models (freeze graph,etc) and load it on Android. If you look at my previous thread - it also mentions bugs,threads and support requests where people are consistently confused.

Re:Developer preview of TensorFlow Lite by rajatmonga on Wednesday November 15, 2017 @01:27PM (#15706308)
Agree, that is a big problem that we are working hard to solve. It isn't solved in this release, but it is high up on our task list.
Re:Developer preview of TensorFlow Lite by sandGorgon on Thursday November 16, 2017 @02:37AM (#15710822)
hey, thanks for the reply!

petewarden (https://news.ycombinator.com/item?id=15596990) from Google is also working on this - so im really hopeful you guys will have something soon. This is a serious blocker for doing anything reasonable in TF.

Re:Developer preview of TensorFlow Lite by bitmapbrother on Tuesday November 14, 2017 @05:10PM (#15699672)
Will this leverage the Pixel Visual Core SoC on a Pixel 2 device?
Re:Developer preview of TensorFlow Lite by sarasuec on Tuesday November 14, 2017 @06:03PM (#15700088)
This release of Tensorflow Lite doesn't leverage the Pixel Visual Core. We will explore different hardware options available to us in the future.
Re:Developer preview of TensorFlow Lite by rajatmonga on Tuesday November 14, 2017 @05:39PM (#15699886)
TF Lite supports Android NN API that allows each phone to accelerate these models leveraging the custom accelerator on the phone.
Re:Developer preview of TensorFlow Lite by lern_too_spel on Tuesday November 14, 2017 @05:09PM (#15699664)
What about using XLA to compile libraries for mobile deployment fusing only the operations needed by the model?
Re:Developer preview of TensorFlow Lite by petewarden on Tuesday November 14, 2017 @06:40PM (#15700323)
One nice thing about Lite is that it's a lot easier to just include the operations you need (compared to TensorFlow 'classic'), there's fusion for common patterns, and the base interpreter is only 70KB. That covers a lot of the advantages of using XLA for mobile apps. In return you have the ability to load models separately from the code, and the ops are hand-optimized for ARM.

I'm still a fan of XLA, and I expect the two will grow closer over time, but I think Lite is better for a lot of scenarios on mobile.

Re:Developer preview of TensorFlow Lite by restricted_ptr on Wednesday November 15, 2017 @03:24AM (#15702272)
How about quantization? Does tensorflow lite perform quantization or is it tensorflow supposed to do it? Is it iterative process or straightforward? Or are you training quantized models as nn api docs say?
Re:Developer preview of TensorFlow Lite by infnorm on Friday November 17, 2017 @06:59PM (#15726976)
The quantization is done with a special training script that is quantization aware. We will be open sourcing a mobilenet quantized training script to show how to do this soon.
Re:Developer preview of TensorFlow Lite by infnorm on Tuesday November 14, 2017 @06:03PM (#15700085)
TensorFlow Lite is an interpreter in contrast with XLA which is a compiler. The advantage of TensorFlow lite is that a single interpreter can handle several models rather than needing specialized code for each model and each target platform. TensorFlow Lite’s core kernels have also been hand-optimized for common machine learning patterns. The advantage of compiler approaches is fusing many operations to reduce memory bandwidth (and thus speed). TensorFlow lite fuses many common patterns in the TensorFlow converter. We are of course excited about the possibility of using JIT techniques and using XLA technology within the TensorFlow Lite interpreter or as part of the TensorFlow Lite converter as a possible future direction.
Re:Developer preview of TensorFlow Lite by dangjc on Wednesday November 15, 2017 @04:33PM (#15708037)
Is it lite enough to compile with Emscripten and use via WebAssembly?
Re:Developer preview of TensorFlow Lite by infnorm on Friday November 17, 2017 @07:00PM (#15726981)
This should be possible, but we haven't tried it. We're likely going to add a simplified target that has minimal dependencies (like no Eigen) that allows building on simple platforms.
Re:Developer preview of TensorFlow Lite by dangjc on Friday November 17, 2017 @11:40PM (#15727783)
Cool. I have something else that uses Eigen in WebAssembly, so that hasn't caused any issues btw.