Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lecture materials
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
generic software skills
lecture materials
Commits
f4c3fa6b
Commit
f4c3fa6b
authored
10 months ago
by
Dominik Zobel
Browse files
Options
Downloads
Patches
Plain Diff
Divide memory model and processor techniques in two chapters (and restructure)
parent
94c2ce8a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!74
Memory hierarchies lecture
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lectures/memory-hierarchies/slides.qmd
+35
-40
35 additions, 40 deletions
lectures/memory-hierarchies/slides.qmd
with
35 additions
and
40 deletions
lectures/memory-hierarchies/slides.qmd
+
35
−
40
View file @
f4c3fa6b
...
...
@@ -167,33 +167,10 @@ Time in seconds using a 2 GB numpy array ($128 \times 128 \times 128 \times 128$
# Memory Models
# Theory
## Techniques
- Caching
- Prefetching
- Branch prediction
## Unavailable data
If data is not available in the current memory level
- register spilling (register -> cache)
- cache missing (cache -> main memory)
- page fault (main memory -> disk)
Miss description
## External Memory Model
balance block size to get from next level to latency it takes to get it
- Study effect of latencies, cache sizes, block sizes, ...
- Here just focus on latency
## Memory access time model (1/3)
...
...
@@ -239,30 +216,30 @@ T_{avg,s} &= H_1 T_1 + ((1-H_1)\cdot H_2)\cdot(T_1+T_2)\\
#
#
Overview/Exercise
#
Behind the scenes
- Introduction from base of pyramid (file access)
- example with access from disk and directly from memory
- background on memory hierarchy with focus on today instead of history
## Processor techniques
- Working our way up the pyramid
- reference values for Levante CPU
- example with optimal and sub-optimal memory access, i.e. cache blocking (see `nproma`)
- openmp reduction (hand implementation), reference/continuation from parallelism lecture
- Caching
- Prefetching
- Branch prediction
##
Observations
##
Unavailable data
- Gap between processor and memory speeds.
Hierarchy needed because of discrepancy between speed of CPU and (main) memory
(include image)
If data is not available in the current memory level
- register spilling (register -> cache)
- cache missing (cache -> main memory)
- page fault (main memory -> disk)
Miss description
- exploit accessing data and code stored close to each other (temporal and spatial locality)
# Visualizations
# Visualization
of memory hierarchie
s
## Memory Pyramid (upwards)
...
...
@@ -507,6 +484,12 @@ $\approx$ Factor 20 between best and worst access
:::
## Hands-On {.handson}
- Either example with optimal and sub-optimal memory access, i.e. cache blocking (see `nproma`)
- Or OpenMP reduction (hand implementation), reference/continuation from parallelism lecture?!
## Different architectures
...
...
@@ -517,6 +500,18 @@ $\approx$ Factor 20 between best and worst access
# Summary
## Observations
- Gap between processor and memory speeds.
Hierarchy needed because of discrepancy between speed of CPU and (main) memory
(include image)
- exploit accessing data and code stored close to each other (temporal and spatial locality)
# Resources {.leftalign}
- "Computer Systems: A Programmer's Perspective" by _R. Bryant_ and _D. O'Hallaron_, Pearson
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment