Skip to content

Conversation

justinchuby
Copy link
Collaborator

Signed-off-by: Justin Chu [email protected]

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Copy link

codecov bot commented Jul 15, 2025

❌ 176 Tests Failed:

Tests completed Failed Passed Skipped
176 176 0 0
View the top 3 failed test(s) by shortest run time
::onnxscript.main
Stack Traces | 0s run time
onnxscript\main.py:14: in <module>
    from onnxscript import _converter, ir, irbuilder, values
onnxscript\_converter.py:92: in <module>
    class DynamicKind(IntFlag):
                      ^^^^^^^
E   NameError: name 'IntFlag' is not defined
::onnxscript.rewriter.models._smollm_2
Stack Traces | 0s run time
onnxscript\rewriter\models\_smollm_2.py:12: in <module>
    from onnxscript import script
onnxscript\__init__.py:69: in <module>
    from .main import export_onnx_lib, graph, script
onnxscript\main.py:14: in <module>
    from onnxscript import _converter, ir, irbuilder, values
onnxscript\_converter.py:92: in <module>
    class DynamicKind(IntFlag):
                      ^^^^^^^
E   NameError: name 'IntFlag' is not defined
::onnxscript.rewriter.onnx_fusions._rms_normalization
Stack Traces | 0s run time
C:\hostedtoolcache\windows\Python\3.11.9\x64\Lib\importlib\__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1126: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1126: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1126: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:940: in exec_module
    ???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
    ???
onnxscript\__init__.py:69: in <module>
    from .main import export_onnx_lib, graph, script
onnxscript\main.py:14: in <module>
    from onnxscript import _converter, ir, irbuilder, values
onnxscript\_converter.py:92: in <module>
    class DynamicKind(IntFlag):
                      ^^^^^^^
E   NameError: name 'IntFlag' is not defined

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 <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
op_signature, args, kwargs
)
args = [self._translate_opt_expr(x) for x in args]
onnx_inputs = [self._translate_opt_expr(x) for x in inputs]

Check warning

Code scanning / lintrunner

PYLINT/W0612 Warning

Unused variable 'onnx_inputs' (unused-variable)
See unused-variable. To disable, use # pylint: disable=unused-variable
op_signature, args, kwargs
)
args = [self._translate_opt_expr(x) for x in args]
onnx_inputs = [self._translate_opt_expr(x) for x in inputs]

Check warning

Code scanning / lintrunner

RUFF/F841 Warning

Local variable onnx\_inputs is assigned to but never used.
See https://docs.astral.sh/ruff/rules/unused-variable
elif kwargs.get(param.name) is not None:
attribute = kwargs[param.name] # type: ignore[assignment]
else:
if param.required:

Check notice

Code scanning / lintrunner

PYLINT/R1720 Note

Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
See no-else-raise. To disable, use # pylint: disable=no-else-raise
from __future__ import annotations

import collections.abc
import copy

Check warning

Code scanning / lintrunner

PYLINT/W0611 Warning

Unused import copy (unused-import)
See unused-import. To disable, use # pylint: disable=unused-import
from __future__ import annotations

import collections.abc
import copy

Check warning

Code scanning / lintrunner

RUFF/F401 Warning

