mllm_shap.benchmarks package#

Submodules#

mllm_shap.benchmarks.bench_api_perf module#

Micro-benchmarks for API/performance hotspots.

class mllm_shap.benchmarks.bench_api_perf.BenchResult(bench: str, label: str, min_s: float, p50_s: float, max_s: float, overhead_p50_pct: float | None = None)[source]#

Bases: object

Structured benchmark result for optional machine-readable exports.

bench: str#

Identifier for the benchmarked operation or code path.

label: str#

Human-readable label describing the benchmark parameters or scenario.

property max_ms: float#

Maximum observed runtime across repetitions, in milliseconds.

max_s: float#

Maximum observed runtime across repetitions, in seconds.

property min_ms: float#

Minimum observed runtime across repetitions, in milliseconds.

min_s: float#

Minimum observed runtime across repetitions, in seconds.

overhead_p50_pct: float | None = None#

Optional overhead percentage for the median runtime.

property p50_ms: float#

Median observed runtime across repetitions, in milliseconds.

p50_s: float#

Median observed runtime across repetitions, in seconds.

to_dict() dict[str, Any][source]#

Convert benchmark result to a dictionary for serialization.

mllm_shap.benchmarks.bench_api_perf.bench_linear_num_samples_update(iters: int, repeats: int) list[BenchResult][source]#

Benchmark in-place sampling budget update path used by experiments runner.

mllm_shap.benchmarks.bench_api_perf.bench_mask_hash(iters: int, mask_len: int, repeats: int) list[BenchResult][source]#

Benchmark current mask hash implementation.

mllm_shap.benchmarks.bench_api_perf.bench_pipeline_observability_overhead(iters: int, repeats: int, n_stages: int) list[BenchResult][source]#

Benchmark pipeline execution overhead with and without observability sink.

mllm_shap.benchmarks.bench_api_perf.bench_response_generation(n_masks: int, mask_len: int, repeats: int, n_jobs: int, verbose: bool) list[BenchResult][source]#

Benchmark masked response generation orchestration.

mllm_shap.benchmarks.bench_api_perf.bench_sampling_adapter(n_masks: int, mask_len: int, repeats: int, n_jobs: int, verbose: bool) list[BenchResult][source]#

Benchmark split-callback sampling path via shared sampling adapter.

mllm_shap.benchmarks.bench_api_perf.main() None[source]#

Module contents#

Benchmark utilities for mllm_shap.