Skip to content

Conversation

@justinchuby
Copy link
Collaborator

Use hasattr instead of version checks to ensure existence of the FLOAT8E8M0 type.

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Aug 29, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
3944 1 3943 4857
View the full list of 1 ❄️ flaky tests
onnxscript.converter_test.TestConverter::test_function_opset_import

Flake rate in main: 83.33% (Passed 6 times, Failed 30 times)

Stack Traces | 0.014s run time
onnxscript/converter_test.py:703: in test_function_opset_import
    @script()
     ^^^^^^^^
onnxscript/main.py:94: in transform
    result = script_check(f_ast, opset, env, src, default_opset=default_opset)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxscript/main.py:38: in script_check
    return convert.translate_function_def(f)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxscript/converter.py:1452: in translate_function_def
    fn_ir = self._translate_function_def_common(stmt)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxscript/converter.py:1439: in _translate_function_def_common
    self._translate_stmt(s, index_of_stmt=i)
onnxscript/converter.py:966: in _translate_stmt
    return self._translate_return_stmt(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxscript/converter.py:1089: in _translate_return_stmt
    return ret(val, 0, "")
           ^^^^^^^^^^^^^^^
onnxscript/converter.py:1065: in ret
    return_var = self._translate_expr(exp, preferred_name).name
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxscript/converter.py:546: in _translate_expr
    r = self._translate_call_expr(node)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxscript/converter.py:832: in _translate_call_expr
    args = autocast.static_cast_inputs(self, callee.op_schema, args)
                                             ^^^^^^^^^^^^^^^^
onnxscript/values.py:527: in op_schema
    self._op_schema = _op_schema_from_function_ir(self.function_ir, self.opset)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxscript/values.py:435: in _op_schema_from_function_ir
    return onnx.defs.OpSchema(
E   ValueError: DataTypeUtils::FromDataTypeString - Received invalid data type string 'float4e2m1'.

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby
Copy link
Collaborator Author

@gramalingam could you approve? Thanks

@justinchuby justinchuby merged commit 2cc2502 into main Aug 29, 2025
32 checks passed
@justinchuby justinchuby deleted the justinchu/better-v branch August 29, 2025 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

4 participants