kernelfoundry.eval_pipeline.profiler_command¶
Profiler command wrappers for different profilers (Unitrace, NCU, VTune)
Functions
|
Get the appropriate profiler class based on user-specified profiler type or language & GPU architecture. |
Classes
|
Nsight Compute profiler helper |
|
Helper to run Unitrace for OpenCL kernels with metric-sampling |
|
Abstract base class for profiler helpers |
|
Unitrace profiler helper |
|
VTune profiler helper for Intel GPUs |
- class kernelfoundry.eval_pipeline.profiler_command.Profiler(output_dir: Path | str)[source]¶
Abstract base class for profiler helpers
- abstract wrap_cmd(cmd: str) str[source]¶
Wrap the given command with profiler-specific command :param cmd: The original command to run the program without profiling
- Returns:
A wrapped command that includes the original command and any additional commands needed for profiling.
- env_vars()[source]¶
Return a dictionary of environment variables to update or add when running the command
- end_marker() str | None[source]¶
Return the end-of-process marker string for this profiler.
The marker is passed to
robust_subprocess_runto detect when the profiled process has finished and can safely be terminated.The default
"pytest"activates the pytest-summary monitor, which waits for the pytest result line. Return a different string to watch for that literal in the output, orNoneto disable early termination entirely.
- class kernelfoundry.eval_pipeline.profiler_command.Unitrace(output_dir: Path | str, group: str = 'ComputeBasic', timeline: bool = True, unitrace_cmd: str = 'unitrace')[source]¶
Unitrace profiler helper
- __init__(output_dir: Path | str, group: str = 'ComputeBasic', timeline: bool = True, unitrace_cmd: str = 'unitrace')[source]¶
- class kernelfoundry.eval_pipeline.profiler_command.OCLUnitrace(output_dir: Path | str, group: str = 'ComputeBasic', timeline: bool = True, unitrace_cmd: str = 'unitrace')[source]¶
Helper to run Unitrace for OpenCL kernels with metric-sampling
- end_marker() str | None[source]¶
Return the end-of-process marker string for this profiler.
The marker is passed to
robust_subprocess_runto detect when the profiled process has finished and can safely be terminated.The default
"pytest"activates the pytest-summary monitor, which waits for the pytest result line. Return a different string to watch for that literal in the output, orNoneto disable early termination entirely.
- class kernelfoundry.eval_pipeline.profiler_command.NCU(output_dir: Path | str, ncu_cmd: str = 'ncu')[source]¶
Nsight Compute profiler helper
- class kernelfoundry.eval_pipeline.profiler_command.VTune(output_dir: Path | str, vtune_cmd: str = 'vtune')[source]¶
VTune profiler helper for Intel GPUs
- wrap_cmd(cmd: str) str[source]¶
Wrap the given command with VTune collection and hotspot report generation.
Chains two commands with && so all vtune invocations happen inside the same environment (e.g. container) where vtune is available:
vtune -collect (paused; the kernel under test resumes it via ITT)
vtune -report hotspots -> tsv file
read_output() then simply reads that file without invoking vtune.
- end_marker() str | None[source]¶
Return the end-of-process marker string for this profiler.
The marker is passed to
robust_subprocess_runto detect when the profiled process has finished and can safely be terminated.The default
"pytest"activates the pytest-summary monitor, which waits for the pytest result line. Return a different string to watch for that literal in the output, orNoneto disable early termination entirely.