Pytorch support

Đang mở
#141 6 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
20/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
python, pytorch, wasm

Hướng nghiên cứu

Bắt đầu với lệnh biên dịch componentize-py 0.16.0 và strategy.py được cung cấp, sau đó tái hiện lỗi import trên Python 3.11.10 trên macOS. Truy vết lý do việc import torch đi tới ctypes mà không có _ctypes; hoàn thành khi module PyTorch được báo cáo có thể biên dịch thành công hoặc giới hạn được hỗ trợ và thiết lập bắt buộc được tài liệu hóa rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Rust
Star
284
Fork
56
Merge trung bình
2 ngày 4 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bytecodealliance/componentize-py

Tất cả issue của bytecodealliance/componentize-py

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.