vibespatial.runtime.crossover¶
Attributes¶
Classes¶
Classification of how left and right geometry arrays relate in size. |
|
Enum where members are also (and must be) strings |
|
Per-kernel crossover thresholds for AUTO dispatch. |
Functions¶
|
Classify the workload shape for a binary operation. |
|
|
|
Select CPU or GPU execution based on row count and crossover policy. |
Module Contents¶
- class vibespatial.runtime.crossover.WorkloadShape¶
Classification of how left and right geometry arrays relate in size.
PAIRWISE: left and right have the same length; element-wise ops. BROADCAST_RIGHT: right has length 1, left has length > 1; the single
right geometry is broadcast against every left row.
- SCALAR_RIGHT: right is a scalar (not an array); skips pandas index
alignment entirely.
BROADCAST_LEFT is intentionally omitted — no consumer exists today. INDEXED is intentionally omitted — gather-evaluate-scatter is a different computation model, not a workload shape.
- PAIRWISE = 'pairwise'¶
- BROADCAST_RIGHT = 'broadcast_right'¶
- SCALAR_RIGHT = 'scalar_right'¶
- vibespatial.runtime.crossover.detect_workload_shape(left_count: int, right_count: int | None) WorkloadShape¶
Classify the workload shape for a binary operation.
- class vibespatial.runtime.crossover.DispatchDecision¶
Enum where members are also (and must be) strings
- CPU = 'cpu'¶
- GPU = 'gpu'¶
- class vibespatial.runtime.crossover.CrossoverPolicy¶
Per-kernel crossover thresholds for AUTO dispatch.
auto_min_rowsis the pairwise threshold (left and right have the same length).broadcast_min_rowsis an optional lower threshold for broadcast workload shapes (BROADCAST_RIGHT / SCALAR_RIGHT) where the right-side geometry fits in L1 cache and is reused N times, making GPU profitable at much smaller N.- kernel_name: str¶
- kernel_class: vibespatial.runtime.precision.KernelClass¶
- auto_min_rows: int¶
- reason: str¶
- broadcast_min_rows: int | None = None¶
- vibespatial.runtime.crossover.DEFAULT_CROSSOVER_POLICIES: dict[vibespatial.runtime.precision.KernelClass, int]¶
- vibespatial.runtime.crossover.DEFAULT_BROADCAST_CROSSOVER_POLICIES: dict[vibespatial.runtime.precision.KernelClass, int]¶
- vibespatial.runtime.crossover.default_crossover_policy(kernel_name: str, kernel_class: vibespatial.runtime.precision.KernelClass | str) CrossoverPolicy¶
- vibespatial.runtime.crossover.select_dispatch_for_rows(*, requested_mode: vibespatial.runtime._runtime.ExecutionMode | str, row_count: int, policy: CrossoverPolicy, gpu_available: bool, workload_shape: WorkloadShape | None = None) DispatchDecision¶
Select CPU or GPU execution based on row count and crossover policy.
When workload_shape is
BROADCAST_RIGHTorSCALAR_RIGHT, the effective threshold ispolicy.broadcast_min_rows(orpolicy.auto_min_rows // 10if the policy does not set a broadcast threshold). This reflects the fact that broadcast workloads have perfect right-side data locality and benefit from GPU execution at much smaller N than pairwise workloads.