Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release and allocate VGPR resoures in tail loop. #1586

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

hcman2
Copy link
Contributor

@hcman2 hcman2 commented Jan 23, 2025

  1. Add a VGPR base index definition.
  2. Rearange VGPR index order for further optimization.
  3. Re-allocate VGPR for tail loop.

Fix 4 potential bugs:

  1. DTV will use the Valu VGPRs which is released in the beginning of tail loop.
  2. BiasSum Valu VGPR should be used when endSum but is released in the beginning of tail loop.
  3. _replaceActBranchLabel() always replaces label without postfix.
    However we should check the label we'd really like to replace with.
  4. For DTL, numVgprG2LAllocated is not set so that it will be
    default=-1.

@hcman2 hcman2 changed the title Release and allocate VGPR resoures in tail loop. [Draft] Release and allocate VGPR resoures in tail loop. Jan 23, 2025
@hcman2 hcman2 force-pushed the vgpr branch 2 times, most recently from 4e58993 to a053a82 Compare January 24, 2025 06:05
@hcman2 hcman2 force-pushed the vgpr branch 2 times, most recently from 05127bf to 33928c3 Compare February 3, 2025 08:40
@solaslin solaslin added the noCI Disable testing on supported CI systems: math libraries CI has this feature enabled.. label Feb 5, 2025
@hcman2 hcman2 force-pushed the vgpr branch 5 times, most recently from a31b071 to 7f6c281 Compare February 10, 2025 02:10
1. Add a VGPR base index definition.
2. Rearange VGPR index order for further optimization.
3. Re-allocate VGPR for tail loop.

Fix 4 potential bugs:
1. DTV will use the Valu VGPRs which is released in the beginning of tail loop.
2. BiasSum Valu VGPR should be used when endSum but is released in the beginning of tail loop.
3. _replaceActBranchLabel() always replaces label without postfix.
   However we should check the label we'd really like to replace with.
4. For DTL, numVgprG2LAllocated is not set so that it will be
   default=-1.

This change is the first step to optimize the VGPR usage in unroll loop.
In general, the VGPRs usage in the unrolled loop is dependent from the
tail. In tail, the VGPR can be used more effectively.
@hcman2 hcman2 added noCI Disable testing on supported CI systems: math libraries CI has this feature enabled.. and removed noCI Disable testing on supported CI systems: math libraries CI has this feature enabled.. labels Feb 10, 2025
@hcman2 hcman2 changed the title [Draft] Release and allocate VGPR resoures in tail loop. Release and allocate VGPR resoures in tail loop. Feb 10, 2025
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.

2 participants