Skip to content

Commit

Permalink
Push updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanWang committed Apr 17, 2018
1 parent f25f85e commit 9bc0089
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
63 changes: 63 additions & 0 deletions Comp-409/notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ TSD | Thread Specific Data
UMA | Uniform Memory Access
UP | Uni-Processor
LL | Linked List
TLS | Thread Level Specialization

# Interfaces

Expand Down Expand Up @@ -1716,3 +1717,65 @@ I was away

# Lecture 21. 2018/04/10

Last time
* Data flow -> static data flow
* Dynamic deletion
* Functions from stream to stream
* Domain of streams - prefix ordered
* Constraints
* Monotonic - if x < y, f(x) < f(y)
* Continuous - eg preserves bounds
* Network of continuous functions is described by a aystem of (recursive) stream flow equations. The solutions describe the possible flow of our network
* Kahn's principle
* Cons - prepends 0 ot act as identity
* Buriden's Ass - given a donkey between and equidistant to two bales of hay, will it ever starve by taking too long in making a decision as to which bale it will go to?
* Buridan's Principle - for any device making a decision among a finte nuumber of possible outcomes based on a continuing possible imputs, there will be inputs for which the device takes abitrarily long to make a decision
* How to fix this?
* Default decision - only pushes the decision; when can we not decide?
* One decision
* Bipartition - evey var is either a gate input & wire output, a wire input & gate output, an I/O wire
* Integrity - each var is the output of at most one gate
* ??? - each wire is input to at most one gate, gate output may connect to multiple wire inputs
* Feedback - no minimal self-cycles
* Arbiter - P<sub>in</sub>, Q<sub>in</sub>, P<sub>out</sub>, Q<sub>out</sub>
* Initially, P<sub>in</sub> = Q<sub>in</sub> = true; P<sub>out</sub> = Q<sub>out</sub> = false
* In any finite history, find state must be such that P<sub>out</sub> &ne; Q<sub>out</sub>
* There exists histories with P<sub>out</sub> &wedge; &not;Q<sub>out</sub> = true and &not;P<sub>out</sub> &wedge; Q<sub>out</sub> = true
* We want it to be
* Delay bounded - all histories are finite
* Stable - in each history, one output remains unchanged
* Glitch-free if delay-bounded & stable

# Lecture 22. 2018/04/12

* Thread-kevel specification (TLS)
* Similar to transactional program
* Automatic parallelization
* Takes advantage of multicore machines
* Aims for ok performance
* SPMT - speculative multithreading
* optimistic/speculative technique
* Parallelize code we don't know can be parallelizable
* Safety guarantees to ensure correct execution
* Speculative threads execute in isolation - all writes are buffered, do not affefct main memory
* Commits buffer at join time and validates using set of assumptions with current memory
* If mismatch, discard result and continuing executing sequentially
* Buffer/isolation ensures we do not see writes from the future
* Major issue
* Overhead
* Hardware - cheaper but limited capacity
* Software - much more expensive, but with logs of capacity
* Deciding where to speculate
* Loop level speculation
* Method level speculations
* Value prediction
* 0, 1
* Last value
* Last stride (diff in return values)
* How any spec threads can we have, and who can speculate
* "out of order" speculation
* Non spec thread can start more than one spec thread
* Spec threads are merged in reverse order of creation
* "in order" speculation
* Every thread can speculate at most once (speculation child)
*
42 changes: 42 additions & 0 deletions Math-323/notes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,46 @@ \subsection{Bernoulli Trial}
\item Expectation $= p$, Variance $=pq$
\end{enumerate}

\section{Final Review}

\subsection{Inequality}

\begin{itemize}
\item Kolmogorov's Axioms \\
Last point: If $A_i \cap A_j = \emptyset$, then $P(A_i \cup A_j) = P(A_i) + P(A_j)$
\item Boole's Inequality \\
For $A_1, A_2, ... \in F$, $P\pp{\bigcup_{i = 1}^\infty A_i} \le \sum_{i = 1}^\infty P(A_i)$ \\
Prove using disjoint settings, using axiom above for summation, and showing that an intersection $A \cap B$ is always less than or equal to $A$.
\item Bonferroni's Inequality \\
For $A_1, A_2, ... \in F$, $P\pp{\bigcap_{i = 1}^\infty A_i} \ge 1 - \sum_{i = 1}^\infty P(A_i^C)$ \\
Prove using DeMorgan's, then Boole's to form the inequality.
\end{itemize}

\subsection{Independence}

Prove that $A$ is independent from $B$ iff $A^C$ is independent from $B$

\subsection{Moment Generation Function}

Used to calculate moments (expectation and variance) and showing that distributions are equal.

To find the expectation, derive MGF and set $t = 0$, or derive $log(MGF)$ and set $t = 1$

An MGF is composed of the normalizing constant and the kernel

\subsection{Transformation}

\begin{itemize}
\item Jacobian
\item CDF

\begin{eqn}
P(Y \le y) &= P(g(X) \le y) \\
&= P(X \le g^{-1}(y)) \\
&= P_x(g^{-1}(y)) \\\\
f_y(y) &= F'_y(y) \\
&= F'_x(f^{-1}(y)) \frac{d}{dy} g^{-1}(y)
\end{eqn}
\end{itemize}

\end{document}

0 comments on commit 9bc0089

Please sign in to comment.