Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

large number of unsupported papi counters on 13th Gen Intel Core i7-13800H #131

Closed
TomMelt opened this issue Dec 5, 2023 · 7 comments
Closed

Comments

@TomMelt
Copy link

TomMelt commented Dec 5, 2023

I want to use papi on my laptop for profiling but I can only see a small number of papi counters (and to get that I had to install the latest version v7)

Initially I tried v6 but it doesnt work for me at all. I moved to version 7 and here is what I get:

$ ./papi_avail -a
Available PAPI preset and user defined events plus hardware information.
--------------------------------------------------------------------------------
PAPI version             : 7.0.1.0
Operating system         : Linux 6.2.0-37-generic
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : 13th Gen Intel(R) Core(TM) i7-13800H (186, 0xba)
CPU revision             : 2.000000
CPUID                    : Family/Model/Stepping 6/186/2, 0x06/0xba/0x02
CPU Max MHz              : 5000
CPU Min MHz              : 400
Total cores              : 14
SMT threads per core     : 1
Cores per socket         : 14
Sockets                  : 1
Cores per NUMA region    : 14
NUMA regions             : 1
Running in a VM          : no
Number Hardware Counters : 0
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

================================================================================
  PAPI Preset Events
================================================================================
    Name        Code    Deriv Description (Note)

--------------------------------------------------------------------------------
Of 0 available events, 0 are derived.

No events detected!  Check papi_component_avail to find out why.

If I run papi_component_avail I get:

$ ./papi_component_avail
Available components and hardware information.
--------------------------------------------------------------------------------
PAPI version             : 7.0.1.0
Operating system         : Linux 6.2.0-37-generic
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : 13th Gen Intel(R) Core(TM) i7-13800H (186, 0xba)
CPU revision             : 2.000000
CPUID                    : Family/Model/Stepping 6/186/2, 0x06/0xba/0x02
CPU Max MHz              : 5000
CPU Min MHz              : 400
Total cores              : 14
SMT threads per core     : 1
Cores per socket         : 14
Sockets                  : 1
Cores per NUMA region    : 14
NUMA regions             : 1
Running in a VM          : no
Number Hardware Counters : 0
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

Compiled-in components:
Name:   perf_event              Linux perf_event CPU counters
   \-> Disabled: Error libpfm4 no default PMU found
Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
   \-> Disabled: No uncore PMUs or events found
Name:   sysdetect               System info detection component

Active components:
Name:   sysdetect               System info detection component
                                Native: 0, Preset: 0, Counters: 0

so finally if I set LIBPFM_FORCE_PMU :

$ LIBPFM_FORCE_PMU=amd64 ./papi_component_avail 
Available components and hardware information.
--------------------------------------------------------------------------------
PAPI version             : 7.0.1.0
Operating system         : Linux 6.2.0-37-generic
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : 13th Gen Intel(R) Core(TM) i7-13800H (186, 0xba)
CPU revision             : 2.000000
CPUID                    : Family/Model/Stepping 6/186/2, 0x06/0xba/0x02
CPU Max MHz              : 5000
CPU Min MHz              : 400
Total cores              : 14
SMT threads per core     : 1
Cores per socket         : 14
Sockets                  : 1
Cores per NUMA region    : 14
NUMA regions             : 1
Running in a VM          : no
Number Hardware Counters : 4
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

Compiled-in components:
Name:   perf_event              Linux perf_event CPU counters
Name:   perf_event_uncore       Linux perf_event CPU uncore and northbridge
   \-> Disabled: No uncore PMUs or events found
Name:   sysdetect               System info detection component

Active components:
Name:   perf_event              Linux perf_event CPU counters
                                Native: 24, Preset: 18, Counters: 4
                                PMUs supported: amd64_k7

Name:   sysdetect               System info detection component
                                Native: 0, Preset: 0, Counters: 0

Now running papi_avail, I get:

