Skip to main content
Glama

roofline

Calculate a GPU kernel's performance bound from FLOPs and bytes moved, then estimate attainable TFLOPS and runtime using dtype and optional measured memory bandwidth.

Instructions

Roofline for a GPU (default: the first GPU in this machine). Pass the kernel's flops and bytes moved (bench()/verify() return them as roofline_inputs) to get the bound, the attainable TFLOPS and attainable_ms from the spec sheet. Pass measured_mem_gbs (the bandwidth a streaming copy reaches on this card under the repo's timer, see docs/platform-matrix.md; 1501 on the reference RTX 5090) to also get attainable_ms_measured, the floor a kernel can realistically get within 10% of. dtype: bf16 | fp16 | fp8 | fp32.

Input Schema

NameRequiredDescriptionDefault
gpuNo
bytesNo
dtypeNobf16
flopsNo
measured_mem_gbsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden but does well: it names the returned metrics, explains the default GPU, clarifies the dtype choices, and describes the optional measured floor. It does not explicitly state side-effect/read-only behavior, though the tool appears to be a pure calculation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is dense but well structured: default GPU behavior first, core inputs and outputs next, optional measured behavior after that, and dtype last. Every sentence adds necessary information for a tool with five undocumented parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given five parameters, zero schema descriptions, and no output schema, the description is nearly complete: it explains inputs, outputs, defaults, and optional measured behavior. It could be slightly stronger by specifying output formatting or units more explicitly, but an agent has enough to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must explain all five parameters, and it does. It covers gpu defaulting to the first GPU, flops/bytes from bench()/verify(), measured_mem_gbs with documentation reference and example value, and dtype options.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that this tool computes a GPU roofline bound and attainable performance metrics from flops and bytes. It is specific about the computation and mentions bench()/verify() as input sources, but it does not explicitly differentiate itself from sibling tools like profile or gpu_info.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives clear usage context by explaining when to pass flops/bytes from bench()/verify() and when to pass measured_mem_gbs for measured attainable performance. It does not state when not to use the tool or name alternative siblings for comparison, so it falls short of full alternative guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.