[Fix] offload .to(cuda) interception + configurable nd_tiling max_tiles and prefetch lookahead - #61
Open
cennn wants to merge 1 commit into
Open
[Fix] offload .to(cuda) interception + configurable nd_tiling max_tiles and prefetch lookahead#61cennn wants to merge 1 commit into
cennn wants to merge 1 commit into
Conversation
3 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Three bug fixes and one config knob exposed during disaggregated multi-model inference on 31 GiB GPUs (RTX 5090):
_patch_cpu_offload_applynow intercepts.to(cuda:X)in addition to.cuda()model.to(device)(common in multi-model pipelines) bypassed the offload hook entirely, putting all weights on GPU and OOMing on 31 GiB cards..to()lambda with a small CPU tensor to detect CUDA target.nd_tiling max_tiles capped at 2 unconditionally
max_tiles exposed as
MAGI_COMPILE_PASS_CONFIG__ND_TILING_MAX_TILESPrefetch lookahead configurable via
OffloadConfig.max_prefetch_lookahead