execution#
- torchsim.execution(target='auto', *, stream=None, budget_bytes=None, lanes=1, reserve_bytes=_RESERVE_BYTES)[source]#
Choose where work runs inside the block.
targetis"auto"to decide per call,"cpu"to insist on the host, or a device or list of devices to insist on those. Deciding weighs the problem against what each card has free right now: work too small to repay a launch stays on the CPU, work that fits goes across in one piece, and work that does not is streamed through in chunks.streamoverrules that last step –Falsedemands the whole volume be resident and lets it fail if it will not fit,Truestreams even when it would have fit.budget_bytescaps what streaming may hold, and defaults to what the devices report free lessreserve_bytes.lanesis passed tooffload()for streamed work and rarely wants changing.Outside a block, work runs wherever its tensors already are.
- Raises:
ValueError – for an empty device list, a non-CUDA device, or a: non-positive
budget_bytesorlanes.