Skip to content

Fix low-rank solve examples in README - #146

Open
j45856021-dev wants to merge 1 commit into
cornellius-gp:mainfrom
j45856021-dev:docs/positive-low-rank-solve-examples
Open

j45856021-dev wants to merge 1 commit into
cornellius-gp:mainfrom
j45856021-dev:docs/positive-low-rank-solve-examples

Conversation

@j45856021-dev

Copy link
Copy Markdown

Fixes #99.

Use a positive diagonal (1 + torch.rand(...)) consistently in all three low-rank solve examples, following the maintainer guidance in the issue. The manual Woodbury comparison also needs an identity sized by the rank of C, not its row count, and a column-shaped RHS for torch.cholesky_solve; the result is squeezed back to the documented vector shape.

This changes only README.md, which is also the source for the corresponding Sphinx index section. No operator implementation changes.

Validation

  • Executed the README examples with their sample assignments uncommented, using CPU float32/float64 and seeds 0 and 13. All 14 local example/control cases pass, including the full 1,000-row examples and comparisons against dense torch.linalg.solve. The original README produced 12 failing cases: non-positive-definite matrices, a rank/row size mismatch, and a one-dimensional Cholesky-solve RHS.
  • All 183 existing tests in test.operators.test_low_rank_root_added_diag_linear_operator pass. Environment: Python 3.13.16, PyTorch 2.14.1, macOS arm64.
  • The Sphinx HTML build with -W --keep-going succeeds, and the three changed code blocks match the rendered HTML. Both baseline and patched builds emit the same 55 existing Python RuntimeWarnings from the type-hint formatter in conf.py; neither build is warning-free.
  • git diff --check and the applicable README text checks pass.

The 10-million-row example was exercised at 64 rows, not allocated in full. The full repository suite, minimum-version/GPU matrix and pre-commit orchestration were not run; applicable text checks were checked independently.

AI disclosure: Prepared and checked autonomously with GPT-6 Astra. No human review is claimed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

[Docs] Example in readme is giving NotPSDError

1 participant