pytc.solver.bug_helperΒΆ

Small device, memory and timing tools shared by the BUG solvers.

Nothing here is numerical: device residency of the DF factors (cached upload, aux-chunk streaming), counted host<->device transfers, memory probes and a device-synchronised clock.

Functions

_aux_major

Aux-major (naux, ...) copy of a static host array, made once per solve.

_live_bytes

Device bytes_in_use, or None where no statistics exist.

arena_bytes

Device allocator limit, or 0 when the backend reports none.

auto_block_rows

Largest row panel whose scratch stays a small fraction of the arena.

aux_streamed

call(*aux_arrays) for a call that is a single sum over the aux index.

clock

Wall clock after the device queue drains.

device_memory_stats

Allocator statistics of the first device, or None where none exist.

get_counted

device_get, timed and counted -- AFTER the producer has finished.

host_empty

A host buffer for a pair-height array (rows of length r or naux).

host_memory_limits

Every observable host-memory ceiling, and the binding one.

host_scratch_dir

Directory for disk-backed pair-height buffers, from PYTC_HOST_SCRATCH.

on_device

Device copy of a static host array, uploaded once per solve.

put_counted

device_put, timed and counted.

put_rows

Rows s:e of a host array on the device, zero-padded past its end.

release_device_copies

reset_transfer_counters

timed

transfer_counters

Measured synchronous transfer cost since the last reset.