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

combine

combine()​

max.nn.ep.combine(config, buffers, outputs, route, tokens, weights)

source

Returns the experts’ outputs to their tokens, weighted, in one launch.

Parameters:

  • config (EPConfig) – The expert-parallel configuration.
  • buffers (EPBuffers) – The exchange’s buffers.
  • outputs (Tensor) – The experts’ outputs, in the rows of the received tokens.
  • route (Route) – The route that dispatch() returned.
  • tokens (Tensor) – The tokens that were dispatched, which give each device’s token count and the result’s mapping.
  • weights (Tensor) – Each device’s router weights, of shape (tokens, top_k) per device.

Returns:

Each token’s weighted sum of its experts’ outputs, mapped as tokens.

Raises:

ValueError – If check_supported() rejects config, or if config asks for an MXFP8 combine, which only combine_start() and combine_finish() send.

Return type:

Tensor