flashinfer.cake_gdn_nondet_train_kcp.cake_gdn_nondet_train_kcp_build_context¶
- flashinfer.cake_gdn_nondet_train_kcp.cake_gdn_nondet_train_kcp_build_context(part: Any, group: Any, rank: int, device: Any, conv_kernel_size: int = 4, *, sm_count: int | None = None, graph_replay: bool = False) Any¶
This rank’s view of a partition: local
cu_seqlens(int32 device), the device fragment table, the crossing fragment lists (in / out) with their byte counts, the exchange plan, the convolution halo plan (at mostconv_kernel_size - 1history rows per continuing fragment) and the segment plan.groupis the caller’storch.distributedprocess group (every collective of the package runs on it); CPU metadata plus small int32 device tables built once; no tensor contents are read. The context holds no mode; its head plan is this package’s own.graph_replay=Truebuilds the context for calls withgraph="replay": the package then drops the one-chain (P = 1) rows of its faster plan, which save launches that graph replay removes.- Parameters:
part – Partition returned by
cake_gdn_nondet_train_kcp_partition().group – Caller-owned
torch.distributedprocess group for all collectives.rank (int) – This rank’s index within
group.device – CUDA device on which to build this rank’s tables.
conv_kernel_size (int, default=4) – Convolution width used to plan the history-row halo exchange.
sm_count (int, optional) – SM count to use when building the segment plan.
graph_replay (bool, default=False) – Build the context for calls with
graph="replay".