Skip to content

DiBB Overhaul#1

Merged
giuse merged 25 commits intogiuse:masterfrom
rolshoven:feature/overhaul
Apr 17, 2026
Merged

DiBB Overhaul#1
giuse merged 25 commits intogiuse:masterfrom
rolshoven:feature/overhaul

Conversation

@rolshoven
Copy link
Copy Markdown
Collaborator

This PR includes the following changes:

  • Minor bugfixes
  • Replaced pipenv with uv
  • Adapted code and tests to work with current dependencies

Copy link
Copy Markdown
Owner

@giuse giuse left a comment

Choose a reason for hiding this comment

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

Thanks for bringing DiBB up to speed! I really like this. There's one file that should not be committed (and added to .gitignore), and one stylistic change I would rather roll back (switching all python strings to double quotes, I use single quotes to distinguish symbols, which are otherwise missing from python), otherwise all good and very happy with this! :)

Comment thread src/dibb/_version.py Outdated
Comment thread src/dibb/opt_wrappers/cma_wrapper.py Outdated
Comment thread src/dibb/opt_wrappers/cma_wrapper.py Outdated
Comment thread src/dibb/opt_wrappers/lmmaes_wrapper.py Outdated
Comment thread tests/test_dibb_distributed.py Outdated
Comment thread tests/test_dibb_local.py Outdated
Comment thread .gitignore
When using DiBB in local mode, i.e. we only have one ip address in the Ray cluster, it does not matter which IP it is. Moreover, when using DiBB on a SLURM cluster node, Ray may not show 127.0.0.1 as the ip adress.
…ndling of string literals. Refactored string quotes in various files to maintain consistency.
…preventing unwanted changes during commits. Updated test assertion formatting for improved readability.
@rolshoven
Copy link
Copy Markdown
Collaborator Author

@giuse I addressed your comments and changed three additional things:

  1. There was an assertion message that used the wrong variable:
index e90cb84..d8085b7 100644
@@ -118,7 +118,7 @@ class DiBB:
 
         assert sum(self.block_sizes) == self.ndims, (
             "Sum of block sizes must sum up to number of dimensions "
-            + f"(tried {len(self.blocks)} blocks totaling {sum(self.blocks)} "
+            + f"(tried {len(self.block_sizes)} blocks totaling {sum(self.block_sizes)} "
             + f"dimensions with {self.ndims} parameters)"
         )
  1. I noticed that in "local DiBB mode", the "NodeManagerAddress" that ray saves in its ray.nodes attribute is not always 127.0.0.1, which led to error on the SLURM node that I used. Therefore, I removed this check. I think that it is not important anyway what the IP of the node is if we only have one node.
index d8085b7..8315e42 100644
@@ -143,9 +143,6 @@ class DiBB:
            ip_addresses = [node["NodeManagerAddress"] for node in ray.nodes()]
            if len(ip_addresses) == 1:
                # Local mode
-                assert ip_addresses[0] == "127.0.0.1", (
-                    "Unexpected error: Running on a single machine which is not 127.0.0.1"
-                )
  1. I added a custom representation for the block workers in the Ray logs:
index c3ec867..6c4b727 100644
@@ -320,6 +320,10 @@ class BlockWorker:
             if self.verbose:
                 print(f"Resuming block {self.block_id}")
         return done
+    
+    def __repr__(self):
+        """Customized prefix for Ray actor logs"""
+        return f"BlockWorker [block_id={self.block_id}]"

Can you have a look at the PR again and give further feedback if needed?

@rolshoven rolshoven requested a review from giuse April 6, 2026 14:32
@giuse giuse merged commit 360b6f0 into giuse:master Apr 17, 2026
@giuse
Copy link
Copy Markdown
Owner

giuse commented Apr 17, 2026

Great work, thank you so much @rolshoven ! :)

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