-
Notifications
You must be signed in to change notification settings - Fork 228
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
Assistance Required with tvmjs Integration and webgpu.get_fmap Error #59
Comments
same error... do u solve it? |
not yet👀 |
@tqchen Sorry to bother you. If it's convenient, can you give some suggestions? |
@ZoneLikeWonderland The error is still reported on Ubuntu, but it is normal on apple M2Pro. I am fresh in tvm, and dont know why... |
@senlyu163
My environment : Python 3.11, MacOS 14.5 M2 |
I also encountered this problem when deployed on the web, probably because of webgpu limitations. You can use the configuration of the following code to tune. ms.relax_integration.tune_relax(
mod=mod,
target=tvm.target.Target("apple/m1-gpu-restricted"),
......
) I tested several configurations and succeeded under the “apple/m1-gpu-restricted” configuration. |
@senlyu163 |
I think the problem you are having is that the number of gpu threads configuration is too large during the tune phase. It is recommended that you refer to the guoyaol's repo: https://github.com/guoyaol/web-real-esrgan |
@senlyu163 My code is as follows:
I’m just tinkering with the parameters — |
@abacaaaaaa I verified I am a freshman in tvm, so i can not provide more professional advice. |
Hi, is there anyone who made progress with the |
I found a way to pass through I realized that models built from https://github.com/mlc-ai/mlc-llm project don't have that problem. There are quite many differences, but I could narrow down the point. There is build 'pipeline' when you build an After adding that step in the pipeline, the built wasm files don't make the But I still have trouble to use tvm with WebGPU. Copying TVM NDArray between devices(cpu <-> gpu) looks not properly working. I hope this helps someone with the same issue and can be part of a constructive discussion to help me resolve my remaining issues. |
@grf53 I would be immensely grateful if @grf53 could provide some additional guidance: Specific Implementation Details: Could you kindly provide more details about how and where you precisely integrated the tvm.dlight Schedules into the build pipeline? |
@Yumin-gd Hey, I could not help you for that issue, but let me just answer your questions.
I made my own function to return 'module pass(pipeline)' by mimicking https://github.com/mlc-ai/relax/blob/mlc/python/tvm/relax/pipeline.py. (I used def my_build_pipeline(
...
):
from tvm import dlight as dl
@tvm.transform.module_pass(opt_level=0)
def _pipeline(mod: tvm.ir.IRModule, _ctx: tvm.transform.PassContext) -> tvm.ir.IRModule:
seq = tvm.transform.Sequential(
[
...
]
)
mod = seq(mod)
return mod
return _pipeline In that pipeline, the following step is included along with the existing steps of default pipeline in https://github.com/mlc-ai/relax/blob/mlc/python/tvm/relax/pipeline.py. [
...
dl.ApplyDefaultSchedule(
dl.gpu.Matmul(),
dl.gpu.GEMV(),
dl.gpu.Reduction(),
dl.gpu.GeneralReduction(),
dl.gpu.Fallback(),
),
...
] And also, I just added that step into the existing
I just saw the file changes, and there is no other modification in the tvm(mlc-ai/relax) repo. I just modified codes using tvm library, but the pipeline part.
I am using Macbook Pro with M3 Pro chip. The OS version is Sonoma 14.6.1 currently.(Not significantly different from that time.) And I used
I can't get what kind of things can help you. One thought that helped me while using tvm was that the project is still making progress so existing codes become easily out of date. And as I see, the direction of progress or maintenance is a lot focused on the 'currently attractive topics' like generative AI, LLM, etc. So maybe we can find the clue more quickly by researching that kind of things. |
Firstly, I'd like to express my admiration for the remarkable work done on this project. The advancements and capabilities it offers are truly impressive.
I've been diligently following the provided "walkthrough.ipynb" to familiarize myself with the pipeline. Unfortunately, I encountered an issue with the trace part, which seems to malfunction, possibly due to updates in the diffusers library. To circumvent this, I opted for a simplified network module as demonstrated below:
Following this, I proceeded to convert the network to ONNX format and subsequently to IR:
After that, I compiled it to wasm:
Finally, I used the following JS to run it:
However, I've hit a roadblock during the execution phase, particularly at
await tvm.asyncLoadWebGPUPipelines(vm.getInternalModule());
, where the console outputs the following error:In addition, I found that when I use
llvm
as build target instead ofwebgpu
and usetvm.cpu()
as device and skip this line, the example is working.Given the scarcity of detailed documentation and tutorials on integrating custom networks with tvmjs, especially regarding WebGPU support, I find myself in need of your expertise and guidance.
Could you please help me identify any potential missteps in my approach? I am particularly interested in ensuring that my network can be successfully operated using tvmjs and would greatly appreciate any insights or suggestions you might have.
Thank you very much for your time and assistance.
The text was updated successfully, but these errors were encountered: