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

Adding partition logic #161

Merged
merged 8 commits into from
Jul 6, 2024
Merged

Adding partition logic #161

merged 8 commits into from
Jul 6, 2024

Conversation

Whattabatt
Copy link
Contributor

No description provided.

Copy link
Member

@soldni soldni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Whattabatt left a few comments on supporting partitioning on all types of filtering (by document, by ngram). I think we could maybe move the check into the bloom filter itself?

python/dolma/cli/deduper.py Outdated Show resolved Hide resolved
num_processed += 1;
//Compute the remaining hashes
hashes.extend(bloom_filter.remaining_hashes(&dedupe_key));
if bloom_filter.contains(&hashes) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm I don't fully follow the logic here. What I would do is have this contains function check if whatever you are putting into the bloom filter matches partition, and if so, put that into the filter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is optimizing for reducing the number of hash function calls - partitioning only on the first hash of N and not doing any other hashing etc if it doesn't. Does that seem worthwhile? Regardless I'll add a comment since the behavior isn't super clear

Copy link
Member

@soldni soldni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New changes looks good–perhaps worth adding some unit tests?

Copy link
Member

@soldni soldni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

python/dolma/cli/deduper.py Outdated Show resolved Hide resolved
@soldni soldni merged commit 7318c44 into main Jul 6, 2024
14 checks passed
@soldni soldni deleted the dedupe_partitions branch July 6, 2024 09:34
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