React: What WPF Should Have Been - <AUTHOR> https://wizardsofsmart.wordpress.com/2016/03/04/react-what-wpf-should-have-been/ <comment><USER2> I don't understand why the author wanted Microsoft to use HTML / CSS / SVG. If Microsoft had actually done that, and wanted or needed anything custom or unique, they would just be accused of "embracing and extending" the technology, as they had been previously.

It's seems like the XAML they went with is actually the better option -- it's close enough to other markup languages that any developer can pick it up with minimal effort, but not exactly the same so they can make any changes they want without hurting anyone else's compatibility or the larger ecosystem.

And (totally subjectively) XAML is actually _nicer_ for developers and users than HTML+CSS+JS in some areas, if your willing to invest just a tiny amount of time to learn it.

\--

Plus, Microsoft's UWP also lets you use a web browser too, if you prefer. If you feel your markup is better in HTML+CSS+SVG, Microsoft already supports that as well - [https://docs.microsoft.com/en-us/windows/uwp/get- started/cre...](https://docs.microsoft.com/en-us/windows/uwp/get- started/create-a-hello-world-app-js-uwp)

<comment><USER3> > they would just be accused of "embracing and extending" the technology

Well, that didn't happen with TypeScript. I think the perception of Microsoft has changed a lot since Nadella took over because they have really worked really hard to avoid the IBM trap.

<comment><USER4> Yes now they're known for monitoring your computer usage and updating it while you're not looking.

<comment><USER5> By a certain subset of people. I think the perception of Microsoft in the tech community has become oddly polarised.

On one hand you have developers and power-users who use Windows and care about privacy. And a probably much tinier number who don't use Windows but care enough about other people's privacy.

On the other hand you have all the web/JS/FOSS tech folk on Linux and macOS - these OSes have pretty tiny usage stats over all but I'd guess relatively high within that community - who don't care so much about Windows and as such just see the positive results of their FOSS efforts.

I wonder who's winning...

</comment></comment></comment></comment><comment><USER6> I think Windows wanted to use a UI language that had a solution to vertically centering an element, and other kinds of more advanced constraint-base layouts.

I know flexbox and stuff exist _now_ , but I think it would have been a mistake to adopt HTML with its document-centric model to represent Windows applications.

<comment> c-smile That's true. Desktop UI has a set of requirements that is still not achievable in modern browsers (and inherently in Electron).

