so good afternoon everyone um this research is a joint effort between ins are N runs and the university of over in in finland so as we all know um we can describe computer programs at different levels of abstraction by using different programming language um that the lower level of abstraction we can use for example as simply and then on the other extreme extremes we have a such languages is thus some functional of is and then in there between some commonly used language which used like see no these and different languages have a different properties if we program mean ask simply generally we think that we get more efficient implementation on the other hand if we go to the other extreme we get a nice features like code reusability we can analyse the designs we can be a very find that our programs are correct and also our productivity and programming probably goes up in this talk we're concentrating on a language called are we seek out which is pretty high level it's definitely about C and this R P C cal is a data flow language which is actually a subset of the cal language that has originally been developed that the U C berkeley R B C cal was recently standardise find that i S O standardisation organization and i will now so you a simple example how the programs look like in our we seek out so this here is in a program that we can imagine it consists of three actors a B and C and as we know in data flow actors are the elements that do would actual the processing now the data between these actors is transmitted over these five for boppers here there are no other connections these connections are be all the ones that exist between actors and enable the communication if we go inside an actor uh we see that these are actually a finite state machines so we have a different states like this skit age here and then we have a state transitions that we call actions and it's these actions that actually do the data processing so that consume data and they produce data the main difference of R V C cal compare to um traditional data flow language use like a D S that was in the previous presentation is that um are we see cal allows conditional execution so we can have a data dependencies in the al gore um on the one side this is quite good because it makes the land which are applicable to a wide a set of applications we can have a data-dependent applications but there's also a now side that the line which is hard to analyse both score programmers and four compile now the topic of this work is that we want to improve the efficiency of the programs that we have described with these are we see cal language as you remember from this picture or are seek is here on the pretty high level of abstraction and what we want to do is to push the efficiency of this language closer to those programs that have been manually rate than for example in C now we want to do this oh sorry um so you know are we seek how um each data flow actor runs really independently basically this is a good thing because it means that we can re use these actors in other programs also but in practice when we look at the complete that application that's read and you know V C cal we actually find out that these actors are really depending on each other and the reason for this is that um and actor need state ah to be able to operate and if there's no data and actor cannot execute on the other hand if the five for buffer is full and actor condo parade either because there's no space for the output data so we try to automatically discover these inter dependencies between actors and with this information optimized the whole program and make it run fast and the approach that we chose here is dynamic dynamic program is which means that we actually observe a running program and based on the information we get from there we can generate the new program which hopefully is more efficient than the original one so now we can go into the details of our method um i told you about this feature of our we seek out that it enables data dependencies and the first step in our method is to find these data dependencies the are we seek help program and we will call these um signals that calls the data dependencies control signals and we have made a detection rule for finding these signals automatically and the rule is like this um if the value of data in coming from the five oh affects the behaviour of an actor and is a control signal because this is a bit harder to grasp so quickly i will show you an example so this here is and are we seek out program we go to each and every actor in this program and we inspect each and every input port of every actor at some point we arrive at this at at their here and the middle input port and we note this that the data that comes to this court actually affects the behaviour of these at actor so we know that they signal here called E type is the control signal so now that we have discovered these control signals we can go on so as we know the control signals we want to express the behaviour of the whole are we see cal network as a function of the data that values that go to these control signals and to be able to do that we have to insert spatial act there is in these are V see cal network we called than token gate so here an example uh suppose we have two act there's a a and B and we have a detected that the C Q know equals five four between then is a control signal with split the signal and in a token gate active or there so now there has been this bus of word strand and that has a here here um a strand we define as a sequence of actor execution or actor invocation and we define it so that each value of of the control signal that passes to this token gate we in the bulk one strand and that this actor invocations sequence at runtime and we can automatically detect these are with the help of this token gate act we do with so um we let one token at that time to this token gate and observe or the value of that token and then we record the set of actors that this so can invoke however unfortunately this is not enough because there's more flexibility and the cal model uh generally these actors can behave in many different ways for one control signal value so we also need to find out all the different actor behave years that can uh take place for one uh token gate value so we observed that the behavior of an are we see cal actor can be fully predict the deed before it actually execute when wind you know know the following properties of an active or we have to know the values of the actors state variable second we have to know how many tokens there are are at the input ports of that factor and we also need to know what the values of those tokens are and and this set of features here we called the signature of the actor and ask we analyzed the operation of the B C cal network we record this C nature of the actor you for we let it to execute and then for every signature we see what happens we record the set of state transitions that happened and in the act finally this is what we get so you know we have a one uh and gate token or one control signal value it is it can have different values like this and here or or in here and each of these values in the boat one strand this is one and this here is the second one and this is that third one and these is trans consist of actor invocations like the first strand here consists of six actor invocations one two three four five C and then in some actors we have a option on different behaviour patterns like this can behave in two different ways and this one can behave in five different weights and we differentiate between these alternative patterns turns based on the signature now that we have all this information we can go to the final phase of code generation where we create um the new program that hopefully is more efficient and the original one so we have a model to the functionality of the application with these gate token values and actor signature so now we generate a C code of course we could also generate other kind of code like pause col or a simply or whatever but we have chosen C and practically we in sir a set of switch statements to these places where we have these uh different gate token mountains or active can each oh we don't have time to go to any example code but um we have to go directly to the results so we test it this uh method with a few versions of an and pick for part two video decoder um these where different implementations of these video decoders and we got um different speed ups for different implementations so some decoders became more than two times faster where on the ones gained all only about fifteen percent of speed so as a conclusion um we have presented a fully automated approach to speed up programs for than in R B C cal and the are average speed was about one point five times um for future work um based on what we have a learned from this uh work we hope that we can create that's static analysis method we which means that we don't beat you each sound mean a running program but we examine the source code of the program and hope to optimize the application to that and another direction of future work is improve in the code generation which should also improve the speed ups we get and finally we can make them in method applicable to a wide set of applications um it by um let's say rewriting writing that method such that we can have more than one token gate in an application the present um method we have it only allows one token gate are application which is a bit twisted D so thanks for your attention a Q are there questions from a yes uh uh i use that it's uh dynamic approach right so you are basically a ink with some that's sample and uh i mean how many past samples did do not or when you on different test sequence uh does it it's to defend of the musicians or or i mean how you deal be we fact that the basically you need to have set college each and uh you have to learn a little examples to to basically optimized to set called that you can now for yeah that that's yes you're completely correct so uh this dynamic or um code down at is means that um the performance of this optimization is dependent on the input data we can also call it the training data uh we used to one uh a low resolution video sequence as the training data and then we test data the functionality and got these numbers by a high resolution well for high resolution sequence not where much longer but of course i mean there can always be situations not your training data that's not contain all the different options that are there and in that case um the decoding might actually fail we have a some um um let's say safety mechanisms against that but that's why this static analysis would be much better i i just one question so you don't attempt to create a co i yeah you're training you have some sense or is there some way to get and and okay and um no at the moment there is no such mechanism um i think if we would implement that we would already go to watch the static code analysis which we intend to to ran any case so i guess that's a clear direction of future work okay uh we thank you i