Wk 9 : SIMD Flashcards

1
Q

Why do I care about SIMD?

A

It’s becoming the new standard. There’s only so much you can do to maximize the ability to do things superscalar and we’ve pretty much hit that limit in terms of speed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What’s the biggest challenge to overcome that arises with SIMD?

A

Lots and lots of data streams to memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Where’s SIMD best?

A

Dot products, matrix multiply, dealing with arrays, especially big arrays.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does Amdahl pitch-in when it comes to SIMD?

A

It can only see improvements based on the fraction of the program that I improve. Not all parts of and not every program allow for speed up via SIMD

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How much can an SIMD register hold? How many of them are there?

A

4 sgl precision floats (32 bit, 4 byte each) or 2 double precision floats (64 bit, 8 byte each)….there are 16 SIMD registers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

differentiate names of SIMD assy instructions

A

addss (scalar sgl prec)

addps (packed sgl prec)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the four options available to take advantage of SIMD?

A

Write directly in assembly
Use C libraries created for it
Use C intrinsics
Compiler vectorization options

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Why is memory alignment so important in SIMD? On what value should it be aligned? Plus the assembly code for moving aligned variables is so much faster

A

Want to get all of the data in one read from memory and store in one write. If we start adding cycles to load/store, we lose the gains we were looking for by doing everything in parallel

Align on 128 bits (16 byte)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What should memory bus size be to make thi SIMD worth our while? Why?

A

128 bits. If takes 4 cycles to get from memory that doesn’t help us.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does using intrinsics buy us?

A

Power of assembly like commands without getting bogged into details of individual registers, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How are MSB / LSB represented?

A

Backwards

LSB -> MSB (left part affected via scalar)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the 3 main issues of SIMD to footstomp?

A
  1. Must use memory alignment
  2. Must explicitly say when load / store
  3. Must handle overhead of shuffles.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why is explicitly specifying loads/stores so important with SIMD?

A

If my code isn’t efficient with regard to memory accesses, I could be using SIMD and end up doing more loads and stores than necessary and negating the benefits of SIMD in the first place

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How did fast math make a difference on the homework?

A

y = y + a[i]

with fast math, it indexes by 4. Without fast math, it still uses 1. This is because compiler is taking more liberty because its told its allowed to via fast math and its not as worried about aliasing issues.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly