Skip to content

Extension to InputContext design: adding per-graph descriptors - #162

Open
carinapeng wants to merge 1 commit into
apple:mainfrom
carinapeng:carina/input-context-descriptors
Open

Extension to InputContext design: adding per-graph descriptors#162
carinapeng wants to merge 1 commit into
apple:mainfrom
carinapeng:carina/input-context-descriptors

Conversation

@carinapeng

Copy link
Copy Markdown
Contributor

Summary

Adds a descriptors: [String: NDArrayDescriptor] field to InputContext (from #147) so an input handler can size its output buffer to the running graph's shape. Backward-compatible: defaults to empty, and the dynamic path is unchanged.

Why

Static-shape / bucketed engines select a different graph per step, so a handler (position ids, causal mask, RoPE, PLE, ...) needs the active graph's input descriptors to allocate correctly. InputContext didn't carry them.

Change

  • New descriptors field; threaded through .dynamic() (empty) and .static() (optional, defaults empty).
  • No change to the SyncInputHandler protocol or existing callers.

Enabling change for the static-shape engine (PR to follow).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant