Skip to content

Rebuild vmap for Rune to support nesting, JIT, and grad #97

@tmattio

Description

@tmattio

Summary

  • Replace the current WIP vmap in rune/lib/vmap.ml with a clean implementation that matches the behaviour of Jax's vmap.
  • Ensure the new design composes with higher-order transforms such as jit, grad, jvp, and nested vmap.

Problem

  • The existing code in rune/lib/vmap.ml is mostly AI-generated and fails the nested scenarios in rune/test/test_vmap.ml.
  • I suspect it currently does not compose well with jit or grad, preventing us from stacking transformations.

Proposed Scope

  • Investigate design space for vmap and propose an effect-based solution that's compatible with Jax semantics and compose well with our other effect handlers.
  • Implement the design in vmap.ml and expose through Rune.vmap. Make sure the implementation passes the tests at test_vmap.ml

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions