Pytorch support
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 20/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- python, pytorch, wasm
调研方向
先从 componentize-py 0.16.0 的编译命令和提供的 strategy.py 开始,然后在 macOS 上的 Python 3.11.10 中重现导入失败。追踪导入 torch 为何会在没有 _ctypes 的情况下到达 ctypes;当报告的 PyTorch 模块能够成功编译,或受支持的限制和所需设置已得到明确记录时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
I introduced the pytorch module. When executing the compilation, the following error was reported. How should I solve this problem?
Building component my-server with `componentize-py -w spin-http componentize my_server -o target/app/my_server.wasm`
Traceback (most recent call last):
File "/Users/ken/Work/Workspace/spin/myenv/bin/componentize-py", line 8, in <module>
sys.exit(script())
AssertionError: Traceback (most recent call last):
File "/0/my_server.py", line 4, in <module>
from strategy import get_strategy_result
File "/0/strategy.py", line 1, in <module>
from torch import tensor
File "/1/torch/__init__.py", line 14, in <module>
import ctypes
File "/python/ctypes/__init__.py", line 8, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
the strategy.py is:
from torch import tensor
def get_strategy_result():
# Create a tensor
x = tensor([1.0, 2.0, 3.0])
# Perform a simple operation
y = x * 2
return y
if __name__ == "__main__":
print(get_strategy_result())
The version of componentize-py is 0.16.0
my plantform is MacBook Pro
the version of Python is 3.11.10
- 主要语言
- Rust
- 星标
- 284
- 派生
- 56
- 平均合并
- 2 天 4 小时
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bytecodealliance/componentize-py 的其他 Issue
-
难度 3/5 半天 新手友好度 40/100
bytecodealliance/componentize-py#259 · 1 条评论 ·
-
wasm32-wasip3 target uses WASI preview 2 bindings可能已有人在做 @Snowiiii 于 6 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 57/100
bytecodealliance/componentize-py#253 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 35/100
bytecodealliance/componentize-py#247 · 12 条评论 ·
-
难度 3/5 1-2 天 新手友好度 68/100
bytecodealliance/componentize-py#217 · 6 条评论 ·
查看 bytecodealliance/componentize-py 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
area: settings bug Haiku review: no-score ui
难度 2/5 1-3 小时 新手友好度 78/100
MMFoundation/WallpaperMachine#346 ·
维护者通常 1 天内回复
-
Make the HTTP server's keep-alive and headers timeouts configurable可能已有人在做 @mattgodbolt 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 76/100
compiler-explorer/compiler-explorer#9902 ·
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 68/100
jonathanong/no-mistakes#5490 ·
-
follow-up
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复