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

Fixed edge case in activation cache shuffling #11

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

lucyfarnik
Copy link
Contributor

There was a bug where you could pass buffer_idx_range=(0, 1) into shuffle_activations_pairwise, it wouldn't raise an exception like it was supposed to and then get stuck in an infinite loop trying to find two non-identical indices within that range.

This was particularly likely to happen during the final shuffling when caching activations, so I've added an if statement there to make sure final pairwise shuffling doesn't happen if there's only 1 cache file.

@jbloomAus
Copy link
Owner

Thanks!

@jbloomAus jbloomAus merged commit 3727b5d into jbloomAus:main Feb 26, 2024
2 checks passed
tom-pollak pushed a commit to tom-pollak/SAELens that referenced this pull request Oct 22, 2024
…dge-case

Fixed edge case in activation cache shuffling
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.

2 participants