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).

Mojo struct

Struct_accept_pair

struct Struct_accept_pair

Registers the sampler.accept_pair graph op.

Writes the sampled-draft verdict's two per-position decisions: whether the accept coin rejects the draft, and which token the residual should remove (the proposal, or a one-hot at the drafted token for a row that carried no distribution). Reading two masses at one vocabulary index would otherwise need a [rows, steps, 3] index tensor to gather them, then a compare, a select, a multiply and a compare: one launch per member here becomes one.

Implemented traitsโ€‹

AnyType, Deinitable, Movable

Methodsโ€‹

executeโ€‹

static def execute[_trace_name: StaticString](rejected: T, fallback: T, probs: T, dist: T, tokens: T, coins: T, ctx: DeviceContext)

Was this page helpful?