Setup Instructions for Git on Windows

This is just one of the ways of using Git. There are several other ways that can involve setting up your own server for repositories or using other services, such as Github. A good friend of mine, Ayush Rai helped me explore this procedure. Please note that I was using this procedure in 2015, so the steps below may have changed slightly. Let me know it this does not work.

Downloads

  • [Bit-bucket] (https://bitbucket.org/): Setup an account in bitbucket.

  • Git: Install Git in your PC.

  • Smart-Git: Install Smart-Git client in your PC. The software is free for non-commercial use.

Setup

  • SSH key setup for your computer (You can use Git Bash for this step): link

  • Make sure that the .ssh folder is in your user folder. For example, Users/Ujjwal/

  • Add the key to your Bit-bucket account: link

  • Start Smart-Git and follow screen instructions to setup, you will be asked to provide your Bit-bucket username and password

That is it! You have the setup ready

How to learn Git?

Here is a short game tutorial for Git. I have not tried it myself!

Computing A Signal Mean in Real Time

The standard way to compute the mean (average) of a data set is to sum all the values and then divide by the total number of values. More explicitly, when we have scalar values $x_1, x_2, x_3, …, x_N$, the mean $\mu_N$ for all the N values is computed as follows:

\[\mu_N = \frac{\sum_{k=1}^N x_k}{N} ... (1)\]

Clearly, this is very simple. The simplicity comes at the cost of larger memory usage. This is because we have to store all the values from $x_1$ to $x_N$ in memory in order to compute the mean $\mu_N$. However, for real time systems performance and memory are critical. Therefore, a different method that computes the mean after every sample in a lightweight manner (without using too much memory) is required. One way is to use a recursive algorithm as follows:

\[\begin{align} & \mu_0 = 0; \nonumber \\\ & \mathrm{for} \hspace{2mm} k = 1:1:N \nonumber \\\ & \hspace{4mm} \mu_k = \left( \frac{k-1}{k} \right) \mu_{k-1} + \frac{x_k}{k}; \nonumber \\\ & \mathrm{endfor} \nonumber \end{align}\]

Proof: The proof is pretty easy. First use the formula for mean assuming $k-1$ values are known. Similarly, write formula of mean assuming $k$ values are known. Perform some simple algebra to obtain the solution of mean at $k$ in terms of mean at $k-1$ and new data $x_k$. Details are shown below:

\[\begin{eqnarray} & \mu_k = \frac{\sum_{i=1}^k x_i}{k} \\\ & \mu_{k-1} = \frac{\sum_{i=1}^{k-1} x_i}{k-1} \end{eqnarray}\]

Now multiply the above equations by the denominator $k$ and ($k-1$),

\[\begin{align} k\mu_k &= \sum_{i=1}^k x_i \\\ (k-1)\mu_{k-1} &= \sum_{i=1}^{k-1} x_i \end{align}\]

Now subtract the first equation from the second equation and perform simple algebra,

\(\begin{align} k\mu_k - (k-1)\mu_{k-1} &= \sum_{i=1}^k x_i - \sum_{i=1}^{k-1} x_i \\\ \Rightarrow k\mu_k - (k-1)\mu_{k-1} &= x_k \\\ \Rightarrow k \mu_k &= (k-1)\mu_{k-1} + x_k \\\ \Rightarrow \mu_k &= \left( \frac{k-1}{k} \right) \mu_{k-1} + \frac{x_k}{k} \end{align}\) $\square$

Reference: Link

How to Typeset Math in a Blog

I want to write some math equations in this blog. MathJax is a Javascript library that displays mathematical notation on web browsers. Apparently, we just have to copy paste the following code in Tumblr HTML, just before the <\head> tag:

<script type="text/x-mathjax-config">
       MathJax.Hub.Config({
       extensions: ["tex2jax.js"],
       jax: ["input/TeX", "output/HTML-CSS"],
       tex2jax: {
       inlineMath: [[ '$','$']],
       displayMath:  [['$$','$$']],
       processEscapes: true
       },
       "HTML-CSS": { availableFonts: ["TeX"] }
       });
</script> 

<script type="text/javascript" async
      src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
</script>

Example code: Maths between dollars is inline: $ p = \alpha C_{dyn} V_{dd}^2f + I_{leak}V_{dd} $

Maths between two dollar signs is display as a separate equation: \(p = \alpha C_{dyn} V_{dd}^2f + I_{leak}V_{dd}\)

Example output:

Maths between dollars is inline: $p = \alpha C_{dyn} V_{dd}^2f + I_{leak}V_{dd}$

Maths between two dollar signs is display as a separate equation: \(p = \alpha C_{dyn} V_{dd}^2f + I_{leak}V_{dd}\)

Tips: Make sure that you write the math as normal text. If it is code type in tumblr then it will not be rendered. You can change the identifiers to display inline vs display math in the code. Documentation Link

My First Peer Reviewed Research Paper

So the story goes like this…

I came back to ASU from Stone Ridge Technology with an incredible summer internship working on state-of-the-art FPGA RTL designs. Everyone working in this small start-up had a research mindset. This was intellectually very satisfying for me. Then, I met two more incredible folks: Prof. Martin Reisslein and Prof. Umit Ogras. They both helped me in unique ways to look at the research. I took Martin’s class in which he reinforced the need for surveying prior art. Umit joined ASU in Fall 2013 as an assistant professor. Frequent interactions with him made me very excited about exploring power management techniques in smartphones. Since the foundation of the power management techniques are power and performance models, we started exploring these models. In particular, we found a generalized form of Amdhal’s law. We got the idea for the performance model from a seminal paper from Hill and Marty on “Amdahl’s Law in the Multicore Era”. This gave the very first lesson about research. If we write a paper that is well thought out and easy to read, it will lead to more research ideas for everyone. We wrote the performance model and then my initial thought was to only publish the performance model that could be used for heterogeneous systems. However, Umit insisted that only the performance model was not sufficient for a good publication (rightly so!). This is because we need more mature ideas that not only show new models but also how they are useful.

“All models are wrong; some models are useful.” - George E. P. Box

Therefore, we also came up with a general power model and used both the power and performance models to perform the energy minimization with timing and temperature constraints. Energy optimization is a very important problem for mobile platforms that help in longer battery life and better user experience. After writing everything down with an illustrative example to convey our approach in detail, we submitted the paper to IEEE Computer Architecture Letters. The Journal was quick in responding back with a major revision. Then, we wrote a very detailed rebuttal incorporating all the reviewer’s suggestions. This provided me with the experience to reply and understand reviewer’s comments. For someone who is starting a research career, some reviewer comments may look cold and harsh. However, after writing several papers and peer reviews myself now, I believe all reviewer comments are useful. If the comment does not appear immediately useful, we should sleep over it and think how to make our paper better by using the reviewer comment. Overall, working on the first paper was very rewarding for me.

Power Management for MpSoCs

Emerging applications on mobile systems demand an increase of computational capabilities, which is delivered by the computer industry using higher operating frequency and heterogeneity to the application processors. This leads to increase in the power consumption and temperature of the platform that directly affects the user experience. Therefore, power management has proliferated all aspects of mobile systems. For example, there are multiple ways to control the power consumption of a SoC, such as choosing a process technology, circuit level optimization, system level optimization and application code level optimization. All these granularities require very different skills and methods to optimize any desired objective, such as meeting a power budget and minimizing the energy consumption. Interestingly, the decisions made at each of the granularities are not independent of each other with no single bottom-up or top-down methodology that can be applied. In fact, it is an iterative process, where time to market and business decisions ultimately play a major role. For example, consider a typical OS level power management policy that critically depends on the number of voltage/frequency knobs. To add these knobs in the system, the circuit designers may have to use more voltage regulators that leads to increase in power consumption. Therefore, circuit designers must build a suboptimal design so that on a global scale the whole SoC can be optimized using the OS level power management. Due to continuous growth in the OS level knobs, such as more voltage-frequency levels and number of cores, it looks like the addition has been fruitful and OS level power management is promising. This is not surprising, because dynamic power depends on the switching activity of transistors which in turn depends on the applications running on the platform. For example, a user may want to run a game instead of a web browser, which have very different energy consumptions. Therefore, OS level power management has already become an integral component of the mobile optimization.

I was fortunate to work with Prof. Umit Ogras and many other academic and industry experts in the field to make substantial contributions in the OS level power management. I developed generalized scaling models for power and performance, studied the impact of background power on energy optimization, developed a CPU-GPU power budget allocation algorithm. In fact, there are many other researchers, who have contributed to a plethora of research in this area. This begs some questions, why is this field still open? What is there to research?

One reason is power management algorithms rely heavily on the performance and power models. These models help the power management algorithms to predict the change in power or performance due to change in the knobs. Currently, most models depend on a set of limited characterization data. It is impossible to characterize the data for all the applications in the world and with changing hardware platform, the problem gets aggravated. This leads to a long cycle of collecting data on every board to tune the power and performance models for a certain key performance indicators. Therefore, it is crucial to change the way power and performance models are developed and used.

We contribute to this changing paradigm by developing a fundamentally new approach to learn the performance models for integrated GPUs, which have become indispensable component of mobile systems. We employ online learning of the model, such that the model parameters can change at runtime, providing adaptability to any workload. More details are in our ICCAD paper, which presents a light-weight adaptive runtime performance model that predicts the frame processing time. We use this model to estimate the frame time sensitivity to the GPU frequency. Our experiments on a mobile platform running common GPU benchmarks show that the mean absolute percentage error in frame time and frame time sensitivity prediction are less than 4%.