Skip to content

PML-327: Backprop guard implemented for memristor#219

Merged
ben9871 merged 32 commits into
merlinquantum:release/0.4from
LF-Vigneux:PML-327-backpropagation-guard-memristor
Jun 1, 2026
Merged

PML-327: Backprop guard implemented for memristor#219
ben9871 merged 32 commits into
merlinquantum:release/0.4from
LF-Vigneux:PML-327-backpropagation-guard-memristor

Conversation

@LF-Vigneux
Copy link
Copy Markdown
Contributor

Summary

Detaching history memristor states after num_backprop_steps forward passes to limit the memristive history depth accessed by the backwards.

Related Issue

PML-327

Type of change

  • Bug fix
  • New feature
  • Documentation update
  • Refactor / Cleanup
  • Performance improvement
  • CI / Build / Tooling
  • Breaking change (requires migration notes)

Proposed changes

Adding a num_backprop_stepsparameter to the add_memristve_phase_shifter method. This argument detaches any tensor in the memristive history that is associated with a forward pass at least num_backprop_steps+1 iterations away.

How to test / How to run

pytest -q

Documentation

  • User docs updated (Sphinx)
  • Examples / notebooks updated
  • Docstrings updated
  • Updated the API

@ben9871 ben9871 self-assigned this May 21, 2026
Copy link
Copy Markdown
Contributor

@ben9871 ben9871 left a comment

Choose a reason for hiding this comment

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

A stray debug print remains, some issues with detaching tensors and observability, can enhance tests too

Comment thread merlin/algorithms/layer.py Outdated
Comment thread tests/algorithms/test_layer.py Outdated
Comment thread merlin/algorithms/layer.py Outdated
Comment thread merlin/builder/circuit_builder.py Outdated
Comment thread merlin/algorithms/layer.py Outdated
@CassNot CassNot added this to the v0.4 milestone May 28, 2026
@CassNot CassNot added the enhancement New feature or request label May 29, 2026
Copy link
Copy Markdown
Contributor

@ben9871 ben9871 left a comment

Choose a reason for hiding this comment

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

files changed and ambiguity solved by adding a utility method for TBPTT

@ben9871 ben9871 merged commit 7d8720b into merlinquantum:release/0.4 Jun 1, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants