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
↓ 10 callers
Function
compile_cuda
Compile CUDA C++ source into a callable PyTorch extension module. Parameters ---------- cuda_src : str The CUDA C++ source c
kernels/cuda/_compile.py:153
↓ 8 callers
Function
_dtype_bytes
Return byte-width for a dtype.
bench.py:325
↓ 8 callers
Function
_has_nan_inf
Check for NaN or Inf.
bench.py:636
↓ 8 callers
Function
kernel_fn
Entry point called by bench.py. Must match reference.matmul_ref signature.
kernel.py:62
↓ 5 callers
Method
__init__
(self, dim: int, eps: float = 1e-6)
models/llama_7b.py:23
↓ 5 callers
Function
save_state
Persist the orchestration state to disk.
orchestrate.py:178
↓ 4 callers
Function
_compare
Compare two tensors and return statistics.
bench.py:604
↓ 4 callers
Function
extract_tensor
Extract a single tensor from model output, which might be a tuple, dict, or ModelOutput-like object.
verify.py:648
↓ 4 callers
Function
shape_to_display
Convert a shape dict to a display string like 'M=4096, N=4096, K=4096'.
extract.py:210
↓ 3 callers
Method
__init__
(self, n_embd: int, dropout: float = 0.0)
models/gpt2.py:58
↓ 3 callers
Method
__init__
(self, hidden_size: int, intermediate_size: int, dropout: float = 0.0)
models/bert_base.py:44
↓ 3 callers
Function
_ensure_workspace
Create workspace directories if they do not exist.
orchestrate.py:80
↓ 3 callers
Function
_get_baseline_throughput
Determine baseline throughput from the first row in results or from baselines.json.
analysis.py:260
↓ 3 callers
Function
_run
()
verify.py:271
↓ 3 callers
Method
analyze
Identify operations, shapes, parameter usage, and estimate difficulty.
kernelbench/bridge.py:92
↓ 3 callers
Function
estimate_aggregate_speedup
Amdahl's law: S = 1 / ((1 - p) + p / s) where p = fraction of total GPU time in optimized kernels, s = speedup of those kernels.
orchestrate.py:255
↓ 3 callers
Function
load_plan
Load workspace/optimization_plan.json. Returns None if missing.
orchestrate.py:95
↓ 3 callers
Method
save_to_cache
(self)
kernelbench/bridge.py:66
↓ 2 callers
Method
__init__
(self, original: nn.Linear, kernel_fn: Callable)
verify.py:411
↓ 2 callers
Function
_do_bench
Benchmark a function and return median time in milliseconds. Uses triton.testing.do_bench if available, otherwise manual implementation.
bench.py:973
↓ 2 callers
Function
_dtype_tag
Short string tag for a dtype, e.g. 'fp16', 'bf16'.
prepare.py:50
↓ 2 callers
Function
_find_next_pending
Return the index of the next pending kernel after current_idx, or None.
orchestrate.py:338
↓ 2 callers
Function
_has_nan_inf
(t)
kernelbench/bench_kb.py:163
↓ 2 callers
Function
_kernel_results_path
Derive the per-kernel results TSV path from a kernel file name.
orchestrate.py:209
↓ 2 callers
Function
_load_module_from_path
Dynamically load a Python module from a file path.
kernelbench/bench_kb.py:104
↓ 2 callers
Function
_load_single_tsv
Load a single TSV file into a DataFrame. Returns None if missing/empty.
analysis.py:45
↓ 2 callers
Function
_parse_dtype
Parse a dtype string into a torch.dtype.
verify.py:939
↓ 2 callers
Function
_print_next_decision
Print the move-on decision.
orchestrate.py:468
↓ 2 callers
Function
_print_summary
Print greppable summary for agent log parsing.
kernelbench/bench_kb.py:675
↓ 2 callers
Function
_robust_median
Trimmed median: median of the middle 80% of measurements.
kernelbench/bench_kb.py:493
↓ 2 callers
Function
_run_forward
Run a single forward pass with the correct calling convention.
profile.py:516
↓ 2 callers
Function
_time_model
Time a model using CUDA events.
kernelbench/bench_kb.py:456
↓ 2 callers
Function
_transition_to
Move the orchestrator to a new kernel index.
orchestrate.py:460
↓ 2 callers
Function
benchmark_model
Benchmark model inference. Returns (output, median_latency_ms). Uses CUDA events for precise GPU timing.
verify.py:258
↓ 2 callers
Function
classify_row
Classify an experiment row (dict or pandas Series) into one of: 'kept' -- correctness PASS and tagged as kept / speedup > 1 'failed
analysis.py:120
↓ 2 callers
Function
compare_outputs
Compare reference and optimized outputs. Returns comparison metrics.
verify.py:687
↓ 2 callers
Function
compute_all_fast_p
Compute fast_p at all standard thresholds.
kernelbench/scorer.py:70
↓ 2 callers
Function
extract_cuda_source
Extract the CUDA_SRC string from a Python kernel file. Handles: - CUDA_SRC = r\"\"\"...\"\"\" - CUDA_SRC = \"\"\"...\"\"\"
export_hf.py:99
↓ 2 callers
Function
extract_function_signatures
Find all torch::Tensor-returning function declarations in the CUDA source. Returns a list of dicts with keys: - 'return_type': e.g. 't
export_hf.py:159
↓ 2 callers
Function
generate_report
Generate a markdown report summarizing the session.
analysis.py:373
↓ 2 callers
Function
get_problem
Retrieve a problem from cache. Returns None if not cached.
kernelbench/bridge.py:486
↓ 2 callers
Function
load_from_file
Load a single problem from a standalone .py file.
kernelbench/bridge.py:446
↓ 2 callers
Function
load_from_huggingface
Load problems from HuggingFace ScalingIntelligence/KernelBench.
kernelbench/bridge.py:354
↓ 2 callers
Function
load_from_local_repo
Load problems from a local KernelBench git clone.
kernelbench/bridge.py:410
↓ 2 callers
Function
load_scores
Load accumulated scores from disk.
kernelbench/scorer.py:36
↓ 2 callers
Function
make_progress_plot
Generate the scatter plot and save to progress.png.
analysis.py:157
↓ 2 callers
Function
precompute_freqs_cis
(dim: int, end: int, theta: float = 10000.0)
models/llama_7b.py:33
↓ 2 callers
Function
print_report
Print a leaderboard-style report.
kernelbench/scorer.py:246
↓ 2 callers
Function
save_verification_json
Save verification results as JSON for programmatic consumption.
verify.py:900
↓ 2 callers
Function
scale_shape
Scale all shape dimensions by a factor, rounding to nearest integer. Ensures all values are at least 1.
extract.py:215
↓ 1 callers
Function
_append_result_row
Append a single result row to the per-kernel TSV.
orchestrate.py:215
↓ 1 callers
Method
_apply_replacement
Replace matching modules in the model. Returns number of modules replaced.
verify.py:557
↓ 1 callers
Function
_benchmark_fn
Benchmark *fn* using CUDA events. Returns median latency in microseconds.
prepare.py:60
↓ 1 callers
Function
_build_ops_schema
Build a torch.library ops.def() schema string for a function.
export_hf.py:349
↓ 1 callers
Function
_compare
Compare two tensors. Returns match info.
kernelbench/bench_kb.py:168
↓ 1 callers
Function
_compare_outputs
Compare outputs: tensors, tuples/lists of tensors, or scalars.
kernelbench/bench_kb.py:222
↓ 1 callers
Function
_default_kernel_entry
Return a default kernel entry for the orchestration state.
orchestrate.py:112
↓ 1 callers
Function
_discover_supported_op_types
Scan kernels/ directory for supported kernel types.
profile.py:61
↓ 1 callers
Function
_export_cuda_kernel
Export a CUDA C++ kernel to HF Kernels format.
export_hf.py:492
↓ 1 callers
Function
_export_triton_kernel
Export a Triton kernel to HF Kernels format. Triton kernels are already Python, so the export is simpler: package the Triton code as a P
export_hf.py:587
↓ 1 callers
Method
_extract_and_rename_model
Extract Model class source and produce a renamed ModelNew copy.
kernelbench/bridge.py:305
↓ 1 callers
Method
_extract_class
Extract a class definition (including body) from source.
kernelbench/bridge.py:324
↓ 1 callers
Function
_extract_forward_decl
Extract a forward declaration for func_name from the CUDA source. load_inline auto-generates pybind11 bindings in main.cpp when ``functi
kernels/cuda/_compile.py:66
↓ 1 callers
Function
_fallback_detect_gpu
Standalone GPU detection when bench.py is not importable.
profile.py:89
↓ 1 callers
Function
_generate_cpp_wrapper
Generate a pybind11-compatible C++ wrapper that forwards torch::Tensor arguments to the CUDA kernel launcher. arg_specs: list of (name,
kernels/cuda/_compile.py:103
↓ 1 callers
Function
_generate_suggestions
Generate actionable suggestions based on experiment history.
analysis.py:505
↓ 1 callers
Function
_get_arch_flags
Generate -gencode flags for the current GPU architecture.
kernels/cuda/_compile.py:44
↓ 1 callers
Function
_get_gpu_name
Get current GPU name.
verify.py:957
↓ 1 callers
Function
_get_module
()
kernels/cuda/layernorm.py:313
↓ 1 callers
Function
_get_module
()
kernels/cuda/fused_mlp.py:163
↓ 1 callers
Function
_get_module
()
kernels/cuda/rotary_embedding.py:150
↓ 1 callers
Function
_get_module
()
kernels/cuda/cross_entropy.py:144
↓ 1 callers
Function
_get_module
()
kernels/cuda/flash_attention.py:241
↓ 1 callers
Function
_get_module
()
kernels/cuda/softmax.py:238
↓ 1 callers
Function
_get_module
()
kernels/cuda/matmul.py:239
↓ 1 callers
Function
_get_module
()
kernels/cuda/reduce.py:104
↓ 1 callers
Function
_get_module
()
kernels/cuda/rmsnorm.py:164
↓ 1 callers
Function
_hash_source
Create a deterministic hash of the source + flags for cache keying.
kernels/cuda/_compile.py:86
↓ 1 callers
Function
_hypothetical_speedup
What-if analysis: if we achieve *assumed_speedup* on the top-N kernels by pct_total.
orchestrate.py:281
↓ 1 callers
Function
_initialize_state_from_plan
Build a fresh orchestration state from an optimization plan.
orchestrate.py:136
↓ 1 callers
Function
_is_language_model
Heuristic: does the model expect input_ids (integer tokens)?
profile.py:313
↓ 1 callers
Function
_load_model_from_file
Load a model class from a Python file and instantiate it.
profile.py:219
↓ 1 callers
Function
_load_model_from_module
Load a model from an installed Python module (e.g. transformers).
profile.py:249
↓ 1 callers
Function
_matmul_flops
FLOPs for a single matmul C[M,N] = A[M,K] @ B[K,N].
prepare.py:55
↓ 1 callers
Function
_now_iso
()
orchestrate.py:86
↓ 1 callers
Function
_param_to_torch_schema
Convert a C++ parameter type to a torch.library schema type.
export_hf.py:328
↓ 1 callers
Function
_parse_param_list
Parse a C++ parameter list into (type, name) pairs. E.g. "torch::Tensor A, torch::Tensor B" -> [("torch::Tensor", "A"), ...]
export_hf.py:209
↓ 1 callers
Function
_prepare_model_and_input
Move model to device, generate input, validate forward pass. Handles OOM by trying smaller batch sizes.
profile.py:379
↓ 1 callers
Function
_priority_label
(pct: float)
profile.py:655
↓ 1 callers
Method
_replace_layernorm_modules
Replace all nn.LayerNorm modules with optimized wrapper.
verify.py:593
↓ 1 callers
Method
_replace_linear_modules
Replace all nn.Linear modules with optimized matmul wrapper.
verify.py:575
↓ 1 callers
Method
_replace_rmsnorm_modules
Replace RMSNorm modules. Since there is no standard nn.RMSNorm, we look for common class names and attributes.
verify.py:608
↓ 1 callers
Function
_resolve_dtype
(dtype_str: str)
profile.py:200
↓ 1 callers
Function
_save_results
Append results to workspace/kb_active/results.json.
kernelbench/bench_kb.py:700
↓ 1 callers
Function
_should_move_on
Evaluate move-on criteria for the current kernel. Returns (should_move, reason).
orchestrate.py:302
↓ 1 callers
Function
_try_forward
Attempt a forward pass. Returns True on success.
profile.py:362
↓ 1 callers
Function
apply_rotary_emb
( xq: torch.Tensor, xk: torch.Tensor, freqs_cis: torch.Tensor )
models/llama_7b.py:40
↓ 1 callers
Function
benchmark_baselines
Benchmark torch.matmul at all sizes and dtypes. Returns results dict.
prepare.py:276
↓ 1 callers
Function
build_parser
()
orchestrate.py:798
↓ 1 callers
Function
build_report
Build the profile_report.json structure.
profile.py:664
next →
1–100 of 293, ranked by callers