Skip to content

fix: remove dead loop in SuperFlex.forward() - #1

Open
giacomo-ciro wants to merge 1 commit into
GabrielTavernini:mainfrom
giacomo-ciro:main
Open

fix: remove dead loop in SuperFlex.forward()#1
giacomo-ciro wants to merge 1 commit into
GabrielTavernini:mainfrom
giacomo-ciro:main

Conversation

@giacomo-ciro

Copy link
Copy Markdown

SuperFlex.forward() was running self.heads(...) on every intermediate refined query in refined_queries_list, even though only the result for the last query (outdict_list[-1]) was ever returned, probably a leftover from debugging.

I was building on top of this repo, fixed the issue for my own code, and figured it was worth sharing as a quick PR.

The impact is minor, but since I'd already done the work, why not share it.

For context, on an NVIDIA RTX 2080 with batch size 4, the average runtime for a forward pass (n=100):

  • Before: mean 0.003 s
  • After: mean 0.001 s

Hope you find this useful, and thanks for your research :)

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.

1 participant