bytecodealliance / bytecodealliance/componentize-py

Pytorch support

オープン
#141 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
277
フォーク
51
平均マージ
12時間 10分
マージ済み PR(30日)
10

説明

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
sys.exit(script())

AssertionError: Traceback (most recent call last):
File "/0/my_server.py", line 4, in
from strategy import get_strategy_result
File "/0/strategy.py", line 1, in
from torch import tensor
File "/1/torch/__init__.py", line 14, in
import ctypes
File "/python/ctypes/__init__.py", line 8, in
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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

componentize-py 0.16.0 のコンパイルコマンドと提供された strategy.py から始め、その後 macOS 上の Python 3.11.10 でインポート失敗を再現します。torch のインポートが _ctypes のない ctypes に到達する理由を追跡します。報告された PyTorch モジュールを正常にコンパイルできるか、サポートされる制限と必要なセットアップが明確に文書化されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python, pytorch, wasm
領域
build-system, machine-learning, tooling
issue の種類
バグ
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
20/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。