MORI-VIZ Kernel Profiler
MORI-VIZ is a warp-level GPU kernel profiler with Perfetto integration. It captures fine-grained timing data from dispatch/combine kernels.
Requirements
Build MORI with profiling enabled, and keep ENABLE_PROFILER=ON set when you
run, so the JIT compiles the instrumented kernels:
ENABLE_PROFILER=ON pip install .
Usage
Capture and export traces:
import mori
from mori.kernel_profiler import export_to_perfetto
# Run dispatch/combine operations first, then:
if hasattr(mori.cpp, "get_debug_time_buf"):
trace_buffer = op.get_debug_time_buf()
export_to_perfetto(trace_buffer, "ep_trace.json")
Visualize: Open the JSON file at ui.perfetto.dev.
export_to_perfetto
export_to_perfetto(
trace_buffer,
filename="trace.json",
slot_map=None,
gpu_freq_ghz=None,
validate_pairs=True,
sanitize_orphans=True,
)
Parameters:
Parameter |
Default |
Description |
|---|---|---|
|
The trace buffer tensor from |
|
|
|
Output file path (Perfetto JSON format) |
|
|
Custom slot name mapping (uses built-in profiler slots if None) |
|
|
GPU clock frequency; auto-detected via |
|
|
Validate begin/end event pairs |
|
|
Remove unpaired events |
C++ Profiler APIs
Available via mori.cpp when built with ENABLE_PROFILER=ON:
Function |
Description |
|---|---|
|
|
|
|
|
GPU wall-clock frequency. Despite the name, the value is in kHz
( |
See PROFILER.md for full profiler documentation.