-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Solve underallocation in VSWA+/VGQA #4667
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
Solve underallocation in VSWA+/VGQA #4667
Conversation
Signed-off-by: Netanel Haber <[email protected]>
Signed-off-by: Netanel Haber <[email protected]>
Signed-off-by: Netanel Haber <[email protected]>
Signed-off-by: Netanel Haber <[email protected]>
Signed-off-by: Netanel Haber <[email protected]>
5790310 to
5e9c4de
Compare
Signed-off-by: Netanel Haber <[email protected]>
|
/bot run |
|
PR_Github #6506 [ run ] triggered by Bot |
|
PR_Github #6506 [ run ] completed with state |
Signed-off-by: Netanel Haber <[email protected]>
|
/bot run |
|
PR_Github #6629 [ run ] triggered by Bot |
|
PR_Github #6629 [ run ] completed with state |
Signed-off-by: Netanel Haber <[email protected]>
|
/bot run |
|
PR_Github #6744 [ run ] triggered by Bot |
|
PR_Github #6744 [ run ] completed with state |
Signed-off-by: Netanel Haber <[email protected]>
Signed-off-by: Netanel Haber <[email protected]>
Signed-off-by: Netanel Haber <[email protected]>
|
/bot run |
|
PR_Github #8327 [ run ] triggered by Bot |
|
PR_Github #8327 [ run ] completed with state |
|
/bot run |
|
PR_Github #8462 [ run ] triggered by Bot |
|
/bot skip --comment "Successful CI has run multiple times and has failed due to flaky tests" |
|
/bot skip --comment "Successful CI has run multiple times and has failed due to flaky tests" |
|
PR_Github #8595 [ skip ] triggered by Bot |
|
PR_Github #8596 [ skip ] triggered by Bot |
|
PR_Github #8595 [ skip ] completed with state |
|
PR_Github #8462 [ run ] completed with state |
|
PR_Github #8596 [ skip ] completed with state |
Solving under-allocation of memory when a non-homogenous model is used - VSWA/VGQA or both.
About a month ago, I merged a hefty PR: #3028 .
What the PR did was create so-called
WindowBlockManagers for each window size, that manage their own 'mini' kv-cache. Each manager manages potentially multiple pools, each corresponding to a unique number of kv heads. See docs.Part of the work was divvying up the free memory ("number of blocks") between each
WindowBlockManager- by calculating the weighted share of each manager.In pseudo-code:
For each window size
w:1. weight[w] = w × (number of layers that use w)
2. totalWeight = sum of all weights
3. blocks[w] = totalBlocks × weight[w] / totalWeight
But, there are two bugs in the above calculation, and both of them are due to not taking into account that the term "blocks" suddenly becomes too generic in the case of a non-homogenous model - VSWA [Variable Sliding Window Attention]/VGQA [Variable GQA] or both:
This pr addresses these shortcomings by weighting these properties as well.