Kartik Agaram
Nick Smith
01/16/2021, 7:13 AMStefan
01/16/2021, 12:35 PMRay Imber
01/16/2021, 8:40 PMWhat does the UX for programming look like if you also have to specify where computations happen?I love this question. I think this was one of that drove the creation of the Unison Language iirc.
Ray Imber
01/16/2021, 8:53 PMshalabh
01/17/2021, 2:50 AMPerhaps all programming is distributed programming?Yes, yes, yes! Its just that we have established models and tools to create a "single computer" abstraction out of certain kinds of smaller computers, e.g. the "PC" bundle. One way I look at this is to see a bundle as having observable, consistent states and "inner bundles". Consider this statement in a C like language:
i = j + 1
This "C-system" (language + runtime) executes the above statement - you have values for i and j, then after the step, you have a new value for i. To simplify you have the "state before" and "state after". But if we look at the same system as a collection of "inner-systems", the transition consists of various nested states such as moving bits from memory to a register, an operation on the register, then moving it back to anther place in memory. Now the question is: if the first MOV has happened, but addition has not, what is the state in terms of the C-computer? It's not inconsistent, maybe it's in transition? Certainly it is on its way to being consistent and visible in outer system. We can go deeper than MOV - a register isn't a single physical array of memory in the CPU (neither is a "location in memory") - theres caches and other kinds of inner-systems all the way. One observable transition in the outer system contains many transitions in the inner systems.
What does the UX for programming look like if you also have to specify where computations happen?This has been on my mind too and I think for certain parts of programs, we specifically don't want to specify where the computation happens. This is what I sometimes call topology independent programs. Note that location presumes a addressing space. Above, in the C-system, there is no location (the C-system is whole world) and when we zoom into it, we see locations such as cpu, ram, AX, BX or whatever. The compiler made that mapping for us - it organized the inner systems to appear as if its one outer system. (But we could have too, and there are many alternative locations and ways to map that would have all worked out just fine). However if we zoom out from the C-system to a distributed database (or whatever it is part of), the single C-system is now one location in a larger address space, but the database-system will have location independent concepts like a table. I think to specify where computation happens, we need to build this idea of mapping the outer-system meaning to the inner-system meaning and distinct address spaces. To do this in a general way would mean we can always scale out to the next level using the same mapping ideas as we did at the previous step out.
Garth Goldwater
01/17/2021, 3:35 AMKonrad Hinsen
01/17/2021, 9:03 AMKartik Agaram
Konrad Hinsen
01/18/2021, 8:01 AMJack Rusher
01/18/2021, 2:25 PMNaveen Michaud-Agrawal
01/18/2021, 4:21 PMNaveen Michaud-Agrawal
01/18/2021, 4:27 PMNaveen Michaud-Agrawal
01/18/2021, 4:28 PMNaveen Michaud-Agrawal
01/18/2021, 4:29 PMKartik Agaram
Naveen Michaud-Agrawal
01/18/2021, 4:32 PMNaveen Michaud-Agrawal
01/18/2021, 4:32 PMNaveen Michaud-Agrawal
01/18/2021, 4:37 PMKartik Agaram
Konrad Hinsen
01/19/2021, 10:04 AMNaveen Michaud-Agrawal
01/19/2021, 6:07 PMScott Anderson
01/19/2021, 6:30 PMScott Anderson
01/19/2021, 6:37 PMScott Anderson
01/19/2021, 6:38 PMRay Imber
01/19/2021, 10:16 PMI don't know of any consumer hardware that will continue to run if say, its GPU just diesI have a direct counter example: I have two GPU's in my laptop, the one bundled with my CPU, and an "external" Nvidia card. The Nvidia card regularly has driver failures and my laptop falls back to the on die graphics card. This is almost seamless, and very much a distributed system. OS kernels handle these kind of driver failures all the time, and they are conceptually very similar to a distributed database that experiences a network partition. Some more extreme examples are Plan9 "everything is a file" and EMACS TRAMP. Both are examples of abstractions that cross both file system and network boundaries with similar semantics and error cases. referring back to my earlier story about my National Science Foundation work, there was one group of grad students working on GPU's, and another group working on distributed graph algorithms on AWS. We were part of the same umbrella project, and regularly exchanged ideas about how to solve problems. The constraints and failure cases are not wildly different at all imo.
Scott Anderson
01/19/2021, 10:27 PMScott Anderson
01/19/2021, 10:33 PMScott Anderson
01/19/2021, 10:39 PMScott Anderson
01/19/2021, 10:52 PMScott Anderson
01/19/2021, 10:59 PMRay Imber
01/19/2021, 11:02 PMI don't believe it is particularly useful to equate heterogeneous computing with distributed computing and use the same abstractionsUsing the same abstraction does not mean requiring the same constraints. And continuing with graphics as an example, things like feature flags for OpenGL are used all the time to provide different feature sets depending on hardware capability. Similarly, Erlang and most actor models have ways to query the available resources for a particular process. Smalltalk has this as well.
In some casesย (most of the interesting ones) a discrete GPU failing and falling back to an embedded GPU is effectively a not working computer.It is a matter of opinion about what is interesting... The fact that I can still use my laptop if one of the GPU's fails seems pretty damn useful to me personally, even if the experience is degraded. In the network case, variable bitrate video is also extremely interesting. If my network is suddenly over saturated or degraded, I used to not be able to play a video on Youtube at all, or my video call would be disconnected. With variable bitrate streaming, the quality is simply lowered.... Same abstraction, that has built in semantics for heterogenous capabilities (dynamically changing capability btw)
Scott Anderson
01/19/2021, 11:19 PMRay Imber
01/19/2021, 11:38 PMMaybe the idea is it could make it easier for driver and kernel developers to implement local failsafe?This is exactly what things like micro-kernels and Docker do. IPC is a form of distributed abstraction.
Ray Imber
01/19/2021, 11:45 PMI'm not sure how a distributed systems approach in a user land application programming language fixes that?The point of exposing these to the user application level is that the application can have a say in how the failure is handled. Cyberpunk 2077 maybe can't run if the GPU fails, but Microsoft Word still can. You want to allow both options.
Scott Anderson
01/19/2021, 11:47 PMRay Imber
01/19/2021, 11:48 PMRay Imber
01/19/2021, 11:49 PMI'm focused on GPUs because I'm a graphics programmerI'm a database programmer, so this is fun to compare perspectives ๐
Ray Imber
01/19/2021, 11:57 PMI guess I'm stuck on... What do we get if we treat a local machine like a distributed system?
Maybe the issue is this all handled at OS level, should be to implement the OS in a different way rather than try to abstract over all OS APIs?Microkernels are the best practical example I can think of that try to do exactly this: http://www.microkernel.info It's more about security and reliability. It does have a performance cost. (Which I'm sure sounds like pure pain to a GPU programmer lol)
Ray Imber
01/19/2021, 11:59 PMKartik Agaram
Ray Imber
01/20/2021, 12:07 AMIt might be an interesting exercise to ask how we might bootstrap a computer from a single tiny bit of RAM, either by building hardcoded circuits or requiring an upstream device to initialize them.This sounds like the idea of a microkernel taken to the level of firmware / BIOS / UEFI. Sounds like an awesome research project to explore ๐คฉ
Ray Imber
01/20/2021, 12:17 AMRay Imber
01/20/2021, 12:26 AM"Another example: all the Parc personal computers of various kinds were microcoded, and in the latter 70s you could sit down to any of them to e.g. run Smalltalk, whose image would be sent from a server, and the machine type would select the special microcode for the Smalltalk VM on that machine."I remember talking to @Kartik Agaram about this exact quote a while ago. The closest modern equivalent we have is probably FPGAs.
Scott Anderson
01/20/2021, 1:54 AM