copy imported but unused.
See https://docs.astral.sh/ruff/rules/unused-import
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
top_level_ast = ast.parse(source)
f_ast = top_level_ast.body[0]
cvt = converter.Converter(
cvt = _converter.Converter(

Check failure

Code scanning / lintrunner

PYLINT/E1120 Error

No value for argument 'root' in constructor call (no-value-for-parameter)
See no-value-for-parameter. To disable, use # pylint: disable=no-value-for-parameter
# TODO: cleanup Converter interface/API, separating checker from
# converter
convert = converter.Converter(
convert = _converter.Converter(

Check failure

Code scanning / lintrunner

PYLINT/E1120 Error

No value for argument 'root' in constructor call (no-value-for-parameter)
See no-value-for-parameter. To disable, use # pylint: disable=no-value-for-parameter
global_names = module.__dict__.copy()
global_names.update(closure.nonlocals)
converter = converter_module.Converter(
converter = _converter.Converter(

Check failure

Code scanning / lintrunner

PYLINT/E1120 Error

No value for argument 'root' in constructor call (no-value-for-parameter)
See no-value-for-parameter. To disable, use # pylint: disable=no-value-for-parameter
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
def analyze(self, fun):
source, parse_tree = ast_utils.get_src_and_ast(fun)
analysis.do_liveness_analysis(parse_tree, formatter(source))
_analysis.do_liveness_analysis(parse_tree, formatter(source))

Check failure

Code scanning / lintrunner

PYLINT/E1120 Error

No value for argument 'meta' in function call (no-value-for-parameter)
See no-value-for-parameter. To disable, use # pylint: disable=no-value-for-parameter
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
converter_: _converter.Converter,
op_schema: Optional[OpSchema],
args: Sequence[Optional[converter.Variable]],
args: Sequence[Optional[_converter.Variable]],

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "_converter.Variable" is not defined To disable, use # type: ignore[name-defined]
"""

def get_type_info(x: Optional[converter.Variable]) -> Optional[converter.Variable]:
def get_type_info(x: Optional[_converter.Variable]) -> Optional[_converter.Variable]:

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "_converter.Variable" is not defined To disable, use # type: ignore[name-defined]

def cast_like(
x: Optional[converter.Variable], y: Optional[converter.Variable]
x: Optional[_converter.Variable], y: Optional[_converter.Variable]

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "_converter.Variable" is not defined To disable, use # type: ignore[name-defined]
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
tensor = autocast.pyvalue_to_onnx_tensor(ovar, pyvalue)
except ValueError as e:
tensor = ir.tensor(pyvalue, name=var_name)
except Exception as e:

Check warning

Code scanning / lintrunner

PYLINT/W0718 Warning

Catching too general exception Exception (broad-exception-caught)
See broad-exception-caught. To disable, use # pylint: disable=broad-exception-caught
preferred_name = f"return_val{suffix}"
return_var = self._translate_expr(exp, preferred_name).name
val = self._lookup(return_var, self._source_of(exp), False)
assert type(val) is values.Dynamic

Check notice

Code scanning / lintrunner

PYLINT/C0123 Note

Use isinstance() rather than type() for a typecheck. (unidiomatic-typecheck)
See unidiomatic-typecheck. To disable, use # pylint: disable=unidiomatic-typecheck
Signed-off-by: Justin Chu <[email protected]>
return tuple(reversed(inputs_reversed)), named_attrs


def _to_onnx_ref_attr(val: values.AttrRef, info: sourceinfo.SourceInfo | None) -> ir.Attr:

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "values.AttrRef" is not defined To disable, use # type: ignore[name-defined]

from onnxscript import converter as converter_module
from onnxscript import irbuilder, sourceinfo, type_annotation
from onnxscript import _converter, irbuilder, sourceinfo, type_annotation

Check warning

Code scanning / lintrunner

PYLINT/W0611 Warning

Unused sourceinfo imported from onnxscript (unused-import)
See unused-import. To disable, use # pylint: disable=unused-import

from onnxscript import converter as converter_module
from onnxscript import irbuilder, sourceinfo, type_annotation
from onnxscript import _converter, irbuilder, sourceinfo, type_annotation

Check warning

Code scanning / lintrunner

RUFF/F401 Warning

onnxscript.sourceinfo imported but unused.
See https://docs.astral.sh/ruff/rules/unused-import
Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Sequence,
Tuple,
Union,
_GenericAlias

Check warning

Code scanning / lintrunner

RUFF/F401 Warning

typing.\_GenericAlias imported but unused.
See https://docs.astral.sh/ruff/rules/unused-import
"""
self.name = name
self.is_castable = castable
class DynamicKind(IntFlag):

Check failure

Code scanning / lintrunner

PYLINT/E0602 Error

Undefined variable 'IntFlag' (undefined-variable)
See undefined-variable. To disable, use # pylint: disable=undefined-variable
"""
self.name = name
self.is_castable = castable
class DynamicKind(IntFlag):

Check failure

Code scanning / lintrunner

RUFF/F821 Error

"""
self.name = name
self.is_castable = castable
class DynamicKind(IntFlag):

Check failure

Code scanning / lintrunner

MYPY/name-defined Error

Name "IntFlag" is not defined To disable, use # type: ignore[name-defined]
self._converter = converter

def get_or_create_value(
self, var: str, info: sourceinfo.SourceInfo

Check warning

Code scanning / lintrunner

PYLINT/W0613 Warning

Unused argument 'info' (unused-argument)
See unused-argument. To disable, use # pylint: disable=unused-argument
Signed-off-by: Justin Chu <[email protected]>
def is_base_type_bool(attr: ir.Attr) -> bool:
"""Check if the attribute is a boolean type."""
# FIXME: Add meta to attributes
attr.meta[_SOURCEINFO_FIELD]

Check warning

Code scanning / lintrunner

PYLINT/W0104 Warning

Statement seems to have no effect (pointless-statement)
See pointless-statement. To disable, use # pylint: disable=pointless-statement
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.

1 participant