Skip to content

Add AutoPiste - #191

Open
EvoArt wants to merge 1 commit into
SciML:mainfrom
EvoArt:add-autopiste
Open

EvoArt wants to merge 1 commit into
SciML:mainfrom
EvoArt:add-autopiste

Conversation

@EvoArt

@EvoArt EvoArt commented Nov 9, 2026 •

Copy link
Copy Markdown

Add AutoPiste for Piste.jl, a forward- and reverse-mode AD package whose derivatives survive juliac --trim. A DifferentiationInterface extension for it is in JuliaDiff/DifferentiationInterface.jl#1089 (draft until this is released).

AutoPiste()                                # forward mode, dual numbers
AutoPiste(; chunksize = 8)                 # forward mode, fixed chunk width
AutoPiste(; mode = ADTypes.ReverseMode())  # reverse mode, a tape

Design

  • One struct, with ADTypes' own mode objects as the mode field. Piste has both modes in one package, so I followed AutoEnzyme (mode as a field) rather than AutoMooncake/AutoMooncakeForward, which I understand were split only to avoid a breaking release. mode(::AutoPiste) returns the field, and the type parameter is restricted to Union{ForwardMode, ReverseMode}.
  • chunksize is a type parameter, as for AutoForwardDiff. This matters more than usual for Piste: under --trim the chunk width has to be known statically, so trimmed code passes an explicit value.
  • Default mode is forward.

Open questions, happy to change either:

  1. ForwardMode/ReverseMode are public but not exported, so users write ADTypes.ReverseMode(). Would you prefer symbols (mode = :reverse), or two structs?
  2. Forward or reverse as the default?

Changes

AutoPiste struct, docstring, mode, show, export, Auto(:Piste), the docs page, and tests in test/dense.jl, test/misc.jl and test/symbols.jl.

🤖 Generated with Claude Code

Selects the Piste.jl backend (https://github.com/EvoArt/Piste.jl), in forward mode
(dual numbers, optional fixed `chunksize`) or reverse mode (a tape), via the
`mode` field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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