Fast Linear Algebra

Many problems in scientific computing include: Solving linear equations Eigenvalue computations Singular value decomposition LU/Cholesky/QR decompositions etc… And the userbase is quite large for this types of computation (number of scientists in the world is growing exponentially ) Quick History of Performance Computing Early seventies it was EISPACK and LINPACK. Then In similar years Matlab was invented, which simplified a lot compared to previous systems. LAPACK redesigned the algorithms in previous libraries to have better block-based locality. BLAS are kernel functions for each computer, while LAPACK are the higher level functions build on top of BLAS (1, 2,3). Then another innovation was ATLAS, which automatically generates the code for BLAS for each architecture. This is called autotuning because it does a search of possible enumerations and chooses the fastest one. Now autotuning has been done a lot for NN systems. ...

May 24, 2025 · Reading Time: 5 minutes ·  By Xuanqiang Angelo Huang

Clustering

Gaussian Mixture Models This set takes inspiration from chapter 9.2 of (Bishop 2006). We assume that the reader already knows quite well what is a Gaussian Mixture Model and we will just restate the models here. We will discuss the problem of estimating the best possible parameters (so, this is a density estimation problem) when the data is generated by a mixture of Gaussians. $$ \mathcal{N}(x \mid \mu, \Sigma) = \frac{1}{\sqrt{ 2\pi }} \frac{1}{\lvert \Sigma \rvert^{1/2} } \exp \left( -\frac{1}{2} (x - \mu)^{T} \Sigma^{-1}(x - \mu) \right) $$Problem statement $$ p(z) = \prod_{i = 1}^{k} \pi_{i}^{z_{i}} $$ Because we know that $z$ is a $k$ dimensional vector that has a single digit indicating which Gaussian was chosen. ...

February 6, 2025 · Reading Time: 6 minutes ·  By Xuanqiang Angelo Huang

Markov Chains

Introduzione alle catene di Markov La proprietà di Markov Una sequenza di variabili aleatorie $X_{1}, X_{2}, X_{3}, \dots$ gode della proprietà di Markov se vale: $$ P(X_{n}| X_{n - 1}, X_{n - 2}, \dots, X_{1}) = P(X_{n}|X_{n-1}) $$ Ossia posso scordarmi tutta la storia precedente, mi interessa solamente lo stato precedente per sapere la probabilità attuale. Da un punto di vista filosofico/fisico, ha senso perché mi sta dicendo che posso predire lo stato successivo se ho una conoscenza (completa, (lo dico io completo, originariamente non esiste)) del presente. ...

December 20, 2024 · Reading Time: 7 minutes ·  By Xuanqiang Angelo Huang

HTTP e REST

HTTP is the acronym for HyperText Transfer Protocol. Caratteristiche principali (3) Comunicazioni fra client e server, e quanto sono comunicate le cose si chiude la connessione e ci sono politiche di caching molto bone (tipo con i proxy) Generico: perché è un protocollo utilizzato per caricare moltissime tipologie di risorse! Stateless, ossia non vengono mantenute informazioni su scambi vecchi, in un certo modo ne abbiamo parlato in Sicurezza delle reti quando abbiamo parlato di firewall stateless. Solitamente possiamo intendere questo protocollo come utile per scambiare risorse di cui abbiamo parlato in Uniform Resource Identifier. ...

December 6, 2024 · Reading Time: 6 minutes ·  By Xuanqiang Angelo Huang

Fast Fourier Transforms

The algorithm has been the same, some ideas are in Fourier Series, but architectures change, which means there are new ways to make this algorithm even faster. Example of transforms We have learned in Algebra lineare numerica, Cambio di Base that linear transforms are usually a change of basis. They are matrix vector multiplications (additions and multiplications by constants). The optimizations are based on what sorts of transforms we have (e.g. Sparse Matrix Vector Multiplication, or dense versions). The same idea applies also for Fourier transforms. ...

April 7, 2025 · Reading Time: 5 minutes ·  By Xuanqiang Angelo Huang

Compiler Limitations

On Compiler Adding compilation flags to gcc not always makes it faster, it just enables a specific set of optimization methods. It’s also good to turn on platform specific flags to turn on some specific optimization methods to that architecture. Remember that compilers are conservative, meaning they do not apply that optimization if they think it does not always apply. What are they good at Compilers are good at: mapping program to machine ▪ register allocation ▪ instruction scheduling ▪ dead code elimination ▪ eliminating minor inefficiencies ...

March 3, 2025 · Reading Time: 3 minutes ·  By Xuanqiang Angelo Huang

Diffusion Models

Diffusion is a physical process that models random motion, first analyzed by Brown when studying pollen grains in water. In this section, we will first analyze a simplified 1-dimensional version, and then delve into diffusion models for images, the ones closest to (Ho et al. 2020). The Diffusion Process This note follows original Einstein’s presentation, here we have a simplified version. Let’s suppose we have a particle at $t = 0$ at some position $i$. We have a probability of jumping to the left of $p$ to right of $q$, the rest is staying at the same position. ...

January 5, 2025 · Reading Time: 13 minutes ·  By Xuanqiang Angelo Huang

Sicurezza OS

Possiamo classificare tre aree generali quando si parla di sicurezza informatica: Hardware Software human-ware. Non tratteremo in particolare esattamente come ogni campo viene declinato, però possiamo Una altra tendenza generale è che più è complessa più è insicura. e questo senso di insicurezza cresce in modo maggiore rispetto al lineare. Security principles Open Design perché così può essere scrutata da più persone Economy of mechanism spiegata sotto. Fail-safe defaults questo molto importante perché molti sistemi hanno dei default che possono essere exploitati. Complete mediation: così abbiamo qualcosa che tracka tutti gli accessi, che controlla gli accessi. Least privilege questo va a braccetto con il fail-safe. Privilege separation così possiamo mettere in modo indipendente un privilegio per qualcos’altro. CIA properties Ne abbiamo parlato in modo leggermente inverso in Sicurezza delle reti e in Notions of Security. In questo caso sono ...

May 30, 2024 · Reading Time: 6 minutes ·  By Xuanqiang Angelo Huang

Wireless attack vectors

In this note we will talk about some common ways to attack wireless based devices. Attacking an automated door Usually these doors are opened by radio frequency keys, and can be opened easily (e.g. replay attacks, Jam the frequency) Jamming This is the easiest way to attack. Just send many signals to make a certain frequency un-usable in our space. But with Frequency hopping this attack is solved. See Tecnologia Wireless#Frequency Hopping But this method could be easily known and observed (enables eavesdropping, against confidentiality, a principle in Notions of Security#CIAA principles of security.) if the initial seed is known. ...

June 2, 2024 · Reading Time: 5 minutes ·  By Xuanqiang Angelo Huang

TLS-SSL protocol

First time we talked about this was in Sicurezza delle reti#Protocollo SSL But that was a simple toy model. Secure Socket Layer Secure socket Layer and TLS add security (see security principles in Notions of Security) on the transport layers, whereas IPSec protocol adds it to the network level. So this works on a higher level of abstraction following the ISO OSI framework Architettura e livelli 1, 2#Livelli ISO/OSI. SSL is the old version of the TLS protocol. This provides integrity and confidentiality to the communication, see Notions of Security. The main difference of SSL and TLS is that this has vulnerabilities like POODLE attack ...

June 1, 2024 · Reading Time: 4 minutes ·  By Xuanqiang Angelo Huang