Conceptually there are still no ways at the moment to reproduce full set of canonic layout managers from AWT: [https://docs.oracle.com/javase/tutorial/uiswing/layout/visua...](https://docs.oracle.com/javase/tutorial/uiswing/layout/visual.html)

Partial attempts to introduce flexibility in CSS were made only recently - flexbox and grid specifications.

But even those attempts look quite random and far from being well thought. For example concept of flex (portion of free space) in flexbox is defined by _property_ flex, but in CSS Grid module the same concept is defined by 'fr' free space _units_. Yet the same entity in HTML was initially known as * (asterisk) units (<frame> and <table> metrics). (All these are expressed by * units in Sciter in their initial meaning).

I suspect that such no-one-is-responsible-for-overall-architecture in CSS was one of major motivations in XAML/WPF appearance.

</comment></comment><comment><USER7> I think this is an article written by someone that does not have an appreciation for static typing, ahead of time compilation, and the compiler benefits thereof. Also, it seems that a deeper study of WPF is warranted since some things it is claimed WPF cannot do are, in fact, quite possible.

<comment><USER8> You can use Typescript with React (TSX instead of JSX) and benefit from static typing.

</comment></comment><comment><USER9> In WPF you can completely sidestep XAML and get direct access to the rendering engine to run your own measure, arrange, and drawing code. Can you do that in React? If not, WPF is what WPF should have been.

XAML is WPF in easy mode.

<comment><USER10> How flexible is this "sidestepping"? Could one build an implementation of another UI toolkit (like Cocoa) on top of it?

<comment><USER11> You can park a DirectX context in a WPF window or control. From there it is off to the races, implementing anything you can imagine from scratch.

<comment><USER9> I don't understand why Microsoft has been keeping this a secret for so long. If you want a taste of what can be done in WPF when you take the training wheels off; find yourself a copy of the now discontinued Windows Media Center. It's UI is built on WPF.

It's such a shame WPF is in maintenance mode instead of active development. I'd imagine a big reason for that is that it didn't gain the level of popularity Microsoft hoped it would. I don't think they did a good job of explaining and evangelizing it since release. UWP/Win2d seems to be what was meant to replace it, but it doesn't offer the same level of control and compatibility at all. I'm sure there's some grand long term plan I'm not privy to, but I'd be much happier in the short term if we could stop pushing windows store apps and get back to building frameworks for the hardcore.

Did you know there was a managed version of DirectX 9? Have you looked into C++/CLI? I'd love to understand the story of why the .net initiative changed direction in the last decade. I'd love to hear the master plan.

<comment><USER12> The master plan is very easy to explain by any long time Windows developer (back to 3.x days).

The political wars between WinDev (Windows and C/C++) and DevTools (Visual Studio and .NET) divisions.

With the mismanagemnt that happened with Longhorn, the WinDev gained in strenght Vista and Windows 7 happened, pushing aside all .NET related plans into DevTools alone.

Then with the failure of the initial store model, the DevTools kind of won in strenght got some of the ex-Midori devs, MDIL compiler became .NET Native and at the last couple of BUILDs you very barely see any talk about using C++ for UWP, rather portability across Linux/mobile OSes and ANSI C++ compatibility, everything else is shown in C#.

</comment></comment></comment></comment></comment><comment><USER13> UWP XAML supports typed binding expressions, so you get compile-time breaks if refactoring doesn't catch it.

And what's the difference between this and "unidirectional data flow"?

        <TextBlock Text="{x:Bind PageTitle, Mode=OneWay}"/>

<comment><USER14> It's not a "cool" JS "dev" nonsense name? What's the difference between flux and observer pattern?

</comment></comment><comment><USER15> The #1 reason React works for me is that the UI and code are in the same file. It's so easy to go back and refactor changes when everything is right there. The natural composability you get from that over time is such a huge win in productivity and major wins for team scalability. The one-way data flow is honestly just a natural outgrowth of that architecture.

WPF and its sister frameworks, Silverlight and UWP all promote this disconnected way to develop the UI. Create a XAML file that then needs to be carefully crafted in a way that hooks up to the code class files. It was initially sold as an idea that designers would build the XAML and the engineers would work on the code. They even released a mini-adobe lite suite marketed to designers.

UWP in its latest iteration seems to acknowledge XAML's shortcomings. They introduced a new new UI foundational framework call the VisualLayer (aka DirectComposition). It reminds me a lot of iOS's CoreAnimation framework.

<comment><USER16> > The #1 reason React works for me is that the UI and code are in the same > file. It's so easy to go back and refactor changes when everything is right > there.

We're bashing VB6 for this exact reason, and now this is cool again?

<comment><USER17> I think its cuz the whole package just works.

Just inlining views into JS wouldn't have been good. But when you add unidirectional data flow, composable components and lots of best practice docs, then you have a system that works really well.

<comment><USER11> VB6 just worked, too. In many ways, it worked better than the current conglomeration of web-dev technologies that replaced it.

<comment><USER18> The language was a bit iffy but boy was it productive, we seem to have gone backwards in so many ways.

<comment><USER12> Which is why as full stack developer across native and web stacks, I try to avoid web projects as much as possible.

</comment></comment></comment></comment></comment></comment><comment><USER19> This is crazy talk. Yes Microsoft momentarily offered a browser plugin called Silverlight and it happened to use some WPF stuff but don't believe for a moment that this somehow means they wanted to make XAML the better HTML or have any sort of adoption beyond the Windows ecosystem. It was pretty much just a somewhat enhanced language for describing a scene graph because nobody wanted the code generation of the Forms days.

They strictly kept any sort of code or logic out of XAML, annoyingly so to the point where you are writing converter classes to negate an expression. Compare that with the mishmash that is React.

<comment><USER20> > They strictly kept any sort of code or logic out of XAML, annoyingly so to > the point where you are writing converter classes to negate an expression

For what it's worth, WPF does provide sufficient flexibility that it's possible to add support for expression-driven converters using markup extensions and an MSBuild task for compile-time codegen. Have a look at this:

[https://github.com/Microsoft/PTVS/blob/ebfc4ca8bab234d453f15...](https://github.com/Microsoft/PTVS/blob/ebfc4ca8bab234d453f15ee426af3b208f3c143c/Python/Product/Cookiecutter/View/CookiecutterSearchPage.xaml#L54)

It can also be used completely inline, i.e.:

        <TextBlock Text="{Binding Name, Converter={ext:Lambda 'x => x.ToUpper()'}"/>

This is the codegen step that extracts those lambdas from XAML and processes them:

[https://github.com/Microsoft/PTVS/blob/6bf34d3611d34e94eddb6...](https://github.com/Microsoft/PTVS/blob/6bf34d3611d34e94eddb6388cfc5d100be70097e/Common/Tools/BuildTasks/ExtractLambdasFromXaml.cs)

and this is the helper classes that are used in its output:

[https://github.com/Microsoft/PTVS/tree/6bf34d3611d34e94eddb6...](https://github.com/Microsoft/PTVS/tree/6bf34d3611d34e94eddb6388cfc5d100be70097e/Common/Product/SharedProject/Wpf/LambdaConverter)

Note that it's language-agnostic; or rather, it uses the same language for expressions that the project itself does (so long as that language has a CodeDOM provider).

<comment><USER21> This is brilliant and needs to be extracted into a library of its own. Thanks for surfacing this!

<comment><USER20> I originally wrote this code back in 2011 with the intent to do just that (after some production use to prove the concept - which did happen; we've been shipping products that use this code since 2013)... but never found enough interest to actually motivate me to go and make it happen. Looking at the upvotes on this comment, I might reconsider :)

Of course, if anyone wants to take this code and go for it, you're quite welcome. Note that it has been also licensed more permissively under MIT as part of RTVS - probably a better starting point for that:

[https://github.com/Microsoft/RTVS/tree/master/src/Common/Wpf...](https://github.com/Microsoft/RTVS/tree/master/src/Common/Wpf/Impl/LambdaConverter)

[https://github.com/Microsoft/RTVS/blob/master/src/Common/Bui...](https://github.com/Microsoft/RTVS/blob/master/src/Common/BuildTasks/ExtractLambdasFromXaml.cs)

</comment></comment></comment></comment><comment><USER22> The funny thing is that he's primarily after unidirectional data flow and anti-data binding. I can actually get behind that. I worked on several large WPF projects many years ago and TBH I don't think it would be impossible to implement a uni-directional/redux style system within WPF. Would be an interesting project.

IF WPF was still the primary UI tech on Windows I probably could get behind implementing such a library.

<comment><USER23> What is the primary UI tech on Windows now?

<comment><USER12> XAML, which is the same XML description language as WPF uses, plus the backing UWP controls, which are also quite similar to the WPF API.

Main differences is that XAML processing is implemented in C# in .NET, and in C++/CX on UWP.

XAML on UWP supports static binding at compile time, and on WPF it is only dynamic (x:Bind vs Binding).

Finally the actual classes backing the UI components aren't 100% compatible, but do have most of the same methods and properties.

Anyone that knows WPF, shouldn't have any issue with XAML/UWP.

<comment><USER20> > Main differences is that XAML processing is implemented in C# in .NET, and > in C++/CX on UWP.

Most stock UWP components (the ones that come with the OS) are implemented in pure C++ using WRL ([https://docs.microsoft.com/en-us/cpp/windows/windows- runtime...](https://docs.microsoft.com/en-us/cpp/windows/windows-runtime-cpp- template-library-wrl)). This is mainly because they were already being actively implemented long before C++/CX became usable.

<comment><USER12> Thanks for the clarification.

</comment></comment></comment></comment></comment><comment> c-smile > Imagine, if you will, a different scenario. Had Microsoft been prescient > enough to see the revival and adoption of HTML and SVG and built WPF on top > of these, do you think things would have gone differently?

Why to imagine? Sciter ( [https://sciter.com](https://sciter.com) ) is exactly that - embeddable HTML/CSS engine for UI of desktop applications. And it was built at the same time: [https://sciter.com/sciter/sciter-vs- wpf/](https://sciter.com/sciter/sciter-vs-wpf/)

Its code already works on around 320 mln PCs and Macs "under the hood" so far... Quite comparable with spread of WPF applications, no?

<comment><USER24> So this is Electron before Electron existed? Does it have File IO APIs?

<comment> c-smile Primary goal of Sciter is to be an embeddable _UI engine_. You can embed it into C/C++, .NET, Java, Go, Rust, Python etc. applications. Each of them have mature File I/O primitives.

As of Sciter itself ... It does have file I/O to load/read resources and data persistence from script but these are just auxiliary components to its main function (UI).

</comment></comment></comment><comment><USER25> I've developed in WPF/XAML and React extensively and couldn't agree more. The fundamental problem with XAML, IMHO, was that it was a plain text file format masquerading as source code. The experience of writing XAML broke down very quickly the moment you try to do anything beyond hello world. You must use an IDE. As a result, WPF/XAML always felt heavy, hard to use and over engineered. WPF, XAML and Blend always felt like it was a tool built by people who did not use it themselves.

React, in the other hand, is dead simple and lightweight.

</comment><comment><USER3> I can see why the author is drawing this conclusion...

I wrote ASP.NET controls for a long time, and I see a lot of similarities in how I structure react components and how I would have written WebControls in ASP.NET.

I think in hindsight, my conclusion/realization from reading this article is that the lost opportunity for Microsoft was to re-invent the whole presentation layer with things like WPF and Silverlight, instead of trying to make it actually fit within the technology stack that people had settled on (HTML/CSS/JS).

<comment><USER24> This was actually how I pitched it to my ASP.NET dev team: "React Components are WebControls for the front-end"

</comment></comment><comment><USER26> It really makes me sad that the author talks about F#, but doesn't mention the awesomeness that is F# -> JS babel that exists called Fable, which allows you to write F# with React.

[http://fable.io/](http://fable.io/)</comment>


Tesla Model 3 registrations in Norway in March 65% higher than previous record - <AUTHOR> https://www.bloomberg.com/news/articles/2019-03-26/tesla-s-model-3-shatters-record-in-electric-car-crazy-norway <comment><USER2> Sounds like good news for Tesla at first, but look into the details:

\- Norway is Tesla's "fourth-biggest market worldwide" despite its small 5-million population \- "Norway received what was likely its biggest shipment of Teslas earlier this month"

Considering all "generous incentives", the two points above and the actual numbers of registrations it does not sound that great, or does it?

All quotations cite from the parent article of this thread.</comment>


Should I offer equity to a potential business partner?  - <AUTHOR>

A single, non-technical founder comes up with a startup idea and recruits an offshore development team to build version 1. The product is popular and 10,000 users sign up and feedback is promising. The founder has some new ideas to improve the product and a business model to earn revenue for the next version. At this point all expenses have been paid for by the founder.
The founder and dev team work together part-time over 3-4 months on a new version that includes new features and enhancements. The founder can no longer afford labor costs, so he decides to negotiate an equity deal with the development firm to create new features, and pay for the recent enhancements.
The offshore team is involved in other consulting projects and requires detailed functional/non-functional requirements, micromangement, and communication is infrequent and strained by time zone differences. The founder questions the firm's level of technical talent and their ability to scale/optimize in anticipation of rapid growth and an angel funding round.
The owner of the offshore team offers 2 dedicated, full time developers for a time period of 4-to-n months in exchange for ownership in the startup.
What would you do? How much stake should the original founder retain? Should the development team be treated as cofounders or investors? How much equity stake would you offer the offshore team? Would you re-recruit a new team of developers/founders onshore to rebuild the product? <comment><USER2> if i were in your shoes, i would probably look for a local cofounder and continue to treat the offshort dev team as supplementary contractors if/when necessary.

you've already encountered issues with standard set of issues with offshore teams, and it will likely only get worse as more issues come up if you actually do end up giving them some ownership, power, and legal control.</comment>


Ask HN: How to reach out to hackers and CS students in India and Brazil? - <AUTHOR>

Building a new product for hackers & CS students and need beta testers.
We got some US users. However, we also want to see how users from other large non-US hacker communities, such as India and Brazil, interact with the product. Any idea or info about online communities, forums, Facebook groups etc will help.
Thank you! <comment><USER2> One good way to start would be to add the url/details in this post as well. Next, as suggested in other comments Reddit is nice, then Quora is also big hangout for many of your target audience (at least in India). Would probably need more details on the product to suggest anything more specific. If you are willing to spend some money, make a fb page and get some fb ads with product details, beta tester incentives and target to specific universities/colleges/companies perhaps...

</comment><comment><USER3> You can try to reach the usergroups we have here. Like [https://groups.google.com/forum/#!forum/ruby- sp](https://groups.google.com/forum/#!forum/ruby-sp) is the official group of Ruby Developers in São Paulo. You can also look for public universities, here in Brazil they have the best courses of CS and IT related in the country.

</comment><comment><USER4> Post the link here as well. Some students from India/Brazil and other countries would be reading hackernews as well and can spread the word. As others have suggested, try posting in reddit groups as well.

</comment><comment><USER5> Sites like this work fine. Also a post to /r/programming or /r/India /r/Brazil would work.

Btw, what is your product ?

</comment><comment><USER6> Indian Myself : HN , Product Hunt , Quora are 3 imp places . hasjob.co is another platform check out if it fits your need .

</comment><comment><USER7> You could look for top universities in Brazil and India in google, and then look for Facebook and Linkedin communities among those universities. After that you can post a message in those communities looking for beta testers.

</comment><comment><USER8> you can ask here on this HN clone <[http://hackerstreet.in>](http://hackerstreet.in>) too

</comment><comment><USER9> Quora is popular among Indian CS students.

<comment><AUTHOR> Thanks! That sounds good, but what should I ask besides putting the site and pitch it?

</comment></comment><comment><USER10> look up universities that offer cs there , and then find fb groups of those universities using fb graph search

</comment><comment><USER11> Reddit is a good place as already suggested by someone.

Also, I'm an Indian CS student. PM me if I can help.

</comment><comment><USER12> how and where did you get your US users? I wonder why would that channel not work for other hacker/cs people. programmer is a community of its own powered by internet so i would guess they would all use the same channel?. like stack overflow, etc.

</comment><comment><USER13> I think HN is good but everybody doesn't use it at least in North India.

</comment><comment><USER14> Why dont just ask them here.. Many of them are on HN.

</comment><comment> bra-ket elance, freelancer etc. hire them as beta testers.</comment>


Homebrew Cray-1A (2010) - <AUTHOR> http://www.chrisfenton.com/homebrew-cray-1a/ <comment><USER2> Several previous discussions. Maybe Chris will show up again.

[https://news.ycombinator.com/item?id=8447518](https://news.ycombinator.com/item?id=8447518)

[https://news.ycombinator.com/item?id=6291515](https://news.ycombinator.com/item?id=6291515)

[https://news.ycombinator.com/item?id=4561787](https://news.ycombinator.com/item?id=4561787)

[https://news.ycombinator.com/item?id=2621177](https://news.ycombinator.com/item?id=2621177)

[https://news.ycombinator.com/item?id=1645291](https://news.ycombinator.com/item?id=1645291)

<comment><USER3> Did someone summon me?

</comment></comment><comment><USER4> I said it before, and I will say it again: If someone managed to build a scaled-down version of the Cray-1 chassis and put a regular PC in it, that would be the coolest case ever.

<comment><USER5> Someone made a 1/3 scale [https://www.bit-tech.net/reviews/modding/case- mod/cray-1-by-...](https://www.bit-tech.net/reviews/modding/case- mod/cray-1-by-daryl-brach/1/)

Due to the hole in middle it is difficult to fit a rectangle without result being quite large. Even with a mini-ITX board (17x17cm) the diameter needs to be at least 2-3 times bigger that's half a meter.

<comment><USER4> I know. :-(

Would be really cool, though!

</comment></comment></comment><comment><USER6> I wish computers still looked like this.

</comment><comment><USER7> That led me to an interesting story about how Andras Tantos recovered a working OS image from the raw high-res magnetic disc image:

[http://www.modularcircuits.com/blog/articles/the-cray- files/...](http://www.modularcircuits.com/blog/articles/the-cray-files/a-new- hope/)

</comment><comment><USER8> The coolest retro machine I've seen are connection machines.

They're just solid black cubes, when powered on they burn hundreds of ominous red dots across their surface, pulsing to show you the status of your program _as it runs in real time_.

It's like something Apple would make if they became a very evil cyberpunk company.</comment>


Epson made the Google Glass we've all been waiting for - <AUTHOR> http://www.thememo.com/2016/06/15/epson-made-the-google-glass-weve-all-been-waiting-for/ <comment><AUTHOR> Epson also makes EVFs for mirrorless cameras so it's not that strange that they would innovate in this area. Zeiss were also developing their glasses, not sure how far they got

[http://www.wired.com/2016/01/zeiss-smart- glasses/](http://www.wired.com/2016/01/zeiss-smart-glasses/)

</comment><comment><USER2> An interesting take on this space. I think something with frames that flipped up over your head (imagine you have your sunglasses on your head pointed upwards) would go a long way to quelling fears of being surreptitiously being filmed.</comment>


High Availability for PostgreSQL, Batteries Not Included - <AUTHOR> https://www.compose.io/articles/high-availability-for-postgresql-batteries-not-included/ <comment><USER2> Where I am we have a similar setup for leader election and failover (using etcd and haproxy) but we add an additional step: a standby instance that does not participate in master election, and always follows the elected master.

Then we turn on confirmed writes on the master so that the non-participating standby (called the "seed") has to receive and confirm your write before the transaction can commit.

This has the bonus of preventing split brain... If the wrong instance thinks it's master, writes will block indefinitely because the seed isn't confirming them. If the seed is following the wrong machine, same thing. And if clients and the seed and the master are all "wrong", then that's ok because at least they all "consistently" disagree with etcd.

The seed instance can run anywhere, and is responsible for receiving WAL snapshots from the master and archiving them (to shared storage) so it can crash too and be brought up elsewhere and catch up fine. The writes just block until this converges.

It's worked quite well for us for a few months on a hundred or so Postgres clusters, we haven't seen an issue yet. I'd love for somebody knowledgeable about this stuff to point out any flaws.

<comment><USER3> That's interesting. We do something pretty similar in the Manatee component that I mentioned elsewhere in this thread, except that the designated synchronous standby can takeover if the primary goes away. But it can only do so when another peer is around to become the new synchronous standby, so we maintain the write-blocking behavior that avoids split-brain.

</comment></comment><comment><USER4> Like a lot of designs that use Raft/Zookeeper/Paxos/whatever as a building block, the full system doesn't inherit all of the safety properties of the underlying consensus algorithm. I don't think that makes this code useless by any means, but I think it's important to be aware of the edge cases.

Consensus algorithms are popular because they're supposed to solve the difficult problem of _guaranteeing_ consistency while attempting to provide liveness, in the presence of _arbitrary_ node or connection failures. Etcd itself can provide this for operations on its own datastore, but that doesn't mean it can be used as a perfect failure detector for another system (which is impossible in the general case). In particular, if the database master becomes partitioned from the etcd leader for more than 30 seconds but is still accessible to clients, boom -- split brain.

(You can attempt to mitigate this with timeouts, but that's not foolproof if your system can experience clock skew or swapping/GC delays. Exactly this kind of faulty assumption has caused critical bugs in e.g. HBase in the past, turning what would otherwise be a temporary period of unavailability into data loss.)

EDIT: If I'm reading the code correctly, compose.io doesn't make any attempt to mitigate this failure scenario. If the Postgresql master can't contact etcd, it continues acting as a master indefinitely, even after 30 seconds have expired and another server might have taken over. This appears to be what happens in the "no action. not healthy enough to do anything." case in ha.py. I'd be happy to be corrected if there's something I'm missing.

<comment><USER5> If the PostgreSQL leader doesn't reset the leader key, it's no longer leader.

<comment><USER6> Fencing isn't quite that simple, unfortunately.

I've been doing database, and specifically PostgreSQL, administration and HA setups for a long time now. This stuff is a lot harder than people think it is. People who roll their own solutions, thinking "Oh, this will totes be good enough!" tend to find themselves very painfully surprised that it isn't.

<comment><USER7> I've seen multiple deployments (not necessarily specific to PostgresSQL) engineer themselves into a corner with what people feel will be a highly available roll your own solution, complete with convincing sounding blog posts.

In every case, at some point, there were implementation/software bug related issues that ultimately caused more unplanned outages than I've ever seen a single, well run server experience.

<comment><USER8> Based on experience is there a common bug or scenario that you see overlooked often? Like say what happens during the transition between leaders, or handling multiple failures (multiple netsplits..)?

<comment><USER7> I can't really identify a common problem. Things I've seen include:

* After a complete, planned shutdown, neither server is happy to start until it sees the other one online. In the end, neither ends up booting. * A failover occurs, at which point you find out the hard way there is state being stored in a non-replicate file. I've seen this with several different Asterisk HA solutions in particular. * A failover occurs, and non-database aware storage snapshots leave the redundant server with a non-mountable mirror of the database.

</comment></comment></comment></comment></comment></comment><comment><USER9> Personally, I would try to go for a simpler solution. In case of a failover event which is already complicated in itself and happening at a point in time where stuff is already going wrong (there would be no failover otherwise), do you really want to have all this additional infrastructure with etcd and haproxy as a dependency?

If you can live with a few minutes of downtime, I would recommend to trigger your failover using human intervention once you have ascertained that the failover would actually help (you never, ever want to fail over if master doesn't respond in time due to high load - at that point, failing over will only make things worse due to cold caches).

See [https://github.com/blog/1261-github-availability-this- week](https://github.com/blog/1261-github-availability-this-week) for a nice story of automated DB failover going wrong.

In our case, we're running keepalived to share the IP address of the postgres master, but we don't actually automatically act on PG availability changes.

In a situation that actually warrants the failover, a human will kill the master node by shutting it down and keepalived will select another master and trigger the failover (which is then automated using `trigger_file` in `recovery.conf`).

In this case we have only one additional piece of infrastructure (keepalived) and we can be sure that we don't accidentally make our lives miserable with automated failovers.

The cost is, of course, potential additional downtime while somebody checks the situation, does minimal emergency root cause analysis and then shuts down the failed master.

In the even rarer case of hardware failure, keepalived would of course fail over automatically, but let's be honest: Most failures are caused by application or devops issues and in these cases it pays off to be diligent instead of panicing.

<comment><USER10> Can keepalived automatically float MAC addresses nowadays? Last time I checked, that didn't work and clients needed an arp flush to use the new master.

<comment><USER11> Shouldn't sending a gratuitous ARP work to update clients?

</comment></comment></comment><comment><USER12> Since most of the comments are critical, I'll say: thank you for the awesome writeup! I agree this is more complex than HA PG setups I've done in the past, but I'm thrilled to have another perspective. Also doing a thorough writeup like this takes time, and a lot of people would rather jump back into building the next thing. It's a great contribution!

I agree with pilif that you almost always want to failover the db manually.

I agree with teraflop that just because etcd gives strong guarantees, that doesn't mean your application logic built on top of etcd primitives shares them. So you have to be careful about your reasoning there.

I'm curious if you're doing anything to mitigate haproxy being a single point of failure?

One thing I've had to fix in other people's HA PG setups is ease of getting back to HA after a failover. You lose the master and promote the slave, and now you've just got a master. Ideally it should be easy to just launch another db instance and everyone keeps going. I think this setup achieves that, and that's great!

<comment><USER13> Agree and that's a great point about human failover. It can become a challenge for distributed databases running on a large number of instances (like bigtable) but if we're talking only about master HA, then yes, that can still do with human intervention though automation is still preferable. For smaller db setups, much easier to just let a human/dba intervene.

<comment><USER14> Smaller DB setups rarely have the ops/DBA support required to do manual failover. I think having an as-consistent-as-feasible, automatic failover is something of a default expectation for databases these days, at any size.

<comment><USER15> You need a larger team to do automatic failover because getting it right is a massive PITA. Either that or pay someone to do it right for you, e.g. RDS, managed solutions.

Manual failover is often a lot safer, automatic systems have a nasty habit of not doing what you expect them to and trashing your database / losing data.

</comment></comment></comment></comment><comment><USER3> Thanks for writing this up!

At Joyent, we built a similar system for automated postgresql failover called Manatee. I'm sure today we would have used a Raft-based system, but that was not available when we did this work, so we used ZooKeeper. We haven't spent much time polishing Manatee for general consumption, but there's a write-up on how it maintains consistency[1]. The actual component is available here[2], and it's also been ported to Go as part of Flynn[3].

Edit: Manatee uses synchronous replication, not async, so it does not lose data on failover.

[1] [https://github.com/joyent/manatee-state- machine](https://github.com/joyent/manatee-state-machine)

[2] [https://github.com/joyent/manatee](https://github.com/joyent/manatee)

[3] [https://github.com/flynn/flynn](https://github.com/flynn/flynn)

</comment><comment><USER16> This seems robust, but feels like more moving parts than are necessary.

I feel like HAProxy with PostgreSQL + Bucardo (multi-master + at least one slave) would achieve this, and net you fewer moving parts. Under what circumstances does this fail where the etcd-dependent solution succeeds?

<comment><USER17> Can I ask why HAProxy seems to be a more popular choice than the very, very simple (and robust) pgbouncer?

<comment><USER18> We tested with PGPool and PgBouncer in various iterations.

PGPool failed at basic failover. It worked fine while the leader remained leader. It would failover to the follower who became leader, but after the first failover, it would stall on connections. We worked through various settings and attempts at making it more stable, but in the end we were not happy with the stability.

PGBouncer requires a connection to a single database and requires a user store associated at the PGBouncer level. One of our internal requirements for our Postgres service is give customers full access to Postgres capabilities. PGBouncer would either limit customer functionality or require us to build more tools for customers to use Postgres's complete functionality. For instance, if a customer ran `CREATE USER foo WITH LOGIN …` from the Postgres connection, the customer would not be authenticate as foo user because PGBouncer would not have immediate knowledge of the new user.

In the end, HAProxy offered the stability and enabled the base functionality of Postgres we wanted. In tests, it failed over quickly and reliably. The only caveat with HAProxy + Postgres is that you have to rely on TCP passthrough with SSL termination at Postgres. We'd have preferred the SSL termination at HAProxy, but Postgres engineered it's own connecting procedure to listen for standard and SSL connections on the same port. SSL termination at the HAProxy was causing issues for drivers that were built to use that procedure and cannot use a standard SSL connection.

<comment><USER17> Interesting. I got around this by just recreating the users file for pgbouncer and issuing a reload every 15 minutes or so. This was only needed for one setup as the rest were just static, or the user was very low volume so I asked them to connect directly. pgbouncer handled reloads _very_ well (on-par with nginx) so it worked for me. Thanks for the great insight with your answer.

</comment></comment></comment></comment><comment><USER19> _" If no one has the leader key it runs health checks and takes over as leader."_

I'm no expert at all on this stuff, but I do smell either a race condition (if other nodes comes alive and 'goes to see who owns the leader key in etcd' before the node 'takes over as leader') or a longer-than-needed time without a leader (where the new node knows it wants to become the leader, but is running health checks)

<comment><USER18> The code relies on functionality in etcd to prevent a race condition. Using `prevExist=false` on acquiring the leader key, the set will fail if another node wins the race.

The functionality in the code is here: [https://github.com/compose/governor/blob/master/helpers/etcd...](https://github.com/compose/governor/blob/master/helpers/etcd.py#L76)

The documentation for etcd is here: [https://coreos.com/etcd/docs/latest/api.html#atomic- compare-...](https://coreos.com/etcd/docs/latest/api.html#atomic-compare-and- swap)

<comment><USER19> But then, isn't it not

 _" If no one has the leader key it runs health checks and takes over as leader."_

but

 _" If no one has the leader key it takes over as leader, runs health checks, and starts functioning as leader."_

? If so, I would do the health checks and then try to become the leader. Or do the 'health checks' involve other nodes?

<comment><USER20> It simply relies on the Voting feature of ETCD (Raft) it's really simple to use locking with etcd, and etcd is really really stable. However it would be easier to install etcd on every Postgres node and just make a golang library that sets the master of Postgres to the etcd master (etcd also has a leader). Also systemd would keep the overall system healthy. (that's what we at envisia do) Just have repeatedly check if the machine is the leader and if yes it sets the url of the currently running machine to a etcd key. So overall we need to use 3 Postgres machines and 1 could fail and we would still have voting, however thats just for a single master where we don't need to read from the slaves, however thats easily extendable.

Oh and here is the Compare and Swap (Atomic) functionality of etcd that he described: [https://github.com/coreos/etcd/blob/master/Documentation/api...](https://github.com/coreos/etcd/blob/master/Documentation/api.md#atomic- compare-and-swap)

<comment><USER18> The problem with etcd members on every Postgres node is that clusters fixed nodes or members. etcd doesn't function well in an environment where you could tear down / build up new nodes. Most of our Postgres service runs on AWS, and thus we must expect that any single node may vanish, and our system must replace that node. We tried running etcd alongside Postgres in an early prototype, but ran into issues with etcd cluster stability when destroying and recreating nodes. Thus, we opt for a stand alone etcd cluster distinct from the Postgres cluster.

<comment><USER21> You can set up a local etcd proxy to mitigate this. You'd run the proxy listening on localhost, and then have it connected to the stable etcd cluster elsewhere.

The proxy can find the cluster manually or use SRV records. Autoscale the Postgres machines as much as you want after that while leaving etcd on stable machines.

<comment><USER20> That's what we basically trying to do in the future, however that's really hard to do if you want to have a running etcd cluster with 5 nodes all the time. You would need to check if one etcd died, and then either promote a proxy to a etcd master or run a new machine (the later is only possible in clouds or virtual environments)

<comment><USER22> You can do that trivially with Mesos and have it always ensure 5 instances are running. Bonus points that it will run identically on bare metal and cross cloud which means less vendor lock in for you.

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER23> I really wonder why people go for implementing their own HA stack when there's Pacemaker or rgmanager available?

First: There's a functional resource agent available to handle PostgreSQL. It handles single instances or multiple ones.

Second: Zhe whole cluster-thing can be very complex. You can have a LOT of fail scenarios and I wouldn't recommend to anyone to try to catch them all.

</comment><comment><USER24> Slightly off-topic:

If you're considering MySQL for HA, a project called Vitess jives well with Kubernetes + CoreOS, and has been in production use at YouTube for a while now:

[http://vitess.io/](http://vitess.io/)

</comment><comment><USER25> What does "Batteries Not Included" mean for a highly available database? Is it a good thing?

<comment><USER26> "Batteries Not Included" is a phrase found on the box of children's toys, so that parents know they will need to buy batteries before giving it to their kids. It has become an expression for something being incomplete and will require effort before it will work properly.

In this case the author is stating that Postgres doesn't come with a high availability capability. He then goes on to explain the high availability setup he put together.

</comment></comment><comment><USER27> How does this compare to RDS - both in terms of HA, and generally speaking?

</comment><comment><USER28> And with this amazing design you can easily loose committed data and have all sorts of other fun problems.

<comment><USER29> Is it even possible to guarantee that you won't lose commits with postgresql replication? For many applications, consistency is more important than not losing any data ever. For the other kind of application, you'll need something else.

<comment><USER3> With postgresql synchronous replication, in order to lose writes that have been acknowledged to the postgresql client, you'd have to lose filesystem data on both the primary and the synchronous standby. (I believe the way postgresql uses the term "committed", you can lose data that's "committed", but not once postgresql has acknowledged it to the client.)

For many applications, consistency _includes_ not losing acknowledged data. If I PUT data into an application and fetch it back and it's not there, that's not consistent.

<comment><USER30> > For many applications, consistency includes not losing acknowledged data. If > I PUT data into an application and fetch it back and it's not there, that's > not consistent.

Durability and consistency are two separate concepts.</comment></comment></comment></comment>


Introduction to Support Vector Machines in Machine Learning - <AUTHOR> https://ranvir.xyz/blog/svm-support-vector-machines-in-machine-learning/ <comment> rusty-rust Large parts of this blog are straight copy-paste from "An introduction to statistical learning" by Gareth James et. al.

</comment><comment><USER2> If you're new to ML or datascience, I would recommend working to build a strong basis in Bayesian statistics. It will help you understand how all of the "canonical" ML methods relate to one another, and will give you a basis for building off of them.

In particular, aspire to learn probabilistic graphical models + the libraries to train them (like pyro, tensorflow probability, Edward, Stan). They have a steep learning curve, especially if you're new to the game, but the reward is great.

All of these methods have their place. SVM's have their place, but also aren't great for probability calibration and non-linear SVM's like every single kernel method can scale absolutely terribly. Neural networks have their place, sometimes as a component of a larger statistical model, sometimes as a feature selector, sometimes in and of themselves. They're also very often the wrong choice for a problem.

Don't fall into the beginner trap: sometimes people tend to mistake 'what is the hottest research topic' for 'what is the right solution to my problem given my constraints, (data limitations, time limitations, skill limitations, etc.)'. Be realistic, don't use magical thinking, and have a strong basis in statistics to weed out the beautiful non-bullshit from the bullshit that is frustratingly prevalent (everyone and their mother is an ML expert today).

EDIT: I want to also clarify: I don't mean to suggest the author is new to ML, I just mean this as general advice for anyone coming here who is new to DS/ML. The article looks great!

<comment><USER3> Thanks for this insight. Can you kindly also suggest a good book for someone to start with Bayesian Statistics? I could really use a suggestion about first and second book on this.

About Probabilistic Graphical Models, is there book other than Daphne Koller's book that you would suggest?

<comment><USER4> Introduction to Statistical Learning

[https://faculty.marshall.usc.edu/gareth- james/ISL/](https://faculty.marshall.usc.edu/gareth-james/ISL/)

Elements of Statistical Learning

[https://web.stanford.edu/~hastie/ElemStatLearn/](https://web.stanford.edu/~hastie/ElemStatLearn/)

Machine Learning: A Probabilistic Perspective

[https://mitpress.mit.edu/books/machine- learning-1](https://mitpress.mit.edu/books/machine-learning-1)

<comment><USER5> "Machine Learning: a Probabilistic Perspective" is more an encyclopedia of algorithms I would say, and it has lots of typos. I personally would not recommend it (except for the amount of algorithms that it covers, many of which are usually not found in other books).

<comment><AUTHOR> Thanks for early warning. Will have to keep that in mind.

</comment></comment></comment></comment></comment><comment><USER6> Stay away, in my opinion. I spent a year supporting a SVM in a production machine learning application, and it made me wish the ML research community hadn't been so in love with them for so long.

They're the perfect blend of theoretically elegant and practically impractical. Training scales as O(n^3), serialized models are heavyweight, prediction is slow. They're like Gaussian Processes, except warped and without any principled way of choosing the kernel function. Applying them to structured data (mix of categorical & continuous features, missing values) is difficult. The hyperparameters are non-intuitive and tuning them is a black art.

GBMs/Random Forests are a better default choice, and far more performant. Even simpler than that, linear models & generalized linear models are my go-to most of the time. And if you genuinely need the extra predictiveness, deep learning seems like better bang for your buck right now. Fast.ai is a good resource if that's interesting to you.

<comment><USER7> Kernel function is simple - Are you in a high dimensional space? If so, choose linear kernel. Else? Choose the most non-linear one you can (usually a guassian or RBF). I suppose quadratic and the other kernals are useful if what your modeling looks like that but in practice that is rare.

Prediction is not that slow with linear SVMs especially not compared to something like K-NN. The main hyperparamaters which matter are the "C" value and maybe class weights if you have recall or precision requirements. The C value is something that should be grid-searched, but you might as well be grid-searching everything that matters on every ML algorithm and in this regard SVMs are fast to iterate over (because the C value is all that matters).

Applying categorical and continuous features is not difficult if you choose to do it in anything more sophisticated than sklearn. Also, pd.get_dummies() exists (though it may lead to that slow prediction you're concerned about)

You're most likely right with GBM or Random Forests - though they can have all sorts of issues with parallelism if you're not on the right kind of system. You talk about linear models but SVMs are usually using linear kernals anyway and are a generalization of linear models (including lasso and ridge regression models).

<comment><USER6> Agreed -- linear SVMs, especially in text processing applications, is the one area where they are a natural fit. All their attributes complement the domain. Linear SVMs also have desirable performance characteristics.

But at that point, they also have a lot in common with linear models. Those also seem practical in that domain (though I have less experience here, tbh). And performant, when using SGD + feature hashing like e.g. vowpal wabbit.

My beef with non-linear kernels and structured data is a longer discussion, but I find kernel methods for structured data (which is usually high-dimension but low-rank -- lots of shared structure between features, shared structure between missingness of features) to be highly problematic.

</comment></comment></comment><comment><USER8> ITT: Whether SVMs are still relevant in the deep learning era. Some junior researchers will say neural networks are all you need. Industry folks will talk about how they still use decision trees.

Personally, I'm quite bullish on the resurgence of SVMs as SOTA. What did it for me was Mikhail Belkin's talk at IAS.[1]

[1] [https://m.youtube.com/watch?index=15&list=PLdDZb3TwJPZ5dqqg_...](https://m.youtube.com/watch?index=15&list=PLdDZb3TwJPZ5dqqg_S- rgJqSFeH4DQqFQ&v=5-Kqb80h9rk)

<comment><USER9> I mean NNs are still quite bad at low n tabular data (and they may always be), which is honestly how a lot of real life data is, so there is clearly a need for not a neural network.

I feel like I've seem more tree ensembles in the wild than SVMs, though.

<comment><AUTHOR> Anyway the idea of NNs was introduced to work on data which a simple human brain couldn't make sense of.

For more general tabular data, like trees, regression and even rule based models are more realistic.

</comment></comment></comment><comment><USER10> I've been an ML practioner since 2009. I've used every method imaginable or popular, I think. With the exception of non-linear SVMs. Linear SVM => All good, just the hingle loss optimization. Non-linear SVM, a bit of overkill with basis expansion. Just too slow, or too complex a model?

My impression: SVMs are more of theoretical interest than practical interest. Yeah, learn your statistics. Loss functions. Additive models. Neural nets. Linear models. Decision trees, kNNs etc. SVM is more of a special interest, imho.

<comment><AUTHOR> We can definitely learn a piece from such an experienced practitioner. Thanks for sharing, I think your intuition matches with the other experienced once in the comments.

</comment></comment><comment><USER11> Interestingly, a top Kaggler (Ahmet) just posted a nice contest solution with SVMs for the TReNDS Neuroimaging contest: [https://www.kaggle.com/aerdem4/rapids-svm-on-trends- neuroima...](https://www.kaggle.com/aerdem4/rapids-svm-on-trends-neuroimaging)

<comment><USER12> Interestingly they're also popularizing RAPIDS of Nvidia as part of it. Thanks for sharing. Never imagined SVM in such scenario!

</comment></comment><comment><AUTHOR> Since, I am here. I would like to take a small feedback about the general structure of the website and how it feels.

If someone has a suggestion on how I can improve the user experience feel free to hop in and let me know.</comment>


N.S.A. Examines Social Networks of U.S. Citizens - <AUTHOR> http://www.nytimes.com/2013/09/29/us/nsa-examines-social-networks-of-us-citizens.html?partner=rssnyt&emc=rss&utm_medium=twitter <comment> fsck--off This program has Keith Alexander's name written all over it. Alexander has a history of mining as much data as he can, even if it turns out to be worthless.

From a Foreign Policy article [1]:

"When he ran INSCOM and was horning in on the NSA's turf, Alexander was fond of building charts that showed how a suspected terrorist was connected to a much broader network of people via his communications or the contacts in his phone or email account.

"He had all these diagrams showing how this guy was connected to that guy and to that guy," says a former NSA official who heard Alexander give briefings on the floor of the Information Dominance Center. "Some of my colleagues and I were skeptical. Later, we had a chance to review the information. It turns out that all [that] those guys were connected to were pizza shops."

A retired military officer who worked with Alexander also describes a "massive network chart" that was purportedly about al Qaeda and its connections in Afghanistan. Upon closer examination, the retired officer says, "We found there was no data behind the links. No verifiable sources. We later found out that a quarter of the guys named on the chart had already been killed in Afghanistan."

Those network charts have become more massive now that Alexander is running the NSA."

[1] [http://www.foreignpolicy.com/articles/2013/09/08/the_cowboy_...](http://www.foreignpolicy.com/articles/2013/09/08/the_cowboy_of_the_nsa_keith_alexander?page=full)

</comment><comment><USER2> I believe the Onion nailed it here a couple years ago: [http://www.youtube.com/watch?v=cqggW08BWO0](http://www.youtube.com/watch?v=cqggW08BWO0)

</comment><comment><USER3> The thing that irritates me is that this "examination" can only determine guilt by association. That's specifically an un-American determination. Guilt, in the USA, is supposed to be determined by a public trial, where everyone knows the evidence. Concealed evidence is explicitly illegal. There's even a clause in the constitution to allow the accused to confront their accusers: no secret witnesses. Various laws exist to make prosecutors turn over exculpatory evidence.

This whole thing is just totally un-American, at least from first principles. It looks like the "intelligence community" has forgotten those same first principles.

<comment><USER4> I presume this "evidence" is used for a parallel construction: [https://en.wikipedia.org/wiki/Parallel_construction](https://en.wikipedia.org/wiki/Parallel_construction)

<comment><USER3> Or to put people on "watch lists" or whatever. There's never been any public information on how names make it on to the "No Fly" list, or the "Special Search List" for air travel.

And there we plunge off the cliff into another un-American idea: the government can allow petitions for redress of being put on a "No Fly" or "Search Real Good" list, but it can't act on them: both method of determining reason, and the evidence of reason for being on the list don't hold up to reason. The government might allow petition for redress, but it can't effectively redress that greivance. Completely un-American.

<comment><USER5> Maybe we should stop pronouncing things like this as un-American as it is seems to be very American in any sort of recent history and I don't mean only in the past 10 years.

<comment><USER3> Actually, I'm OK with that, as long as I don't have to "support the troops", stand for "The Star-Spangled Banner" or say the Pledge of Allegiance, and all copies of Lee Greenwood's "Proud to be an American" are relegated to the trash. Oh, and the Republican's "American Exceptionalism" is laughed out of existance. There's probably some other things that would seem ridiculous, maybe all the pious preaching on July 4th, I dunno.

</comment></comment></comment></comment></comment><comment><USER6> The problem is that public outrage never amounts to effective activist action unless people can physically see the government's oppression -- that usually stirs people up.

With Internet spying, nothing changes -- we just now know what we sort of assumed. It's really easy to just move on with your day.

The question is, What does it take to make policymakers take action?

</comment><comment><USER7> From the article (emphasis mine):

        Analysts were warned to follow existing "minimization rules,"
        which prohibit the N.S.A. from sharing with other agencies names
        and other details of Americans whose communications are collected,
        unless they are necessary to understand foreign intelligence
        reports _or there is evidence of a crime_.

The NSA got a green light to dragnet Americans' communication on behalf of the FBI. Simply stunning.

<comment><USER8> There have been little hints like this throughout the recent articles. Yet people say "stop whining about what they _could_ do; they're not actually doing it."* Well, there's enough evidence they _are actually_ "fighting crime" with intelligence data (see the Reuters story about DEA, IRS, etc. getting tips from NSA.) Even if not, who can honestly think a system, where a spy agency collects everything from everyone and is allowed to hand it off for domestic criminal investigations, is a good idea?

*And yeah, I do try to keep in perspective life as an American is pretty good. But "we're not as bad as those guys" or "we're currently using our extraordinary powers pretty responsibly" are dangerous excuses to have when expanding power...

</comment></comment><comment><USER9> Anyone else feel that Keith Alexander will be synonymous with Joseph McCarthy 50 years from now?

<comment><USER10> What people don't understand is that those public individuals (the front-end, if you want) just doesn't matter. If Alexander didn't exist, it would be just another name here and everything would be the same. People who decide things, they are behind the curtains, mastering their puppets. Those two parties that you think you vote for one of them is theatre of democracy, they are two hands of the one evil. You would say this is another conspiracy theory? You would've said it about Snowden's revelations one year ago. Open you eyes. Those who have power, those several families, banks and the corporations, they will do everything and anything to preserve their power and control over the people.

<comment><USER11> I've known about or guessed at the Snowden revelations for years now, and I think you're personifying a complex system by saying "Surely some person must be in charge!"

The truth is that it actually seems to just be a clusterfuck of many people interacting, each pursuing their own (usually ambivalent to good) intentions, and that no one really is running the show.

Which in many ways, is more terrifying: if someone is in charge, then all we have to do is change who is in charge to fix the problem; but if the problem is that even with good intentions, there are problems with scale and complexity that mangle them in to monstrosities like this... what can we do about it?

You can always behead a bad king, but what do you do about human nature and the problems of scale?

<comment><USER12> I'm glad to see other people thinking this way, because I believe this is the problem we're actually dealing with. Combine that with the fact that this cat can not be stuffed back in its bag, and all I can think of doing is hoping the surveillance is complete enough and disseminated widely enough that no one asshole or cabal of assholes can seize control.

<comment><USER11> I mean, I would argue that any solutions have to be found in restructuring things to be much more localized and decentralized.

A return to city-states, for instance, would deal with the problem of global super powers that can spy on huge swathes of the population, because it would require many independent groups who all have their own self-interests to collaborate in a way that lessens their individual power.

To some degree, the kind of spying we see now is only possible because the balance between the federal government and the states swung in favor of the federal government - something the citizens can influence directly (if they opt to do so).

</comment></comment></comment></comment></comment><comment><USER13> This is a gripping account of what these surveillance programs lead to written by someone who saw when they go wrong:

I live in a country generally assumed to be a dictatorship. One of the Arab spring countries. I have lived through curfews and have seen the outcomes of the sort of surveillance now being revealed in the US. People here talking about curfews aren't realizing what that actually FEELS like. It isn't about having to go inside, and the practicality of that. It's about creating the feeling that everyone, everything is watching. A few points:

1) the purpose of this surveillance from the governments point of view is to control enemies of the state. Not terrorists. People who are coalescing around ideas that would destabilize the status quo. These could be religious ideas. These could be groups like anon who are too good with tech for the governments liking. It makes it very easy to know who these people are. It also makes it very simple to control these people.

Lets say you are a college student and you get in with some people who want to stop farming practices that hurt animals. So you make a plan and go to protest these practices. You get there, and wow, the protest is huge. You never expected this, you were just goofing off. Well now everyone who was there is suspect. Even though you technically had the right to protest, you're now considered a dangerous person.

With this tech in place, the government doesn't have to put you in jail. They can do something more sinister. They can just email you a sexy picture you took with a girlfriend. Or they can email you a note saying that they can prove your dad is cheating on his taxes. Or they can threaten to get your dad fired. All you have to do, the email says, is help them catch your friends in the group. You have to report back every week, or you dad might lose his job. So you do. You turn in your friends and even though they try to keep meetings off grid, you're reporting on them to protect your dad.

2) Let's say number one goes on. The country is a weird place now. Really weird. Pretty soon, a movement springs up like occupy, except its bigger this time. People are really serious, and they are saying they want a government without this power. I guess people are realizing that it is a serious deal. You see on the news that tear gas was fired. Your friend calls you, frantic. They're shooting people. Oh my god. you never signed up for this. You say, fuck it. My dad might lose his job but I won't be responsible for anyone dying. That's going too far. You refuse to report anymore. You just stop going to meetings. You stay at home, and try not to watch the news. Three days later, police come to your door and arrest you. They confiscate your computer and phones, and they beat you up a bit. No one can help you so they all just sit quietly. They know if they say anything they're next. This happened in the country I live in. It is not a joke.

3) Its hard to say how long you were in there. What you saw was horrible. Most of the time, you only heard screams. People begging to be killed. Noises you've never heard before. You, you were lucky. You got kicked every day when they threw your moldy food at you, but no one shocked you. No one used sexual violence on you, at least that you remember. There were some times they gave you pills, and you can't say for sure what happened then. To be honest, sometimes the pills were the best part of your day, because at least then you didn't feel anything. You have scars on you from the way you were treated. You learn in prison that torture is now common. But everyone who uploads videos or pictures of this torture is labeled a leaker. Its considered a threat to national security. Pretty soon, a cut you got on your leg is looking really bad. You think it's infected. There were no doctors in prison, and it was so overcrowded, who knows what got in the cut. You go to the doctor, but he refuses to see you. He knows if he does the government can see the records that he treated you. Even you calling his office prompts a visit from the local police.

You decide to go home and see your parents. Maybe they can help. This leg is getting really bad. You get to their house. They aren't home. You can't reach them no matter how hard you try. A neighbor pulls you aside, and he quickly tells you they were arrested three weeks ago and haven't been seen since. You vaguely remember mentioning to them on the phone you were going to that protest. Even your little brother isn't there.

4) Is this even really happening? You look at the news. Sports scores. Celebrity news. It's like nothing is wrong. What the hell is going on? A stranger smirks at you reading the paper. You lose it. You shout at him "fuck you dude what are you laughing at can't you see I've got a fucking wound on my leg?"

"Sorry," he says. "I just didn't know anyone read the news anymore." There haven't been any real journalists for months. They're all in jail.

Everyone walking around is scared. They can't talk to anyone else because they don't know who is reporting for the government. Hell, at one time YOU were reporting for the government. Maybe they just want their kid to get through school. Maybe they want to keep their job. Maybe they're sick and want to be able to visit the doctor. It's always a simple reason. Good people always do bad things for simple reasons.

You want to protest. You want your family back. You need help for your leg. This is way beyond anything you ever wanted. It started because you just wanted to see fair treatment in farms. Now you're basically considered a terrorist, and everyone around you might be reporting on you. You definitely can't use a phone or email. You can't get a job. You can't even trust people face to face anymore. On every corner, there are people with guns. They are as scared as you are. They just don't want to lose their jobs. They don't want to be labeled as traitors.

This all happened in the country where I live.

You want to know why revolutions happen? Because little by little by little things get worse and worse. But this thing that is happening now is big. This is the key ingredient. This allows them to know everything they need to know to accomplish the above. The fact that they are doing it is proof that they are the sort of people who might use it in the way I described. In the country I live in, they also claimed it was for the safety of the people. Same in Soviet Russia. Same in East Germany. In fact, that is always the excuse that is used to surveil everyone. But it has never ONCE proven to be the reality.

Maybe Obama won't do it. Maybe the next guy won't, or the one after him. Maybe this story isn't about you. Maybe it happens 10 or 20 years from now, when a big war is happening, or after another big attack. Maybe it's about your daughter or your son. We just don't know yet. But what we do know is that right now, in this moment we have a choice. Are we okay with this, or not? Do we want this power to exist, or not?

You know for me, the reason I'm upset is that I grew up in school saying the pledge of allegiance. I was taught that the United States meant "liberty and justice for all." You get older, you learn that in this country we define that phrase based on the constitution. That's what tells us what liberty is and what justice is. Well, the government just violated that ideal. So if they aren't standing for liberty and justice anymore, what are they standing for? Safety?

Ask yourself a question. In the story I told above, does anyone sound safe?

I didn't make anything up. These things happened to people I know. We used to think it couldn't happen in America. But guess what? It's starting to happen.

I actually get really upset when people say "I don't have anything to hide. Let them read everything." People saying that have no idea what they are bringing down on their own heads. They are naive, and we need to listen to people in other countries who are clearly telling us that this is a horrible horrible sign and it is time to stand up and say no.

-[http://www.reddit.com/r/changemyview/comments/1fv4r6/i_belie...](http://www.reddit.com/r/changemyview/comments/1fv4r6/i_believe_the_government_should_be_allowed_to/caeb3pl)

If you found this post inspiring, please consider signing up for the mass rally on Washington DC in October to protest these surveillance programs: [http://rally.stopwatching.us](http://rally.stopwatching.us)

<comment><USER14> I agree with you pvnick -- it's a little different this time though. More dangerous. Because you can be observed by computers that can correlate your activities from many different sources. The thing is, this technology is becoming cheaper and more available, and it's not just governments that want it. Corporations do too. Just like cellphones are addictive to PEOPLE, this is like crack to organizations of any kind.

TODAY: Uploaded a YouTube video with copyrighted song in the background? Video censored. Sent money to a friend on Paypal? Account limited. K-Mart figures out girl is pregnant before her dad knows, based on her shopping. Exceeded speed limit between toolbooths? Instant fine.

TOMORROW: Left a parking lot without entering restaurant? Instant towing. Exceeded parking meter by 2 minutes? Instant fine. Exceeded speed limit for 10 seconds on the road? Instant fine. Surfing websites correlated to high incidence of child abuse? Children taken away. Need to be arrested? "parallel construction" will resultin "random" traffic stop and arrest. Facebook, Google, all these companies want your data, not just governments. Credit score and insurance premiums calculated based on your fb friends etc.

Truth is, the information is out there, and the cameras are going to be smaller and more prevalent. So now what? We have to focus on making our GOVERNMENTS more transparent. Presumably our privacy will shrink as cameras will be more available.

Terrorism is a problem of technology. And this leads to the "solution" of increased surveillance - which may prove to be worse than the problem.

<comment><USER15> Exceeded parking meter by 2 minutes? Instant fine.

^ This one is already a reality, there are digital meters in place in many cities that do just this.

<comment><USER16> Can you provide some examples? Which cities? I was not able to find any in operation using the following google search:

[https://www.google.com/search?q=parking+meter+automatic+fine](https://www.google.com/search?q=parking+meter+automatic+fine)

</comment></comment></comment></comment><comment><USER17> I have to say, I am kind of numbed down by all the NSA revelations.

Yeah, they scan and read everything they physically can. So that's metadata and the data themselves.

They hack into SSL authorities, they try to read SSL traffic as much as possible, they try to get into Tor (and with such a little number of Tor relays, they very well may own it already).

I stopped caring, since I am not even a US citizen and can't change it with my votes anyway. Yeah, if they _can_ get to some data, because the data is in plaintext sitting somewhere, they probably already did.

<comment><USER18> > since I am not even a US citizen and can't change it with my votes anyway

You can vote with:

a) Your data (usage of the various products and services)

b) Your money (purchase of the various products and services)

<comment><USER19> Short of dropping off the grid and moving to a cabin in Montana, I don't see how any of us can exercise this vote.

<comment><USER20> The only thing I can really think of is donating money to the EFF. Still, unless the American people take to the streets, nothing will change.

<comment><USER21> The entire budget of the EFF is only $3.8m at last count ( [http://www.charitynavigator.org/index.cfm?bay=search.summary...](http://www.charitynavigator.org/index.cfm?bay=search.summary&orgid=7576)). I bet we could _double_ that just among the people reading this page.

</comment></comment></comment></comment></comment><comment><USER22> I love the undertones of public, unapologetic racism that permeates every official response to the leaks. It's totally OK because we only shit over the human rights of "foreigners".

<comment><USER23> "Racism"? No. What you're describing is nationalism.

All nations spy on other nations to the degree they can afford to do so. The US can afford to do a lot of spying, so it does.

It has nothing to do with people's race, and everything to do with their nationality.

<comment><USER24> Potayto, potahto. Racism and nationalism stem from a common root: fear of the other (or tribalism). Whether it's triggered by skin color or cultural differences, that fear still comes from a primal, irrational place. (It doesn't help that any particular other you could name will likely hold a similar bias against us.)

<comment><USER25> That's an idealistic view of things. What's really happening is that human beings banded together to protect their mutual interests on multiple, fractal levels on the way up. Individuals formed families, which formed communities, which formed towns and neighborhoods and cities, all the way up to nation- states. The difference is, there's no stable mechanism, other than humanitarian good feelings, for the people of the United States and the people of Pakistan to respect each other's mutual interests, so they pursue their interests in opposition to one another.

<comment><USER26> That is a very old fashioned way to describing 'tribal' groups. One of the things that the internet has brought about is the aggregation of 'tribal' groups that cut across the old boundaries.

This is, IMO, one of the things that governments are having real problems dealing with.

<comment><USER25> Cross cutting tribal groups have historically been difficult to deal with. Just look at how much trouble the Jews have had.

</comment></comment></comment></comment></comment></comment><comment><USER27> This is no surprise; if phone metadata of US citizens is legal to harvest, then social network metadata collection, which is essentially the same, is also legal to harvest. It looks like this collection is limited only to metadata, if this can be believed:

"The legal underpinning of the policy change, she said, was a 1979 Supreme Court ruling that Americans could have no expectation of privacy about what numbers they had called. Based on that ruling, the Justice Department and the Pentagon decided that it was permissible to create contact chains using Americans' "metadata," which includes the timing, location and other details of calls and e-mails, but not their content. The agency is not required to seek warrants for the analyses from the Foreign Intelligence Surveillance Court."

So, as long as that 1979 Supreme Court ruling is not modified, this collection is legal. I'm a bit surprised it's the NSA and not the FBI, but if you're going to track the intersection of foreigners or U.S. citizens, one agency has to be picked over the other, and they picked the NSA.

</comment><comment><USER28> It is with sadness that I announce the passing of Privacy. A cherished friend; he will be missed by all, and remembered fondly.

I know that we all thought that he would live forever, so news of his parting has been greeted universally with shock and with sorrow in equal measure.

For we who remain, we need to learn afresh how to survive in a world that - without our late companion - is changed beyond recognition; to adapt, and to survive without his comfort and protection.

Survive, of course, we will; and adapt to our loss also. We cannot have any doubt though - we are weaker and more vulnerable as a result of our friend's untimely demise.

</comment><comment><USER29> I'm curious, how much of this did the NSA learn from Facebook et al? There has to be some overlap between the analytics Facebook uses and what the NSA is doing. Did they learn anything from articles Facebook employees have written? Has Facebook _assisted_ them with any of this? Or has the NSA basically had to reinvent the wheel?

<comment><USER30> The NYT is using "social network" in the term's pre-Internet era sense, meaning, as the headline and story say, "social connections" and "large-scale graph analysis."

Nowhere in their story do the reporters allege that the NSA has been bulk- downloading private Twitter, Facebook, Google+, etc. information with the cooperation of those companies. (In fact, I would be very surprised if that were the case, as it goes against what my own reporting has established.)

Instead, as the story says in the second paragraph, the NSA is building social graphs based on its "analysis of phone call and e-mail logs." We know they get phone call metadata via Section 215 of the Patriot Act from telcoms like AT&T, VZ, Sprint, etc., which have long been in bed with FedGov. My guess is that the email metadata comes from two sources: AT&T, VZ, Sprint, etc., and bulk fiber taps (remember, "UPSTREAM" from the earlier Snowden slides) aimed at email providers that do not fully support SMTP-TLS.

When I wrote about this in June ([http://news.cnet.com/8301-13578_3-57590389-38/](http://news.cnet.com/8301-13578_3-57590389-38/)), only Google among the top mail providers was fully supporting SMTP-TLS, while Yahoo Mail, Hotmail.com/Outlook.com, AOL, etc. were not. And for SMTP-TLS, it takes two to tango.

A possible third source, also via UPSTREAM, is monitoring HTTPS connections to Facebook itself, which was using 1024-bit RSA keys until recently, as I wrote about here: [http://news.cnet.com/8301-13578_3-57591560-38/](http://news.cnet.com/8301-13578_3-57591560-38/)

Finally, the NSA is supplementing its email-and-phone metadata database with whatever it can vacuum up through public records (the article refers to voter registration rolls, property records, and Facebook profiles) and non-public data held by regulated industries that, unlike large Silicon Valley companies, have little interest in litigating against FedGov on privacy. The article refers to bank codes, insurance information, passenger manifests, billing records, and "location-based services like GPS and TomTom" \-- odd wording, that, and a hint that the reporters may not have understood all of their material. Cell phone location metadata from carriers is probably included as well.

In other words, Facebook can be reasonably criticized for moving slowly away from 1024-bit RSA keys and not supporting SMTP-TLS, which have made it easier for not only the NSA but other intelligence agencies to conduct surveillance too. But this story is not about the NSA having direct access to Facebook's servers or getting bulk dumps of direct messages from Twitter, and in fact there's zero evidence that's the case.

<comment><USER31> _In fact, I would be very surprised if that were the case, as it goes against what my own reporting has established._

Which makes me wonder why they aren't.

At the least, I don't see anything illegal about their scraping public facebook info, and they can easily gain access to the private stuff as we've learned.

So why wouldn't they populate their old-school social graphs with new-school social graph information?

<comment><USER30> They absolutely would. As I said above, "the NSA is supplementing its email- and-phone metadata database with... Facebook profiles."

The point I was making (perhaps poorly) is that the NSA is surely bulk vacuuming up public Facebook profiles and using its relationship with AT&T/VZ/Sprint/etc. to do fiber taps of poorly encrypted or unencrypted data in transit. But there's no evidence of direct access to Facebook/Twitter/G+ servers or bulk downloads of private data from social networks.

<comment><USER32> [http://nakedsecurity.sophos.com/2012/11/19/facebook- https-t-...](http://nakedsecurity.sophos.com/2012/11/19/facebook-https-t- shirt/)

Worth pointing out that Facebook only had opt in https as of 2011 and default https came a long time after that.

</comment></comment></comment></comment></comment><comment><USER33> I have two things to contribute here:

(1) Image of Keith Alexander in relative youth (from a .mil personnel file source) @ [http://imgur.com/CXU67Fn](http://imgur.com/CXU67Fn)

(2) AMDOCS is without question a major source of metadata. It amazes me with all the coverage, nobody is digging at this. (New York Times is less likely, since it's hosted at the only place in the world I've ever seen a _pro- Israeli_ march! That was quite a shock, let me tell you!)

</comment><comment><USER34> i live in a democracy yet i feel powerless.

<comment><USER35> Do you know what power is? That's the first step to not being powerless.

</comment></comment><comment><USER36> It's funny. I never cared about the NSA one way or the other. Now, I hate them a little bit more everyday.

</comment><comment><USER37> OK, we 're not really surprised, and as others say, the onion had predicted it years ago. What are the results? Can somebody ask for anonymized copies of these publicly-funded data? You know, for research purposes and all...

<comment><USER38> Please stop saying "we are really not surprised", whether you actually mean it or trying to joke about it. It legitimizes such behavior for some people who are not very privacy conscious and it really takes out the sting from the gravity of such incidents.

<comment><USER39> You want us to lie?

<comment><USER38> No, I want you to acknowledge the gravity of the incident, by saying "oh I am really not surprised", you are in fact lying because you have no way to know for sure the extend of the privacy infringement. You might have thought "I bet NSA is snooping my facebook activity" but thats not the same as saying "I know NSA is snooping on my FB to such and such extend."

<comment><USER40> Now that the NYT (who has been known to collude with intelligence agencies in the shaping of public opinion) has released something, we now know the _full_ extent of privacy infringement and the world will magically turn into a better place…

When NSA whistleblowers have been trying to do outreach to the public for _years_ prior to the Snowden leaks[0], to be upset because some people want to take a pragmatic approach/perspective after witnessing an apathetic public for _years_ at large, is pretty farcical IMO.

At this point, I don't expect anything from congress nor many of my "friends" on social networks. If I want to be secure in my communications with them, I will/have taken the steps to do so through means discussed at length plenty of times on HN. If governments across the world want to go on witch hunts, they'll only get more of what has happened because of them: "If you always do what you've always done, you'll always get what you always got".

The way I see it, the point of no return was long ago…

[0] [http://techtv.mit.edu/embeds/21783?html5=true&size=medium&cu...](http://techtv.mit.edu/embeds/21783?html5=true&size=medium&custom_width=432&player=simple&external_stylesheet=)

</comment></comment></comment></comment></comment><comment><USER18> Which - once more - leads us to the question (amongst others):

Still want to use Gmail, Hotmail, Yahoo mail, AOL mail etc.?

</comment><comment> o0-0o If everyone created a few fake profiles, this might muck the waters.

<comment><USER15> Unlikely, all social network websites have been full of fake profiles since day 1, and their overseers have grown brilliantly adept at distinguishing the real humans behind them.

</comment></comment><comment><USER41> Surely Google and Facebook do this too. Why are we surprised that the government does it?

<comment><USER42> Because it's not their information to play with. If I willingly give my information to Google or Facebook, I don't expect the government to get their hands on it immediately and begin interrogating me via proxy.

There have been what... 3, 4 deaths from terrorism this year in the USA? And 6,000+ deaths by way of guns/criminal activity? Doesn't really seem to be worth their trouble to be snooping through who I talk to and who I hang out with.

<comment><USER41> Most people don't willingly give the information to Google or Facebook. They give it _unwittingly_.

Also, by your logic, it's not your information anymore - you have given it to Google and Facebook, which makes it _their_ information to give to the government.

<comment><USER42> Exactly. I understand that if I give away my social profile and/or pictures to a large corporation that they may be abused by said corporation. That's what corporations do.

I choose not to do so, I don't use facebook or gmail, but if I did I would only expect them to be using and abusing it, not some secret government program.

<comment><USER41> But why would such an expectation be reasonable? Surely once you have given the information away, it's their business what they do with it?</comment></comment></comment></comment></comment>


Benchmarking Modern GPUs for Maximum Cloud Cost Efficiency in Deep Learning - <AUTHOR> http://minimaxir.com/2017/11/benchmark-gpus/ <comment><USER2> _> As with the original benchmark, I set up a Docker container containing the deep learning frameworks (based on cuDNN 6, the latest version of cuDNN natively supported by the frameworks) that can be used to train each model independently. The Keras benchmark scripts run on the containers are based off of real world use cases of deep learning._

Can someone who is knowledgeable about docker (and container performance in general) comment on how using a docker instance impacts benchmark performance?

I understand containers are not virtual machines, but my preference would be for a benchmark run on bare metal without containerization involved. In particular, it's not clear to me whether a container can take advantage of the same CPU and GPU instruction optimizations that a binary or compiled-from- source version can. For example, I'm curious if containers package redundant versions of software for convenience that are underoptimized when compared to versions packaged with the operating system. Is that a realistic concern?

In other words, is there generally a meaningful downside to benchmarking with containers, and if so what is it? And equally importantly, are containers the way most people use deep learning frameworks? I have never installed Tensorflow or Keras using a container.

<comment><USER3> > it's not clear to me whether a container can take advantage of the same CPU > and GPU instruction optimizations that a binary or compiled-from-source > version can.

Since the container is running on the bare metal, with the same kernel and everything, just isolated, it absolutely can take advantage of these things. It'll require about the same amount of work to do the compilation for using any special instructions for performance as it would if it's on bare metal.

> For example, I'm curious if containers package redundant versions of > software for convenience that are underoptimized when compared to versions > packaged with the operating system. Is that realistic concern?

Maybe. It'll mean that there's extra data on disk and maybe in ram from loading other shared libraries which will mean some overhead, but unless there's some specific set of instructions or optimizations that would make a difference for the workload it should be basically the same.

<comment><USER4> > unless there's some specific set of instructions or optimizations that would > make a difference for the workload

I think this was the parent's worry. Most HPC deployments have versions of libc, libm, etc. compiled with tuning flags specific to the microarchitecture of the system, to allow workloads deployed on them to squeeze as much performance as possible out of the system. I would worry that the versions of libraries in the container are just the generic packages that ship with the OS, compiled with -march=i686 or whatever the modern equivalent is, where they don't try to take advantage of e.g. AVX512 instructions if they're available.

<comment><USER5> Yes you're 100% correct, but if you're using a well tuned GPU Deep Learning pipeline the bottleneck is GPU compute and the CPU is always waiting on the GPU.

It can be a bit tricky to optimise this though - some deep learning users do things like resizing images on the fly, or on the fly vectorising / scaling of input data in these cases the CPU can be the bottleneck and the optimisations above can help - but this is largely a symptom of a poor pipeline configuration in newbie shops, most serious places have optimised this away and the GPU is the bottleneck

</comment></comment></comment></comment><comment><USER6> Great write up! I would be remiss to not mention Paperspace [https://www.paperspace.com](https://www.paperspace.com) where we also offer cloud GPU infrastructure that is less expensive and more powerful than most of the larger clouds.

We also offer a suite of tools that makes setting up cloud AI pipelines a bit easier to set up and manage.

If this is of interest to anyone here's a $5 promo code to try us out : HNGPU5

full disclosure: I'm one of the co-founders :)

</comment><comment><USER7> I would be interested to see how the new preemptible GPU instances fare in this comparison, perhaps on the next revision? [https://cloud.google.com/compute/docs/instances/preemptible#...](https://cloud.google.com/compute/docs/instances/preemptible#preemptible_with_gpu)

<comment><AUTHOR> Dammit. When did Google announce these?

It looks like preemptable GPUs are exactly half the price of normal GPUs (for both K80s and P100s; $0.73/hr and $0.22/hr respectively), so they're about double the cost efficiency (when factoring in the cost of the base preemptable instance), which would put them squarely ahead of CPUs in all cases. (and since the CPU instances used here were also preemptable, it's apples-to- apples)

<comment><USER7> Quite recently I think. You can't be blamed for missing it, the documentation is inconsistent on if it is supported. ([https://mobile.twitter.com/danielwithmusic/status/9421780263...](https://mobile.twitter.com/danielwithmusic/status/942178026309140480/photo/1)).

</comment></comment></comment><comment><USER8> Shameless plug, we also have a benchmark post for CPU/K80/V100 focusing on image tasks: [https://blog.floydhub.com/benchmarking-floydhub- instances](https://blog.floydhub.com/benchmarking-floydhub-instances). In this case, V100 can be a lot more cost effect compared to CPU and K80. Our tensorflow environments are built from source with optimizations targeting our CPU instances.

</comment><comment> oh-kumudo Would be better if Volta-based P3 instances are involved in the comparison.

Spoiler Alert: It is a game changer.

<comment><AUTHOR> I talked about Volta at the end of the post, but it'll still be a bit for Volta/cuDNN 7 support is baked into the native Tensorflow/CNTK distributions.

Even if Volta has the speed advantages touted, I doubt P3s will be as cost- effective as a K80.

<comment> oh-kumudo It is actually more interesting than that. My experience is P3 instance can significantly accelerate the training performance, as much as 2x-3x, so to train the same model, you won't need to keep the instance up nearly as long for a K80 instance.

</comment></comment></comment><comment><USER9> 1\. I wouldn't take much away from the LSTM benchmark. It's more a benchmark of Keras since Keras only supports CuDNN's LSTM via Tensorflow right now. AFAIK CNTK does supports CuDNN LSTM but not through Keras. Keras actually implements its own LSTM in terms of the base math operations (it doesn't call the Tensorflow or CNTK LSTM operations which are in some cases optimized in C++ etc.), so on the CPU you probably could get better performance if you were using the Tensorflow or CNTK functions directly.

2\. Compiling Tensorflow from source on CPUs is a bit of a hassle but I have seen nice performance gains (10-20%) for LSTM tasks. I bet you would get even higher gains for CNNs since they're more parallelizable. (Note: I've never gotten the latest TF to work with Intel MKL).

3\. I haven't fully tested this myself, but with the P100s you also have full support for half precision floats, which supposedly offer a huge speedup.

4\. Also would have liked to see benchmarks of other frameworks like PyTorch, etc. I haven't used them myself but everything I've heard indicates that Tensorflow is often slower.

</comment><comment><USER10> Great write up! Even though I'm very far from understanding deep learning and the various frameworks you're testing here, benchmarking GPUs has always been a muse to me.

I'm interested to see the utilization of the underlying GPU devices when you run the MLP or CNN benchmarks (monitored with `nvidia-smi`) — the speed-up factor between the different benchmarks don't seem to be inline with the speed-up factor shown in cuDNN link[1] between a K80 and P100. I'm wondering if the P100 device is under-utilized when used with TensorFlow or CNTK.

[1] [https://developer.nvidia.com/cudnn](https://developer.nvidia.com/cudnn)

</comment><comment><USER11> At least for personal experiments, how much worse is it to just build a system with a 1080 ti, leave it in a corner where you live and remote in as needed, from a laptop, school, wherever.

Separately it seems with ML price/performance is sometimes less important than how much money do you have to spend?

For example with other development work, I'd probably never buy an 18 core cpu because for most projects it wouldn't speed up my iterative work much.

However ML is more like VFX work, where it's common that nothing may be too fast. In other words I would be more often willing ignore price/perf, and for example pay 100% more for only a 50% perf gain, if it were within my means to do so.

</comment><comment><USER12> This is a great deal, 4x 1080 for $1700 CAD/month if you need it the whole month or for longer:

[https://www.ovh.com/ca/en/dedicated- servers/gpu/1801gpu06.xm...](https://www.ovh.com/ca/en/dedicated- servers/gpu/1801gpu06.xml)

But the best deal with regards to GPUs is to buy your own and put it in your office.

<comment><USER13> Hetzner has a single 1080 for 99 EUR a month: [https://www.hetzner.de/dedicated-rootserver/ex51-ssd- gpu](https://www.hetzner.de/dedicated-rootserver/ex51-ssd-gpu)

<comment><USER14> I've used hetzner, works great and a tiny fraction of the cost. But you have to manage nodes yourself and bandwidth isn't great.

<comment><USER12> With Kubernetes and docker, it has never been easier to run it yourself.

</comment></comment></comment></comment><comment><USER15> > Indeed, the P100 is twice as fast and the K80, but due to the huge cost > premium, it's not cost effective for this simple task.

Am I reading the graph wrong, or is this statement not true?

Looks like the P100 is running the code in around half the time as the K80 and the cost is only 150% that of the K80.

.5::1.5 == 1::3 > 1::1

</comment><comment><USER16> I'd be interested in hearing how this compares to TPU.</comment>


Love Minority Report? Come to Meet Precog Agatha Live Online - <AUTHOR>

Do you believe a computer can actually know you better than you know yourself? If you are in Divergent, how do you know your faction without going through the tests Tris did?
Please meet Juji at https://juji.io, a system we just built based on AI technologies. Like the "precog" Agatha live online,  Juji can "read" you by automatically inferring your faction(s) and strengths, and your likelihood to career success and a long-lasting marriage, all from your own data (e.g., Facebook posts and tweets).
Want to know which faction your friends or strangers belong to? Juji knows it too!
Check out what Juji knows about you (Juji Me) and people you want to know (Juji People) at https://juji.io !
We are running a trial now and especially interested in your comments and feedback on: how does the derived info HELP YOU as a unique individual? (e.g., self branding, match making, etc.).
IMPORTANT: The derived portrait is for your eyes only unless you share. If you are a student, you are eligible for winning an Amazon Gift Card, if you enter your school code (your school name in your school URL before .edu) and confirm you email address during the sign up for notification.
We featured several Juji-inferred portraits, including Lady Gaga, President Obama, and NCAA Star Players at our Facebook page: https://www.facebook.com/juji.io
thanks,
The Juji Team email@example.com <comment><USER2> I don't see any form on the signup page:

[https://juji.io/login](https://juji.io/login)

</comment><comment><AUTHOR> Our site is: [https://juji.io](https://juji.io)

Please send comments to firstname.lastname@example.com

</comment><comment><AUTHOR> I'm sorry! I forgot to put ShowHN in front of the title.

Reposting it on ShowHN

</comment><comment><USER3> You should post this as a "Show HN"</comment>


The Least Important Ex-CEO - <AUTHOR> http://blog.quirky.com/home/2015/7/31/the-least-important-ex-ceo

<comment><USER2> What is up with that title?</comment>


PG's comments on $150k funding offer - <AUTHOR> http://blogs.wsj.com/venturecapital/2011/02/01/y-combinators-paul-grahahttp://blogs.wsj.com/venturecapital/2011/02/01/y-combinators-paul-graham-on-the-150k-per-start-up-offer/m-on-the-150k-per-start-up-offer/

<comment><USER2> This was posted already here:

<http://news.ycombinator.com/item?id=2167100></comment>