| Loop Id: 26 | Module: attention-icx-skl512 | Source: attention_v2.cpp:26-98 [...] | Coverage: 0.07% |
|---|
| Loop Id: 26 | Module: attention-icx-skl512 | Source: attention_v2.cpp:26-98 [...] | Coverage: 0.07% |
|---|
0x405200 LEA 0x1(%RDX),%ESI |
0x405203 MOV 0xb8(%RSP),%RDI |
0x40520b ADD %RDI,%RCX |
0x40520e CMP 0xac(%RSP),%EDX |
0x405215 MOV %ESI,%EDX |
0x405217 JE 4053f0 |
0x40521d MOV %EDX,%ESI |
0x40521f IMUL %EDI,%ESI |
0x405222 VPBROADCASTD %ESI,%YMM0 |
0x405228 MOV %EDX,%ESI |
0x40522a IMUL 0x120(%RSP),%ESI |
0x405232 XOR %EDI,%EDI |
0x405234 JMP 405333 |
(27) 0x405240 VXORPD %XMM2,%XMM2,%XMM2 |
(27) 0x405244 XOR %R8D,%R8D |
(27) 0x405247 VPBROADCASTQ %R8,%ZMM3 |
(27) 0x40524d VMOVDQU64 0x340(%RSP),%ZMM4 |
(27) 0x405255 VPSUBQ %ZMM3,%ZMM4,%ZMM4 |
(27) 0x40525b VPCMPGTQ %ZMM13,%ZMM4,%K1 |
(27) 0x405261 VPMOVQD %ZMM3,%YMM3 |
(27) 0x405267 VPADDD %YMM3,%YMM14,%YMM3 |
(27) 0x40526b VPADDD %YMM3,%YMM0,%YMM4 |
(27) 0x40526f MOV 0xc8(%RSP),%R8 |
(27) 0x405277 ADD %R14,%R8 |
(27) 0x40527a VPBROADCASTD 0x8d81(%RIP),%YMM6 |
(27) 0x405283 VPSUBD %YMM6,%YMM4,%YMM4 |
(27) 0x405287 VXORPS %XMM5,%XMM5,%XMM5 |
(27) 0x40528b KMOVQ %K1,%K2 |
(27) 0x405290 VGATHERDPS (%R8,%YMM4,4),%YMM5{%K2} |
(27) 0x405297 VMOVAPS %YMM5,%YMM12{%K1} |
(27) 0x40529d VCVTPS2PD %YMM12,%ZMM4 |
(27) 0x4052a3 VPMULLD 0x320(%RSP),%YMM3,%YMM3 |
(27) 0x4052ad VPADDD %YMM3,%YMM1,%YMM1 |
(27) 0x4052b1 LEA (%R12,%R14,1),%R8 |
(27) 0x4052b5 VPSUBD %YMM6,%YMM1,%YMM1 |
(27) 0x4052b9 VPXOR %XMM3,%XMM3,%XMM3 |
(27) 0x4052bd KMOVQ %K1,%K2 |
(27) 0x4052c2 VGATHERDPS (%R8,%YMM1,4),%YMM3{%K2} |
(27) 0x4052c9 VMOVAPS %YMM3,%YMM11{%K1} |
(27) 0x4052cf VCVTPS2PD %YMM11,%ZMM1 |
(27) 0x4052d5 VMULPD %ZMM4,%ZMM1,%ZMM1{%K1}{z} |
(27) 0x4052db VEXTRACTF64X4 $0x1,%ZMM1,%YMM3 |
(27) 0x4052e2 VADDPD %ZMM3,%ZMM1,%ZMM1 |
(27) 0x4052e8 VEXTRACTF128 $0x1,%YMM1,%XMM3 |
(27) 0x4052ee VADDPD %XMM3,%XMM1,%XMM1 |
(27) 0x4052f2 VSHUFPD $0x1,%XMM1,%XMM1,%XMM3 |
(27) 0x4052f7 VADDSD %XMM3,%XMM1,%XMM1 |
(27) 0x4052fb VADDSD %XMM1,%XMM2,%XMM2 |
(27) 0x4052ff VCVTSD2SS %XMM2,%XMM2,%XMM1 |
(27) 0x405303 VMULSS 0x19c(%RSP),%XMM1,%XMM1 |
(27) 0x40530c LEA (%RSI,%RDI,1),%R8D |
(27) 0x405310 MOV 0xa0(%RSP),%R9 |
(27) 0x405318 VMOVSS %XMM1,(%R9,%R8,4) |
(27) 0x40531e LEA 0x1(%RDI),%R8 |
(27) 0x405322 CMP 0x188(%RSP),%RDI |
(27) 0x40532a MOV %R8,%RDI |
(27) 0x40532d JE 405200 |
(27) 0x405333 VPBROADCASTD %EDI,%YMM1 |
(27) 0x405339 TEST %R15,%R15 |
(27) 0x40533c JE 405240 |
(27) 0x405342 VXORPD %XMM2,%XMM2,%XMM2 |
(27) 0x405346 XOR %R8D,%R8D |
(27) 0x405349 NOPL (%RAX) |
(28) 0x405350 LEA (%RCX,%R8,1),%R9D |
(28) 0x405354 VPBROADCASTD %R9D,%YMM3 |
(28) 0x40535a LEA (%R11,%R14,1),%R9 |
(28) 0x40535e VXORPD %XMM4,%XMM4,%XMM4 |
(28) 0x405362 VPCMPEQB %XMM0,%XMM0,%K1 |
(28) 0x405368 VPBROADCASTD %R8D,%YMM5 |
(28) 0x40536e VPADDD %YMM3,%YMM10,%YMM3 |
(28) 0x405372 VPADDD %YMM5,%YMM8,%YMM5 |
(28) 0x405376 VPMULLD %YMM5,%YMM7,%YMM5 |
(28) 0x40537b VPADDD %YMM5,%YMM1,%YMM5 |
(28) 0x40537f LEA (%R12,%R14,1),%R10 |
(28) 0x405383 VPSUBD %YMM9,%YMM5,%YMM5 |
(28) 0x405388 VXORPS %XMM6,%XMM6,%XMM6 |
(28) 0x40538c VGATHERDPS (%R9,%YMM3,4),%YMM4{%K1} |
(28) 0x405393 VPCMPEQB %XMM0,%XMM0,%K1 |
(28) 0x405399 VGATHERDPS (%R10,%YMM5,4),%YMM6{%K1} |
(28) 0x4053a0 VCVTPS2PD %YMM4,%ZMM3 |
(28) 0x4053a6 VCVTPS2PD %YMM6,%ZMM4 |
(28) 0x4053ac VFMADD231PD %ZMM4,%ZMM3,%ZMM2 |
(28) 0x4053b2 ADD $0x8,%R8 |
(28) 0x4053b6 CMP %R15,%R8 |
(28) 0x4053b9 JB 405350 |
(27) 0x4053bb VEXTRACTF64X4 $0x1,%ZMM2,%YMM3 |
(27) 0x4053c2 VADDPD %ZMM3,%ZMM2,%ZMM2 |
(27) 0x4053c8 VEXTRACTF128 $0x1,%YMM2,%XMM3 |
(27) 0x4053ce VADDPD %XMM3,%XMM2,%XMM2 |
(27) 0x4053d2 VSHUFPD $0x1,%XMM2,%XMM2,%XMM3 |
(27) 0x4053d7 VADDSD %XMM3,%XMM2,%XMM2 |
(27) 0x4053db MOV %R15,%R8 |
(27) 0x4053de TEST $0x1,%AL |
(27) 0x4053e0 JE 405247 |
(27) 0x4053e6 JMP 4052ff |
/home/eoseret/Applications/llm-attention/attention_v2.cpp: 26 - 98 |
-------------------------------------------------------------------------------- |
26: for (unsigned int i = 0; i < M; ++i) { |
27: for (unsigned int j = 0; j < N; ++j) { //vectorized |
28: double sum = 0.0; |
29: #pragma clang loop vectorize(enable) |
30: for (unsigned int k = 0; k < K; ++k) { //vectorized |
31: sum += (double)A[i * K + k] * (double)B[k * N + j]; |
32: } |
33: C[i * N + j] = alpha * static_cast<float>(sum); |
[...] |
98: if (argc < 4) { |
| Coverage (%) | Name | Source Location | Module |
|---|---|---|---|
| ►100.00+ | __libc_init_first | libc.so.6 | |
| ○ | __libc_start_main | libc.so.6 | |
| ○ | _start | attention-icx-skl512 |
| 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 | 3.25 |
| CQA speedup if FP arith vectorized | 1.00 |
| CQA speedup if fully vectorized | 13.87 |
| CQA speedup if no inter-iteration dependency | NA |
| CQA speedup if next bottleneck killed | 1.08 |
| Bottlenecks | micro-operation queue, |
| Function | main |
| Source | attention_v2.cpp:26-26,attention_v2.cpp:31-33 |
| Source loop unroll info | NA |
| Source loop unroll confidence level | NA |
| Unroll/vectorization loop type | NA |
| Unroll factor | NA |
| CQA cycles | 3.25 |
| CQA cycles if no scalar integer | 1.00 |
| CQA cycles if FP arith vectorized | 3.25 |
| CQA cycles if fully vectorized | 0.23 |
| Front-end cycles | 3.25 |
| P0 cycles | 2.00 |
| P1 cycles | 3.00 |
| P2 cycles | 1.50 |
| P3 cycles | 1.50 |
| P4 cycles | 0.00 |
| P5 cycles | 2.00 |
| P6 cycles | 2.00 |
| P7 cycles | 0.00 |
| DIV/SQRT cycles | 0.00 |
| Inter-iter dependencies cycles | 0 |
| FE+BE cycles (UFS) | NA |
| Stall cycles (UFS) | NA |
| Nb insns | 13.00 |
| Nb uops | 13.00 |
| Nb loads | 3.00 |
| Nb stores | 0.00 |
| Nb stack references | 3.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 | 4.92 |
| Bytes prefetched | 0.00 |
| Bytes loaded | 16.00 |
| Bytes stored | 0.00 |
| Stride 0 | NA |
| Stride 1 | NA |
| Stride n | NA |
| Stride unknown | NA |
| Stride indirect | NA |
| Vectorization ratio all | 0.00 |
| Vectorization ratio load | 0.00 |
| Vectorization ratio store | NA |
| Vectorization ratio mul | 0.00 |
| Vectorization ratio add_sub | 0.00 |
| Vectorization ratio fma | NA |
| Vectorization ratio div_sqrt | NA |
| Vectorization ratio other | 0.00 |
| Vector-efficiency ratio all | 7.81 |
| Vector-efficiency ratio load | 9.38 |
| Vector-efficiency ratio store | NA |
| Vector-efficiency ratio mul | 6.25 |
| Vector-efficiency ratio add_sub | 12.50 |
| Vector-efficiency ratio fma | NA |
| Vector-efficiency ratio div_sqrt | NA |
| Vector-efficiency ratio other | 6.25 |
| Metric | Value |
|---|---|
| CQA speedup if no scalar integer | 3.25 |
| CQA speedup if FP arith vectorized | 1.00 |
| CQA speedup if fully vectorized | 13.87 |
| CQA speedup if no inter-iteration dependency | NA |
| CQA speedup if next bottleneck killed | 1.08 |
| Bottlenecks | micro-operation queue, |
| Function | main |
| Source | attention_v2.cpp:26-26,attention_v2.cpp:31-33 |
| Source loop unroll info | NA |
| Source loop unroll confidence level | NA |
| Unroll/vectorization loop type | NA |
| Unroll factor | NA |
| CQA cycles | 3.25 |
| CQA cycles if no scalar integer | 1.00 |
| CQA cycles if FP arith vectorized | 3.25 |
| CQA cycles if fully vectorized | 0.23 |
| Front-end cycles | 3.25 |
| P0 cycles | 2.00 |
| P1 cycles | 3.00 |
| P2 cycles | 1.50 |
| P3 cycles | 1.50 |
| P4 cycles | 0.00 |
| P5 cycles | 2.00 |
| P6 cycles | 2.00 |
| P7 cycles | 0.00 |
| DIV/SQRT cycles | 0.00 |
| Inter-iter dependencies cycles | 0 |
| FE+BE cycles (UFS) | NA |
| Stall cycles (UFS) | NA |
| Nb insns | 13.00 |
| Nb uops | 13.00 |
| Nb loads | 3.00 |
| Nb stores | 0.00 |
| Nb stack references | 3.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 | 4.92 |
| Bytes prefetched | 0.00 |
| Bytes loaded | 16.00 |
| Bytes stored | 0.00 |
| Stride 0 | NA |
| Stride 1 | NA |
| Stride n | NA |
| Stride unknown | NA |
| Stride indirect | NA |
| Vectorization ratio all | 0.00 |
| Vectorization ratio load | 0.00 |
| Vectorization ratio store | NA |
| Vectorization ratio mul | 0.00 |
| Vectorization ratio add_sub | 0.00 |
| Vectorization ratio fma | NA |
| Vectorization ratio div_sqrt | NA |
| Vectorization ratio other | 0.00 |
| Vector-efficiency ratio all | 7.81 |
| Vector-efficiency ratio load | 9.38 |
| Vector-efficiency ratio store | NA |
| Vector-efficiency ratio mul | 6.25 |
| Vector-efficiency ratio add_sub | 12.50 |
| Vector-efficiency ratio fma | NA |
| Vector-efficiency ratio div_sqrt | NA |
| Vector-efficiency ratio other | 6.25 |
| Path / |
| Function | main |
| Source file and lines | attention_v2.cpp:26-98 |
| Module | attention-icx-skl512 |
| nb instructions | 13 |
| nb uops | 13 |
| loop length | 57 |
| used x86 registers | 5 |
| used mmx registers | 0 |
| used xmm registers | 0 |
| used ymm registers | 1 |
| used zmm registers | 0 |
| nb stack references | 3 |
| micro-operation queue | 3.25 cycles |
| front end | 3.25 cycles |
| P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | |
|---|---|---|---|---|---|---|---|---|
| uops | 2.00 | 2.00 | 1.50 | 1.50 | 0.00 | 2.00 | 2.00 | 0.00 |
| cycles | 2.00 | 3.00 | 1.50 | 1.50 | 0.00 | 2.00 | 2.00 | 0.00 |
| Cycles executing div or sqrt instructions | NA |
| Longest recurrence chain latency (RecMII) | 0.00 |
| Front-end | 3.25 |
| Dispatch | 3.00 |
| Data deps. | 0.00 |
| Overall L1 | 3.25 |
| all | 0% |
| load | 0% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 0% |
| add-sub | 0% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 0% |
| all | 7% |
| load | 9% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 6% |
| add-sub | 12% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 6% |
| Instruction | Nb FU | P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | Latency | Recip. throughput | Vectorization |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| LEA 0x1(%RDX),%ESI | 1 | 0 | 0.50 | 0 | 0 | 0 | 0.50 | 0 | 0 | 1 | 0.50 | N/A |
| MOV 0xb8(%RSP),%RDI | 1 | 0 | 0 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 4-5 | 0.50 | scal (12.5%) |
| ADD %RDI,%RCX | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | scal (12.5%) |
| CMP 0xac(%RSP),%EDX | 1 | 0.25 | 0.25 | 0.50 | 0.50 | 0 | 0.25 | 0.25 | 0 | 1 | 0.50 | N/A |
| MOV %ESI,%EDX | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | N/A |
| JE 4053f0 <main+0x2140> | 1 | 0.50 | 0 | 0 | 0 | 0 | 0 | 0.50 | 0 | 0 | 0.50-1 | N/A |
| MOV %EDX,%ESI | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | scal (6.3%) |
| IMUL %EDI,%ESI | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | scal (6.3%) |
| VPBROADCASTD %ESI,%YMM0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | scal (6.3%) |
| MOV %EDX,%ESI | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | scal (6.3%) |
| IMUL 0x120(%RSP),%ESI | 1 | 0 | 1 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 3 | 1 | scal (6.3%) |
| XOR %EDI,%EDI | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | scal (6.3%) |
| JMP 405333 <main+0x2083> | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1-2 | N/A |
| Function | main |
| Source file and lines | attention_v2.cpp:26-98 |
| Module | attention-icx-skl512 |
| nb instructions | 13 |
| nb uops | 13 |
| loop length | 57 |
| used x86 registers | 5 |
| used mmx registers | 0 |
| used xmm registers | 0 |
| used ymm registers | 1 |
| used zmm registers | 0 |
| nb stack references | 3 |
| micro-operation queue | 3.25 cycles |
| front end | 3.25 cycles |
| P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | |
|---|---|---|---|---|---|---|---|---|
| uops | 2.00 | 2.00 | 1.50 | 1.50 | 0.00 | 2.00 | 2.00 | 0.00 |
| cycles | 2.00 | 3.00 | 1.50 | 1.50 | 0.00 | 2.00 | 2.00 | 0.00 |
| Cycles executing div or sqrt instructions | NA |
| Longest recurrence chain latency (RecMII) | 0.00 |
| Front-end | 3.25 |
| Dispatch | 3.00 |
| Data deps. | 0.00 |
| Overall L1 | 3.25 |
| all | 0% |
| load | 0% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 0% |
| add-sub | 0% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 0% |
| all | 7% |
| load | 9% |
| store | NA (no store vectorizable/vectorized instructions) |
| mul | 6% |
| add-sub | 12% |
| fma | NA (no fma vectorizable/vectorized instructions) |
| div/sqrt | NA (no div/sqrt vectorizable/vectorized instructions) |
| other | 6% |
| Instruction | Nb FU | P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | Latency | Recip. throughput | Vectorization |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| LEA 0x1(%RDX),%ESI | 1 | 0 | 0.50 | 0 | 0 | 0 | 0.50 | 0 | 0 | 1 | 0.50 | N/A |
| MOV 0xb8(%RSP),%RDI | 1 | 0 | 0 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 4-5 | 0.50 | scal (12.5%) |
| ADD %RDI,%RCX | 1 | 0.25 | 0.25 | 0 | 0 | 0 | 0.25 | 0.25 | 0 | 1 | 0.25 | scal (12.5%) |
| CMP 0xac(%RSP),%EDX | 1 | 0.25 | 0.25 | 0.50 | 0.50 | 0 | 0.25 | 0.25 | 0 | 1 | 0.50 | N/A |
| MOV %ESI,%EDX | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | N/A |
| JE 4053f0 <main+0x2140> | 1 | 0.50 | 0 | 0 | 0 | 0 | 0 | 0.50 | 0 | 0 | 0.50-1 | N/A |
| MOV %EDX,%ESI | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | scal (6.3%) |
| IMUL %EDI,%ESI | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 1 | scal (6.3%) |
| VPBROADCASTD %ESI,%YMM0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | scal (6.3%) |
| MOV %EDX,%ESI | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | scal (6.3%) |
| IMUL 0x120(%RSP),%ESI | 1 | 0 | 1 | 0.50 | 0.50 | 0 | 0 | 0 | 0 | 3 | 1 | scal (6.3%) |
| XOR %EDI,%EDI | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | scal (6.3%) |
| JMP 405333 <main+0x2083> | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1-2 | N/A |