$ LIBPFM_FORCE_PMU=amd64 ./papi_avail -a
Available PAPI preset and user defined events plus hardware information.
--------------------------------------------------------------------------------
PAPI version             : 7.0.1.0
Operating system         : Linux 6.2.0-37-generic
Vendor string and code   : GenuineIntel (1, 0x1)
Model string and code    : 13th Gen Intel(R) Core(TM) i7-13800H (186, 0xba)
CPU revision             : 2.000000
CPUID                    : Family/Model/Stepping 6/186/2, 0x06/0xba/0x02
CPU Max MHz              : 5000
CPU Min MHz              : 400
Total cores              : 14
SMT threads per core     : 1
Cores per socket         : 14
Sockets                  : 1
Cores per NUMA region    : 14
NUMA regions             : 1
Running in a VM          : no
Number Hardware Counters : 4
Max Multiplex Counters   : 384
Fast counter read (rdpmc): yes
--------------------------------------------------------------------------------

================================================================================
  PAPI Preset Events
================================================================================
    Name        Code    Deriv Description (Note)
PAPI_L1_DCM  0x80000000  No   Level 1 data cache misses
PAPI_L1_ICM  0x80000001  No   Level 1 instruction cache misses
PAPI_L1_TCM  0x80000006  Yes  Level 1 cache misses
PAPI_TLB_DM  0x80000014  No   Data translation lookaside buffer misses
PAPI_TLB_IM  0x80000015  No   Instruction translation lookaside buffer misses
PAPI_TLB_TL  0x80000016  Yes  Total translation lookaside buffer misses
PAPI_HW_INT  0x80000029  No   Hardware interrupts
PAPI_BR_TKN  0x8000002c  No   Conditional branch instructions taken
PAPI_BR_MSP  0x8000002e  No   Conditional branch instructions mispredicted
PAPI_TOT_INS 0x80000032  No   Instructions completed
PAPI_BR_INS  0x80000037  No   Branch instructions
PAPI_TOT_CYC 0x8000003b  No   Total cycles
PAPI_L1_DCH  0x8000003e  Yes  Level 1 data cache hits
PAPI_L1_DCA  0x80000040  No   Level 1 data cache accesses
PAPI_L1_ICA  0x8000004c  No   Level 1 instruction cache accesses
PAPI_L1_ICR  0x8000004f  No   Level 1 instruction cache reads
PAPI_L1_TCH  0x80000055  Yes  Level 1 total cache hits
PAPI_L1_TCA  0x80000058  Yes  Level 1 total cache accesses
--------------------------------------------------------------------------------
Of 18 available events, 5 are derived.

But I want to get PAPI_FP_INS for example and I can only 18 out of about 108 possible events.

Can anyone explain how I can find out where to get options for LIBPFM_FORCE_PMU? I got this off stackoverflow but I don't know how to find it out myself.

Is it possible to configure PAPI without needing to export LIBPFM_FORCE_PMU?

Is my intel i7 currently not fully supported, or am I doing something wrong? e.g. missing configure options.

(FYI I have set /proc/sys/kernel/perf_event_paranoid equal to 0 and I have sudo access on my laptop if necessary -- although commands above were run as user)

@TomMelt
Copy link
Author

TomMelt commented Dec 5, 2023

This could be related to #126

@TomMelt
Copy link
Author

TomMelt commented Dec 5, 2023

Looks like my CPU is raptor lake and perhaps it's not supported yet. I couldn't find anything in the repo's documentation about raptor.

If I am correct and it's just not added yet, let me know if I can help to add it in 👍

@gcongiu
Copy link
Contributor

gcongiu commented Dec 5, 2023

@TomMelt this is a two step process. First, you will need to ask the libpfm4 maintainer to add support for the raptor lake PMU. You can also submit a patch yourself, if you are willing to contribute. This will make the raptor lake PMU visible to PAPI and, consequently, all the hardware events supported by it. Second, PAPI preset events should be added for raptor lake. If you are willing to contribute here as well @adanalis can give you instructions on how to do that.

@TomMelt
Copy link
Author

TomMelt commented Dec 7, 2023

I have raised an issue for libpfm4. If that goes ahead I will reopen this issue.

@TomMelt TomMelt closed this as completed Dec 7, 2023
@junyongheo
Copy link

@gcongiu @adanalis I would be interested in contributing PAPI preset events for raptor lake, could you point me to the instructions for doing so?

@adanalis
Copy link
Contributor

adanalis commented Mar 7, 2024 via email

@junyongheo
Copy link

junyongheo commented Mar 8, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants