Live data from Hacker News

FastSpark: A New Fast Native Implementation of Spark from Scratch

medium.com

81–90 of 93 posts

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#81
post #14

Earlier quoted context omitted.

If you want a more complicated transform on lots of data your fancy sql won’t help.

Please give me an example. I can't think of any transform which cannot be done by using SQL or inbuilt Functions or new UDF.

It’s also possible to do a lot in excel, it is just not always the best tool for the job.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#82

Earlier quoted context omitted.

distributed in-memory computing for massive datasets to big to fit into vertically scaled memory. generic tabular files, not tables. delta lake.

Yes those features help and all of the distributed SQL databases have data and query cache.

Then once the subset of data is in distributed memory... you hittem w pyspark and all compatible libraries.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#83

Earlier quoted context omitted.

> like running input through GloVe and pushing ngrams to a temporal store why exactly you think PG will not do this well?

Tell me how you'd do it and I'll tell you why it won't work :)

gloves are stored in table: token -> vector. Function tokenizes text and store in another table: texd_id, token

Then you join first and second table.

Also, I think typical scenario is to resolve embeddings in your model code or data input pipeline.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#84

Earlier quoted context omitted.

train a set of sklearn models one each per a random partition of the data (computed distributed). then combine all those models using averaging and evaluate them all against an even larger dataset. how do you do that in SQL

Sharding the table can help scale the problem across many machines and as I mentioned earlier you can use PL/R or PL/Python language extension to lift all sorts of ML functions to SQL functions.

I'm unfamiliar with PL/Python. Can you have a Python object be the returned value of a sql query? Because that's a requirement of my example.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#85

Earlier quoted context omitted.

Tell me how you'd do it and I'll tell you why it won't work :)

gloves are stored in table: token -> vector. Function tokenizes text and store in another table: texd_id, token Then you join first and second table. Also, I think typical scenario is to resolve embeddings in your model code or data input pipeline.

> Also, I think typical scenario is to resolve embeddings in your model code or data input pipeline.

Correct. PG has no place in this workload other than being the final store for the model output. And even then, you'd be using a column store like Redshift or Clickhouse. PG not even suitable for the ngram counters because its ingest rates are way too slow to keep up with a fanned out model spitting out millions of ngrams per second in addition to everything else going on in the pipeline.

You -could- probably do it all in PG. But that'd be a silly esoteric challenge exercise and not something anyone would try on a project. I am sure you recognise that.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#86

Earlier quoted context omitted.

gloves are stored in table: token -> vector. Function tokenizes text and store in another table: texd_id, token Then you join first and second table. Also, I think typical scenario is to resolve embeddings in your model code or data input pipeline.

> Also, I think typical scenario is to resolve embeddings in your model code or data input pipeline. Correct. PG has no place in this workload other than being the final store for the model output. And even then, you'd be using a column store like Redshift or Clickhouse. PG not even suitable for the ngram counters because its ingest rates are way too slow to keep up with a fanned out model spitting out millions of ng…

I would say "fanned out model spitting out millions of ngrams per second" is much more unusual exercise comparing to using PG for ETL workload.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#87

Earlier quoted context omitted.

> Also, I think typical scenario is to resolve embeddings in your model code or data input pipeline. Correct. PG has no place in this workload other than being the final store for the model output. And even then, you'd be using a column store like Redshift or Clickhouse. PG not even suitable for the ngram counters because its ingest rates are way too slow to keep up with a fanned out model spitting out millions of ng…

I would say "fanned out model spitting out millions of ngrams per second" is much more unusual exercise comparing to using PG for ETL workload.

A typical twitter post will have about 50 2/3/4-grams. Let's ignore skipgrams. The twitter decahose will throw about 600 of these at you per second. That's 30k barebones ngrams per second to keep with the decahose.

But you have a year worth of historical data that you want to work with. If you're able to process 1m ngrams per second, it'll take a couple of days to get through that. You probably want to get closer to 10m/s if you're tweaking your model and want to iterate reasonably quickly. Of course there's ways to optimise all that and batch it and whatnot, but basically any big data tasks with the need to work on historical data and iterate on their models, quickly end up with kafka clusters piping millions of messages per second to keep those iteration times productive.

Ultimately this post is about Spark, and the comment that started this was someone listing PG 'replacements' for traditional ML pipeline components. If you need Spark, you're at scales where PG has no place.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#88

Earlier quoted context omitted.

I would say "fanned out model spitting out millions of ngrams per second" is much more unusual exercise comparing to using PG for ETL workload.

A typical twitter post will have about 50 2/3/4-grams. Let's ignore skipgrams. The twitter decahose will throw about 600 of these at you per second. That's 30k barebones ngrams per second to keep with the decahose. But you have a year worth of historical data that you want to work with. If you're able to process 1m ngrams per second, it'll take a couple of days to get through that. You probably want to get closer to…

That's why I mentioned scale in my first comment. For sub-TB datasizes with 16 cores CPU and NVME raid (you can get such machine for less than $1k nowdays) PG will be just fine.

Also in typical ML pipeline as I mentioned you can generate ngrams in input function of your model (Dataset API in TF), you don't need to store it somewhere.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#89
post #71

Earlier quoted context omitted.

Spark is still potentially faster for SQL-like workloads due to the existence of a query optimizer. Dask works at a different level of abstraction and does not have a query optimizer.

Are you talking about the spark SQL catalyst optimiser ? That's apples to oranges - because dask does not expose a SQL syntax that needs a query optimiser. Also pyspark has the additional issue of serialisation between python and jvm. Turns out that just getting rid of that is a huge performance boost.

It’s not apples to oranges with respect to my point though.

Most operations on dataframe-like objects can be described in SQL operations. Spark supports these operations and Catalyst can optimize query plans for these.

You are correct in that Dask does not optimize for this because Dask operations are more primitive hence it does not have the correct level of abstraction to do query optimization, only task graph optimization. Which reinforces my point that if you have a SQL-like workload on Dask.dataframes, chances are Dask may not outperform Spark.

Re: FastSpark: A New Fast Native Implementation of Spark from Scratch

#90
post #3

I'm kind of surprised it took this long for someone to do this. It was clear very early on that the JVM was a bad match for what Spark was trying to do.

this sounds far too simplistic, so .. reference?

I attended a talk at Strata a few years back by a Spark committer who was talking about how Spark was stretching JVM memory allocations far past how the JVM was originally designed. Do a couple searches for "spark JVM OOM" and you'll see some discussions about similar things.
Post reply on HN