Existing project using v0.5.x fails due to functions in the model
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 冷清
调研方向
使用 torch~=2.9.0 和 onnxscript~=0.5.6,仅通过 torch.nn.Linear 和 torch.onnx.export 重现该失败。检查依赖项规范和 _ConvertVersionPassRequiresInline 失败,然后验证已解析的依赖项允许在没有意外模型函数的情况下进行导出。
由索引模型根据 Issue 内容生成。
描述
New deployment of a project with dependencies torch~=2.9.0, onnxscript~=0.5.6 ran into errors on torch.onnx.export. The error is not correlated to the exporting module (exporting a sole torch.nn.Linear still causes error). Example output:
[torch.onnx] Translate the graph into ONNX...
[torch.onnx] Translate the graph into ONNX... ✅
Traceback (most recent call last):
File "D:\Workspaces\Playgrounds\.venv\Lib\site-packages\onnx_ir\passes\_pass_infra.py", line 250, in call
pass_result = pass_(model)
^^^^^^^^^^^^
File "D:\Workspaces\Playgrounds\.venv\Lib\site-packages\onnx_ir\passes\_pass_infra.py", line 127, in __call__
result = self.call(model)
^^^^^^^^^^^^^^^^
File "D:\Workspaces\Playgrounds\.venv\Lib\site-packages\onnxscript\version_converter\__init__.py", line 77, in call
raise ValueError(
ValueError: The model contains functions. The version conversion pass does not support functions. Please use `common_passes.InlinePass` to inline the functions before applying this pass (_ConvertVersionPassRequiresInline).
The above exception was the direct cause of the following exception:
……
onnx_ir.passes.PassError: An error occurred when running the '<onnxscript.version_converter._ConvertVersionPassRequiresInline object at 0x00000194E90F6E70>' pass after the following passes: ['<onnx_ir.passes.common.inliner.InlinePass object at 0x00000194E2E0C770>']
Breaking into where the error is raised, inspecting pass_result.model.functions gives {('pkg.onnxscript.torch_lib.common', 'Rank', ''): Function('pkg.onnxscript.torch_lib.common', 'Rank', '', inputs=[Value(name='input')], attributes={}), outputs=[Value(name='return_val', producer='n1', index=0)]), ('pkg.onnxscript.torch_lib.common', 'IsScalar', ''): Function('pkg.onnxscript.torch_lib.common', 'IsScalar', '', inputs=[Value(name='input')], attributes={}), outputs=[Value(name='return_val', producer='n3', index=0)])}, which is not empty as expected.
It looks like a problem with the dependency specifications of onnxscript, as previous deployments with the same requirements.txt did not encounter such error.
Updating the package seems to clear the error but I guess it would be better if the dependencies could be fixed.
EDIT: Seems to be related to https://github.com/microsoft/onnxscript/issues/2790
- 主要语言
- Python
- 星标
- 457
- 派生
- 149
- 平均合并
- 3 天 16 小时
- 30 天内合并 PR
- 24
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/onnxscript 的其他 Issue
-
`fuse_skip_rms_normalization` fuses a float16 residual into a norm whose scale is float32, which ONNX Runtime rejects可能已有人在做 @justinchuby 于 2 天前认领。 未关闭module: optimizer
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/onnxscript#3155 · 3 条评论 · 1 个 reaction · 已指派 2 人 ·
维护者通常 4 天内回复
-
Constant folding uses onnx's plain reference ops, never onnx.reference.ops_optimized可能已有人在做 @todkarsant 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/onnxscript#3003 · 3 条评论 ·
维护者通常 4 天内回复
-
CI : Pin github actions to full commit SHA可能已有人在做 @Aniketsy 于 187 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/onnxscript#2903 · 6 条评论 ·
维护者通常 4 天内回复
-
Batch-transpose fusion into `FusedMatMul` sets `transBatchA` on inputs of different ranks, which ONNX Runtime can't compute可能已有人在做 @Syedmudassir1604 于 3 天前认领。 未关闭module: optimizer
难度 3/5 1-2 天 新手友好度 72/100
microsoft/onnxscript#3156 ·
维护者通常 4 天内回复
-
`SlicesSplit` rule makes `optimizer.optimize` quadratic in the number of `Slice` nodes可能已有人在做 @mayuriphad 于 1 天前认领。 未关闭module: optimizer
难度 4/5 3-5 天 新手友好度 68/100
microsoft/onnxscript#3154 ·
维护者通常 4 天内回复
查看 microsoft/onnxscript 的全部 Issue
相似的 Issue
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)可能已有人在做 @geyazheng 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
langchain-ai/langchain-aws#1469 ·
维护者通常 1 天内回复
-
GCToggler leaves collection enabled if the body re-enables it可能已有人在做 @Gambit-Checkmate 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 7 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
doronz88/pymobiledevice3#2176 ·
维护者通常 1 天内回复
-
b4b usability
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复