pymc-devs / pymc-devs/pytensor-ml

compile_train gives no way to get the shared variables its step writes

Open
#80 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
9
Forks
7
Avg merge
6h 55m
Merged PRs (30d)
40

Description

save_state wants the list of shared variables one step writes and compile_train assembles exactly that dict and throws it away, so anything that checkpoints -- or that has to force MLX's lazy arrays each step -- hand-assembles the updates instead, or reaches into f.maker.expanded_inputs.

step = compile_train(loss, adam(1e-3), extra_outputs=[abs_residual])
save_state(step, "latest.safetensors")  # want: a Function is enough to say what to save

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing compile_train and the dict of shared-variable updates it assembles, then inspect how save_state consumes its step argument. Compare this with f.maker.expanded_inputs and the extra_outputs example. Done means callers can obtain the step's shared variables through the returned Function rather than rebuilding or reaching into internal inputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.