Skip to content
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

Trace hook never unhooks the attention processor #52

Closed
rockerBOO opened this issue Nov 13, 2023 · 0 comments · Fixed by #53
Closed

Trace hook never unhooks the attention processor #52

rockerBOO opened this issue Nov 13, 2023 · 0 comments · Fixed by #53

Comments

@rockerBOO
Copy link
Contributor

daam/daam/trace.py

Lines 281 to 282 in a323129

def _hook_impl(self):
self.module.set_processor(self)

This hook doesn't unhook which can cause problems for the network in the future.

So I added a capture of the original processor and then added an unhook impl to set it back to the original processor.

    def _hook_impl(self):
        self.original_processor = self.module.processor
        self.module.set_processor(self)

    def _unhook_impl(self):
        self.module.set_processor(self.original_processor)

I can make a PR in the future but in a messy situation at the moment.

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 a pull request may close this issue.

1 participant