Rethinking the World Computer Paradigm with Array Programming Languages | 25th May | Via Zoom
Ethereum Malaysia·Mon, Oct 9, 2023, 12:00 AM
Distributed computing could be said to consist of two major parts: computing and communication. Juuso's research on implicit parallelization of array programming languages attempts to combine the two. The goal of the research is a similar system to Ethereum's smart contracts: the developer merely pushes the code onto a distributed infrastructure, and the particularities of how the task is executed are abstracted away.
Transcript
becomes yep over to you hey welcome everyone uh thank you for coming to this session so um this session will be about rethinking Eagle computer and then with array program language um we are very happy to have uh do so come here and give a talk about this so I'm not gonna say any more things so without further Ado um as well come and do so right um Let me show the screen cool you all see it yep clear right so uh yeah hello everyone and today I'm going to present some of my work in in research at the University of Oxford and I guess this talk is a little bit more it's more like holistic view of my reasons and where I want to go with it the actual things that I reset here are more particular the array programming languages but back there on the background there's like a bigger idea about how new programming languages could be created and what some features that I would personally want to see in those programming languages are so uh I usually like to start the talk with the just talking about what and why I'm doing this so rather than hiding the information somewhere down down further further into the presentation I rather give it right at the start so my general View and maybe the overarching theme that I want to insist today is that I think that programming has this disconnect between communication and compute or computing in the sense that um when when I then study some or sometimes I also tell that I study implicit parallelization so what this actually is it's made of two components first one is compute and nowadays it's many times the question about how we can use multi-core systems efficiently so some ways to uh approach that or type systems parallel programming CPUs and array programming languages and I want to like think these as a tools really to address this uh challenge of computation on our current Day Hardware but then as I started to study more about the compute problem I started to realize that there's maybe even a bigger challenge here which is that about the communication so the communication would be then how you know distributed network are the nodes connected to each other and how we can query this information and the capabilities and something that I constrained as we will later see so some ways to model these networks is then like systems theory and some category Theory can be mixed up in there and then more particularly I've been working on a lot with NYX OS which uh I will present some ideas that NYX always has in in our in compared to like other our Linux operating systems and why it's useful and then finally the SMP is always also in decorate do this but it uses information from NYX OS to really do the distribution for us so the question here is really about scheduling and for me when I'm talking about compute and array programming languages what we are really doing is that we are scheduling array operations uh to a distributed Network and uh the ethereum is more like a this is the stuff that you know but the thing that I'm very interested in each room is this idea of an abstracted programming Paradigm so when you write smart contracts one of the very nice ideas and some some very novel idea I think that ethereum really brought forward is this concept that the developers us writes their code but they don't have to care about where it runs so the infrastructure is abstracted from them so that so that uh you don't really know which computer runs this of the uh your smart contract and you don't really have to care either you just push it to the code and it runs somewhere and very nice thing is that in ethereum they not only get this uh infrastructure abstraction but also some guarantees about the proper execution of the smart contract and what I've been then researching is that how could this be incorporated into a general purpose language and this now connects to the maybe what in each room was initially the idea of of our the world computer but it was kind of like tossed away and they focused more on Smart contracts instead and the way I've kind of like run into this programming language stuff is quite complex or uh convoluted let's say is that I started from telecommunications and then the problems that I I I ran into when doing telecommunications pushed me to programming languages you might sometimes also hear this if you've been listening to maybe I think Solana Founders were also coming from Telecom so this is not completely completely uh one of exception that I somehow started in telecommunications and ran into each room and distributed networks and programming languages and the connect here is that if you think about it this 5G mobile networks and what we call Beyond so talking about six uh six generation cellular networks are similar to ethereum in the sense that Buffs are distributed and both their vision of the world computer which is this a network of composable computing so in in 5G it's called Edge computing and the idea is basically that these smaller handheld devices to computation on other devices and one example of this is huawei's so-called DaVinci project and here what Huawei is trying to do is having like if I have a phone and you have a phone then my phone could somehow alone the computation power from your device to achieve some capabilities another example could be these AR classes so you might know that uh or the concept of that you have some some very lightweight hardware and then it uses the computation through this cellular link so it goes through the Telecom Mast or the base station and the servers are on that base station so it's a way also for Telecom operators and companies like Huawei which actually produce the base stations which you use to connect to devices and doing the phone to have this integrated a computation of loading Paradigm so the kind of like another way to say is that if you think about well phones from Apple and others I think what the Huawei is like uh Point here was that well they don't even have to compete and they maybe cannot compete with Apple's Hardware but because Huawei also does the base stations they can compete with these features that they can Source from the network to give capabilities and functionality to the end user devices that are not just possible on on like uh Hardware or like a phones that are created by a single company which does not control also the cellular network and uh yeah one of one of the kind of like interesting thing here is that huawei's size of This Global Network is quite big whereas with ethereum you have the same idea on a on an abstract sense that you have the storage and compute which come from the validators or the node Runners to which you pay in the form of transaction fees and the network is much smaller because if or if you look at the internets you see that there's like 7.5 000 execution layer nodes in the world and that's not quite much so I I think in general I I think the this concept of going towards uh offloaded Computing is quite prevalent in nowadays computer networks and then I like to talk about what's the next big score in programming languages maybe you read the Big Score book it's very nice you should probably check it out but basically it talks about the uh these ideas which seem quite prevalent uh going forward so my take on this is that in the context of programming languages the next step is a programming language which can kind of like facilitate the creation of this new kind of app store for general purpose computing and if you want to put your in a fall hat on top of your head and think about maybe the reasons why Huawei might have been banned in the US is probably a bit connected into the App Store ideology in the sense that if you think about U.S companies well they have apple which has the app store and then they have Google which has the Google Play Store so in some sense the US can kind of like control nowadays that what goes into your phone but with 5G and this kind of like Global latency Computing there Comes This Paradigm assist in which the control moves from the hardware producers more to the people or the company which controls the network or this is at least kind of like this thread model that can exist and I also like looked into this and started this uh before getting into programming languages and in general you can think that there's two main challenges in this uh computation of floating Paradigm which I've marked here as one and two so the first is that if I have a phone and you have a phone then if you are going to do some computation for me you probably want to answer that whatever I run on your phone doesn't hack your device or your bigger server so this is the point one and uh there's some ways to address this and usually I think there's the column network is one example in ethereum which tries to which which has attempt at this notion of the general purpose Computing on top of e3 and they're the idea of a sandboxing so you'll take something like a Docker container and then you run the software inside of this sound box to ensure that some that basically you you couldn't add the device or something like that but then there's also another properties that are quite relevant such that um whether the program that I give to you ever terminates so this very very foundational problem in computer science of the whole thing problem is also kind of like uh relevant here because in general when you have some program that your device runs you cannot know beforehand whether it will ever end and that's this is one of the guarantees that in this Edge Computing computation of floating Paradigm you should have and another thing is then the um The Challenge on me now that now if I provided these guarantees for you that it's fine to take programs from from me and execute them then what up what about that if I cannot know or if I kind of do the computation like what is one plus one how can I guarantee that when you give me the response you just don't give me a zero Because by the basis of the fact that I'm asking you to do some competition for it for me it implies that I for some reason cannot do it and this is like prevalent in the you could think about the uh AR classes now the augmented reality classes that if they want to do some computation and now you just return me like zero values then the uh the this very lightweight Hardware constraint devices cannot really verify whether that competition was done properly or not and here is kind of like this is usually where some like Golem Network and most of these uh current approaches break up or kind of like they they kind of like a are unable to solve this second problem with this then ensuring that the computation is indeed right and I don't really have better uh better solution to this than game theoretical guarantees but then thinking from the point of view of a programming language what this means is that if you would want to somehow be able to address both the first and the second point the programming language should have distribution built into it or this concept of program slicing so somehow I should be able to take my program and then me personally be able to slice it into smaller pieces for the distribution of using multiple devices but on the other hand if you can do the distribution then it also implies that you could maybe overlap the results a little bit to see if uh if the if like most of the nodes which does the computation for me agree on the results then maybe it's a good enough model the trust and then I ran into this array programming languages to address this biggest these languages are constrained very foundationally because the only data type that is allowed is this rank polymorphic array and it makes reasoning about programs and things like termination much easier because the recursion and the for Loops are actually in the they're structural so it means that it's something it's bounded by the data type so by Banning the user to write their own for Loops or if all else or like uh any source of randomness you can actually prove that certain array programs terminate so you can kind of like a have these guarantees that you want but it's not solving the halting problem it's kind of like uh going around it and finding finding ways to make the language so constrained that this static properties and information can be inferred from from the uh users program but then but then this also connects to this bigger idea that uh whether I want to really go towards to is that instead of the program and describing how to execute some program the infrastructure works as this lens which chooses the nodes and ways to slice the program for you so this also is very relevant that if you now have different devices and you have to figure out which one you want to do the competition on somehow the infrastructure should be making the decisions for you otherwise it's kind of like you should it's not much out from current cloud computing paradigm and I want to kind of like to solve this uh how I got here through some projects which I've done before to really like insist on the fact that I I like suddenly didn't just there was some some uh red thread or how they what's this um are they say it in English but basically I says that I did these different demos and eventually ran into this problem of with a stem started to solve with array programming languages static semantics smt solvers so I I I want to show you a few demos which might help you to understand where I'm coming from and yeah this first one is this uh vacuum cleaner thingy and this was quite long ago but here down below you can see the vacuum cleaner and what it will do for me is that it will use this server or my desktop PC to do leg detection for me so let me just show you the video and the point is that here you can see my lips as I move in the room and the vacuum cleaner is following me but the computation to really figure out uh or the computation really happens on the PC the vacuum cleaner is just a dump device which is loading the compute power from the PC I don't know maybe maybe there was a pass-through of the uh of the uh voice here from the video but basically at the end I could ask the vacuum cleaner where I was going or where I was in the room and the vacuum cleaner would use the computation from the PC to do the computation so that was the concept of computer flooring that was what I started with the computation part but then the next thing was this augmented reality tablet which I created as a custom Hardware so so here I now I created this a tablet like an augmented reality tablet through which you can look things by pointing it to different iot devices so when I was pointing at that particular wall the device would show me controls for lights and now that I point the TV I can stop the uh kind of like the seeking of the video and then I put my lights off switch on the other wall so this would use kind of like again information collected before to actually features that um were not previously possible and yeah that was that but the point here was that I very uh early now solve that the problem here is really about communication it's not only that whether you can compute whether the whether you're a vacuum cleaner can kind of like offload the computation to some other device the next step is then be able to somehow communicate with these iot devices now the address at which the lights are the iot lights or or wealthy Apple TV is to control it and it's kind of like connects now into the 5G thing which I did did next so I moved this this thing into the 5G Network because in a 5G Network when your phone has an internet connection it implies that the base station knows where your device is like physically but also its IP address so 5G networks were kind of like an isps like internet service service providers in general have information about the infrastructure because they know the addresses of these devices so in a 5G Network you could in a very very uh kind of like a subtle way integrate the compute and communication onto a single distributed Network and then as I was kind of like then figuring out that oh how do I create an app store on top of this then I kind of like got into the array programming languages because of this the issues One and Two from this slide so that then drew me into array programming languages and then I did something called Static semantics of APL which is about the formal proofs part of the first problem though so that's how I then started to go deeper into programming language Theory and then that wasn't just quite enough for me I also took smt solvers to do scheduling for me so now that I could verify that my programs are correct then the second problem is then to use the infrastructure somehow to select the nodes on which the computation is actually happening on my solution to this was mixed OS and Nyx OS basically it kind of like works as a telecom service in the sense that you don't have to be an ISP because NYX OS is able to integrate the compute and communication into a single infrastructure so NYX always can tell you where your device is in a programmatic manner and now combining all of this this uh this stuff together we can get into the idea of a smart language which would be the implicit parallelization of this array operations or big one operations that use smt solvers that integrate with big service infrastructure so very long way to really explain how I got here and a nice way or something that I want to kind of like you to think about this this concept of a lens so lens is a view into a data structure like at least this is how it's usually uh described in categories Theory but you can also think about the lens as a way to look at your infrastructure and do the node selection for you and it will be an essential notion going forward in these slides because it works as this driving force to model this distributed networks for us and yeah so then if you want to get more theoretical it represent this by by directional stateful computation which is able to not only view data or have a partial view but also write to it so in Excel as you could say that creating an OS image is this identity Arrow or it could be it's it's not really an identity Arrow but the idea is that uh basically when you compose something with an X OS it gives you also the all the required information to recreate the operating system from the start so in some sense you are able to go back in the state to recreate your operating system and this is actually the thing which now makes possible to create this composable networks with mix OS and in biku and you also have a lens with a uh representatives in this operation of under or a donut so uh yeah I have one example in Bitcoin which uses this donut thingy I don't want to go too much into this but the idea is that in in a lens you can take some representation of data and kind of like reform it in a way that you want uh to be the output so here you big one is right from right to left so so this is the shape or the kind of like date the data format you want and this is the date that you actually have and this under operation or this lens what it actually does is that it figures magically the way to represent the underlying data structure in a new format and that can be a little bit hard to understand or maybe grasp the idea from that operation alone so now I'm going to bring that tomorrow into the next OS part of it so basically next source is a way to combine the Computing and communication in a single package so if you compare it to something like Docker you could say that Docker only provides Computing for you or something like a kubernetes it only does the compute for you but it doesn't really handle the network in between those kubernetes nodes and that's in retrospect to something like tail scale and Tails can only provides communication but it doesn't provide the community or compute or Computing on those nodes so you kind of like have this awkward uh situation in which to do to have a distributed infrastructure you kind of like have to take these two parts and make them work together instead of it being a single thing so in this sense the Nix OS makes the Linux configuration into Legos we have this concept of labs Flags so Flex is just an interface to compose these different mix OS configurations together and what an X os does is that it it allows you to compute a fixed point of multiple Nexus servers on evaluation as a single infrastructure so this is a way you can like take multiple server configurations but when you are Computing the Nyx OS declaration which defines the whole operating system you can already at that point integrate the parameters from one computer to the another and one way to like solve this is that I can I can ask that how and what software is running on my Linux operating system so this command here uh gives us a graph of all of the software installed on the next OS uh server with or the image of some uh nodes that we have and the point is that uh basically this is useful in the sense that if I would have my device and you have your device this way I could check whether you have the uh required software to even run my program and where this means each room is then this project called homesteaker OS which is actually a project of my company to manage e-trim nodes and there's a website for it but then also uh we have the whole our own validator infrastructure as an exos configuration available publicly and we also receive initial funding from Israel Foundation to try this theme forward but what this really does is that this now ties us back to the 5G networks and figuring out what's the address of our device so we can run this command here and it will give us the address on which the lighthouse endpoint is in our VPN network but the thing to know this year is that I just ran this on my developer machine and my developer machine is not part of my validator cluster in the sense that I don't do validations on my laptop but I can still query information from this NYX OS declaration so it allows this Dynamic environments to build uh on different devices and various toolings on top of it so if we now think about the lens again what really happens is that my laptop is using a lens provided by NYX OS to look or have a view into the infrastructure from which I extract information and integrate tools on top of so in in excellence you can also have something like rear end which means that when you actually go to the folder of your project you are giving a Project Specific lens into your infrastructure so this provides us the necessary uh computable or programmatic tooling to query our distributed infrastructure and the nodes in it and this is going to be done automatically and on Project basis so actually you can even run this command given that you have Nix uh installed and you will get the same result but you don't have the same lens as I do into the infrastructure because you can you will only have the read-only access whereas whereas I will actually have the uh kind of like this access controls to really reach to this service but another thing that is very fancy is that we can use this to query information like what's the current Block in in Israel right now and I can run it like this and then I I will get a long engineer which is like cropped here but the basic idea is that this allows tooling to be created on top of this lens which provide useful tools for me without really relying on any third party like uh service provider to fetch the information so so this is like a quality of life Improvement for developers but but on the other hand what it what this is really doing is that this is solving the networking the communication part of a distributed computation infrastructure on top of which we could create the programming languages on top of so that's why I find this find it interesting is that when the complete server configurations can be public like we have in GitHub anyone can go see it and we are encrypting parts of the VPN configuration so you cannot really see what's going on or you cannot connect like anyone says cannot use our service but what it does is that it also helps others to replicate our distributed infrastructures so it's like a next step into the uh kind of like the transparency of distributed networks in the sense that now if you think about each room you don't really know how different people are configuring their infrastructures but this allows someone to take our configuration and recreate for them and then the interesting part then it comes that you could also if you think about this like there's not that much in between to actually start integrating different networks together by doing like uh if you have one network and I have one network we could use this same concept of a lens to give a partial information of our infrastructure and share our resources this way so it not only preaches the gap between the third party service providers but it also give us these uh new ways to model our Networks and yeah the lens the lens concept is very strong here because we can represent partial information which is enforced by Access Control layers to share our infrastructure our disability infrastructure running at our home or maybe some cloud computing service between each other and then something that is kind of like interesting is that it goes back to these constraints so Access Control layer is one way of one form of constraint and then we can see that these constraints now start to integrate with something called SMD solvers so if you think about smt is always smt solicitor or AI but AR is modern machine learning nowadays everyone is talking about chatty PP and that's only machine learning part of the AI but you could think about combining conscious range as a way to also uh inhibit artificial intelligence in the form of emergent properties so before we had the vacuum cleaner you could tell the vacuum cleaner that in order to function it has to charge so that's a constraint that the device has but then this could also be the optimization part of this problem so the vacuum cleaner could be told that the the objective is to collect as much dust as possible and this could be like arbitrary uh objective that you give to the vacuum cleaner but the point is that once you kind of like pile onto these constraints of different systems you can start to see maybe like a an observer might think that this is an intelligent form of uh thinking because now the robot vacuum cleaner might tell you it might decline your request to clean your room because it has to charge but on the other hand it might also prioritize some other room to clean before it comes to your room to clean it up and another example is from this paper I wrote a couple of years ago called software defined networking enhanced resource orchestration of containerized applications for industrial internet of things but here the constraints the idea I was saying we were using SMD solvers to take constraints of servers like Ram disk space a network bandwidth to do an optimization the load balancing amongst multiple nodes together and now you can maybe start seeing how this will connect to programming language and array uh programming languages and yeah that's what I'm then doing I call this my project called really uh calling it and that the world computer language is kind of a hyperbolic but anyway it's like a GPU only rust-based Vulcan scheduler it's also open source and I want to integrate it with Bitcoin later on but the thing is that now I can use this program to get the capabilities of my laptop and the constraints when within it so it could be something like how much memory do I have on the computer what are my sim sizes things like this so it's just getting like if you think about the network now to think about what kind of constraints could you model of these nodes to do the node selection for us so the uh this review project is really like combining constraints from Google account and given some a model of an array operation like a sum reduction where you can get difference we can get Dynamic schedules so yeah and then I just want to note that like the capabilities to which this this approach can be used to perform array operations speed a bit hazy right now but the idea is that if we would have something like this big one operation which is taking 4096 numbers and it it puts a one into each one so it gets a big array and then it gives us a result which is actually this thing but what what we can also do is then oops the next part which is uh no no I'm getting bit easier but the point is that now you could also take these models of array operations given here in an smt solver so we can give it an objective that if if we have four cores which is the information that we got from here so it told us that we have four queues which are like cores on the GPU and then we have these same sizes and this memory uh available then we can actually think about we can add the smt solver that how should this computation be distributed amongst the individual course of the computer and then given that we have one ten thousand elements uh one one result would be this one so it tells that on the first core you do nothing on the second you do this and on the third you do that and on the photo you do that and it gives us like this uh results in between and basically tells us that how many steps do we have to run in order to get the final result so this is now taking on an individual computer basis the idea of constraints to do a static schedule for us so uh you can see that how this now given the next hours part I don't have a demo of that yet I actually couldn't get it to run for certain certain reasons on my uh GPU laptop but then the point is that with the next OS you can now create a lens which can expose the physical constraints of ease of the devices for the end user laptop like mine so that I will know where can I find a computer which can do the computation for me but also how and how I could slice the program into smaller parts given the physical constraints and capabilities of each device um yeah and I I think that almost comes a bit to the end end of my talk in the sense that what I what I really want to have like a takeaway is here is that uh given this way to do computation with an array programming language which is then distributed with an smt solver uh and given this next door space lens to abstract the infrastructure we can like create or start thinking about new kinds of uh programming languages with state which are taking an inspiration from Israel and its World computer idea about doing computation in a dynamic and a smart way between different uh distributed infrastructures and something that I kind of like want to really note here is that when you're thinking about these distributed net groups then then the communication part is arguably the more important part than Computing nowadays because once you take once you think about like uh like many investing learning models for example requires one specific GPU to run so you might have like a very fancy uh AI mode like a machine learning model but then you require a certain Hardware to do it and the reason why it's kind of like built like that is that I feel like so many languages nowadays only focus on Computing paths and when you kind of like assume that there is no communication between multiple nodes and no easy way to do it what you will end up doing is doing competition on a single computer rather than spreading it out to a network and somehow magically getting the answer from Summoner in the end and so I think that going forward these new languages should integrate communication and compute together and what I kind of like was presenting today is a single approach to do it and my tools for the next OS and the smt installer to do it first look at the lens knowing what's the address of each of the nodes where the computers are but also to get the kind of like the communication link to each of those computers to fetch the constraints which will be used by the smt solver to figure out how should we compute something so uh it's not only a question about what we want to compute you shouldn't only think about like your arrays and your your single algorithm and how it's created but also the way kind of like how that computation could be divided into smaller parts and how you do the communication whether it be like in my uh GPU example with some reduction within a single computer or or single computer and amongst single cores of that GPU but also amongst on a higher level between separate computers and uh yeah so I I guess like one one knows here is also this uh I actually went to this talk yesterday and there was a team Bond sleeve was talking about Victory and some of his ideas around it and how we could build things on top of the current protocols to address the future problems but I really think that there still exists a lot of ways we could address the lower end of the stack not only thinking how we can build the stack upwards but also how we can address this very basic uh challenges in our existing protocols like DNS or like ipv4 and 6 in the sense that how we can how we can like programmatically use those uh existing protocols to query us information to facilitate the new parts on top so more like thinking about just what bricks to create on top we could also think that how we could what kind of tooling would be required on the lower stacks of current Internet protocols so that those new capabilities added onto the lower levels could be used to create let's say more elegant Solutions on top of the stack so this is like where mix always and these things are going it's not only about having the access to different computers but also like thinking about operating systems in a new way and the communication between these computers and yeah it seems like I still have some time so I have an extra slide because one thing that I I kind of like presented such this higher level architectural or systems approach into doing these programming languages but I didn't really talk too much about bigquen or smt solvers but on the other hand I think I would need a maybe I should come here some other time to tell more about those in more particular way but this nice slides about like tell like what what is what is really big when or what is APL or what are array programming languages then kind of like to figure out that what you can actually do this is kind of like the constraints in some sense to also thinking about what kind of computation can you actually even do given these tools because Bitcoin and APL were in a ranked polymorphic manner in which the rank it's scalar Vector Matrix cuboid and the polymorphism comes create kind of means like many forms of the rank so basically in Bitcoin and APL if you do one plus one two three four uh you get this result so here you can see how how this structural for Loop is constructed for the programmer so instead of going through its value and selling two at once with uh Bitcoin and APL take the structure of the array and kind of like figure out that well if you're doing a plus with a scalar added to a vector then maybe you just want to add a single number do its of the elements but this also works for higher Dimensions so here what I'm saying is that give me numbers going from zero to nine and then reshape it three by three so give me a matrix which says three rows and three columns and then add one two three to eight of the rows and then you get this answer so in this sense it's also like very constrained into what kind of computation can you represent in Array forms so that's kind of like but that's really no real good way to get around it in the in this sense that uh if we are talking about the the problems about the one and the first and the second Point around this uh proves and kind of like guarantees about my my arbitrary program not not around the smart contract but any kind of program that I want to run on your computer how you could know even though it's not written in a smart contract language how could you still extract some some constraints some proofs or properties of those programs in the a sense of termination and like type checking and yeah then there's the last example is that oh now you can compose like different things like false like some Opera like I'm just trying to like tell you that I feel like one major point in which Pro why this like array programs array programming languages and maybe this kind of a distributed approach in the programming languages has not really been used so far so yet is the fact that it requires a completely different mental model from the programmer to think about their problems in a more mathematical and more constrained way because you're not you're not getting the distribution completely for free you have to start thinking about your algorithms in in ways that those algorithms will be or those programs will be well defined and that is very very hard but it's also a human problem so it's a hard problem because people have accustomed to use uh languages like C and Java and things like this made long time ago and made for a single single core a single core computer but now since like 2000s or 2005 we started getting uh dual core CPUs and then we started to get gpus with more much much more course and you can now see that if you if you go to the store and buy an AMD processor who knows it might have 64 cores or whatever and the GPS probably have 5 000 cores or whatever so but the programming languages so far have not really taken that into account that they are not like if you if you think about it it's like uh when you're programming you see or even in Rust your program by default is single threaded or signal course and when you want to do computation multiple cores you have to explicitly call like parallel Loops or some concurrency Primitives to offload the computation on multiple cores but on the other hand the array programming languages which were invented in the 60s as well so APL which is uh which means a programming language it's not an array programming language it just means a programming language it was that of that they just the guy who invented it just decided to call it a programming language because there were so few of them at that point so these languages because they're so constraints are based on very uh like a fundamental and foundational mathematics and things that are well understood actually translate very well to current day uh Hardware properties and the way that we have constructed the multi-core machines but that's not really the all of it it's still that to really make it easier to use multiple multi-core computers and a network of modern computers you have to also have the constraints not on the language level but on the communication level and you have to have some programmatic way to extract those constraints from your infrastructure so that you can do this smart language idea of like intellicent load balancing on top of your network uh yeah I I guess I could stop there I I think you might maybe some people have more questions but uh that's that's about it thank you thank you very much so uh that's a very impactful talk to apl's program language and also uh how it can be used as a smart language for a distributed system thank you very much for those that do have questions you can put it in the chat or you can also unmute yourself I'm gonna start with a question so there's a previous slide that talks about um how the assembly smt solver can determine how to use the course based on the specs of the machine so from my knowledge right now um pro games something like games or programs uh game engines they use essentially they have certain algorithms that help the game engine itself determines how to distribute load on the GPU right how how does an smt solver do that like is it the same or um yeah I don't know enough about uh game engines whether they use an smt solver based approach or something more or or more I think many many times like even if you think about machine learning many times if you have multiple cores it's kind of like heuristic space so you might know that if you have two gpus and you want to split some data that is like like very parallel then it says then the program or the program literally just chunks it into two pieces without taking into account the physical capabilities of the uh of the computer and I I think there might be another reason why it's probably not SMD based solution is that uh there are some quirks about this which is first of all that you have to know how to write uh SMD Clauses or like constraints so if you look at this on on here you can see that this is in uh Essence language so I use something called several Row from uh which is developed in Saint Andrews University and you can see that even though it's using kind of like this white quite basic constraints telling that all you have have an input size somewhere and so forth the problem is that to create these models you have to know something about the computation beforehand so it might be kind of non-trivial to maybe do the offloading and that's one challenge of it but then there's also this thing right here and this is in seconds so these these things do not really at least seven row does not scale very well into short running computations because to find a solution any solution or let's say even an optimal solution it will take a lot of time so what is kind of like assumed is that if you use a GPU in a general purpose programming you will basically have some overhead anyway because you're probably blocking on that operation for multiple seconds or minutes or hours and only at that point that the accommodation takes more than like one second let's say that's more or less the cutoff point in which you should even take into the consideration of applying uh smt solvers to do the distribution for you but you can see that in some cases this might be acceptable if you have a device which by basis can it do the computation in itself but can do the constraint solvent for you so yeah so essentially for a program that you would like to run in this manner or like that a program a smart program that understands that the machine understands how to distribute you have to write essentially a smt solver program for that so that the machine knows from the program how to run the application nicely that is true that you have to have a in the reason why you need to do that is that now if my if I would plug in here like a AMD or Nvidia GPU the constraints these physical properties about how many cores you have and like what is the uh simply length so how many operations can you do or how many data points can you compute at the same time will evolve so that requires that you have to make it more Dynamic than a single uh kind of like concrete implementation it has to be a bit more abstract so that in the case that you have two gpus let's say which have different physical properties or two CPUs on different machines which have different core counts to make it so that you can you can balance it even when the physical properties are not the same even though they don't have the same amount of course requires the fact that there is a more abstract model of that computation in the form of a smt program yes got it thank you thanks she in the chat us is move the language related in any way to the a programming um I don't think so uh move with this with the smart contract language from Facebook do I recall it correctly or how how did it just go I I recall remembering something about it but no I would say that the current uh uh array programming languages one is at Google it's called text d e x and then there's um uh there's footwork and then there's uh one another from MIT and Adobe which I cannot really remember I can put like we had a talk Series last year in Oxford about the kind of like giving an overall view of everything that there is in in what what is They Don't Really call themselves array programming languages they call themselves tensor programming languages but the there's some connection which is that every every array programming language that is introduced now and even I I use dependent types to figure out some of these static properties that I give to them so to kind of like figure out these competition things and I think move uh it uses I think it uses more like if I remember correctly it does use a linear types which is a form of well you could think about dependencies in the sense of a linear like uh these uh type systems from that group of family but those are a bit more limited in the sense that you have rust and those are good more like separation logic to do the multi-core Computing rather than using an array programming based approach so I think the move is foundational if I remember correctly that it's based on separation logic like rust then it does the it uses the separation logic to do the multi-core computation but it's not exactly what's Happening Here thank you any more questions I have no question can I hey uh yeah Henry here I was really interested in hearing you say uh talk about this because uh coincidentally I actually did my Master's research in Oxford as well on decentralized optimization algorithms right uh about basically uh something like a atom solver but uh breaking up into smaller problems and then uh Distributing it over smaller Edge devices and then those devices are solving their own version of the small problem without knowing the context of the the bigger problems hence uh in that sense preserving privacy right and then only combine the result and um I I've got some questions in my head right like the first one is a bit more higher level which is uh huawei's DaVinci project right and I haven't managed to get too much information online but most of it seems to be talking about it as like an AI thing I'm just a bit uh cures as to why far away would use its base stations and its 5G Network to kind of like offload computation to users devices right like what's the what's the motivation behind that you know because people would be quite I imagine people be quite uh unhappy about their their phones being used to solve computational problems that are you know not something that they specifically requested to do right so I'm just curious what was what is the motivation behind that yeah yeah I think DaVinci project is a bit of terminology I think the new operating system from Huawei is the concrete implementation of the ideas pre-hunted DaVinci project there's a there's an article from the information from many years ago which uh kind of like describes it in a more better terms but the idea is that in in this huawei's uh reason I I don't think the idea was that like the individual end user devices would be uh necessarily trading the computation between different end user devices it was more about Huawei creating the required the software so that all the software will be running on the base station so you would plug in like the gpus and the servers very close proximity to the base so it would be then be like a edit service to the Telecom provider because you have to say that there's a different like if you have some company like uh Deutsche Telecom or let's say here we have like uh uh British Telecom then they buy that software from uh the base station providers like Nokia Ericsson and then uh Samsung and Huawei and they kind of like they they provide all the hardware and the software to provide the services to the uh mobile users so it was like a way for those telecoms to create their own Computing infrastructure so that certain phones could use those services from the base station so it's like an added value to the internet service provider because they might be able to offer you uh in within your monthly Telecom subscription like AI Computing from the telecoms uh infrastructure but yeah it's a bit like no like almost like competing with the cloud in that sense right exactly but they are trying to tackle the cloud in a way that the cloud cannot really address it which is the low latency computation so they think that when the future will be become like a more more like a as they call it like eyes on hands off devices then like the latency will be a big problem with those devices and with cloud service providers you might have a longer latency to some data center but if you just plug it into the base station then the latency to that service is more or less the latency introduced by the uh kind of like the radio wave coming from the base station to your end user device but there is a point about Huawei being interested in this because and these other companies which produce the full end-to-end solution to like Telecom which is doing like Samsung for example and I guess Nokia to some extent which are doing the phones and the base stations together because then they don't have to compete with the features provided by like they they don't they don't have to make a phone which is better than let's say Apple's iPhone phone because this the computation is partially coming from the yeah like you're not competing whether you have a better phone than with Apple but you are competing with the fact that whether your internet service provider is created on huawei's or Nokia's or Samsung's Network so it's good yeah so basically you get a if you get a Samsung phone and your internet service provider it's using Samsung base stations then you get extra features on your phone so your phone becomes better or cheaper to produce because it's kind of like baked into your uh Telecom subscription yeah I I can I can it's much clearer to me now because because I do uh machine learning and Edge compute as well and it's not a question about whether or not there is compute resources right because AWS all these clouds have compute resources the problem is utilizing it right uh and availability right like what you say you can see and having to move data all the way from you know from Malaysia which doesn't really have those uh data centers all the way across the US and you know it's only a certain certain chips are only available in certain parts of the US as well not in Singapore and it's just a mess right in terms of the networking and the bandwidth right it's not even a question of like there's a computer it's just that's compute but I just can't use it right exactly so that's kind of like where uh we're on what to like highlight with the communication thing is that when you have the smt solver you have to also think about that the smt solver doesn't have to necessarily be the that the constraints are coming just by the physical constraints of the device the smt solver could also take any arbitrary constraints about the network so it your good model in your bigger SMD model like Network bandwidth limitations and latency things so that you could create you could like start addressing the communication and the data moving Parts rather than just thinking about compute yeah right right so it's it's a language it sounds to me like a language that is a bit more catered towards ensuring that distributed computing and also you know networking is managed well right efficiently uh yes I'm just wondering like is it a specific type of a programming language such that you know it's not necessarily too incomplete for example yeah so I work on touring incomplete languages so for for you to be able to think about the program slicing it usually means that you have to know something about the program and things like whether to really know that uh how you can slice some array operation into smaller pieces it would be nice to know whether that operation will even terminate or something like that so I I don't I think there might be like uh but it can get hazy because you think that you could take like I don't think that any everyone will be necessarily using a language like this for everything but they might have they might be programming Python and then they have a part in Python which uses this tooling so it's kind of like now you use Python and then some part of the uh program uses gpus so I think the same way is that maybe there's a fragment in your in your overall program that would benefit from this kind of approach and then it doesn't really matter whether it's a touring complete language because if there's a touring incomplete fragment in that program then that can be distributed the inline code like how we do for SQL statements as well in Python sprinkling that and C plus statements as well in Python cool stuff yeah thank you um there's a question in the chat so uh aslab is asking how would bqn know whether to distribute its compute on CPU cores or the GPU are both easily the OS that knows which resources are free at any time yeah so that's like where I want to go so piku and currently CPU and which I used on these slides as an example runs only on CPU cores but my I haven't got that around it because it's bunch of software engineering work but I want to do it so that given certain operations uh there would be like an added interpreter on top of cpq and which I use a CP when to do most of the operations but when it detects that there is a big array operation it would be probably be a combination of some basic heuristics but also then the features that could be uh could be queried with something like NYX OS to do the uh offloading to the GPU like in case by case basis and then continuing like it would basically get the pointer from C and now that I'm writing the GPU stuff in Rust then the rust program does the thing written terms of pointer which is given to CPU and then it continues so that's something I have not quite I don't think there's an elegant solution to that but I I think there's many approaches and tools to iterate over but um I think we have like four more minutes so let I think we can take one or two more questions so for anyone who wants to ask a question you can again do it in the chat or um yes this voice up um I personally have one more questions yeah I have a lot of questions actually but you know right so just let me know later on yeah you can send me email or whatever if you have more questions or want to talk in more depth like any of you yeah me too but I think I would just like uh yeah drag drag in drag it too long I mean yeah I think um in the case I think I'll just talk to you later about this so is there any more questions from the audience if not I think that's a wrap right thank you appreciate it yeah thank you yeah yeah great questions it's it's nice to say that other people are also interested in the same stuff so I don't feel so crazy myself I'm hearing Masters on it so I guess I'm crazy too I guess correct education dedication okay so thank you everyone for coming um okay yeah now uh thanks everyone for coming so now I'm going to stop the recording
Automatic transcript — names and jargon may be misspelled.