Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
animist
Aug 28, 2018

ah dammit, I was just working on something like this. oh well

terrible snipe

Adbot
ADBOT LOVES YOU

mystes
May 31, 2006

Cybernetic Vermin posted:

iirc you're cited in this, any chance for a small effortpost on it for us many lazy people?
Just skimming quickly:

One of the neat things in Haskell is the ST monad which allows you to do things like take an array and temporarily treat it as mutable like in an imperatively language, despite haskell being a pure functional language, and then freeze it and return it as an immutable array.

It seems like they're saying that the limitation of this is that it's not parallelization, so the paper appears to be proposing a new way of doing something similar but where the array can't be read from until it's done being written to, which allows parallelization.

I don't know if it's doing something that's impossible in Haskell, though (if not why are they proposing Dex as a new language?).

Athas
Aug 6, 2007

fuck that joker

Cybernetic Vermin posted:

iirc you're cited in this, any chance for a small effortpost on it for us many lazy people?

I wrote an effortpost offsite a few months ago. That didn't cover the effect system or AD parts, which are the cool parts of this new paper. What I think is the most cool is that they use a notion of "associative effects", which allow you to essentially perform '+=' updates on shared variables (and arrays) within loops, while still parallelising those loops. This is because as long as the definition of "+" for the element type is associative, it doesn't actually matter in which order you do the updates, so you can run the loop iterations in any order, and particularly in parallel. Dex also supports ordinary ad-hoc update effects, which require standard sequential execution of loop iterations. This idea of using effect types to tell the compiler which loops can be parallelised is quite neat. In particular, it allows you to express various parallel constructs by putting loops and effects together in various ways. E.g. this is a summation:

code:
sum = \x:n=>Float.
  snd $ runAccum \total.
    for i. total += x.i
and this is a histogram (sometimes called "generalized reduction" by Fortran people):

code:
histogram = \x:n=>bins.
  snd $ runAccum \hist.
    for i. hist!(x.i) += 1
What I don't know is how far this idea will take you. It sure allows you a lot of flexibility in expressing various forms of reductions, but I don't see how it'll let you express a prefix sum, and even scatters (parallel in-place updates) seem a bit iffy. But I'm not very experienced with effect systems, so maybe that can be handled with other kinds of effects. In most/all other parallel functional languages, you use various built-in combinators (map, reduce, scan, filter, etc), which are then intrinsic to the compiler, which means you need more fundamental constructs.

I also suspect Dex is closer than most other functional languages to syntax-wise looking like something Real Scientists might want to use.

Cybernetic Vermin
Apr 18, 2005

ty, will attempt a proper read with that guiding a bit. i spent some time on understanding futhark drom some previous post, so helps to get that perspective as a starting point.

animist
Aug 28, 2018
effortpost:

Also check out TACO (http://tensor-compiler.org/) which has some similar properties. The framing is different though; they come at to the same idea starting from sparse linear algebra, rather than from functional PLs. But it's the same basic idea.

There's been this trend of manually re-schedulable languages recently, starting with Halide. Basically, you start with the spec, which is a high level mathematical description. Then to you apply transformations, which can reorder loops, rearrange data in memory, etc. Eventually you arrive at the implementation. It's a really cool model and lets you construct fast code quickly.

But imo a lot of the ideas are actually being rediscovered, not invented for the first time.

Like, TACO is all about "sparse tensor operations". What is a "sparse tensor"? It's a multidimensional array, which can have null entries. So you imagine your data as a big cube of little cubes, where some of the little cubes can be missing.

There's another way to picture the same data, though. What if, instead of giving each dimension it's own axis, you arranged them all along the top of a table, and then had a bunch of rows, one row for each non-null member.

That is. Just put the data in a table lol.

So basically, we've recreated SQL. But instead of an opaque query optimizer, you are the query optimizer. You get to choose the data layout, what to use as your keys, what data structures to use for the indexes, the order of evaluation of subqueries, and so on.

That's actually really powerful, since people are often way better at figuring out fast algorithms than compilers. You can be confident your algorithm is correct -- because you've specified it in a data layout independent way, and then just supplied it the data layout to use.

But it's also a problem, since your users need to understand the re-mapping tools available to them.

Imo the key problem to be solved here is usability. You gotta make your query planning system understandable and intuitive. A lot of systems, Halide included, struggle with this. SQL sidesteps it with automatic query planning, but then it's easy to get performance problems... Trade-offs, trade-offs.

My personal project recently has been trying to invent better UIs for all this. I think if you can create a good UI here, you can take away the part of SQL that programmers don't like -- the fact that the actual execution of their query is unpredictable and out of their control.

Then you can bring the benefits of databases -- i.e. flexibility, correctness, data layout independence -- to a much broader class of programs. Or at least, that's my hope.

Definitely gonna play with Dex this weekend, see their approach to this stuff.

(This has been my hobby project for a while lol.)

animist
Aug 28, 2018
Oh also, fun fact: Currying can be seen as a generalization of numpy slicing. Fix some data, leave the rest available to select in a subquery. The isomorphism becomes especially clear when you're working with sparse arrays instead of dense arrays. I suspect this is how Dex thinks about things, but I haven't given it a close read yet.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

animist posted:

But instead of an opaque query optimizer, you are the query optimizer.

really, the developer is always the query optimizer, it’s just that it went from being a puzzle over “storage model + index behaviour” to one over “storage model + index behaviour + black box that twists your words”. I wouldn’t say I miss the old days of trivial query planners, but I’ve seen a lot of developers with EXPLAIN carved into their forearms too. (for extra fun stick an ORM in the way too!)

great post, btw. I just wanted to snarl at sql for a bit

animist
Aug 28, 2018

Subjunctive posted:

really, the developer is always the query optimizer, it’s just that it went from being a puzzle over “storage model + index behaviour” to one over “storage model + index behaviour + black box that twists your words”. I wouldn’t say I miss the old days of trivial query planners, but I’ve seen a lot of developers with EXPLAIN carved into their forearms too. (for extra fun stick an ORM in the way too!)

great post, btw. I just wanted to snarl at sql for a bit

the other key benefit of these new languages is that they aren't saddled with sql's syntax lol

M31
Jun 12, 2012
is there any reason why it's not possible to just send an execution plan instead of a query?

Shaggar
Apr 26, 2006
you guys must be doing some heinous poo poo to encounter serious problems with the query optimizer

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
a friend once joined a company which relied entirely upon an in-house "application framework" their lead programmer- a 19-year-old wünderkind- had designed. it was a 20,000 line php script that started by selecting * from every table in the database joined together. the rest was mostly nested for loops. management raved about the speed with which the golden child could build new reports, but after some probing admitted quietly that they'd needed to staff up considerably to keep pace with bugfixes and "optimization"

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
alternately, https://twitter.com/garybernhardt/status/600783770925420546

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
500k, more like 5 million

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
well it is a 5 year old tweet

Kazinsal
Dec 13, 2011
and conveniently you can fit more poo poo in $10k worth of ram in 2021 than you could in $10k worth of ram in 2015

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

pokeyman posted:

well it is a 5 year old tweet

still true

animist
Aug 28, 2018
has anybody started a cryptocurrency that needs lots of ram yet

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

animist posted:

has anybody started a cryptocurrency that needs lots of ram yet

yes, I don't remember which ones but early in the days of bitcoin gpu mining, people didn't like that big gpus were the ticket to "riches" and some tried to fight it by creating new coins with alternate proof of work algorithms designed to require more ram than consumer gpus had

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

there's also some cryptobutt systems where you dedicate a large amount of storage space to it, which proves you are invested in the coin somehow

VikingofRock
Aug 24, 2008




Wasn't there some attempt to use protein folding as proof of work or something? That at least would be putting the insane computing resources to good use.

Vanadium
Jan 8, 2005

BobHoward posted:

yes, I don't remember which ones but early in the days of bitcoin gpu mining, people didn't like that big gpus were the ticket to "riches" and some tried to fight it by creating new coins with alternate proof of work algorithms designed to require more ram than consumer gpus had

Litecoin comes to mind, which apparently uses scrypt, but I have no idea what the current favorites are.

darthbob88
Oct 13, 2011

YOSPOS

VikingofRock posted:

Wasn't there some attempt to use protein folding as proof of work or something? That at least would be putting the insane computing resources to good use.

Apparently there are two, Folding@Home's Curecoin, and BOINC's Gridcoin. They don't sound like a bad idea, but obviously they have problems with adoption compared to other cryptocurrency.

Athas
Aug 6, 2007

fuck that joker
There is also Filecoin, which uses some arcane "proof of storage" to create a decentralised storage system (think paying someone to host stuff on IPFS). I really like the idea behind it, but I haven't scratched the surface too much.

Kazinsal
Dec 13, 2011

Athas posted:

There is also Filecoin, which uses some arcane "proof of storage" to create a decentralised storage system (think paying someone to host stuff on IPFS). I really like the idea behind it, but I haven't scratched the surface too much.

except nobody with a functioning brain wants to be part of a distributed file system whose primary users are the kind of people buying and selling things with cryptocurrencies

that's how you gets feds showing up at your door with warrants for your computers and coming back with one for you a week later

mystes
May 31, 2006

Proof of work is bad, so it's cool that we can move on to new systems like proof of making hard drive prices go up, proof of destroying life saving medicine, and proof of clubbing seals.

Kazinsal
Dec 13, 2011
one day we'll move onto proof-of-dead-pedophiles and in the process the market for cryptoshit will collapse

Athas
Aug 6, 2007

fuck that joker

Kazinsal posted:

except nobody with a functioning brain wants to be part of a distributed file system whose primary users are the kind of people buying and selling things with cryptocurrencies

that's how you gets feds showing up at your door with warrants for your computers and coming back with one for you a week later

How does that work for the various cloud hosting services when someone uploads child porn?

Actually, what happens with the Bitcoin blockchain itself when people put illegal stuff there? Has it been a problem?

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Athas posted:

How does that work for the various cloud hosting services when someone uploads child porn?

Actually, what happens with the Bitcoin blockchain itself when people put illegal stuff there? Has it been a problem?

what do you mean by a problem? there’s child pornography on the buttcoin blockchain yes, and it ain’t going away

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Athas posted:

How does that work for the various cloud hosting services when someone uploads child porn?

fbi makes a phone call to amazon, amazon tells fbi all the personal details of whoever uploaded the cp, makes a backup as evidence, then 2 microseconds later deletes the data and bans the user for tos violation. fbi arrests the person who uploaded the cp.

minidracula
Dec 22, 2007

boo woo boo
About three weeks ago I discovered the existence of Hot Soup Processor and now I can't look away...

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

https://lists.llvm.org/pipermail/llvm-dev/2021-June/151199.html posted:

This implies that pointer-to-int casts (and other exposures) are semantically significant events in the program. They don’t have side effects in the normal sense, but they must be treated by the compiler just like things that do have side effects: e.g. unless I’m missing something in the TR, eliminating a completely unused pointer-to-int cast may make later code UB.

i get why pointer provenance is important and useful but i really hate it

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
it's okay, c hates you right back

bobbilljim
May 29, 2013

this christmas feels like the very first christmas to me
:shittydog::shittydog::shittydog:
convinced at this point that using automapper creates much more work than just doing everything manually

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

bobbilljim posted:

convinced at this point that using automapper creates much more work than just doing everything manually

yep

wanna map 100 PascalCase class properties to 100 snake_cased persistence fields anyway for a laugh? we had a tool for that, it was called FIND/REPLACE

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

also if it's 2021 and your entities still have parameterless constructors and when you add a new field the compiler doesn't point out to you all the places where you need to populate it, then lol && lmao

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.

bobbilljim posted:

convinced at this point that using automapper creates much more work than just doing everything manually
bah hmpf! instead of TEDIOUSLY writing that one-time 100-line mapping function it is much more convenient to use automapper, use its easy fluent syntax and poor documentation to create a 98-line mapping *configuration* instead

which will break every now and again, requiring someone to relearn automapper

NihilCredo posted:

wanna map 100 PascalCase class properties to 100 snake_cased persistence fields anyway for a laugh? we had a tool for that, it was called FIND/REPLACE
#[serde(rename_all = "snake_case")] bitchez

Sagacity
May 2, 2003
Hopefully my epitaph will be funnier than my custom title.
quote != edit

Xarn
Jun 26, 2015

Plorkyeran posted:

i get why pointer provenance is important and useful but i really hate it

nobody actually likes it

toiletbrush
May 17, 2010

Sagacity posted:

bah hmpf! instead of TEDIOUSLY writing that one-time 100-line mapping function it is much more convenient to use automapper, use its easy fluent syntax and poor documentation to create a 98-line mapping *configuration* instead

which will break every now and again, requiring someone to relearn automapper

#[serde(rename_all = "snake_case")] bitchez
it might take just as many lines and be totally undiscoverable but automapper makes your mappings ~*declarative*~ :smuggo:

Adbot
ADBOT LOVES YOU

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
intel is completely dropping avx-512 support from its next line of desktop/mobile processors (alder lake). the p-cores are the same design as their new server cores (sapphire rapids), so they do actually have avx-512 silicon on core, but it’s going to be permanently fused off, either because they don’t want to include avx-512 on the e-cores or because they want better yields on the p-cores or both. so they’re throwing out the “well, at least it’ll be the isa everywhere” idea, and it’ll probably kill off avx-512 in non-specialized hardware

i of course don’t give a poo poo because x86 is haram

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply