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 class

DistributedLogitsPostprocessMixin

DistributedLogitsPostprocessMixin​

class max.nn.transformer.DistributedLogitsPostprocessMixin

source

Bases: object

Mixin providing logits postprocessing for multi-device sharded models.

Requires: self.norm_shards, self.lm_head, self.return_logits, self.devices. Optional: self.return_hidden_states, self.logits_scaling.

devices​

devices: list[DeviceRef]

source

lm_head​

lm_head: Callable[[list[TensorValue], Sequence[BufferValue]], Sequence[TensorValue]]

source

logit_softcapping​

logit_softcapping: float | None = None

source

logits_scaling​

logits_scaling: float = 1.0

source

norm_shards​

norm_shards: Sequence[Callable[[TensorValue], TensorValue]]

source

return_hidden_states​

return_hidden_states: ReturnHiddenStates = 'none'

source

return_logits​

return_logits: ReturnLogits

source