KEMBAR78
Improve documentation for torch.lobpcg by VijayKestur · Pull Request #156139 · pytorch/pytorch · GitHub
Skip to content

Conversation

@VijayKestur
Copy link
Contributor

The changes are documentation changes to the function lobpcg. There are three changes to the doc.

  1. Match doc arg description to be in the same order as the parameters to the function.
  2. Update documentation for arg n to indicate that when arg x is specified value of n is ignored if set.
  3. Add warning that m must be bigger than 3 x the number of requested eigenpairs.

Fixes #152107
cc: @ILCSFNO @spzala @soulitzer

@pytorch-bot
Copy link

pytorch-bot bot commented Jun 16, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/156139

Note: Links to docs will display an error until the docs builds have been completed.

✅ You can merge normally! (1 Unrelated Failure)

As of commit 040ace4 with merge base 4e8dd11 (image):

UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 16, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@colesbury colesbury added the topic: not user facing topic category label Jun 17, 2025
@colesbury colesbury requested a review from svekars June 17, 2025 12:21
@colesbury colesbury added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jun 17, 2025
@colesbury colesbury changed the title This change is to address the fix for issue 152107. Improve documentation for torch.lobpcg Jun 17, 2025
@VijayKestur
Copy link
Contributor Author

@pytorchbot label "topic: not user facing"

@spzala
Copy link
Contributor

spzala commented Jun 17, 2025

/easyCLA

@svekars svekars requested a review from soulitzer June 17, 2025 14:48
@VijayKestur
Copy link
Contributor Author

/easycla

torch/_lobpcg.py Outdated
we do the following symmetrization map: `A -> (A + A.t()) / 2`.
The map is performed only when the `A` requires gradients.
.. warning:: `m` must be bigger than 3 x the number of requested eigenpairs.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you change this to something like:
-> LPBPCG algorithm is not applicable when the number of A's rows is smaller than 3x the number of requested eigenpairs n

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure I will make this change and re generate the PR.

Copy link
Contributor

@soulitzer soulitzer left a comment

Choose a reason for hiding this comment

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

Thanks for the update
Last thing is that we probably still want the backticks around A and n and use :math: for X.

Copy link
Contributor

@soulitzer soulitzer left a comment

Choose a reason for hiding this comment

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

Thanks for the update

@soulitzer
Copy link
Contributor

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Jun 23, 2025
@soulitzer soulitzer added release notes: python_frontend python frontend release notes category topic: docs topic category and removed topic: not user facing topic category labels Jun 23, 2025
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@VijayKestur
Copy link
Contributor Author

Thanks for the update
@soulitzer you are welcome and thanks for reviewing my first merge to this repo.

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: trunk / macos-py3-arm64 / test (mps, 1, 1, macos-m2-15)

Details for Dev Infra team Raised by workflow job

@VijayKestur
Copy link
Contributor Author

Hi @soulitzer ,
The test failure for Mac is not related to my change. How should I proceed ?
Thanks
cc: @spzala

@soulitzer
Copy link
Contributor

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here

The changes are documentation changes to the function lobpcg.
There are three changes to the doc.
1. Match doc arg description to be in the same order as the parameters to the function.
2. Update documentation for arg `n` to indicate that when arg `x` is specified value of
   `n` is ignored if set.
3. Add warning that `m` must be bigger than 3 x the number of requested eigenpairs.
for parameter n and the new warning message.
in the previous commit. Also using :math: when referring the vector variable X
@pytorchmergebot
Copy link
Collaborator

Successfully rebased fix-for-doc-issue-152107 onto refs/remotes/origin/viable/strict, please pull locally before adding more changes (for example, via git checkout fix-for-doc-issue-152107 && git pull --rebase)

@pytorchmergebot pytorchmergebot force-pushed the fix-for-doc-issue-152107 branch from a785ef7 to a283e42 Compare June 24, 2025 13:45
@pytorch-bot pytorch-bot bot removed the ciflow/trunk Trigger trunk jobs on your pull request label Jun 24, 2025
@soulitzer
Copy link
Contributor

The test failure for Mac is not related to my change. How should I proceed ?

It should be enough to see the docs build pass, but it seems like the rendered docs link isn't being updated...

@VijayKestur
Copy link
Contributor Author

It should be enough to see the docs build pass, but it seems like the rendered docs link isn't being updated...

@soulitzer thanks for re-basing, if there is anything else to be done from my side to make progress let me know.

@soulitzer
Copy link
Contributor

@pytorchbot merge -f "docs build passed"

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use -f as last resort and instead consider -i/--ignore-current to continue the merge ignoring current failures. This will allow currently pending tests to finish and report signal before the merge.

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

skarjala pushed a commit to skarjala/pytorch that referenced this pull request Jun 25, 2025
The changes are documentation changes to the function lobpcg. There are three changes to the doc.
1. Match doc arg description to be in the same order as the parameters to the function.
2. Update documentation for arg `n` to indicate that when arg `x` is specified value of `n` is ignored if set.
3. Add warning that `m` must be bigger than 3 x the number of requested eigenpairs.

Fixes pytorch#152107

Pull Request resolved: pytorch#156139
Approved by: https://github.com/soulitzer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged open source release notes: python_frontend python frontend release notes category topic: docs topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some Doc Issue about torch.lobpcg()

6 participants