Skip to content

[Tests] Use proper offloading utils in test_compress_tensor_utils #1449

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 1 commit into
base: main
Choose a base branch
from

Conversation

kylesayrs
Copy link
Collaborator

Purpose

  • Prerequisite for Use model compression pathways #1419
    • This PR disables getting the offloaded state dict unless necessary (sparsity statistics). However, the utility function cpu_offload only works if the offloaded state dict is retrieved. Let's replace this with dispatch_model, which is the actual function used by PretrainedModel, not cpu_offload

Changes

  • Rename device_map to device
  • Use dispatch_model rather than cpu_offload
  • Use align_module_device and update_offload_parameter utilities
    • This change is necessary because, after these changes, some of these test models no longer have offloaded state dicts (which is the way it should always have been)

Signed-off-by: Kyle Sayers <[email protected]>
Copy link

👋 Hi! Thank you for contributing to llm-compressor. Please add the ready label when the PR is ready for review.

Note: This is required to complete the testing suite, please only add the label once the PR is code complete and local testing has been performed.

@kylesayrs kylesayrs added the ready When a PR is ready for review label May 19, 2025
Copy link
Collaborator

@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.

💚

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready When a PR is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants