flashinfer.cake_gdn_det_train_kcp.cake_gdn_det_train_kcp_build_context

flashinfer.cake_gdn_det_train_kcp.cake_gdn_det_train_kcp_build_context(part: Any, group: Any, rank: int, device: Any, conv_kernel_size: int = 4, *, sm_count: int | None = None) → 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 most conv_kernel_size - 1 history rows per continuing fragment) and the segment plan. group is the caller’s torch.distributed process group (every collective of the route runs on it); CPU metadata plus small int32 device tables built once; no tensor contents are read.

Parameters:
  • part – Partition returned by cake_gdn_det_train_kcp_partition().

  • group – Caller-owned torch.distributed process 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.