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

Preserve token strategy used at inference stage #3

Open
King4819 opened this issue Jun 21, 2024 · 3 comments
Open

Preserve token strategy used at inference stage #3

King4819 opened this issue Jun 21, 2024 · 3 comments

Comments

@King4819
Copy link

Hi, I want to ask that what is the strategy at inference stage ? The method utilizes gumbel softmax to generate preserve token mask at training stage, but how to generate preserve token mask at inference stage ?

@ZLKong
Copy link
Collaborator

ZLKong commented Jun 28, 2024

For the inference stage, we remove (hard prune) the tokens for speedup.

x = batch_index_select(x, now_policy)

We only use gumbel softmax during training. The same approach is used in DynamicViT

https://github.com/raoyongming/DynamicViT/blob/1322e626d1e9eca18cc150569908fb4af29e15f7/models/dyvit.py#L449

@King4819
Copy link
Author

@ZLKong Thanks for your reply. If during inference stage it utilizes the technique same as DynamicViT, how do it achieve adaptive pruning? Since the preserve number of tokens is already determined

@King4819
Copy link
Author

King4819 commented Dec 7, 2024

@ZLKong Sorry. I'm wondering if you have seen the reply, thanks !!!

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

No branches or pull requests

2 participants