Skip to content

Feat kernel profiler#1407

Draft
SamuelBelanger wants to merge 15 commits into
mainfrom
feat/performance-observability
Draft

Feat kernel profiler#1407
SamuelBelanger wants to merge 15 commits into
mainfrom
feat/performance-observability

Conversation

@SamuelBelanger

@SamuelBelanger SamuelBelanger commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This is an early draft and a work in progress. It is not complete or clean.

Overview

The goal of this POC is to introduce a profiler that:

  1. Is easily integrated into the existing CubeCL execution model.
  2. Remains detached from cubecl-ir operations. This separation is crucial for future compatibility with pliron.

Design Choices

By keeping the profiler decoupled from cubecl-ir, we avoid entangling performance measurement logic with the intermediate representation. This means:

  • The profiler intercepts or instruments at the runtime/execution layer rather than modifying IR nodes.
  • When cubecl-ir transitions to or integrates with pliron, the profiler will require minimal, if any, changes because it does not depend on the specific IR structure.

Integration

The profiler is designed to be easily plugged into the CubeCL runtime. The current POC demonstrates counting FLOPs and memory operations, as seen in the tests (e.g., in crates/cubecl/tests/profiler.rs).

Once integrated, the profiler is capable of generating detailed operation summaries. Here is a possible output demonstrating this:

FlopRecord:
  samples: 1
  last:
f32
├── Arithmetic
│   └── Add:   3 ops
└── Memory
    ├── Index: 8 bytes
    └── Store: 8 bytes
u32
└── Arithmetic
    ├── Min:   2 ops
    └── Sub:   2 ops

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

Successfully merging this pull request may close these issues.

2 participants