{"_id":"@alancnet/tvm","_rev":"3-e27018ea9420166cb83e599fe893fa1a","name":"@alancnet/tvm","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.1":{"contentHash":"97bba458bc13abe26be0d15e07a03b84973a79d101f7fd1f4247b0d10b9590e4","name":"@alancnet/tvm","version":"0.0.1","description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/apache/tvm.git"},"keywords":["javascript","machine-learning","performance","deep-learning","metal","compiler","gpu","vulkan","opencl","tensor","spirv","rocm","tvm"],"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/apache/tvm/issues"},"homepage":"https://github.com/apache/tvm","types":"./index.d.ts","_id":"@alancnet/tvm@0.0.1","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-7vz7WOiSdnAg+Um2RCHDOuIr7dFXi2VpYtiSkVuEuySfKyy/UmxvEFxGQ9BFrBw4sX4d5b3S6fNDi4lq44ra/A==","shasum":"6f1f8b7a654cf5d79d0e8e28255730ed5ff0e0b9","tarball":"https://registry.npmjs.org/@alancnet/tvm/-/tvm-0.0.1.tgz","fileCount":41,"unpackedSize":4231625,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLW8jsDC1ZziiaiQ59Yn2DBpR2gsTEN5vjQ4+3WucffQIgf8JkzgaZixBAxuW9YxwMIrBeYvbFkeClb0ugECcMABk="}]},"_npmUser":{"name":"alancnet","email":"npm@alanc.net"},"directories":{},"maintainers":[{"name":"alancnet","email":"npm@alanc.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tvm_0.0.1_1692803541590_0.21813685388865567"},"_hasShrinkwrap":false},"0.0.2":{"contentHash":"03547902c5054cc09027aaa3f50c36d310f906fc8d990510effab4609ea6687d","name":"@alancnet/tvm","version":"0.0.2","description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/apache/tvm.git"},"keywords":["javascript","machine-learning","performance","deep-learning","metal","compiler","gpu","vulkan","opencl","tensor","spirv","rocm","tvm"],"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/apache/tvm/issues"},"homepage":"https://github.com/apache/tvm","types":"./index.d.ts","_id":"@alancnet/tvm@0.0.2","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-uljbfiPxIXofLVD15Gg71tCrCrSaP1XTAH4Cj9H/0UrvMRB2tdGL31lAZ/2zb97E1PeLmweAai+CnKH8MQFlaQ==","shasum":"cb7defea6e9d545333e19d41db32bf950ec9a9a5","tarball":"https://registry.npmjs.org/@alancnet/tvm/-/tvm-0.0.2.tgz","fileCount":42,"unpackedSize":4235427,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDPWQgvqVhpw1hUTStZQwEmwnbpLUw7mfy5Evz4uoiapAiEAzrkMXLBWOoOSKNiyZxt/HDx89lIOdNsMLzPwNudSLGs="}]},"_npmUser":{"name":"alancnet","email":"npm@alanc.net"},"directories":{},"maintainers":[{"name":"alancnet","email":"npm@alanc.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tvm_0.0.2_1692803743018_0.7389431335787171"},"_hasShrinkwrap":false},"0.0.3":{"contentHash":"3bb7eb6c255fb098a810a175d10b70949123265a1a6ef9af529e52e2dd2875ba","name":"@alancnet/tvm","version":"0.0.3","description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/apache/tvm.git"},"keywords":["javascript","machine-learning","performance","deep-learning","metal","compiler","gpu","vulkan","opencl","tensor","spirv","rocm","tvm"],"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/apache/tvm/issues"},"homepage":"https://github.com/apache/tvm","types":"./index.d.ts","gitHead":"8a78df47d2fd798496fe35870394279364342b47","_id":"@alancnet/tvm@0.0.3","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-zdY+Ntq2/e0uFh13PRX3d2lHs4fxanvTjaKeKziHvg99LGALM8CmvipbU8C4KlrtkCZ6bLFBv0nNfFTFKmBEzA==","shasum":"f9c6ec3a8147800efd9fefdf8847047628278a88","tarball":"https://registry.npmjs.org/@alancnet/tvm/-/tvm-0.0.3.tgz","fileCount":42,"unpackedSize":6025819,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICrInbHSmbR9hOjpRRVJqP1vYqnQGb1xRpW2cVdQVdT4AiAuitotBZEouPG5HUnwjO9WvVCdcUOAxwDxLJnXvopm2Q=="}]},"_npmUser":{"name":"alancnet","email":"npm@alanc.net"},"directories":{},"maintainers":[{"name":"alancnet","email":"npm@alanc.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tvm_0.0.3_1692879503475_0.25161303164503557"},"_hasShrinkwrap":false},"0.0.4":{"contentHash":"091cc947b4281e2203747de50fc65416b618ee54e0ece344fdb081af1938ea13","name":"@alancnet/tvm","version":"0.0.4","description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/apache/tvm.git"},"keywords":["javascript","machine-learning","performance","deep-learning","metal","compiler","gpu","vulkan","opencl","tensor","spirv","rocm","tvm"],"author":"","license":"Apache-2.0","bugs":{"url":"https://github.com/apache/tvm/issues"},"homepage":"https://github.com/apache/tvm","gitHead":"8a78df47d2fd798496fe35870394279364342b47","_id":"@alancnet/tvm@0.0.4","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-1UjlIcspU51fm+YMR6IGsJgu29GbWqIYttL6xVzwXZs6LQjP5ip1v6/ld957fbe6ZyKdDqkO64GS7BJf2+ombA==","shasum":"adefd08c7408fdd66738cd59421fc06aa81e210e","tarball":"https://registry.npmjs.org/@alancnet/tvm/-/tvm-0.0.4.tgz","fileCount":13,"unpackedSize":5819393,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDYjFq9Acldlup9nGNPSv2s9KWrLoJBPy1vowxaoh08xAIgKC+54MX/9pU7PRIBPAwxRCupw4slgCC/KssEvXro8pQ="}]},"_npmUser":{"name":"alancnet","email":"npm@alanc.net"},"directories":{},"maintainers":[{"name":"alancnet","email":"npm@alanc.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/tvm_0.0.4_1692880928965_0.38465984809405107"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-23T15:12:21.506Z","0.0.1":"2023-08-23T15:12:22.065Z","modified":"2023-08-24T12:42:09.368Z","0.0.2":"2023-08-23T15:15:43.369Z","0.0.3":"2023-08-24T12:18:23.794Z","0.0.4":"2023-08-24T12:42:09.187Z"},"maintainers":[{"name":"alancnet","email":"npm@alanc.net"}],"description":"Open deep learning compiler stack for cpu, gpu and specialized accelerators","homepage":"https://github.com/apache/tvm","keywords":["javascript","machine-learning","performance","deep-learning","metal","compiler","gpu","vulkan","opencl","tensor","spirv","rocm","tvm"],"repository":{"type":"git","url":"git+https://github.com/apache/tvm.git"},"bugs":{"url":"https://github.com/apache/tvm/issues"},"license":"Apache-2.0","readme":"<!--- Licensed to the Apache Software Foundation (ASF) under one -->\n<!--- or more contributor license agreements.  See the NOTICE file -->\n<!--- distributed with this work for additional information -->\n<!--- regarding copyright ownership.  The ASF licenses this file -->\n<!--- to you under the Apache License, Version 2.0 (the -->\n<!--- \"License\"); you may not use this file except in compliance -->\n<!--- with the License.  You may obtain a copy of the License at -->\n\n<!---   http://www.apache.org/licenses/LICENSE-2.0 -->\n\n<!--- Unless required by applicable law or agreed to in writing, -->\n<!--- software distributed under the License is distributed on an -->\n<!--- \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -->\n<!--- KIND, either express or implied.  See the License for the -->\n<!--- specific language governing permissions and limitations -->\n<!--- under the License. -->\n\n# TVM WebAssembly Runtime\n\nThis folder contains TVM WebAssembly Runtime.\n\n## Installation\n\nThe LLVM main branch support webassembly as a target, we can directly\nbuild TVM with LLVM mainline to generate wasm modules.\nNote that, however, we still need emscripten to compile the runtime and provide system library support.\n\nNote that so far we requires everything to be in the source and setup PYTHONPATH(instead of use setup.py install).\n\n### Setup Emscripten\n\nWe use emscripten to compile our runtime wasm library as well as a WASI variant that we can deploy\nto the browser environment.\n\nFollow [Emscripten](https://emscripten.org/) to download emsdk and install emcc on your local environment.\n\n### Build TVM Wasm Runtime\n\nAfter the emcc is setup correctly. We can build tvm's wasm runtime by typing `make` in the web folder.\n\n```bash\nmake\n```\n\nThis command will create the follow files:\n- `dist/wasm/libtvm_runtime.bc` bitcode library `tvm.contrib.emcc` will link into.\n- `dist/wasm/tvmjs_runtime.wasm` a standalone wasm runtime for testing purposes.\n- `dist/wasm/tvmjs_runtime.wasi.js` a WASI compatible library generated by emscripten that can be fed into runtime.\n\n\n### Build TVM Wasm JS Frontend\n\nType the following command in the web folder.\n\n```bash\nnpm run bundle\n```\n\nThis command will create the tvmjs library that we can use to interface with the wasm runtime.\n\n\n## Use TVM to Generate Wasm Library and Run it\n\nCheck code snippet in\n\n- [tests/python/prepare_test_libs.py](https://github.com/apache/tvm/tree/main/web/tests/python/prepare_test_libs.py)\n  shows how to create a wasm library that links with tvm runtime.\n  - Note that all wasm libraries have to created using the `--system-lib` option\n  - emcc.create_wasm will automatically link the runtime library `dist/wasm/libtvm_runtime.bc`\n- [tests/web/test_module_load.js](https://github.com/apache/tvm/tree/main/web/tests/node/test_module_load.js) demonstrate\n  how to run the generated library through tvmjs API.\n\n\n## Run Wasm Remotely through WebSocket RPC.\n\nWe can now use js side to start an RPC server and connect to it from python side,\nmaking the testing flow easier.\n\nThe following is an example to reproduce this.\n- run `python -m tvm.exec.rpc_proxy --example-rpc=1` to start proxy.\n- Start the WebSocket RPC\n  - Browswer version:  open https://localhost:8888, click connect to proxy\n  - NodeJS version: `npm run rpc`\n- run `python tests/python/websock_rpc_test.py` to run the rpc test.\n\n\n## WebGPU Experiments\n\nWeb gpu is still experimental, so apis can change.\nRight now we use the SPIRV to generate shaders that can be accepted by Chrome and Firefox.\n\n- Obtain a browser that support webgpu.\n  - So far only Chrome Canary on MacOS works\n  - Firefox should be close pending the support of Fence.\n- Download vulkan SDK (1.1 or higher) that supports SPIRV 1.3\n- Start the WebSocket RPC\n- run `python tests/node/webgpu_rpc_test.py`\n","readmeFilename":"README.md"}