Commit dfa7544
Support metadata_prop merge and version 25 in version converter (microsoft#2782)
Fix pytorch/pytorch#172784
---
This pull request adds support for ONNX opset version 25 in the version
converter and introduces a new mechanism to copy node metadata during
version conversions. It also includes comprehensive tests to ensure that
metadata is properly transferred to new or replacement nodes created by
adapters during the conversion process.
**Version converter improvements:**
* Increased the maximum supported ONNX opset version from 23 to 25 in
`SUPPORTED_MAX_ONNX_OPSET` within
`onnxscript/version_converter/_version_converter.py`.
* Integrated a new `metadata_merger` utility and implemented a default
metadata merger to ensure node metadata is copied during version
conversion. Metadata is now merged from original nodes to all
replacement nodes in the conversion process.
[[1]](diffhunk://#diff-b6c70f90bafaee79b30e43c90bc0fd5192fb3de7ccc4cf9d48a209798dd775faR239-R244)
[[2]](diffhunk://#diff-b6c70f90bafaee79b30e43c90bc0fd5192fb3de7ccc4cf9d48a209798dd775faR303)
**Testing and validation:**
* Added a new `VersionConverterMetadataMergeTest` class in
`onnxscript/version_converter/_version_converter_test.py` to verify that
metadata is copied correctly to replacement nodes and to all nodes
created by adapters during conversion.
* Updated the test suite to reflect the new maximum supported opset
version and to ensure that conversion beyond version 25 is marked as
expected to fail for future-proofing.
---------
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>1 parent 0ed5f23 commit dfa7544
File tree
2 files changed
+92
-5
lines changed- onnxscript/version_converter
2 files changed
+92
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | | - | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
241 | 248 | | |
242 | 249 | | |
243 | 250 | | |
| |||
293 | 300 | | |
294 | 301 | | |
295 | 302 | | |
| 303 | + | |
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
301 | 380 | | |
302 | 381 | | |
303 | 382 | | |
304 | | - | |
| 383 | + | |
305 | 384 | | |
306 | 385 | | |
307 | 386 | | |
| |||
314 | 393 | | |
315 | 394 | | |
316 | 395 | | |
317 | | - | |
| 396 | + | |
318 | 397 | | |
319 | 398 | | |
320 | 399 | | |
| |||
0 commit comments