Skip to content

[Transform] Accelerate Utilities #328

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kylesayrs
Copy link
Contributor

@kylesayrs kylesayrs commented May 30, 2025

Purpose

Changes

  • Implement register_offload_module
    • Used to register transform modules during apply
  • Implement delete_offload_module
    • Used to delete transform modules during serialization
  • Implement force_cpu_offload
    • Used for testing
  • Misc: Add missing fallbacks for disable_offload and align_modules

Testing

  • Add tests for register_offload_module, delete_offload_module, and force_cpu_offload

kylesayrs added 2 commits May 30, 2025 13:40
Signed-off-by: Kyle Sayers <[email protected]>
Signed-off-by: Kyle Sayers <[email protected]>
@kylesayrs kylesayrs marked this pull request as ready for review May 30, 2025 18:31
Copy link
Contributor

@brian-dellabetta brian-dellabetta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming force name means that takes precedent over any other context, e.g. force_cpu_offload overrules disable_offload, and the module/tensor will be moved to CPU?

Signed-off-by: Kyle Sayers <[email protected]>
@kylesayrs
Copy link
Contributor Author

kylesayrs commented May 30, 2025

@brian-dellabetta Not necessarily. I use the word "force" because dispatch_model does not always cause tensors to go to the meta device (become offloaded). For example, passing a device map with just one device will not trigger offloading for small models.

This method "forces" the tensors to go onto the meta device by nature of specifying a very granular device map (dispatch_model is a weird method :/ )

@kylesayrs kylesayrs changed the title [Transforms] Accelerate Utilities [Transform] Accelerate Utilities May 31, 2025
Signed-off-by: Kyle Sayers <[email protected]>
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