Skip to content
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

[IR] Do not serialize the trailing outputs that have empty names #1905

Merged
merged 5 commits into from
Oct 15, 2024

Conversation

justinchuby
Copy link
Collaborator

No description provided.

@justinchuby justinchuby added the topic: IR Intermediate representation label Oct 14, 2024
Copy link

codecov bot commented Oct 14, 2024

❌ 21 Tests Failed:

Tests completed Failed Passed Skipped
14822 21 14801 3119
View the top 3 failed tests by shortest run time
tests.ir.serde_roundtrip_test.SerdeTest test_serialization_deserialization_produces_same_model_0292_test_cast_FLOAT16_to_FLOAT4E2M1_model_onnx
Stack Traces | 0.001s run time
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:711: in deserialize_type_proto_for_type
    return _core.TensorType(_enums.DataType(elem_type), denotation=denotation)
....../Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:714: in __call__
    return cls.__new__(cls, value)
....../Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:1137: in __new__
    raise ve_exc
E   ValueError: 23 is not a valid DataType

The above exception was the direct cause of the following exception:
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:657: in deserialize_value_info_proto
    value.type = deserialize_type_proto_for_type(proto.type)
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling deserialize_type_proto_for_type with: tensor_type {
E     elem_type: 23
E     shape {
E       dim {
E         dim_value: 3
E       }
E       dim {
E         dim_value: 5
E       }
E     }
E   }

The above exception was the direct cause of the following exception:
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:600: in _deserialize_graph
    outputs = [deserialize_value_info_proto(info, values[info.name]) for info in proto.output]
onnxscript/ir/serde.py:600: in <listcomp>
    outputs = [deserialize_value_info_proto(info, values[info.name]) for info in proto.output]
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling deserialize_value_info_proto with: name: "output"
E   type {
E     tensor_type {
E       elem_type: 23
E       shape {
E         dim {
E           dim_value: 3
E         }
E         dim {
E           dim_value: 5
E         }
E       }
E     }
E   }

The above exception was the direct cause of the following exception:
..../test_onnx_weekly/lib/python3.11.../site-packages/parameterized/parameterized.py:620: in standalone_func
    return func(*(a + p.args), **p.kwargs, **kw)
tests/ir/serde_roundtrip_test.py:38: in test_serialization_deserialization_produces_same_model
    ir_model = ir.serde.deserialize_model(model)
onnxscript/ir/serde.py:459: in deserialize_model
    graph = _deserialize_graph(proto.graph, [])
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling _deserialize_graph with: main_graph
tests.ir.serde_roundtrip_test.SerdeTest test_serialization_deserialization_produces_same_model_0430_test_dequantizelinear_float4e2m1_model_onnx
Stack Traces | 0.001s run time
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:711: in deserialize_type_proto_for_type
    return _core.TensorType(_enums.DataType(elem_type), denotation=denotation)
....../Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:714: in __call__
    return cls.__new__(cls, value)
....../Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/enum.py:1137: in __new__
    raise ve_exc
E   ValueError: 23 is not a valid DataType

The above exception was the direct cause of the following exception:
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:657: in deserialize_value_info_proto
    value.type = deserialize_type_proto_for_type(proto.type)
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling deserialize_type_proto_for_type with: tensor_type {
E     elem_type: 23
E     shape {
E       dim {
E         dim_value: 5
E       }
E     }
E   }

The above exception was the direct cause of the following exception:
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:568: in _deserialize_graph
    deserialize_value_info_proto(info, value)
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling deserialize_value_info_proto with: name: "x"
E   type {
E     tensor_type {
E       elem_type: 23
E       shape {
E         dim {
E           dim_value: 5
E         }
E       }
E     }
E   }

The above exception was the direct cause of the following exception:
..../test_onnx_weekly/lib/python3.11.../site-packages/parameterized/parameterized.py:620: in standalone_func
    return func(*(a + p.args), **p.kwargs, **kw)
tests/ir/serde_roundtrip_test.py:38: in test_serialization_deserialization_produces_same_model
    ir_model = ir.serde.deserialize_model(model)
onnxscript/ir/serde.py:459: in deserialize_model
    graph = _deserialize_graph(proto.graph, [])
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling _deserialize_graph with: main_graph
tests.ir.serde_roundtrip_test.SerdeTest test_serialization_deserialization_produces_same_model_0571_test_cast_FLOAT4E2M1_to_FLOAT_model_onnx
Stack Traces | 0.001s run time
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:711: in deserialize_type_proto_for_type
    return _core.TensorType(_enums.DataType(elem_type), denotation=denotation)
.../hostedtoolcache/Python/3.11.10....../x64/lib/python3.11/enum.py:714: in __call__
    return cls.__new__(cls, value)
.../hostedtoolcache/Python/3.11.10....../x64/lib/python3.11/enum.py:1137: in __new__
    raise ve_exc
E   ValueError: 23 is not a valid DataType

The above exception was the direct cause of the following exception:
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:657: in deserialize_value_info_proto
    value.type = deserialize_type_proto_for_type(proto.type)
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling deserialize_type_proto_for_type with: tensor_type {
E     elem_type: 23
E     shape {
E       dim {
E         dim_value: 3
E       }
E       dim {
E         dim_value: 5
E       }
E     }
E   }

The above exception was the direct cause of the following exception:
onnxscript/ir/serde.py:97: in wrapper
    return func(*args, **kwargs)
onnxscript/ir/serde.py:568: in _deserialize_graph
    deserialize_value_info_proto(info, value)
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling deserialize_value_info_proto with: name: "input"
E   type {
E     tensor_type {
E       elem_type: 23
E       shape {
E         dim {
E           dim_value: 3
E         }
E         dim {
E           dim_value: 5
E         }
E       }
E     }
E   }

The above exception was the direct cause of the following exception:
..../test_onnx_weekly/lib/python3.11.../site-packages/parameterized/parameterized.py:620: in standalone_func
    return func(*(a + p.args), **p.kwargs, **kw)
tests/ir/serde_roundtrip_test.py:38: in test_serialization_deserialization_produces_same_model
    ir_model = ir.serde.deserialize_model(model)
onnxscript/ir/serde.py:459: in deserialize_model
    graph = _deserialize_graph(proto.graph, [])
onnxscript/ir/serde.py:99: in wrapper
    raise SerdeError(
E   onnxscript.ir.serde.SerdeError: Error calling _deserialize_graph with: main_graph

To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard

onnxscript/ir/serde.py Outdated Show resolved Hide resolved
@justinchuby justinchuby added the hold on merging Don't merge yet label Oct 15, 2024
@justinchuby
Copy link
Collaborator Author

Will follow up with more tests

@justinchuby justinchuby removed the hold on merging Don't merge yet label Oct 15, 2024
@justinchuby justinchuby merged commit d4b81dc into main Oct 15, 2024
25 of 41 checks passed
@justinchuby justinchuby deleted the justinchu/trailing-outputs branch October 15, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: IR Intermediate representation
Projects
Development

Successfully merging this pull request may close these issues.

2 participants