Skip to content

Correctly set max_numwarps in coordinate_descent_tuner#159146

Closed
jataylo wants to merge 8 commits intopytorch:mainfrom
jataylo:warps
Closed

Correctly set max_numwarps in coordinate_descent_tuner#159146
jataylo wants to merge 8 commits intopytorch:mainfrom
jataylo:warps

Conversation

@jataylo
Copy link
Collaborator

@jataylo jataylo commented Jul 25, 2025

Current max_numwarps is incorrect on ROCm as warp_size is not taken into account. This PR resolves this and handles in a none hardcoded way using device props when available.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @chenyang78 @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben

@pytorch-bot
Copy link

pytorch-bot bot commented Jul 25, 2025

🔗 Helpful Links

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

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

✅ No Failures

As of commit 9182ff2 with merge base cf6d089 (image):
💚 Looks good so far! There are no failures yet. 💚

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

@jataylo jataylo added ciflow/rocm Trigger "default" config CI on ROCm ciflow/inductor-rocm Trigger "inductor" config CI on ROCm ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 labels Jul 25, 2025
pragupta pushed a commit to ROCm/pytorch that referenced this pull request Jul 30, 2025
jithunnair-amd added a commit to ROCm/pytorch that referenced this pull request Jul 30, 2025
Relands #2416 with caching fix

Upstream equivalent pytorch#159146

---------

Co-authored-by: Jithun Nair <37884920+jithunnair-amd@users.noreply.github.com>
pragupta pushed a commit to ROCm/pytorch that referenced this pull request Jul 30, 2025
Relands #2416 with caching fix

Upstream equivalent pytorch#159146

---------

Co-authored-by: Jithun Nair <37884920+jithunnair-amd@users.noreply.github.com>
(cherry picked from commit f0aebdc)
jithunnair-amd added a commit to ROCm/pytorch that referenced this pull request Jul 31, 2025
Relands #2416 with caching fix

Upstream equivalent pytorch#159146

---------

Co-authored-by: Jithun Nair <37884920+jithunnair-amd@users.noreply.github.com>
(cherry picked from commit f0aebdc)
jataylo added a commit to jataylo/pytorch that referenced this pull request Aug 11, 2025
…#2421)

Relands ROCm#2416 with caching fix

Upstream equivalent pytorch#159146

---------

Co-authored-by: Jithun Nair <37884920+jithunnair-amd@users.noreply.github.com>
(cherry picked from commit f0aebdc)
@iupaikov-amd
Copy link
Collaborator

Hello @shunting314 @davidberard98 @jeffdaily !

We would like to have this prior to release/2.9 cut. The main issue is that linter is wary of lru_cache usage because of memory leaks. We've seen it used in other places, is there no way to merge this with lru_cache? Maybe you know other methods of making it more convenient since decorated func will be called a lot.

Regards, Iurii.

tvukovic-amd pushed a commit to ROCm/pytorch that referenced this pull request Aug 20, 2025
Relands #2416 with caching fix

Upstream equivalent pytorch#159146

---------

Co-authored-by: Jithun Nair <37884920+jithunnair-amd@users.noreply.github.com>
(cherry picked from commit f0aebdc)
@davidberard98
Copy link
Contributor

@iupaikov-amd can you separate the function from the class (I.e make it a function instead of a method) and apply lru cache on that function instead?

@iupaikov-amd
Copy link
Collaborator

Don't have write access to Jack's fork unfortunately, he'll come back next week and apply what we discussed.

@jataylo PR for your fork: jataylo#1

@jataylo
Copy link
Collaborator Author

jataylo commented Sep 3, 2025

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

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

@pytorchmergebot
Copy link
Collaborator

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

@jataylo
Copy link
Collaborator Author

jataylo commented Sep 9, 2025

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

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

@pytorchmergebot
Copy link
Collaborator

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

@jataylo jataylo requested review from eellison and jansel and removed request for davidberard98 November 24, 2025 23:57
@jataylo
Copy link
Collaborator Author

jataylo commented Nov 24, 2025

Cleaned this up, opening for review.

@jataylo jataylo marked this pull request as ready for review November 24, 2025 23:58
@jataylo
Copy link
Collaborator Author

jataylo commented Dec 1, 2025

@pytorchbot rebase

@pytorchmergebot
Copy link
Collaborator

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

@pytorchmergebot
Copy link
Collaborator

Rebase failed due to Command git -C /home/runner/work/pytorch/pytorch push -f https://github.com/jataylo/pytorch.git pull/159146/head:warps returned non-zero exit code 128

remote: The 'AMD' enterprise forbids access via a personal access tokens (classic) if the token's lifetime is greater than 366 days. Please adjust your token's lifetime at the following URL: https://github.com/settings/tokens/779664343
fatal: unable to access 'https://github.com/jataylo/pytorch.git/': The requested URL returned error: 403

Raised by https://github.com/pytorch/pytorch/actions/runs/19819289174

@jataylo jataylo requested a review from shunting314 December 2, 2025 11:08
@jataylo jataylo added the topic: not user facing topic category label Dec 3, 2025
@jataylo
Copy link
Collaborator Author

jataylo commented Dec 3, 2025

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Dec 3, 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

JacobSzwejbka pushed a commit that referenced this pull request Dec 8, 2025
Current max_numwarps is incorrect on ROCm as warp_size is not taken into account. This PR resolves this and handles in a none hardcoded way using device props when available.

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

Labels

ciflow/inductor ciflow/inductor-rocm Trigger "inductor" config CI on ROCm ciflow/rocm Trigger "default" config CI on ROCm ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 ciflow/trunk Trigger trunk jobs on your pull request Merged module: inductor open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants