Skip to content

Commit 419494f

Browse files
committed
Revert "Fix/onnx serde error workaround (#10422)"
This reverts commit dcc4a7a.
1 parent ece31cc commit 419494f

File tree

5 files changed

+5
-642
lines changed

5 files changed

+5
-642
lines changed

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
88
### Fixed
99

1010
- Fixed `ogbn_train_cugraph` example for distributed cuGraph ([#10439](https://github.com/pyg-team/pytorch_geometric/pull/10439))
11-
- Added `safe_onnx_export` function with workarounds for `onnx_ir.serde.SerdeError` issues in ONNX export ([#10422](https://github.com/pyg-team/pytorch_geometric/pull/10422))
1211
- Fixed importing PyTorch Lightning in `torch_geometric.graphgym` and `torch_geometric.data.lightning` when using `lightning` instead of `pytorch-lightning` ([#10404](https://github.com/pyg-team/pytorch_geometric/pull/10404), [#10417](https://github.com/pyg-team/pytorch_geometric/pull/10417)))
1312
- Fixed `detach()` warnings in example scripts involving tensor conversions ([#10357](https://github.com/pyg-team/pytorch_geometric/pull/10357))
1413
- Fixed non-tuple indexing to resolve PyTorch deprecation warning ([#10389](https://github.com/pyg-team/pytorch_geometric/pull/10389))

test/nn/models/test_basic_gnn.py

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,10 @@ def test_packaging():
251251
@onlyLinux
252252
@withPackage('torch>=2.6.0')
253253
@withPackage('onnx', 'onnxruntime', 'onnxscript')
254-
def test_onnx(tmp_path: str) -> None:
254+
def test_onnx(tmp_path):
255255
import onnx
256256
import onnxruntime as ort
257257

258-
from torch_geometric import safe_onnx_export
259-
260258
warnings.filterwarnings('ignore', '.*tensor to a Python boolean.*')
261259
warnings.filterwarnings('ignore', '.*shape inference of prim::Constant.*')
262260

@@ -278,27 +276,17 @@ def forward(self, x, edge_index):
278276
assert expected.size() == (3, 16)
279277

280278
path = osp.join(tmp_path, 'model.onnx')
281-
success = safe_onnx_export(
279+
torch.onnx.export(
282280
model,
283281
(x, edge_index),
284282
path,
285283
input_names=('x', 'edge_index'),
286284
opset_version=18,
287285
dynamo=True, # False is deprecated by PyTorch
288-
skip_on_error=True, # Skip gracefully in CI if upstream issue occurs
289286
)
290287

291-
if not success:
292-
# ONNX export was skipped due to known upstream issue
293-
# This allows CI to pass while the upstream bug exists
294-
warnings.warn(
295-
"ONNX export test skipped due to known upstream onnx_ir issue. "
296-
"This is expected and does not indicate a problem with PyTorch "
297-
"Geometric.", UserWarning, stacklevel=2)
298-
return
299-
300-
onnx_model = onnx.load(path)
301-
onnx.checker.check_model(onnx_model)
288+
model = onnx.load(path)
289+
onnx.checker.check_model(model)
302290

303291
providers = ['CPUExecutionProvider']
304292
ort_session = ort.InferenceSession(path, providers=providers)

0 commit comments

Comments
 (0)