Skip to content

Allow user to dynamically set batch size of pixel SOM assignments #1069

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

Merged
merged 8 commits into from
Oct 30, 2023

Conversation

alex-l-kong
Copy link
Contributor

What is the purpose of this PR?

The current hard-coded batch size of 100 makes pixel SOM cluster assignment extremely slow. For a powerful machine (and even modern-day M1's and M2's), it can handle a much larger batch size and offer a 100x+ speedup.

How did you implement your changes

Pass an argument through the PixelSOMCluster process called num_parallel_pixels, which controls how many SOM clusters get assigned at once.

…orts, and also that users can change if necessary
@alex-l-kong alex-l-kong self-assigned this Sep 28, 2023
@alex-l-kong alex-l-kong requested a review from cliu72 October 3, 2023 20:15
Copy link
Contributor

@cliu72 cliu72 left a comment

Choose a reason for hiding this comment

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

Sorry for the late review! Just some small requests.

@alex-l-kong alex-l-kong requested a review from cliu72 October 19, 2023 22:34
Copy link
Contributor

@cliu72 cliu72 left a comment

Choose a reason for hiding this comment

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

Can we add the same functionality to assign_som_clusters in the CellSOMCluster class in cluster_helpers.py (and cell_som_clustering.py respectively)?

@alex-l-kong
Copy link
Contributor Author

Can we add the same functionality to assign_som_clusters in the CellSOMCluster class in cluster_helpers.py (and cell_som_clustering.py respectively)?

Sure, same batch size work?

@cliu72
Copy link
Contributor

cliu72 commented Oct 25, 2023

Can we add the same functionality to assign_som_clusters in the CellSOMCluster class in cluster_helpers.py (and cell_som_clustering.py respectively)?

Sure, same batch size work?

Yup, that works.

@alex-l-kong alex-l-kong requested a review from cliu72 October 25, 2023 23:15
Copy link
Contributor

@cliu72 cliu72 left a comment

Choose a reason for hiding this comment

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

Looks good!

@alex-l-kong alex-l-kong added this pull request to the merge queue Oct 27, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Oct 27, 2023
@alex-l-kong alex-l-kong added this pull request to the merge queue Oct 30, 2023
Merged via the queue into main with commit bfc53b7 Oct 30, 2023
@alex-l-kong alex-l-kong deleted the pixie_som_batch branch October 30, 2023 19:54
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