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)
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()rejectsconfig, or ifconfigasks for an MXFP8 combine, which onlycombine_start()andcombine_finish()send. -
Return type: