-
Notifications
You must be signed in to change notification settings - Fork 741
[PyTorch] Debug CPU offloading in grouped linear and grouped MLP #3047
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
Merged
timmoon10
merged 7 commits into
NVIDIA:main
from
lhb8125:feat/selective-offload-on-srelu-fuser
Jun 6, 2026
+108
−20
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3a6683f
Support selective offload for fused grouped MLP
lhb8125 376d28c
Add no_offload_activation to grouped MLP ops
lhb8125 933d64b
Use offload_activation API for activation offload control
lhb8125 1ce8fd2
Fix CPU offloading correctness in ops layer
timmoon10 1da42fd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e60b579
Merge branch 'main' into feat/selective-offload-on-srelu-fuser
timmoon10 aae2f2e
Construct internal grouped tensors within grouped linear and grouped MLP
timmoon10 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we set the input quantizer with
.internal = True, isn't it redundant to repackgrouped_fc1_xinto aGroupedTensorStorage?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they are targeting different cases. The input quantizer with
.interal= True```` takes effects on bf16 input, where we need to quantize it byfc1_input_quantizer. The second case is that the input is already a quantized fp8 tensor, where we need to repack it into aGroupedTensorStorage```.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How could it already be quantized? The only way to create it is from the quantizer, either just now or from a previous step (e.g. with activation recompute). If the quantizer has.internal=True, it can only beGroupedTensorStorage.If something is incorrectly producingGroupedTensor, then that's a bug. Fixing it here is papering over the real problem.Actually, on second thought, it makes sense that
input_can be aGroupedTensorsince it comes from outside the op. It would be useful to know what use-case hit this bug though. Activation recompute?Really the root cause is that CPU offloading doesn't handle
GroupedTensorgracefully, but that would be a more involved effort.