flashinfer.green_ctx.split_device_green_ctx_by_locality_domain¶
- flashinfer.green_ctx.split_device_green_ctx_by_locality_domain(dev: device, backfill: bool = True) Tuple[List[Stream], List[CUdevResource]]¶
Create one green context per locality domain (uGPU) of
devand return its stream andCUdevResource, in domain order. A kernel launched on streamiruns only on domaini’s SMs, so together with memory placed in that domain (empty_per_locality_domain()) its DRAM traffic stays on the die.- Parameters:
dev – The device to split.
backfill – If
True(default), each group getsnum_SMs // num_domainsSMs and the driver completes a domain’s group with SMs that belong to no domain (on Rubin VR200: 100 native SMs + 6 of the 12 remaining ones per die, so all 212 SMs work). IfFalse, each group holds its domain’s native SMs only.
- Returns:
One
torch.Streamper locality domain. resources: The matchingCUdevResourceobjects (.sm.smCountis the SM count).- Return type:
streams
- Raises:
RuntimeError – if the device has fewer than two locality domains.