pymc-devs / pymc-devs/pytensor-ml
compile_train gives no way to get the shared variables its step writes
Nobody has claimed this yet.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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