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

Support Value Zeroing for non-eager attention types #267

Merged
merged 1 commit into from
Apr 25, 2024
Merged

Conversation

gsarti
Copy link
Member

@gsarti gsarti commented Apr 25, 2024

Description

This PR addresses the bug with SDPA attention described in #266, and enables the usage of VZ out of the box for all attention implementations

@gsarti gsarti enabled auto-merge (squash) April 25, 2024 19:55
@gsarti gsarti disabled auto-merge April 25, 2024 19:56
@gsarti gsarti linked an issue Apr 25, 2024 that may be closed by this pull request
@gsarti gsarti merged commit f2b9d92 into main Apr 25, 2024
3 checks passed
@gsarti gsarti deleted the eager-attn-req branch April 25, 2024 19:56
LuukSuurmeijer pushed a commit to LuukSuurmeijer/inseq that referenced this pull request May 10, 2024
gsarti added a commit that referenced this pull request Jul 23, 2024
* Save attribution tensors with a lower precision.

#202
Adds functionality for saving feature attributions objects and tensors in float16 or float8 format,
depending on `scores_precision` parameters.
Tensors are saved in huggingface safetensor format, and quantized using
zeropoint quantization. Because safetensors are bytes objects, they are
encoded with b64 to be saved in the output json and decoded upon
reloading.

* Add support for `device_map` use (#264)

* Add device_map support

* Fix device setter in HF model

* Support Value Zeroing for non-eager attention types (#267)

* Fix nans in attn, add pad if missing (#269)

* Add transformers v4.40 models to config, update changelog

* run tests

* Minor fixes

* fixed json decode error

* Switched to torch-native float8_e4m3fn format

* Fix style

* Fix reqs

* Fix safety

* Add changelog

---------

Co-authored-by: Gabriele Sarti <gabriele.sarti996@gmail.com>
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.

Issue with the implementation of Value Zeroing
1 participant