-
-
Notifications
You must be signed in to change notification settings - Fork 21
Add GNN-Based Predictor with DAG Preprocessing #430
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
base: main
Are you sure you want to change the base?
Changes from 102 commits
12fad57
be734dd
61c6824
75875ff
081651c
b82dc01
5ebd202
857cd6f
6081f6b
7c54da6
bb4da24
10bb52c
06be0d6
ce990e3
96ca75b
a64a082
f8c99b5
e4e2742
5784ff7
7e17379
082de05
5ed00a9
e59a941
3a9f16c
c43ee01
92eda99
dc1aa55
6809ccb
8c77598
dc0a824
2419952
5335241
96096a0
4613012
1c728e2
c31cb46
13cf0f4
713343f
17c6575
169b00e
2248081
8f90b12
74ec34b
f99e17b
57b1a29
96232f0
61965d8
93f5414
95f5359
4fb7112
5ea1720
312e6ea
156b7e6
77c9f5c
1ff39e1
5a2d583
820895c
8b0b51f
de738df
794896e
29761dc
3716688
65b409b
ef8e567
a734050
a43dd5a
07e937e
1e29f6b
6dc9d28
f664616
f97e164
2e9cc1e
1a8b1a4
595469e
15d4814
ca5339e
ddb6f50
a2cca5c
af38ff4
fc48550
92897cb
f27358f
3af112a
88256c9
2cf80d1
be5210b
2e28a14
1e4a279
e9f698e
ea825ff
e28dc60
620a1d7
c258fe0
29cf56a
f412af8
3c077b1
8b79177
2a9457d
77cca31
1acc0cb
64a94ff
c4cc835
7acbec7
6ebded4
6207f97
5828e7f
a09b7dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,10 @@ dependencies = [ | |
| "numpy>=1.26; python_version >= '3.12'", | ||
| "numpy>=1.24; python_version >= '3.11'", | ||
| "numpy>=1.22", | ||
| "numpy>=1.22,<2; sys_platform == 'darwin' and 'x86_64' in platform_machine and python_version < '3.13'", # Restrict numpy v2 for macOS x86 since it is not supported anymore since torch v2.3.0 | ||
| "optuna>=4.5.0", | ||
| "torch-geometric>=2.6.1,<2.7.0", | ||
| "torch>=2.7.1,<2.8.0; sys_platform == 'darwin' and 'x86_64' in platform_machine and python_version < '3.13'", # Restrict torch v2.3.0 for macOS x86 since it is not supported anymore. | ||
| "typing-extensions>=4.1", # for `assert_never` | ||
| ] | ||
|
|
||
|
|
@@ -118,6 +122,8 @@ xfail_strict = true | |
| filterwarnings = [ | ||
| 'error', | ||
| 'ignore:.*pytorch.*:UserWarning:', | ||
| "ignore:.*torch_geometric.*:UserWarning:", | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "ignore:.*'type_params' parameter of 'typing\\._eval_type'.*:DeprecationWarning:", | ||
|
Comment on lines
+125
to
+126
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Line 125: Verify torch_geometric UserWarning filter is appropriately specific. The filter Line 126 appears to be a new, targeted filter for a specific typing deprecation, which is appropriate. Can you provide the specific torch_geometric UserWarning message(s) that prompted line 125? If there are reproducible warnings, I can help refine the filter to be more specific. |
||
| 'ignore:.*Values in x.*:RuntimeWarning:', | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'ignore:.*The least populated class in y has only 3 members, which is less than n_splits=5.*:UserWarning:', | ||
| 'ignore:.*divide by zero encountered in det.*:RuntimeWarning:', | ||
|
|
@@ -126,6 +132,7 @@ filterwarnings = [ | |
| 'ignore:.*qiskit.providers.models is deprecated since Qiskit 1.2*:DeprecationWarning:', | ||
| 'ignore:.*The class ``qiskit.qobj.*`` is deprecated as of Qiskit 1.3.*:DeprecationWarning:', | ||
| 'ignore:.*The property ``qiskit.circuit.instruction.Instruction.*`` is deprecated as of qiskit 1.3.0.*:DeprecationWarning:', | ||
| "ignore::DeprecationWarning:torch_geometric\\.distributed.*", | ||
| ] | ||
|
|
||
| [tool.coverage] | ||
|
|
@@ -163,9 +170,13 @@ implicit_reexport = true | |
| # recent versions of `gym` are typed, but stable-baselines3 pins a very old version of gym. | ||
| # qiskit is not yet marked as typed, but is typed mostly. | ||
| # the other libraries do not have type stubs. | ||
| module = ["qiskit.*", "joblib.*", "sklearn.*", "matplotlib.*", "gymnasium.*", "mqt.bench.*", "sb3_contrib.*", "bqskit.*", "qiskit_ibm_runtime.*", "networkx.*", "stable_baselines3.*"] | ||
| module = ["qiskit.*", "joblib.*", "sklearn.*", "matplotlib.*", "gymnasium.*", "mqt.bench.*", "sb3_contrib.*", "bqskit.*", "qiskit_ibm_runtime.*", "networkx.*", "stable_baselines3.*", "torch", "torch.*", "torch_geometric", "torch_geometric.*", "optuna.*"] | ||
| ignore_missing_imports = true | ||
|
|
||
| [[tool.mypy.overrides]] | ||
| module = ["mqt.predictor.ml.*"] | ||
| disallow_subclassing_any = false | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| [tool.ruff] | ||
| line-length = 120 | ||
| extend-include = ["*.ipynb"] | ||
|
|
@@ -247,6 +258,7 @@ wille = "wille" | |
| anc = "anc" | ||
| aer = "aer" | ||
| fom = "fom" | ||
| TPE = "TPE" | ||
|
|
||
| [tool.repo-review] | ||
| ignore = [ | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file should not be tracked and can be removed. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| # Copyright (c) 2023 - 2025 Chair for Design Automation, TUM | ||
| # Copyright (c) 2025 Munich Quantum Software Company GmbH | ||
| # All rights reserved. | ||
| # | ||
| # SPDX-License-Identifier: MIT | ||
| # | ||
| # Licensed under the MIT License | ||
|
|
||
| # file generated by setuptools-scm | ||
| # don't change, don't track in version control | ||
| from __future__ import annotations | ||
|
|
||
| __all__ = [ | ||
| "__commit_id__", | ||
| "__version__", | ||
| "__version_tuple__", | ||
| "commit_id", | ||
| "version", | ||
| "version_tuple", | ||
| ] | ||
|
|
||
| TYPE_CHECKING = False | ||
| if TYPE_CHECKING: | ||
| VERSION_TUPLE = tuple[int | str, ...] | ||
Check warningCode scanning / CodeQL Unreachable code Warning
This statement is unreachable.
|
||
| COMMIT_ID = str | None | ||
| else: | ||
| VERSION_TUPLE = object | ||
| COMMIT_ID = object | ||
|
|
||
| version: str | ||
| __version__: str | ||
| __version_tuple__: VERSION_TUPLE | ||
| version_tuple: VERSION_TUPLE | ||
| commit_id: COMMIT_ID | ||
| __commit_id__: COMMIT_ID | ||
|
|
||
| __version__ = version = "0.1.dev719+g5ea17201a.d20250908" | ||
| __version_tuple__ = version_tuple = (0, 1, "dev719", "g5ea17201a.d20250908") | ||
|
|
||
| __commit_id__ = commit_id = None | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to change this file. GNN should never be accessed by a user directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Script executed:
Repository: munich-quantum-toolkit/predictor
<shell_result>
Repository: munich-quantum-toolkit/predictor
Script execution failed with unrecoverable error: [CAPABILITY:RUN_SHELL_SCRIPT] Failed to clone repository munich-quantum-toolkit/predictor: Clone operation failed
</shell_result>
torch-geometric 2.6.1 PyTorch 2.7.x compatibility
<web_search_result>
Short answer: Not officially — torch-geometric 2.6.1 does not list PyTorch 2.7 as a supported runtime. PyG added explicit PyTorch 2.7/2.8 support in the 2.7 release; the installation docs/wheels matrix show PyTorch 2.7 support beginning with PyG 2.7.0. [1][2]
Recommendation: upgrade torch-geometric to 2.7+ when using PyTorch 2.7.x, or stick to PyTorch 2.6.x (or the PyG-supported PyTorch version shown in the 2.6.x docs) and ensure your extension wheels (torch-scatter, torch-sparse, etc.) match the PyTorch+CUDA pairing. [1][2]
Sources:
</web_search_result>
torch-geometric version requirements PyTorch 2.7.1
<web_search_result>
Torch‑Geometric (PyG) supports PyTorch 2.7.x — use PyG 2.7 (torch-geometric==2.7.0) and the matching extension wheels (torch==2.7.0 in wheel filenames). Install extension wheels with the torch-2.7.0+{CUDA} index (cpu|cu118|cu126|cu128). [1][2]
Example (after installing torch==2.7.1):
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.7.0+cu128.html
pip install torch-geometric. [1][2]
Sources:
[1] PyG installation docs (compatibility / wheel patterns).
[2] PyG 2.7 release notes (PyTorch 2.7/2.8 support).
</web_search_result>
I've verified the core concern through web search. The compatibility issue is confirmed: torch-geometric 2.6.1 does not officially support PyTorch 2.7.x. According to PyG's official documentation and release notes, only torch-geometric 2.7.0 onwards provides explicit support for PyTorch 2.7/2.8.
Unfortunately, the repository clone failed, preventing me from reading the exact comment text on lines 47 and 50. However, the fundamental version mismatch issue is confirmed and requires remediation.
Update torch-geometric to 2.7.0+ for PyTorch 2.7.1 compatibility, and correct stale version references in comments.
Line 49 specifies
torch-geometric>=2.6.1,<2.7.0, but this version does not officially support PyTorch 2.7.x. According to PyG's release notes and installation documentation, torch-geometric 2.7.0 is the minimum version required for PyTorch 2.7.1 compatibility. Upgrade totorch-geometric>=2.7.0,<2.8.0to match the torch version constraint on line 50.Additionally, comments on lines 47 and 50 should be updated to reflect the current PyTorch 2.7.1 constraint rather than any outdated references.
🤖 Prompt for AI Agents