Skip to content

Conversation

keturn
Copy link
Contributor

@keturn keturn commented Mar 10, 2023

No description provided.

@keturn keturn added the techdebt Toil to reduce technical debt label Mar 10, 2023
Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

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

Nice to see so much code disappearing.

@lstein
Copy link
Collaborator

lstein commented Mar 10, 2023

In model_manager.py dangling call to _model_to_cpu here:

    def offload_model(self, model_name: str) -> None:
        """
        Offload the indicated model to CPU. Will call
        _make_cache_room() to free space if needed.
        """
        if model_name not in self.models:
            return

        print(f">> Offloading {model_name} to CPU")
        model = self.models[model_name]["model"]
        model.offload_all()
        self.models[model_name]["model"] = self._model_to_cpu(model)

        gc.collect()
        if self._has_cuda():
            torch.cuda.empty_cache()

Also, pyflakes is complaining about undefined name 'model_description' I'll commit fixes.

Copy link
Collaborator

@lstein lstein left a comment

Choose a reason for hiding this comment

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

Seems to be working now.

@keturn
Copy link
Contributor Author

keturn commented Mar 10, 2023

Thanks for catching that!

@lstein lstein enabled auto-merge March 10, 2023 03:49
@lstein lstein merged commit 12c7db3 into main Mar 10, 2023
@lstein lstein deleted the cleanup/more_ldm_cleanup branch March 10, 2023 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

techdebt Toil to reduce technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants