apache / tvm

Open deep learning compiler stack for cpu, gpu and specialized accelerators
https://tvm.apache.org/
Apache License 2.0
11.83k stars 3.48k forks source link

[Web] Allow deprecated API requestAdapterInfo with any cast #17420

Closed CharlieFRuan closed 2 months ago

CharlieFRuan commented 2 months ago

The WebGPU API requestAdapterInfo() was deprecated as described here: https://developer.mozilla.org/en-US/docs/Web/API/GPUAdapter/requestAdapterInfo#browser_compatibility. This caused npm run build under web/ to cause error since it cannot find requestAdapterInfo, hence the PR: https://github.com/apache/tvm/pull/17371

However, downstream users may still have older browser version and would still rely on requestAdapterInfo(), see https://github.com/mlc-ai/web-llm/issues/572 for an example.

This PR casts adapter to any type when calling requestAdapterInfo(), so it does not complain about not being able to find requestAdapterInfo() during compile time, hence no issue should be observed during runtime on older browsers, achieving backward compatibility.

Bump TVMjs version from 0.18.0-dev0 to 0.18.0-dev2 (skipped dev1 due to a mistake)

CharlieFRuan commented 2 months ago

@tvm-bot rerun

ysh329 commented 1 month ago

Hi @CharlieFRuan , recently release starts, but I found WebGPU part has some modification about version number. Is it required to change version in web/package-lock.json with same version number?

Each modification includes fixed five file modifications: https://github.com/apache/tvm/pull/17156. If there are any modifications related to web/package-lock. json, I will add them to the document and make the necessary changes this time if requied.

CharlieFRuan commented 1 month ago

Hi @ysh329, thanks for the note! Just to check my understanding, does the version in web/package-lock.json have to match all five files, including the dev suffix?

ysh329 commented 1 month ago

@CharlieFRuan I think it's better keep same between dev suffix in web/package-lock.json and other five files. Besides, I wann know in this patch why change the dev0 to dev2, but not dev1?

CharlieFRuan commented 1 month ago

@ysh329 I see, then I think it's easier for me to revert the version in web/package-lock.json. Shall I make a PR to revert back to 0.18.0-dev0? Thanks

ysh329 commented 1 month ago

@CharlieFRuan Don't worry. Let me fix this minor problem.

CharlieFRuan commented 1 month ago

Thanks a lot!