New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Examples] Provide end2end examples using byteir ( fronts compiler and runtime ) ,for example resnet18 #223
Comments
Hi, you could try like https://github.com/bytedance/byteir/tree/main/frontends/torch-frontend/examples/demo. But the demo seems to be a little outdated. If you meet any problem when you try the demo, feel free to ask me. |
Hi I run gpt2 under demo recently and got following errors: python3: /host/byteir/frontends/torch-frontend/third_party/torch-mlir/lib/Dialect/Torch/IR/TorchDialect.cpp:176: virtual mlir::Operation* mlir::torch::Torch::Torch /host/byteir/frontends/torch-frontend/examples/demo# python3 main.py gpt2 File "/host/byteir/frontends/torch-frontend/examples/demo/backend.py", line 205, in byteir_runner Could you take a look? My commit is f734a1f |
1、use https://github.com/bytedance/byteir/blob/main/frontends/torch-frontend/examples/inference/infer_resnet.py generate resnet.stablehlo.mlir
error shows :
|
In this case, the root cause is that torch-frontend has different stablehlo version with byteir. You could use stablehlo's bytecode to fill the gap. Here is example code: import byteir
from byteir._mlir_libs._stablehlo import get_current_version
import torch_frontend
module_bytes = torch_frontend.compile(Resnet18(), sample_inputs, "stablehlo+"+get_current_version())
with open("./resnet.mlirbc", "wb") as f:
f.write(module_bytes)
byteir.compile("./resnet.mlirbc", "./out.mlir", entry_func="forward", target="cuda", verbose=True) |
Get it. Thanks . |
Close this issue. |
hello , can you provide end2end examples using byteir ( fronts compiler and runtime ) ,for example resnet18
The text was updated successfully, but these errors were encountered: