MCPcopy Create free account
hub / github.com/RightNow-AI/autokernel / get_supported_kernels

Function get_supported_kernels

extract.py:405–423  ·  view source on GitHub ↗

Extract the list of supported (autokernel_supported=True) kernels from the profile report, sorted by rank.

(report: Dict[str, Any])

Source from the content-addressed store, hash-verified

403
404
405def get_supported_kernels(report: Dict[str, Any]) -> List[Dict[str, Any]]:
406 """
407 Extract the list of supported (autokernel_supported=True) kernels from
408 the profile report, sorted by rank.
409 """
410 kernels = report.get("top_kernels", report.get("kernels", report.get("bottleneck_kernels", [])))
411 supported = []
412 for k in kernels:
413 if k.get("autokernel_supported", False):
414 supported.append(k)
415
416 # Sort by rank if available, otherwise by gpu_time_ms descending
417 supported.sort(key=lambda x: x.get("rank", x.get("gpu_time_ms", 0)))
418 # Ensure rank ordering (lower rank = higher priority)
419 for i, k in enumerate(supported):
420 if "rank" not in k:
421 k["rank"] = i + 1
422
423 return supported
424
425
426# ---------------------------------------------------------------------------

Callers 1

extract_kernelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected