Custom pseudo-operations for generic rewriting
维护者通常 4 天内回复
还没有人认领这个 Issue。
评估
调研方向
首先阅读附加的 cusops2ons.py.txt 和 test_generic_as_wrap.py.txt,然后检查 Opset、script、Op 和 op_schema 附近的 onnxscript rewriter 用法。确定自定义伪操作是否可以参与通用重写,并记录一个可工作的自定义节点示例,同时提供一个展示预期重写行为的测试。
由索引模型根据 Issue 内容生成。
描述
This text organized as
- Problem
- Solution
- This issue subject
Problem to solve
I want element-wise operations move above their commutatives (friends). See picture:
I don't want to encode every possible interchange pair, so must be generic element-wise and generic friend. Can I have it with current onnxscript (0.2.2) rewriter?
- Solution
Use meta-abc node pairs like this:
In the attachment, there is prototype implementation.
It moves elementwise operations (ReLU and Tanh) above Identity and Flatten
For now, we encode elementwise wrappers as [Split(axis=20), Sub]
and wrappers of their friend as [Split(axis=30), Sub]
What do you think about this approach to generics?
- The issue
Well, it works! But using Split and Sub as replacement to ABC_pre and ABC_post is obviously bad.
I actually tried to create custom pseudo-operation, but failed.
As I create op like this:
my_opset = Opset("com.mydomain", 15)
@script(my_opset)
def joy_of_relu( x:FLOAT ) -> FLOAT:
y = op.Relu(x)
return op.Relu(y)
opsch = joy_of_relu.op_schema
shiny_new_op = Op(
opset=my_opset, name="relurelu", op_schema=opsch
)
it not work with rewriter, also I tried onnxruntime_extensions.onnx_op
So, if it is possible, it would be great to have example of using rewriter with custom nodes.
- 主要语言
- Python
- 星标
- 457
- 派生
- 149
- 平均合并
- 3 天 20 小时
- 30 天内合并 PR
- 22
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/onnxscript 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
microsoft/onnxscript#3155 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/onnxscript#3003 · 3 条评论 ·
维护者通常 4 天内回复
-
CI : Pin github actions to full commit SHA可能已有人在做 @Aniketsy 于 184 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
microsoft/onnxscript#2903 · 6 条评论 ·
维护者通常 4 天内回复
-
难度 3/5 1-2 天 新手友好度 72/100
microsoft/onnxscript#3156 ·
维护者通常 4 天内回复
-
难度 4/5 3-5 天 新手友好度 68/100
microsoft/onnxscript#3154 ·
维护者通常 4 天内回复
查看 microsoft/onnxscript 的全部 Issue
相似的 Issue
-
flow-measurement measurement
难度 1/5 1 小时以内 新手友好度 76/100
MichaelYcJo/SpecSeal#1366 ·
-
bug c/evals c/ui size:L
难度 2/5 1-3 小时 新手友好度 66/100
Arize-ai/phoenix#17633 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
TransformerLensOrg/TransformerLens#1980 ·
维护者通常 1 天内回复
-
Module: Solr Needs: Lead Needs: Triage Theme: Search Type: Bug
难度 2/5 1-3 小时 新手友好度 76/100
internetarchive/openlibrary#14284 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 69/100
SpaceCowMedia/commander-spellbook-backend#1292 · 1 条评论 ·
维护者通常 1 天内回复