Conversation
…rtitioning pymetis depends on METIS which includes sys/resource.h, a Unix-only header that prevents compilation on Windows CI. KaHIP provides equivalent multi-way graph partitioning with native Windows support via prebuilt wheels on PyPI. - Replace pymetis with kahip>=3.25 in pyproject.toml - Swap partition backend in physical_layout.py to use kahip.kaffpa() - Rename metis_seed field to partitioner_seed for backend neutrality - Retain existing post-partition capacity enforcement for strict word-size adherence - Add backend adapter unit test with monkeypatched KaHIP calls - Regenerate uv.lock Closes #293 Made-with: Cursor
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
weinbe58
reviewed
Mar 22, 2026
weinbe58
requested changes
Mar 23, 2026
Member
weinbe58
left a comment
There was a problem hiding this comment.
Can you remove the exception catching in terms of the import? its a part of the required dependency so it shuold always be installed.
…windows-find-cross-platform-alternative
github-actions bot
pushed a commit
that referenced
this pull request
Mar 23, 2026
…rtitioning (#295) * build(python): replace pymetis with kahip for cross-platform graph partitioning pymetis depends on METIS which includes sys/resource.h, a Unix-only header that prevents compilation on Windows CI. KaHIP provides equivalent multi-way graph partitioning with native Windows support via prebuilt wheels on PyPI. - Replace pymetis with kahip>=3.25 in pyproject.toml - Swap partition backend in physical_layout.py to use kahip.kaffpa() - Rename metis_seed field to partitioner_seed for backend neutrality - Retain existing post-partition capacity enforcement for strict word-size adherence - Add backend adapter unit test with monkeypatched KaHIP calls - Regenerate uv.lock Closes #293 Made-with: Cursor * changed bloqade lanes version * removed asserting kahip imports * Fixed test import --------- Co-authored-by: Jason Ludmir <jasonludmir@JLudmir-Mac-QDNH.local>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pymetiswithkahip>=3.25as the graph partitioning backend inphysical_layout.py, fixing Windows CI compilation failures caused by METIS's dependency on the Unix-onlysys/resource.hheader (build: pymetis fails to compile on Windows — find cross-platform alternative #293).pymetis.part_graphtokahip.kaffpa, mapping the existingu_factorto KaHIP'simbalanceparameter and preserving the post-partition capacity enforcement that guarantees strict word-size adherence.metis_seedtopartitioner_seedfor backend-neutral naming.test_physical_layout_backend_adapter.py) that validates the KaHIP adapter via monkeypatching.Changes
pyproject.tomlpymetis>=2025.2.1→kahip>=3.25python/bloqade/lanes/heuristics/physical_layout.pykahip.kaffpa; renamemetis_seed→partitioner_seed; graceful import withtry/exceptpython/tests/heuristics/test_physical_layout_backend_adapter.pykaffpauv.lockMotivation
pymetiswraps METIS, which relies onsys/resource.h— a POSIX header unavailable on Windows. This blocks the cross-platform CI pipeline. KaHIP provides equivalent k-way graph partitioning with prebuilt Windows wheels on PyPI, eliminating the native-compilation dependency.Closes #293
Made with Cursor