Skip to content

Use cpu_cycles for core and nvidia_scf_pmu_0/cycles for SCF (#752)#752

Closed
charles-typ wants to merge 1 commit into
facebookresearch:v2-betafrom
charles-typ:export-D111288659-to-v2-beta
Closed

Use cpu_cycles for core and nvidia_scf_pmu_0/cycles for SCF (#752)#752
charles-typ wants to merge 1 commit into
facebookresearch:v2-betafrom
charles-typ:export-D111288659-to-v2-beta

Conversation

@charles-typ

@charles-typ charles-typ commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary:

Switch the NVIDIA Grace (Neoverse V2) perf-counter collection from the generic cycles event to the core-only cpu_cycles alias.

On ARM Grace in system-wide mode (perf stat -a), requesting the generic cycles event auto-expands to open a cycles counter on every PMU, including the uncore SCF PMU (nvidia_scf_pmu_0/cycles/). This wastes a scarce SCF counter slot and produces a duplicate row. Requesting cpu_cycles targets only the core PMU, while the SCF group keeps its explicit nvidia_scf_pmu_0/cycles/ event.

Changes:

  • collect_nvda_neoversev2_perf_counters.sh: INSTRUCTIONS_RATE now uses cpu_cycles instead of cycles.
  • generate_arm_perf_report.py: all core-cycles group lookups (get_group("cycles")) updated to get_group("cpu_cycles") to match the renamed event. The SCF cycles lookup (nvidia_scf_pmu_0/cycles/) is unchanged.

The two literals must change together, otherwise skip_if_missing would silently drop IPC/TopDown/timestamp metrics on a KeyError.

Ref: D99517233 reviewer feedback.

Session trajectory link

Differential Revision: D111288659

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 9, 2026
@meta-codesync

meta-codesync Bot commented Jul 9, 2026

Copy link
Copy Markdown

@charles-typ has exported this pull request. If you are a Meta employee, you can view the originating Diff in D111288659.

…research#752)

Summary:

Switch the NVIDIA Grace (Neoverse V2) perf-counter collection from the generic `cycles` event to the core-only `cpu_cycles` alias.

On ARM Grace in system-wide mode (`perf stat -a`), requesting the generic `cycles` event auto-expands to open a cycles counter on **every** PMU, including the uncore SCF PMU (`nvidia_scf_pmu_0/cycles/`). This wastes a scarce SCF counter slot and produces a duplicate row. Requesting `cpu_cycles` targets only the core PMU, while the SCF group keeps its explicit `nvidia_scf_pmu_0/cycles/` event.

Changes:
- `collect_nvda_neoversev2_perf_counters.sh`: `INSTRUCTIONS_RATE` now uses `cpu_cycles` instead of `cycles`.
- `generate_arm_perf_report.py`: all core-cycles group lookups (`get_group("cycles")`) updated to `get_group("cpu_cycles")` to match the renamed event. The SCF cycles lookup (`nvidia_scf_pmu_0/cycles/`) is unchanged.

The two literals must change together, otherwise `skip_if_missing` would silently drop IPC/TopDown/timestamp metrics on a `KeyError`.

Ref: D99517233 reviewer feedback.

[Session trajectory link](https://www.internalfb.com/intern/devai/devmate/inspector/?id=1e5a7bee-9130-4920-83cd-fe4560ed1d0c)

Differential Revision: D111288659
@meta-codesync meta-codesync Bot changed the title Use cpu_cycles for core and nvidia_scf_pmu_0/cycles for SCF Use cpu_cycles for core and nvidia_scf_pmu_0/cycles for SCF (#752) Jul 9, 2026
@charles-typ
charles-typ force-pushed the export-D111288659-to-v2-beta branch from ff960cf to 324ea2b Compare July 9, 2026 21:21
meta-codesync Bot pushed a commit that referenced this pull request Jul 11, 2026
Summary:
Pull Request resolved: #752

Switch the NVIDIA Grace (Neoverse V2) perf-counter collection from the generic `cycles` event to the core-only `cpu_cycles` alias.

On ARM Grace in system-wide mode (`perf stat -a`), requesting the generic `cycles` event auto-expands to open a cycles counter on **every** PMU, including the uncore SCF PMU (`nvidia_scf_pmu_0/cycles/`). This wastes a scarce SCF counter slot and produces a duplicate row. Requesting `cpu_cycles` targets only the core PMU, while the SCF group keeps its explicit `nvidia_scf_pmu_0/cycles/` event.

Changes:
- `collect_nvda_neoversev2_perf_counters.sh`: `INSTRUCTIONS_RATE` now uses `cpu_cycles` instead of `cycles`.
- `generate_arm_perf_report.py`: all core-cycles group lookups (`get_group("cycles")`) updated to `get_group("cpu_cycles")` to match the renamed event. The SCF cycles lookup (`nvidia_scf_pmu_0/cycles/`) is unchanged.

The two literals must change together, otherwise `skip_if_missing` would silently drop IPC/TopDown/timestamp metrics on a `KeyError`.

Ref: D99517233 reviewer feedback.

Reviewed By: YifanYuan3

Differential Revision: D111288659

fbshipit-source-id: f1059cf48ee773a81709dd2033ac6d74fdaf043e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant