| Loop Id: 36 | Module: attention-icx-skl256 | Source: attention_v2.cpp:30-31 | Coverage: 39.84% |
|---|
| Loop Id: 36 | Module: attention-icx-skl256 | Source: attention_v2.cpp:30-31 | Coverage: 39.84% |
|---|
0x404e60 LEA (%RAX,%R8,1),%R9D |
0x404e64 VPBROADCASTD %R9D,%XMM2 |
0x404e6a LEA (%R11,%R12,1),%R9 |
0x404e6e VPCMPEQB %XMM0,%XMM0,%K1 |
0x404e74 VXORPD %XMM3,%XMM3,%XMM3 |
0x404e78 VPBROADCASTD %R8D,%XMM4 |
0x404e7e VPADDD %XMM6,%XMM2,%XMM2 |
0x404e82 VPADDD %XMM7,%XMM4,%XMM4 |
0x404e86 VPMULLD %XMM4,%XMM5,%XMM4 |
0x404e8b VPADDD %XMM4,%XMM1,%XMM4 |
0x404e8f LEA (%RCX,%R12,1),%R10 |
0x404e93 VPSUBD %XMM8,%XMM4,%XMM4 |
0x404e98 VPCMPEQB %XMM0,%XMM0,%K2 |
0x404e9e VGATHERDPS (%R9,%XMM2,4),%XMM3{%K1} [2] |
0x404ea5 VXORPS %XMM2,%XMM2,%XMM2 |
0x404ea9 VGATHERDPS (%R10,%XMM4,4),%XMM2{%K2} [1] |
0x404eb0 VCVTPS2PD %XMM3,%YMM3 |
0x404eb4 VCVTPS2PD %XMM2,%YMM2 |
0x404eb8 VFMADD231PD %YMM2,%YMM3,%YMM0 |
0x404ebd ADD $0x4,%R8 |
0x404ec1 CMP %R15,%R8 |
0x404ec4 JB 404e60 |
/home/eoseret/Applications/llm-attention/attention_v2.cpp: 30 - 31 |
-------------------------------------------------------------------------------- |
30: for (unsigned int k = 0; k < K; ++k) { //vectorized |
31: sum += (double)A[i * K + k] * (double)B[k * N + j]; |
| Coverage (%) | Name | Source Location | Module |
|---|---|---|---|
| ►100.00+ | __libc_init_first | libc.so.6 | |
| ○ | __libc_start_main | libc.so.6 | |
| ○ | _start | attention-icx-skl256 |
| min | med | avg | max |
|---|---|---|---|
| Percentile Index | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 |
|---|---|---|---|---|---|---|---|---|---|---|
| Value |
| min | med | avg | max |
|---|---|---|---|
| Percentile Index | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 |
|---|---|---|---|---|---|---|---|---|---|---|
| Value |
| Path / |
| Metric | Value |
|---|---|
| CQA speedup if no scalar integer | 1.12 |
| CQA speedup if FP arith vectorized | 1.17 |
| CQA speedup if fully vectorized | 4.80 |
| CQA speedup if no inter-iteration dependency | NA |
| CQA speedup if next bottleneck killed | 1.05 |
| Bottlenecks | micro-operation queue, |
| Function | main |
| Source | attention_v2.cpp:30-31 |
| Source loop unroll info | unrolled by 8 |
| Source loop unroll confidence level | max |
| Unroll/vectorization loop type | intermediate |
| Unroll factor | 4 |
| CQA cycles | 7.00 |
| CQA cycles if no scalar integer | 6.25 |
| CQA cycles if FP arith vectorized | 6.00 |
| CQA cycles if fully vectorized | 1.46 |
| Front-end cycles | 7.00 |
| P0 cycles | 6.67 |
| P1 cycles | 6.67 |
| P2 cycles | 4.00 |
| P3 cycles | 4.00 |
| P4 cycles | 0.00 |
| P5 cycles | 6.67 |
| P6 cycles | 2.00 |
| P7 cycles | 0.00 |
| DIV/SQRT cycles | 0.00 |
| Inter-iter dependencies cycles | 4 |
| FE+BE cycles (UFS) | NA |
| Stall cycles (UFS) | NA |
| Nb insns | 22.00 |
| Nb uops | 28.00 |
| Nb loads | 2.00 |
| Nb stores | 0.00 |
| Nb stack references | 0.00 |
| FLOP/cycle | 1.14 |
| Nb FLOP add-sub | 0.00 |
| Nb FLOP mul | 0.00 |
| Nb FLOP fma | 4.00 |
| Nb FLOP div | 0.00 |
| Nb FLOP rcp | 0.00 |
| Nb FLOP sqrt | 0.00 |
| Nb FLOP rsqrt | 0.00 |
| Bytes/cycle | 4.57 |
| Bytes prefetched | 0.00 |
| Bytes loaded | 32.00 |
| Bytes stored | 0.00 |
| Stride 0 | 0.00 |
| Stride 1 | 0.00 |
| Stride n | 0.00 |
| Stride unknown | 1.00 |
| Stride indirect | 1.00 |
| Vectorization ratio all | 87.50 |
| Vectorization ratio load | 100.00 |
| Vectorization ratio store | NA |
| Vectorization ratio mul | 100.00 |
| Vectorization ratio add_sub | 100.00 |
| Vectorization ratio fma | 100.00 |
| Vectorization ratio div_sqrt | NA |
| Vectorization ratio other | 80.00 |
| Vector-efficiency ratio all | 24.22 |
| Vector-efficiency ratio load | 25.00 |
| Vector-efficiency ratio store | NA |
| Vector-efficiency ratio mul | 25.00 |
| Vector-efficiency ratio add_sub | 25.00 |
| Vector-efficiency ratio fma | 50.00 |
| Vector-efficiency ratio div_sqrt | NA |
| Vector-efficiency ratio other | 21.25 |
| Metric | Value |
|---|---|
| CQA speedup if no scalar integer | 1.12 |
| CQA speedup if FP arith vectorized | 1.17 |
| CQA speedup if fully vectorized | 4.80 |
| CQA speedup if no inter-iteration dependency | NA |
| CQA speedup if next bottleneck killed | 1.05 |
| Bottlenecks | micro-operation queue, |
| Function | main |
| Source | attention_v2.cpp:30-31 |
| Source loop unroll info | unrolled by 8 |
| Source loop unroll confidence level | max |
| Unroll/vectorization loop type | intermediate |
| Unroll factor | 4 |
| CQA cycles | 7.00 |
| CQA cycles if no scalar integer | 6.25 |
| CQA cycles if FP arith vectorized | 6.00 |
| CQA cycles if fully vectorized | 1.46 |
| Front-end cycles | 7.00 |
| P0 cycles | 6.67 |
| P1 cycles | 6.67 |
| P2 cycles | 4.00 |
| P3 cycles | 4.00 |
| P4 cycles | 0.00 |
| P5 cycles | 6.67 |
| P6 cycles | 2.00 |
| P7 cycles | 0.00 |
| DIV/SQRT cycles | 0.00 |
| Inter-iter dependencies cycles | 4 |
| FE+BE cycles (UFS) | NA |
| Stall cycles (UFS) | NA |
| Nb insns | 22.00 |
| Nb uops | 28.00 |
| Nb loads | 2.00 |
| Nb stores | 0.00 |
| Nb stack references | 0.00 |
| FLOP/cycle | 1.14 |
| Nb FLOP add-sub | 0.00 |
| Nb FLOP mul | 0.00 |
| Nb FLOP fma | 4.00 |
| Nb FLOP div | 0.00 |
| Nb FLOP rcp | 0.00 |
| Nb FLOP sqrt | 0.00 |
| Nb FLOP rsqrt | 0.00 |
| Bytes/cycle | 4.57 |
| Bytes prefetched | 0.00 |
| Bytes loaded | 32.00 |
| Bytes stored | 0.00 |
| Stride 0 | 0.00 |
| Stride 1 | 0.00 |
| Stride n | 0.00 |
| Stride unknown | 1.00 |
| Stride indirect | 1.00 |
| Vectorization ratio all | 87.50 |
| Vectorization ratio load | 100.00 |
| Vectorization ratio store | NA |
| Vectorization ratio mul | 100.00 |
| Vectorization ratio add_sub | 100.00 |
| Vectorization ratio fma | 100.00 |
| Vectorization ratio div_sqrt | NA |
| Vectorization ratio other | 80.00 |
| Vector-efficiency ratio all | 24.22 |
| Vector-efficiency ratio load | 25.00 |
| Vector-efficiency ratio store | NA |
| Vector-efficiency ratio mul | 25.00 |
| Vector-efficiency ratio add_sub | 25.00 |
| Vector-efficiency ratio fma | 50.00 |
| Vector-efficiency ratio div_sqrt | NA |
| Vector-efficiency ratio other | 21.25 |
| Path / |
| Function | main |
| Source file and lines | attention_v2.cpp:30-31 |
| Module | attention-icx-skl256 |
| nb instructions | 22 |
| nb uops | 28 |
| loop length | 102 |
| used x86 registers | 8 |
| used mmx registers | 0 |
| used xmm registers | 9 |
| used ymm registers | 3 |
| used zmm registers | 0 |
| nb stack references | 0 |
| micro-operation queue | 7.00 cycles |
| front end | 7.00 cycles |
| P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | |
|---|---|---|---|---|---|---|---|---|
| uops | 6.67 | 6.67 | 4.00 | 4.00 | 0.00 | 6.67 | 2.00 | 0.00 |
| cycles | 6.67 | 6.67 | 4.00 | 4.00 | 0.00 | 6.67 | 2.00 | 0.00 |
| Cycles executing div or sqrt instructions | NA |
| Longest recurrence chain latency (RecMII) | 4.00 |
| Front-end | 7.00 |
| Dispatch | 6.67 |
| Data deps. | 4.00 |
| Overall L1 | 7.00 |
| all | 77% |
| load | NA (no load vectorizable/vectorized instructions) |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 100% |
| add-sub | 100% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| other | 50% |
| all | 100% |
| load | 100% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | NA (no mul vectorizable/vectorized instructions) |
| add-sub | NA (no add-sub vectorizable/vectorized instructions) |
| fma | 100% |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 100% |
| all | 87% |
| load | 100% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 100% |
| add-sub | 100% |
| fma | 100% |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 80% |
| all | 20% |
| load | NA (no load vectorizable/vectorized instructions) |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 25% |
| add-sub | 25% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| other | 15% |
| all | 28% |
| load | 25% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | NA (no mul vectorizable/vectorized instructions) |
| add-sub | NA (no add-sub vectorizable/vectorized instructions) |
| fma | 50% |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 25% |
| all | 24% |
| load | 25% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 25% |
| add-sub | 25% |
| fma | 50% |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 21% |
| Instruction | Nb FU | P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | Latency | Recip. throughput | Vectorization |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| LEA (%RAX,%R8,1),%R9D | 1 | 0 | 0.50 | 0 | 0 | 0 | 0.50 | 0 | 0 | 1 | 0.50 | N/A |
| VPBROADCASTD %R9D,%XMM2 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | scal (6.3%) |
| LEA (%R11,%R12,1),%R9 | 1 | 0 | 0.50 | 0 | 0 | 0 | 0.50 | 0 | 0 | 1 | 0.50 | N/A |
| VPCMPEQB %XMM0,%XMM0,%K1 | vect (25.0%) | |||||||||||
| VXORPD %XMM3,%XMM3,%XMM3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | vect (25.0%) |
| VPBROADCASTD %R8D,%XMM4 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | scal (6.3%) |
| VPADDD %XMM6,%XMM2,%XMM2 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (25.0%) |
| VPADDD %XMM7,%XMM4,%XMM4 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (25.0%) |
| VPMULLD %XMM4,%XMM5,%XMM4 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 1 | vect (25.0%) |
| VPADDD %XMM4,%XMM1,%XMM4 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (25.0%) |
| LEA (%RCX,%R12,1),%R10 | 1 | 0 | 0.50 | 0 | 0 | 0 | 0.50 | 0 | 0 | 1 | 0.50 | N/A |
| VPSUBD %XMM8,%XMM4,%XMM4 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (25.0%) |
| VPCMPEQB %XMM0,%XMM0,%K2 | vect (25.0%) | |||||||||||
| VGATHERDPS (%R9,%XMM2,4),%XMM3{%K1} | 4 | 1 | 0 | 2 | 2 | 0 | 1 | 0 | 0 | 19 | 4 | vect (25.0%) |
| VXORPS %XMM2,%XMM2,%XMM2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | vect (25.0%) |
| VGATHERDPS (%R10,%XMM4,4),%XMM2{%K2} | 4 | 1 | 0 | 2 | 2 | 0 | 1 | 0 | 0 | 19 | 4 | vect (25.0%) |
| VCVTPS2PD %XMM3,%YMM3 | 2 | 0.50 | 0.50 | 0 | 0 | 0 | 1 | 0 | 0 | 7 | 1 | vect (25.0%) |
| VCVTPS2PD %XMM2,%YMM2 | 2 | 0.50 | 0.50 | 0 | 0 | 0 | 1 | 0 | 0 | 7 | 1 | vect (25.0%) |
| VFMADD231PD %YMM2,%YMM3,%YMM0 | 1 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0.50 | vect (50.0%) |
| ADD $0x4,%R8 | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | N/A |
| CMP %R15,%R8 | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | N/A |
| JB 404e60 <main+0x1d40> | 1 | 0.50 | 0 | 0 | 0 | 0 | 0 | 0.50 | 0 | 0 | 0.50-1 | N/A |
| Function | main |
| Source file and lines | attention_v2.cpp:30-31 |
| Module | attention-icx-skl256 |
| nb instructions | 22 |
| nb uops | 28 |
| loop length | 102 |
| used x86 registers | 8 |
| used mmx registers | 0 |
| used xmm registers | 9 |
| used ymm registers | 3 |
| used zmm registers | 0 |
| nb stack references | 0 |
| micro-operation queue | 7.00 cycles |
| front end | 7.00 cycles |
| P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | |
|---|---|---|---|---|---|---|---|---|
| uops | 6.67 | 6.67 | 4.00 | 4.00 | 0.00 | 6.67 | 2.00 | 0.00 |
| cycles | 6.67 | 6.67 | 4.00 | 4.00 | 0.00 | 6.67 | 2.00 | 0.00 |
| Cycles executing div or sqrt instructions | NA |
| Longest recurrence chain latency (RecMII) | 4.00 |
| Front-end | 7.00 |
| Dispatch | 6.67 |
| Data deps. | 4.00 |
| Overall L1 | 7.00 |
| all | 77% |
| load | NA (no load vectorizable/vectorized instructions) |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 100% |
| add-sub | 100% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| other | 50% |
| all | 100% |
| load | 100% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | NA (no mul vectorizable/vectorized instructions) |
| add-sub | NA (no add-sub vectorizable/vectorized instructions) |
| fma | 100% |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 100% |
| all | 87% |
| load | 100% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 100% |
| add-sub | 100% |
| fma | 100% |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 80% |
| all | 20% |
| load | NA (no load vectorizable/vectorized instructions) |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 25% |
| add-sub | 25% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| other | 15% |
| all | 28% |
| load | 25% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | NA (no mul vectorizable/vectorized instructions) |
| add-sub | NA (no add-sub vectorizable/vectorized instructions) |
| fma | 50% |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 25% |
| all | 24% |
| load | 25% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 25% |
| add-sub | 25% |
| fma | 50% |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 21% |
| Instruction | Nb FU | P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | Latency | Recip. throughput | Vectorization |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| LEA (%RAX,%R8,1),%R9D | 1 | 0 | 0.50 | 0 | 0 | 0 | 0.50 | 0 | 0 | 1 | 0.50 | N/A |
| VPBROADCASTD %R9D,%XMM2 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | scal (6.3%) |
| LEA (%R11,%R12,1),%R9 | 1 | 0 | 0.50 | 0 | 0 | 0 | 0.50 | 0 | 0 | 1 | 0.50 | N/A |
| VPCMPEQB %XMM0,%XMM0,%K1 | vect (25.0%) | |||||||||||
| VXORPD %XMM3,%XMM3,%XMM3 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | vect (25.0%) |
| VPBROADCASTD %R8D,%XMM4 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | scal (6.3%) |
| VPADDD %XMM6,%XMM2,%XMM2 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (25.0%) |
| VPADDD %XMM7,%XMM4,%XMM4 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (25.0%) |
| VPMULLD %XMM4,%XMM5,%XMM4 | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 1 | vect (25.0%) |
| VPADDD %XMM4,%XMM1,%XMM4 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (25.0%) |
| LEA (%RCX,%R12,1),%R10 | 1 | 0 | 0.50 | 0 | 0 | 0 | 0.50 | 0 | 0 | 1 | 0.50 | N/A |
| VPSUBD %XMM8,%XMM4,%XMM4 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (25.0%) |
| VPCMPEQB %XMM0,%XMM0,%K2 | vect (25.0%) | |||||||||||
| VGATHERDPS (%R9,%XMM2,4),%XMM3{%K1} | 4 | 1 | 0 | 2 | 2 | 0 | 1 | 0 | 0 | 19 | 4 | vect (25.0%) |
| VXORPS %XMM2,%XMM2,%XMM2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | vect (25.0%) |
| VGATHERDPS (%R10,%XMM4,4),%XMM2{%K2} | 4 | 1 | 0 | 2 | 2 | 0 | 1 | 0 | 0 | 19 | 4 | vect (25.0%) |
| VCVTPS2PD %XMM3,%YMM3 | 2 | 0.50 | 0.50 | 0 | 0 | 0 | 1 | 0 | 0 | 7 | 1 | vect (25.0%) |
| VCVTPS2PD %XMM2,%YMM2 | 2 | 0.50 | 0.50 | 0 | 0 | 0 | 1 | 0 | 0 | 7 | 1 | vect (25.0%) |
| VFMADD231PD %YMM2,%YMM3,%YMM0 | 1 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0.50 | vect (50.0%) |
| ADD $0x4,%R8 | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | N/A |
| CMP %R15,%R8 | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | N/A |
| JB 404e60 <main+0x1d40> | 1 | 0.50 | 0 | 0 | 0 | 0 | 0 | 0.50 | 0 | 0 | 0.50-1 | N/A |
