| Loop Id: 34 | Module: attention-clang-skl256 | Source: attention_v2.cpp:237-238 | Coverage: 0.16% |
|---|
| Loop Id: 34 | Module: attention-clang-skl256 | Source: attention_v2.cpp:237-238 | Coverage: 0.16% |
|---|
0x4420 VPMULLQ %YMM5,%YMM0,%YMM2 |
0x4426 VMOVUPS (%RCX,%RDI,4),%XMM3 [2] |
0x442b VMOVUPS 0x10(%RCX,%RDI,4),%XMM4 [2] |
0x4431 KXNORW %K0,%K0,%K1 |
0x4435 VSCATTERQPS %XMM3,(%RSI,%YMM2,4){%K1} [1] |
0x443c VPMULLQ %YMM5,%YMM1,%YMM2 |
0x4442 KXNORW %K0,%K0,%K1 |
0x4446 VSCATTERQPS %XMM4,(%RSI,%YMM2,4){%K1} [1] |
0x444d ADD $0x8,%RDI |
0x4451 VPADDQ %YMM6,%YMM0,%YMM0 |
0x4455 VPADDQ %YMM6,%YMM1,%YMM1 |
0x4459 CMP %RDI,%R8 |
0x445c JNE 4420 |
/home/eoseret/Applications/llm-attention/attention_v2.cpp: 237 - 238 |
-------------------------------------------------------------------------------- |
237: for (int j = 0; j < dim; ++j)// vectorized |
238: h_KT[j * context_size + i] = h_K[i * dim + j]; |
| Coverage (%) | Name | Source Location | Module |
|---|---|---|---|
| ►100.00+ | __libc_init_first | libc.so.6 | |
| ○ | __libc_start_main | libc.so.6 | |
| ○ | _start | attention-clang-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.04 |
| CQA speedup if FP arith vectorized | 1.00 |
| CQA speedup if fully vectorized | 3.06 |
| CQA speedup if no inter-iteration dependency | NA |
| CQA speedup if next bottleneck killed | 1.63 |
| Bottlenecks | micro-operation queue, |
| Function | main |
| Source | attention_v2.cpp:237-238 |
| Source loop unroll info | unrolled by 16 |
| Source loop unroll confidence level | high |
| Unroll/vectorization loop type | main |
| Unroll factor | 16 |
| CQA cycles | 13.00 |
| CQA cycles if no scalar integer | 12.50 |
| CQA cycles if FP arith vectorized | 13.00 |
| CQA cycles if fully vectorized | 4.25 |
| Front-end cycles | 13.00 |
| P0 cycles | 4.00 |
| P1 cycles | 4.00 |
| P2 cycles | 5.00 |
| P3 cycles | 5.00 |
| P4 cycles | 8.00 |
| P5 cycles | 4.00 |
| P6 cycles | 2.00 |
| P7 cycles | 0.00 |
| DIV/SQRT cycles | 0.00 |
| Inter-iter dependencies cycles | 1 |
| FE+BE cycles (UFS) | NA |
| Stall cycles (UFS) | NA |
| Nb insns | 13.00 |
| Nb uops | 52.00 |
| Nb loads | 2.00 |
| Nb stores | 2.00 |
| Nb stack references | 0.00 |
| FLOP/cycle | 0.00 |
| Nb FLOP add-sub | 0.00 |
| Nb FLOP mul | 0.00 |
| Nb FLOP fma | 0.00 |
| Nb FLOP div | 0.00 |
| Nb FLOP rcp | 0.00 |
| Nb FLOP sqrt | 0.00 |
| Nb FLOP rsqrt | 0.00 |
| Bytes/cycle | 7.38 |
| Bytes prefetched | 0.00 |
| Bytes loaded | 32.00 |
| Bytes stored | 64.00 |
| Stride 0 | 0.00 |
| Stride 1 | 1.00 |
| Stride n | 0.00 |
| Stride unknown | 1.00 |
| Stride indirect | 0.00 |
| Vectorization ratio all | 100.00 |
| Vectorization ratio load | 100.00 |
| Vectorization ratio store | 100.00 |
| Vectorization ratio mul | 100.00 |
| Vectorization ratio add_sub | 100.00 |
| Vectorization ratio fma | NA |
| Vectorization ratio div_sqrt | NA |
| Vectorization ratio other | NA |
| Vector-efficiency ratio all | 37.50 |
| Vector-efficiency ratio load | 25.00 |
| Vector-efficiency ratio store | 25.00 |
| Vector-efficiency ratio mul | 50.00 |
| Vector-efficiency ratio add_sub | 50.00 |
| Vector-efficiency ratio fma | NA |
| Vector-efficiency ratio div_sqrt | NA |
| Vector-efficiency ratio other | NA |
| Metric | Value |
|---|---|
| CQA speedup if no scalar integer | 1.04 |
| CQA speedup if FP arith vectorized | 1.00 |
| CQA speedup if fully vectorized | 3.06 |
| CQA speedup if no inter-iteration dependency | NA |
| CQA speedup if next bottleneck killed | 1.63 |
| Bottlenecks | micro-operation queue, |
| Function | main |
| Source | attention_v2.cpp:237-238 |
| Source loop unroll info | unrolled by 16 |
| Source loop unroll confidence level | high |
| Unroll/vectorization loop type | main |
| Unroll factor | 16 |
| CQA cycles | 13.00 |
| CQA cycles if no scalar integer | 12.50 |
| CQA cycles if FP arith vectorized | 13.00 |
| CQA cycles if fully vectorized | 4.25 |
| Front-end cycles | 13.00 |
| P0 cycles | 4.00 |
| P1 cycles | 4.00 |
| P2 cycles | 5.00 |
| P3 cycles | 5.00 |
| P4 cycles | 8.00 |
| P5 cycles | 4.00 |
| P6 cycles | 2.00 |
| P7 cycles | 0.00 |
| DIV/SQRT cycles | 0.00 |
| Inter-iter dependencies cycles | 1 |
| FE+BE cycles (UFS) | NA |
| Stall cycles (UFS) | NA |
| Nb insns | 13.00 |
| Nb uops | 52.00 |
| Nb loads | 2.00 |
| Nb stores | 2.00 |
| Nb stack references | 0.00 |
| FLOP/cycle | 0.00 |
| Nb FLOP add-sub | 0.00 |
| Nb FLOP mul | 0.00 |
| Nb FLOP fma | 0.00 |
| Nb FLOP div | 0.00 |
| Nb FLOP rcp | 0.00 |
| Nb FLOP sqrt | 0.00 |
| Nb FLOP rsqrt | 0.00 |
| Bytes/cycle | 7.38 |
| Bytes prefetched | 0.00 |
| Bytes loaded | 32.00 |
| Bytes stored | 64.00 |
| Stride 0 | 0.00 |
| Stride 1 | 1.00 |
| Stride n | 0.00 |
| Stride unknown | 1.00 |
| Stride indirect | 0.00 |
| Vectorization ratio all | 100.00 |
| Vectorization ratio load | 100.00 |
| Vectorization ratio store | 100.00 |
| Vectorization ratio mul | 100.00 |
| Vectorization ratio add_sub | 100.00 |
| Vectorization ratio fma | NA |
| Vectorization ratio div_sqrt | NA |
| Vectorization ratio other | NA |
| Vector-efficiency ratio all | 37.50 |
| Vector-efficiency ratio load | 25.00 |
| Vector-efficiency ratio store | 25.00 |
| Vector-efficiency ratio mul | 50.00 |
| Vector-efficiency ratio add_sub | 50.00 |
| Vector-efficiency ratio fma | NA |
| Vector-efficiency ratio div_sqrt | NA |
| Vector-efficiency ratio other | NA |
| Path / |
| Function | main |
| Source file and lines | attention_v2.cpp:237-238 |
| Module | attention-clang-skl256 |
| nb instructions | 13 |
| nb uops | 52 |
| loop length | 62 |
| used x86 registers | 4 |
| used mmx registers | 0 |
| used xmm registers | 2 |
| used ymm registers | 5 |
| used zmm registers | 0 |
| nb stack references | 0 |
| micro-operation queue | 13.00 cycles |
| front end | 13.00 cycles |
| P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | |
|---|---|---|---|---|---|---|---|---|
| uops | 4.00 | 4.00 | 5.00 | 5.00 | 8.00 | 4.00 | 2.00 | 0.00 |
| cycles | 4.00 | 4.00 | 5.00 | 5.00 | 8.00 | 4.00 | 2.00 | 0.00 |
| Cycles executing div or sqrt instructions | NA |
| Longest recurrence chain latency (RecMII) | 1.00 |
| Front-end | 13.00 |
| Dispatch | 8.00 |
| Data deps. | 1.00 |
| Overall L1 | 13.00 |
| all | 100% |
| 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 | NA (no other vectorizable/vectorized instructions) |
| all | 100% |
| load | 100% |
| store | 100% |
| mul | NA (no mul vectorizable/vectorized instructions) |
| add-sub | NA (no add-sub vectorizable/vectorized instructions) |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| all | 100% |
| load | 100% |
| store | 100% |
| mul | 100% |
| add-sub | 100% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| all | 50% |
| load | NA (no load vectorizable/vectorized instructions) |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 50% |
| add-sub | 50% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| all | 25% |
| load | 25% |
| store | 25% |
| mul | NA (no mul vectorizable/vectorized instructions) |
| add-sub | NA (no add-sub vectorizable/vectorized instructions) |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| all | 37% |
| load | 25% |
| store | 25% |
| mul | 50% |
| add-sub | 50% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| Instruction | Nb FU | P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | Latency | Recip. throughput | Vectorization |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| VPMULLQ %YMM5,%YMM0,%YMM2 | 3 | 1.50 | 1.50 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 1.50 | vect (50.0%) |
| VMOVUPS (%RCX,%RDI,4),%XMM3 | 1 | 0 | 0 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 4-5 | 0.50 | vect (25.0%) |
| VMOVUPS 0x10(%RCX,%RDI,4),%XMM4 | 1 | 0 | 0 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 4-5 | 0.50 | vect (25.0%) |
| KXNORW %K0,%K0,%K1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | N/A |
| VSCATTERQPS %XMM3,(%RSI,%YMM2,4){%K1} | 19 | 0 | 0 | 2 | 2 | 4 | 1 | 0 | 0 | 13 | 9 | vect (25.0%) |
| VPMULLQ %YMM5,%YMM1,%YMM2 | 3 | 1.50 | 1.50 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 1.50 | vect (50.0%) |
| KXNORW %K0,%K0,%K1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | N/A |
| VSCATTERQPS %XMM4,(%RSI,%YMM2,4){%K1} | 19 | 0 | 0 | 2 | 2 | 4 | 1 | 0 | 0 | 13 | 9 | vect (25.0%) |
| ADD $0x8,%RDI | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | N/A |
| VPADDQ %YMM6,%YMM0,%YMM0 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (50.0%) |
| VPADDQ %YMM6,%YMM1,%YMM1 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (50.0%) |
| CMP %RDI,%R8 | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | N/A |
| JNE 4420 <main+0x1f40> | 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:237-238 |
| Module | attention-clang-skl256 |
| nb instructions | 13 |
| nb uops | 52 |
| loop length | 62 |
| used x86 registers | 4 |
| used mmx registers | 0 |
| used xmm registers | 2 |
| used ymm registers | 5 |
| used zmm registers | 0 |
| nb stack references | 0 |
| micro-operation queue | 13.00 cycles |
| front end | 13.00 cycles |
| P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | |
|---|---|---|---|---|---|---|---|---|
| uops | 4.00 | 4.00 | 5.00 | 5.00 | 8.00 | 4.00 | 2.00 | 0.00 |
| cycles | 4.00 | 4.00 | 5.00 | 5.00 | 8.00 | 4.00 | 2.00 | 0.00 |
| Cycles executing div or sqrt instructions | NA |
| Longest recurrence chain latency (RecMII) | 1.00 |
| Front-end | 13.00 |
| Dispatch | 8.00 |
| Data deps. | 1.00 |
| Overall L1 | 13.00 |
| all | 100% |
| 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 | NA (no other vectorizable/vectorized instructions) |
| all | 100% |
| load | 100% |
| store | 100% |
| mul | NA (no mul vectorizable/vectorized instructions) |
| add-sub | NA (no add-sub vectorizable/vectorized instructions) |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| all | 100% |
| load | 100% |
| store | 100% |
| mul | 100% |
| add-sub | 100% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| all | 50% |
| load | NA (no load vectorizable/vectorized instructions) |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 50% |
| add-sub | 50% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| all | 25% |
| load | 25% |
| store | 25% |
| mul | NA (no mul vectorizable/vectorized instructions) |
| add-sub | NA (no add-sub vectorizable/vectorized instructions) |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| all | 37% |
| load | 25% |
| store | 25% |
| mul | 50% |
| add-sub | 50% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | NA (no other vectorizable/vectorized instructions) |
| Instruction | Nb FU | P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | Latency | Recip. throughput | Vectorization |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| VPMULLQ %YMM5,%YMM0,%YMM2 | 3 | 1.50 | 1.50 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 1.50 | vect (50.0%) |
| VMOVUPS (%RCX,%RDI,4),%XMM3 | 1 | 0 | 0 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 4-5 | 0.50 | vect (25.0%) |
| VMOVUPS 0x10(%RCX,%RDI,4),%XMM4 | 1 | 0 | 0 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 4-5 | 0.50 | vect (25.0%) |
| KXNORW %K0,%K0,%K1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | N/A |
| VSCATTERQPS %XMM3,(%RSI,%YMM2,4){%K1} | 19 | 0 | 0 | 2 | 2 | 4 | 1 | 0 | 0 | 13 | 9 | vect (25.0%) |
| VPMULLQ %YMM5,%YMM1,%YMM2 | 3 | 1.50 | 1.50 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 1.50 | vect (50.0%) |
| KXNORW %K0,%K0,%K1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | N/A |
| VSCATTERQPS %XMM4,(%RSI,%YMM2,4){%K1} | 19 | 0 | 0 | 2 | 2 | 4 | 1 | 0 | 0 | 13 | 9 | vect (25.0%) |
| ADD $0x8,%RDI | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | N/A |
| VPADDQ %YMM6,%YMM0,%YMM0 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (50.0%) |
| VPADDQ %YMM6,%YMM1,%YMM1 | 1 | 0.33 | 0.33 | 0 | 0 | 0 | 0.33 | 0 | 0 | 1 | 0.33 | vect (50.0%) |
| CMP %RDI,%R8 | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | N/A |
| JNE 4420 <main+0x1f40> | 1 | 0.50 | 0 | 0 | 0 | 0 | 0 | 0.50 | 0 | 0 | 0.50-1 | N/A |
