IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).

Python function

dispatch_finish

dispatch_finish()​

max.nn.ep.dispatch_finish(config, buffers, tokens, *, layer_idx=None)

source

Waits for each device’s dispatch that dispatch_start() launched.

Each device gets its own copy of the grouped matmul bounds, built right after its wait, where the legacy EPBatchManager.ep_dispatch_wait builds it.

Parameters:

  • config (EPConfig) – The expert-parallel configuration.
  • buffers (EPBuffers) – The exchange’s buffers.
  • tokens (Tensor) – The tokens that were dispatched, which give each device’s token count.
  • layer_idx (Tensor | None) – As for dispatch(). The wait adds to the tally.

Returns:

As dispatch().

Raises:

ValueError – If check_supported() rejects config, if config quantizes NVFP4 with per-token global scales, which only dispatch() sends, or if config counts expert load without layer_idx or without EPBuffers.expert_load.

Return type:

tuple[Grouped, Route]