Skip to content

Ensure node ids are always selected into the same split#104

Merged
kmontemayor2-sc merged 14 commits intomainfrom
kmonte/fix-split
Jun 25, 2025
Merged

Ensure node ids are always selected into the same split#104
kmontemayor2-sc merged 14 commits intomainfrom
kmonte/fix-split

Conversation

@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator

Changes:

  • update _fast_hash to run again to improve mixing - without this our N=20 node ids had splits like [18], [0], [2]
  • enforce val_num and test_num as floats - since we can't guarantee counts easily anymore.
  • Update splitting logic to ensure nodes are always selected into the same split [discussed more below].
  • Added a (basic) test for the "distributed" case.
  • Removed some tests that relied on integer counts.

The issue with our previous splitting logic, is that even though a given node id would always have the same hash on different machines, since we sorted the hashed, it's "position" may be different and so it may be selected into different splits.

For instance, let's assume the hash function is the identity, and rank_0_nodes: [0, 1, 2, 3] rank_1_nodes: [3, 4, 5, 6]

On rank 0, 3 would be selected into Test, as its hash value is the greatest sorted, while it would be in train on rank 1.

Now what we do is fine the globally largest/smallest hash and then normalize the hash values per machine.

We then select the nodes based on the normalized values, since the hashes are consistent, and they get normalized the same, the same node id will be selected into the same split always now.

@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator Author

/unit_test

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 19, 2025

GiGL Automation

@ 02:38:55UTC : 🔄 Unit Test started.

@ 03:06:03UTC : ❌ Workflow failed.
Please check the logs for more details.

@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator Author

/unit_test

@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator Author

/integration_test

@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator Author

/e2e_test

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 19, 2025

GiGL Automation

@ 03:53:41UTC : 🔄 Unit Test started.

@ 04:27:15UTC : ✅ Workflow completed successfully.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 19, 2025

GiGL Automation

@ 03:53:44UTC : 🔄 Integration Test started.

@ 04:34:46UTC : ✅ Workflow completed successfully.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 19, 2025

GiGL Automation

@ 03:53:48UTC : 🔄 E2E Test started.

@ 05:23:37UTC : ✅ Workflow completed successfully.

Comment thread python/gigl/utils/data_splitters.py
Comment thread python/gigl/utils/data_splitters.py Outdated
Comment thread python/gigl/utils/data_splitters.py
Comment thread python/tests/unit/distributed/distributed_neighborloader_test.py Outdated
Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
Comment thread python/tests/unit/utils/data_splitters_test.py
Copy link
Copy Markdown
Collaborator

@nshah-sc nshah-sc left a comment

Choose a reason for hiding this comment

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

thx!

Comment thread python/gigl/utils/data_splitters.py
Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
Comment thread python/gigl/utils/data_splitters.py
Comment thread python/gigl/utils/data_splitters.py
Comment thread python/gigl/utils/data_splitters.py
Comment thread python/gigl/utils/data_splitters.py
Comment thread python/gigl/utils/data_splitters.py
Comment thread python/gigl/utils/data_splitters.py Outdated
Comment thread python/tests/unit/distributed/distributed_neighborloader_test.py Outdated
@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator Author

/unit_test

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 23, 2025

GiGL Automation

@ 23:20:25UTC : 🔄 Unit Test started.

@ 23:43:39UTC : ❌ Workflow failed.
Please check the logs for more details.

Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator Author

/unit_test

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 24, 2025

GiGL Automation

@ 17:03:47UTC : 🔄 Unit Test started.

@ 17:25:55UTC : ❌ Workflow failed.
Please check the logs for more details.

Comment thread python/tests/unit/utils/data_splitters_test.py Outdated
@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator Author

/unit_test

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 24, 2025

GiGL Automation

@ 20:41:18UTC : 🔄 Unit Test started.

@ 21:06:43UTC : ❌ Workflow failed.
Please check the logs for more details.

Copy link
Copy Markdown
Collaborator

@svij-sc svij-sc 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 the iterations

Comment thread python/tests/unit/utils/data_splitters_test.py
Comment thread python/gigl/distributed/dataset_factory.py
@kmontemayor2-sc
Copy link
Copy Markdown
Collaborator Author

/unit_test

@github-actions
Copy link
Copy Markdown
Contributor

GiGL Automation

@ 22:10:49UTC : 🔄 Unit Test started.

@kmontemayor2-sc kmontemayor2-sc marked this pull request as ready for review June 24, 2025 22:43
@kmontemayor2-sc kmontemayor2-sc added this pull request to the merge queue Jun 24, 2025
Merged via the queue into main with commit dd619e2 Jun 25, 2025
4 checks passed
@kmontemayor2-sc kmontemayor2-sc deleted the kmonte/fix-split branch June 25, 2025 00:14
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.

4 participants