Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/RightNow-AI/autokernel
/ functions
Functions
293 in github.com/RightNow-AI/autokernel
⨍
Functions
293
◇
Types & classes
28
↓ 1 callers
Function
classify_kernel
Map a CUDA kernel name to an AutoKernel op type.
profile.py:449
↓ 1 callers
Function
cmd_next
Determine which kernel to optimize next and print the decision.
orchestrate.py:414
↓ 1 callers
Function
cmd_plan
Show the full optimization plan with Amdahl's law analysis.
orchestrate.py:716
↓ 1 callers
Function
cmd_record
Record an experiment result for a kernel. *status* is one of: kept, revert, failed, crash, timeout
orchestrate.py:476
↓ 1 callers
Function
cmd_report
Generate the aggregate report at workspace/aggregate_report.md.
orchestrate.py:577
↓ 1 callers
Function
cmd_status
Print the current orchestration status.
orchestrate.py:351
↓ 1 callers
Function
compute_fast_p
Compute fast_p metric. fast_p = (# correct AND speedup >= threshold) / total
kernelbench/scorer.py:52
↓ 1 callers
Function
detect_backend
Detect whether a kernel file uses the CUDA C++ or Triton backend. Returns 'cuda' or 'triton'.
export_hf.py:52
↓ 1 callers
Function
detect_gpu
Try to import detect_gpu from bench.py; fall back to standalone.
profile.py:170
↓ 1 callers
Function
detect_gpu
Auto-detect current GPU and return its spec.
bench.py:133
↓ 1 callers
Function
detect_kernel_type
Extract the KERNEL_TYPE from the source file, if declared.
export_hf.py:87
↓ 1 callers
Function
diagnose_kernel_failures
Apply each kernel replacement individually to find which one causes failure.
verify.py:772
↓ 1 callers
Function
discover_optimized_kernels
Find optimized kernels from the workspace directory. Checks orchestration_state.json first, then scans for *_optimized.py files.
verify.py:322
↓ 1 callers
Function
estimate_roofline_position
Rough heuristic: is this kernel compute-bound or memory-bound?
profile.py:477
↓ 1 callers
Function
export_kernel
Main export pipeline. Parameters ---------- kernel_path : str Path to the AutoKernel kernel file (kernel.py or similar).
export_hf.py:674
↓ 1 callers
Function
extract_function_name_from_compile
Extract the function name passed to compile_cuda(). Looks for patterns like: compile_cuda(CUDA_SRC, "matmul_cuda") compile_cuda(
export_hf.py:139
↓ 1 callers
Function
extract_kernel_body
Extract the Triton kernel code from a starter file, stripping the original module docstring and KERNEL_TYPE declaration (which we replace
extract.py:262
↓ 1 callers
Function
extract_kernels
Main extraction pipeline.
extract.py:462
↓ 1 callers
Function
extract_triton_code
Extract the Triton kernel code from a Python file. Returns everything from the first import statement onward, skipping the module docstr
export_hf.py:237
↓ 1 callers
Function
format_report
Format the verification result into a human-readable report.
verify.py:835
↓ 1 callers
Function
generate_build_toml
Generate the build.toml file for HF Kernels. Parameters ---------- name : str Kernel project name. functions : list
export_hf.py:269
↓ 1 callers
Function
generate_flake_nix
Generate the flake.nix for the HF kernel-builder Nix pipeline.
export_hf.py:423
↓ 1 callers
Function
generate_init_py
Generate the Python __init__.py for the HF Kernels module.
export_hf.py:450
↓ 1 callers
Function
generate_input
Generate appropriate sample input for the model.
profile.py:343
↓ 1 callers
Function
generate_kernel_file
Generate the complete kernel file content for extraction.
extract.py:290
↓ 1 callers
Function
generate_optimization_plan
Build the optimization_plan.json data structure.
extract.py:430
↓ 1 callers
Function
generate_sample_input
Generate a sample input tensor from a shape string like '1,2048'.
verify.py:202
↓ 1 callers
Method
generate_starter
Generate a starter kernel.py (ModelNew initially copies Model logic).
kernelbench/bridge.py:206
↓ 1 callers
Function
generate_test_data
Generate deterministic test tensors for all sizes and dtypes.
prepare.py:150
↓ 1 callers
Function
generate_torch_binding_cpp
Generate torch_binding.cpp with TORCH_LIBRARY_EXPAND registration. Uses the HuggingFace Kernels convention: torch/library.h + registration.h
export_hf.py:367
↓ 1 callers
Function
generate_torch_binding_h
Generate torch_binding.h with forward declarations.
export_hf.py:401
↓ 1 callers
Function
get_default_shape
Return a reasonable default shape for a given op_type when parsing fails. Based on the 'large' size from bench.py KERNEL_CONFIGS.
extract.py:223
↓ 1 callers
Function
get_or_create_state
Load existing state, or create one from the optimization plan.
orchestrate.py:187
↓ 1 callers
Function
get_supported_kernels
Extract the list of supported (autokernel_supported=True) kernels from the profile report, sorted by rank.
extract.py:405
↓ 1 callers
Function
get_vram_usage
Get current GPU VRAM usage in MB.
kernelbench/bench_kb.py:511
↓ 1 callers
Function
infer_input_type
Try to determine if the model expects integer token IDs or float tensors.
verify.py:219
↓ 1 callers
Function
is_autokernel_supported
Check if this op type has a matching kernels/*.py implementation.
profile.py:468
↓ 1 callers
Function
list_cached
List all cached problems with metadata.
kernelbench/bridge.py:469
↓ 1 callers
Function
load_baselines
Load cached baselines.json if it exists.
analysis.py:108
↓ 1 callers
Method
load_from_cache
(cls, level: int, problem_id: int)
kernelbench/bridge.py:78
↓ 1 callers
Function
load_kernel
Load ModelNew from kernel.py.
kernelbench/bench_kb.py:134
↓ 1 callers
Function
load_kernel_module
Dynamically import a kernel .py file and return the module.
verify.py:396
↓ 1 callers
Function
load_metadata
Load active problem metadata.
kernelbench/bench_kb.py:151
↓ 1 callers
Function
load_model
Unified model loader from CLI args.
verify.py:161
↓ 1 callers
Function
load_model
Load model according to CLI args. Returns (model, description_string).
profile.py:293
↓ 1 callers
Function
load_model_from_file
Load a model from a Python file by importing it and instantiating the class.
verify.py:104
↓ 1 callers
Function
load_model_from_module
Load a model from an installed Python module (e.g. 'transformers').
verify.py:129
↓ 1 callers
Function
load_orchestration_state
Load workspace/orchestration_state.json if it exists.
verify.py:314
↓ 1 callers
Function
load_profile_report
Load and validate the profile report JSON. Returns None on failure.
extract.py:392
↓ 1 callers
Function
load_reference
Load the reference Model, get_inputs, get_init_inputs from workspace.
kernelbench/bench_kb.py:115
↓ 1 callers
Function
load_results
Parse results.tsv into a pandas DataFrame, also merging any TSV files found in workspace/results/ (written by orchestrate.py). Returns No
analysis.py:66
↓ 1 callers
Function
load_state
Load the orchestration state, or None if it does not exist.
orchestrate.py:162
↓ 1 callers
Function
main
()
analysis.py:580
↓ 1 callers
Function
main
()
orchestrate.py:820
↓ 1 callers
Function
main
()
export_hf.py:806
↓ 1 callers
Function
main
()
verify.py:977
↓ 1 callers
Function
main
()
prepare.py:328
↓ 1 callers
Function
main
()
profile.py:939
↓ 1 callers
Function
main
()
bench.py:1194
↓ 1 callers
Function
main
()
extract.py:607
↓ 1 callers
Function
main
()
kernelbench/bridge.py:554
↓ 1 callers
Function
main
()
kernelbench/bench_kb.py:527
↓ 1 callers
Function
main
()
kernelbench/scorer.py:309
↓ 1 callers
Function
make_model_input
Create an appropriate input for the model.
verify.py:230
↓ 1 callers
Function
matmul_ref
Standard matrix multiplication. A @ B.
reference.py:10
↓ 1 callers
Function
parse_args
()
profile.py:826
↓ 1 callers
Function
parse_problem_range
Parse '1-10' or '1,3,5,7' into a list of problem IDs.
kernelbench/scorer.py:78
↓ 1 callers
Function
parse_shape_info
Parse a shape_info string like "M=4096, N=4096, K=4096" into a dict. Handles various formats: - "M=4096, N=4096, K=4096" - "B=1,
extract.py:176
↓ 1 callers
Function
print_report
Pretty-print the profiling results to the terminal.
profile.py:748
↓ 1 callers
Function
print_terminal_summary
Print a concise summary of the experiment session to stdout.
analysis.py:288
↓ 1 callers
Function
profile_model
Profile the model and return a list of KernelRecords sorted by GPU time desc. Returns: Tuple of (records, extras) where extras contains p
profile.py:529
↓ 1 callers
Function
read_starter_kernel
Read the starter kernel file. Returns None if not found. For backend='triton': reads from kernels/{op_type}.py For backend='cuda': reads fr
extract.py:246
↓ 1 callers
Function
run_correctness
Run all correctness stages. Returns dict with results.
bench.py:641
↓ 1 callers
Function
run_correctness
KernelBench-compatible correctness checks. Generate n_trials random input sets, run both models, compare within (atol, rtol).
kernelbench/bench_kb.py:255
↓ 1 callers
Function
run_determinism
Run 3 times with identical inputs, check bitwise reproducibility.
kernelbench/bench_kb.py:367
↓ 1 callers
Function
run_level
Run all (or selected) problems in a level.
kernelbench/scorer.py:182
↓ 1 callers
Function
run_performance
Run performance benchmarks. Returns dict with metrics.
bench.py:1003
↓ 1 callers
Function
run_performance
KernelBench-compatible performance benchmarking via CUDA event timing. Returns speedup = ref_time / kernel_time.
kernelbench/bench_kb.py:427
↓ 1 callers
Function
run_profile
Run torch profiler and save a trace.
bench.py:1138
↓ 1 callers
Function
run_single_problem
Set up and evaluate a single KernelBench problem. Returns a result dict with correctness, speedup, etc.
kernelbench/scorer.py:91
↓ 1 callers
Function
run_stability
Test numerical stability: check for NaN/Inf on normal inputs.
kernelbench/bench_kb.py:330
↓ 1 callers
Function
save_scores
Save scores to disk.
kernelbench/scorer.py:46
↓ 1 callers
Function
setup_problem
Set up workspace for optimizing a KernelBench problem. Creates: workspace/kb_active/reference.py -- original Model + get_inputs
kernelbench/bridge.py:495
↓ 1 callers
Function
smoke_test
Import kernel.py, run on tiny input, check correctness.
prepare.py:187
↓ 1 callers
Function
verify_environment
Print GPU specs, PyTorch version, Triton version. Exit on failure.
prepare.py:89
Function
TORCH_LIBRARY_EXPAND
examples/hf_kernels_test/torch-ext/torch_binding.cpp:6
Method
__enter__
(self)
verify.py:525
Method
__enter__
(self)
bench.py:55
Method
__enter__
(self)
kernelbench/bench_kb.py:76
Method
__exit__
(self, *exc)
verify.py:546
Method
__exit__
(self, *exc)
bench.py:67
Method
__exit__
(self, *_)
kernelbench/bench_kb.py:85
Method
__init__
(self, original: nn.LayerNorm, kernel_fn: Callable)
verify.py:444
Method
__init__
(self, original: nn.Module, kernel_fn: Callable)
verify.py:481
Method
__init__
(self, model: nn.Module, replacements: List[KernelReplacement])
verify.py:519
Method
__init__
(self, seconds: int)
bench.py:47
Method
__init__
(self, seconds: float, msg: str = "timeout")
kernelbench/bench_kb.py:71
Method
__init__
(self, n_embd: int, n_head: int, block_size: int, dropout: float = 0.0)
models/gpt2.py:19
Method
__init__
(self, n_embd: int, n_head: int, block_size: int, dropout: float = 0.0)
models/gpt2.py:74
Method
__init__
( self, vocab_size: int = 50257, block_size: int = 1024, n_layer: int = 12,
models/gpt2.py:98
← previous
next →
101–200 of 293, ranked by callers