Skip to content

Refactor PEPS environment caching for backward pass#76

Merged
fliingelephant merged 7 commits intomainfrom
opus/sequential
Feb 6, 2026
Merged

Refactor PEPS environment caching for backward pass#76
fliingelephant merged 7 commits intomainfrom
opus/sequential

Conversation

@fliingelephant
Copy link
Owner

  • Summary
    • cache top boundaries during PEPS forward sweeps and reuse them during backward energy/gradient evaluation
    • swap tensor contractions to more efficient einsum signatures and remove unused logging import
    • return cached environments from grads_and_energy/sweep and update sampler flows accordingly
  • Testing
    • Not run (not requested)

fliingelephant and others added 3 commits February 4, 2026 06:29
sweep() now returns cached top_envs, and grads_and_energy() uses a
backward pass (bottom→top) with those top_envs, returning cached
bottom_envs for the next sweep. This eliminates the separate
bottom_envs() call in mc_sweep, reducing environment computation
overhead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: 周唤海 <albus.zhouhh@gmail.com>
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f191534959

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fliingelephant fliingelephant linked an issue Feb 6, 2026 that may be closed by this pull request
Signed-off-by: 周唤海 <albus.zhouhh@gmail.com>
@fliingelephant
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4df2cfc00a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: 周唤海 <albus.zhouhh@gmail.com>
@fliingelephant
Copy link
Owner Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f6e3469c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fliingelephant fliingelephant merged commit a16bec8 into main Feb 6, 2026
1 check passed
@fliingelephant fliingelephant deleted the opus/sequential branch February 6, 2026 16:12
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.

Make Householder QR batch-polymorphical

1 participant