analytical_roofline#
Helpers for the agent-derived analytical roofline target.
The analytical-roofline skill (see skills/analytical-roofline) asks a one-shot agent
session to derive an ideal, hardware-instruction-count-independent roofline target (FLOPs and
bytes moved) from a task’s reference math and benchmark shapes. These helpers build that
agent’s prompt and parse/validate its output; see
_compute_analytical_roofline()
for how the agent session itself is run.
Functions
Build the prompt for the one-shot roofline-analysis agent. |
|
Textual summary of the reference's profiler data. |
|
|
Parse and validate the JSON the roofline-analysis agent should have written. |
Check whether the task package already ships a hand-authored |
- kernelfoundry.algorithm.utils.analytical_roofline.collate_reference_profiler_feedback(task: Task) str | None[source]#
Textual summary of the reference’s profiler data. Handed to the roofline-analysis agent just for reference.
Returns
Noneif no reference trace data is available.
- kernelfoundry.algorithm.utils.analytical_roofline.build_analytical_roofline_prompt(task: Task) str[source]#
Build the prompt for the one-shot roofline-analysis agent.
Appends the reference’s measured profiler feedback (if available) as a sanity-check signal - see
collate_reference_profiler_feedback().
- kernelfoundry.algorithm.utils.analytical_roofline.read_analytical_roofline_output(task_data_dir: Path) dict | None[source]#
Parse and validate the JSON the roofline-analysis agent should have written.
Returns
None(triggering a fallback to the instruction-count roofline) if the file is missing or fails validation - this number gates an automated stopping criterion, so an unparsable or malformed agent output must never be trusted silently.