-
Notifications
You must be signed in to change notification settings - Fork 10
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
Attention masking issue for batch submissions, Huggingface #16
Comments
There might be more issues than just this. It worked in the case of the two sequences I tested this on, but got an xformers error when I tried a larger batch of more diverse sequence lengths. I tried changing the dtype to float16 and padded the sequences to be multiples of 8 but to no avail. NotImplementedError: No operator found for I saw in a different thread that the CPU version uses default torch instead of xformers. Is there a way to add functionality so that the GPU version can also disable xformers? |
Placing my fix here, in case people need it for batching tokens. I commented out a portion of the amplify.py script located here (on my machine). portion of the script changed (removing xformers memory_efficient_attention implementation)
|
Hi @prwoolley, thank you for your interest in AMPLIFY! Apologies for the delayed response. You’re right, the Alternatively, you could verify the
The second issue you observed might be related to the Our group is working on an improved version of the codebase. We will fix this in the next release. |
Thanks for the model! This is regarding the default behavior on Huggingface. When running a batch forward pass on the model for inference, there is an issue with the attention mask created by the tokenizer. Feeding the model the attention mask tensor throws an error because the tokenizer makes the attention mask as integers whereas a downstream step expects floats. This can be fixed by simply changing the datatype to a float before the forward pass, but this is another step for the user to figure out. Can this become a default tokenizer step?
The text was updated successfully, but these errors were encountered: