Skip to content

Rename hooks to io_call#1774

Draft
Chapaman wants to merge 12 commits into
elixir-nx:mainfrom
Chapaman:rename-hooks-to-io-call-step3
Draft

Rename hooks to io_call#1774
Chapaman wants to merge 12 commits into
elixir-nx:mainfrom
Chapaman:rename-hooks-to-io-call-step3

Conversation

@Chapaman

@Chapaman Chapaman commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary:

Chapaman and others added 9 commits June 22, 2026 21:38
Route hook side effects through exla_runtime_callback instead of the
outfeed u16-flag protocol. Outfeed remains only for lazy-transfer
infeed. Unifies runtime_call and hook callbacks on the same server path.

Co-authored-by: Cursor <cursoragent@cursor.com>
Restore the missing run_runtime_callback/4 header in outfeed.ex and move
add_host_hook_callback/6 after all cached_recur_operator/4 clauses.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop %Nx.Defn.Token{}, create_token/attach_token, and the :token expr
op in favor of side-effect :hook nodes that preserve hook/3 and :hooks.
Update EXLA lowering to compile :hook via host_callback.

Co-authored-by: Cursor <cursoragent@cursor.com>
Rebase token removal onto merged EXLA host-callback work. Keep :hook
lowering, accept main naming in outfeed, drop unused after_all helper.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce Nx.io_call/2-3 and :io_calls as the primary API while keeping
deprecated hook/2-3, :hooks, and token shims for backward compatibility.
Stacked on top of elixir-nx#1767 token plumbing removal.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread nx/lib/nx.ex
Comment on lines -3906 to 3918
```elixir
tensor = Nx.tensor([10, 20, 30])
Nx.pad(tensor, 0, [{2, 1, 3}])
#Nx.Tensor<
s32[11]
[0, 0, 10, 0, 20, 0, 30, 0, 0, 0]
>
# └ low ┘ └ interior ┘ └ high ┘
```

Padding widths can be negative. If they are negative,
the tensor is clipped on either end according to the
padding width. Interior padding widths cannot be negative.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be kept

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.

2 participants