From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 35EF77EE34 for ; Wed, 30 Mar 2016 17:13:05 +0200 (CEST) IronPort-PHdr: 9a23:QqtdGhzRwfkmkHzXCy+O+j09IxM/srCxBDY+r6Qd0OoUIJqq85mqBkHD//Il1AaPBtWLragUwLWH+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuSt6U1ZT8iLH60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYCgJ45jPvATZQA2Trl4VQGwMn1IcBwHY9hz8QtH0uznzrOdV1yyTPMmwRrcxD2eM9aBuHT3lkz8KLXYd93zWkYRZiq5WugmsoVQrwYPPeIyPcv55Y6LGO9ocSWdbRctXfyNEC4K4KYAICrxSbq5js4Dhqg5W/lOFDg62Cbaqk2cQiw== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jesper.louis.andersen@gmail.com; spf=Pass smtp.mailfrom=jesper.louis.andersen@gmail.com; spf=None smtp.helo=postmaster@mail-lf0-f54.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of jesper.louis.andersen@gmail.com) identity=pra; client-ip=209.85.215.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="jesper.louis.andersen@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of jesper.louis.andersen@gmail.com designates 209.85.215.54 as permitted sender) identity=mailfrom; client-ip=209.85.215.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="jesper.louis.andersen@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-lf0-f54.google.com) identity=helo; client-ip=209.85.215.54; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="jesper.louis.andersen@gmail.com"; x-sender="postmaster@mail-lf0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BaAQBf7PtWizbXVdFdg1GBMgaoUI01hm2GDQKBQwc7EQEBAQEBAQEBEAEBAQgLCwkfMYItghUBAQMBEhEdARsdAQMBCwYFBAc3AgIhAQERAQUBHAYTCBIIh28BAwoIok2BMT4xizaBaoJXhm0KGScNUYQ0AQEBAQYBAQEBARUBBQoFilSCQIR+glYBBJMPhC4xjBKBdY8NhzyGFxEegQ42giMegVQ6MIg/AQEB X-IPAS-Result: A0BaAQBf7PtWizbXVdFdg1GBMgaoUI01hm2GDQKBQwc7EQEBAQEBAQEBEAEBAQgLCwkfMYItghUBAQMBEhEdARsdAQMBCwYFBAc3AgIhAQERAQUBHAYTCBIIh28BAwoIok2BMT4xizaBaoJXhm0KGScNUYQ0AQEBAQYBAQEBARUBBQoFilSCQIR+glYBBJMPhC4xjBKBdY8NhzyGFxEegQ42giMegVQ6MIg/AQEB X-IronPort-AV: E=Sophos;i="5.24,416,1454972400"; d="scan'208,217";a="211165615" Received: from mail-lf0-f54.google.com ([209.85.215.54]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 30 Mar 2016 17:13:04 +0200 Received: by mail-lf0-f54.google.com with SMTP id k79so38637613lfb.2; Wed, 30 Mar 2016 08:13:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5FjeftvqjG5UoxseFKHXy42KsAEPrhA8sSGHGnhJ2Bk=; b=qQqmPeqJqCtfJiZ1/jvS7flQDewjBO65t2hKY5h9sSHPvwl3wOxaxuF1b4tvKmKR/p bEC7vct0L2WUy2kVmqU0Cls4bJu09xov/jm0fbKUx1mpDYnQUaD7gp0VOGKkWYVKZyg8 F75z9JEoRYzp/NzbtIRCfJX4Vnzjsu59Xjgut1ZEbcf+D6zpbXnPApmdRngCWkwrMXdX Z+2CdBPafmbLIlxROtyAQZI5j8B9iWqm1ocbtHYMsgfogEFahk1GwB6UrfBMOq3PAkdr D8o9eWZUglqTI4Lrzmy6CQJ2+KTHTM6doEFNc0xncAlw/FGSnl145GXm0MLhfzDgH/zM ndUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5FjeftvqjG5UoxseFKHXy42KsAEPrhA8sSGHGnhJ2Bk=; b=MgoQXemqxfWVGkcY0DuCGH5+5jQmVGD3KstifMbwXMFuFEGm2sHNY9e3jobbfPFLzY hqHGnjj29vbSr44xykkOqSAJNP1R2crbX1hzAgL5L0xXe81B0fPvPXTR55HL9MW1YfuQ 6+JktqVHZ2+gwkv026AiUWVMZGRiLpXtgIA6bdU1iH/Wl++/zCuguA3vXizvNIhA0sAf qSE4+M4DfEM+WI4M68IQYWidE0LDFgJxnoh3D6Hp+G49VUaXyqdP3Nn2wesp4FRYDEvI cckYGQW7BZPP1wcPceF/sZ3UaADeGdRzRr8r9WyEm16Wwzsdsak0UPyFbzmhBdM7u87e w4Mg== X-Gm-Message-State: AD7BkJJBbQpXDcxCufPmI4PlAw+aPoX4byAo/5KiTW+bhnZzoQ38NoBEEKC77+VH2MiRNjuRgoWTOaZ6UxkdpA== X-Received: by 10.25.24.69 with SMTP id o66mr4256012lfi.25.1459350783725; Wed, 30 Mar 2016 08:13:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.74.196 with HTTP; Wed, 30 Mar 2016 08:12:24 -0700 (PDT) In-Reply-To: References: <56E18D54.2010306@inria.fr> From: Jesper Louis Andersen Date: Wed, 30 Mar 2016 17:12:24 +0200 Message-ID: To: Laurent Mazare Cc: Milo Davis , Francois Berenger , Caml List Content-Type: multipart/alternative; boundary=001a114019a8111c6e052f4595a6 Subject: Re: [Caml-list] Tensorflow bindings for OCaml --001a114019a8111c6e052f4595a6 Content-Type: text/plain; charset=UTF-8 On Tue, Mar 29, 2016 at 6:01 PM, Laurent Mazare wrote: > We've started putting together some TensorFlow bindings for OCaml. > Excellent news! I've built most of an Erlang/OCaml layer so you can run OCaml programs as computation engines as were they Erlang port programs. Most base-types have been verified through QuickCheck, though I still need to improve the code a bit with some refactoring. If you pipeline messages, the processing roundtrip is around 1.2 million requests per second on my machine, which is quite fine in most cases. The overhead of sending the request to OCaml is around 1000 nanos. And this is without optimization I might add. The overhead is about the same if you move the computation to a dirty scheduler inside the Erlang node, so if you can work with the pipelining overhead, it is not too shabby. Of course the number is worse if you actually do some computation on the OCaml side, but that is the purpose of it all. At 1000 nanos or less, the feasibility of computing in OCaml just went up. Tensorflow in OCaml was next on my TODO list for these kinds of things, but I would much rather use these bindings than writing my own :) -- J. --001a114019a8111c6e052f4595a6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Tue, Mar 29, 2016 at 6:01 PM, Laurent Mazare <laurent.mazare@gma= il.com> wrote:
We'= ve started putting together some TensorFlow bindi= ngs for OCaml.

=
Excellent news!

I've built most of an Erlang/OCaml layer so you can run OCaml p= rograms as computation engines as were they Erlang port programs. Most base= -types have been verified through QuickCheck, though I still need to improv= e the code a bit with some refactoring.

If you pipeline message= s, the processing roundtrip is around 1.2 million requests per second on my= machine, which is quite fine in most cases. The overhead of sending the re= quest to OCaml is around 1000 nanos. And this is without optimization I mig= ht add. The overhead is about the same if you move the computation to a dir= ty scheduler inside the Erlang node, so if you can work with the pipelining= overhead, it is not too shabby. Of course the number is worse if you actua= lly do some computation on the OCaml side, but that is the purpose of it al= l. At 1000 nanos or less, the feasibility of computing in OCaml just went u= p.

Tensorflow in OCaml was next on = my TODO list for these kinds of things, but I would much rather use these b= indings than writing my own :)

-- <= br>
J.
--001a114019a8111c6e052f4595a6--