Giter Site home page Giter Site logo

samginzburg / vectorvisor Goto Github PK

View Code? Open in Web Editor NEW
137.0 6.0 3.0 220.71 MB

VectorVisor is a vectorizing binary translator for GPUs, designed to make it easy to run many copies of a single-threaded WebAssembly program in parallel using GPUs

License: Apache License 2.0

Rust 39.42% Makefile 0.08% C 0.90% Python 8.91% Go 6.88% Shell 1.64% WebAssembly 41.12% Cuda 0.16% TypeScript 0.77% JavaScript 0.10% HTML 0.01%
compiler gpu gpu-computing gpu-programming opencl parallel-programming research webassembly webassembly-runtime vectorvisor

vectorvisor's People

Contributors

engshahrad avatar samginzburg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vectorvisor's Issues

Why Only Single Threaded Applications?

First off, I just wanted to say this an amazing project and I see a lot of potential for where this could be lead!

But onto the main subject, is there a specific technical limitation which is stopping the translation of multi-threaded applications onto GPUs or is it not supported because WasmTime's WASI doesn't have support for threads yet? If it's the latter, I'd love to work on trying to support WASIX and converting using WasmTime to Wasmer! If it's the former, then that's too bad :/

I read the paper and was just a little confused why the reason applications needed to be single threaded was never addressed, so I thought I'd make an issue in case anyone else was curious in the future.

Issue while cloning the repo

No idea why I am getting this error. Is remote corrupted?

dangu@Desktop MINGW64 /d/dev/3rd
$ git clone https://github.com/SamGinzburg/VectorVisor/
Cloning into 'VectorVisor'...
remote: Enumerating objects: 10710, done.
remote: Counting objects: 100% (119/119), done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 10710 (delta 63), reused 52 (delta 25), pack-reused 10591
Receiving objects: 100% (10710/10710), 220.62 MiB | 34.03 MiB/s, done.
Resolving deltas: 100% (7373/7373), done.
error: invalid path 'benchmarks/2022-12-18-02:01:45/a10g_cuda/gpu_cuda_bench_imageblur_bmp_0.txt'
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

OpenCL failed to compile/vectorvisor stall

Hello, I am looking into this project to learn what you have done in this work.
I tried to run scrypt benchmark in the repository, by running the following commands(see build.sh in the attachment).

cd benchmark/scrypt
cargo build --release
cargo run --release -- --ip=0.0.0.0 --heap=3145728 --stack=262144 --hcallsize=131072 --partition=false --serverless=true --vmcount=4096 --vmgroups=1 --interleave=1 --pinput=true --fastreply=true --lgroup=64 --nvidia=true --input=benchmarks/scrypt/target/wasm32-wasi/release/scrypt.wasm

The generated opencl code failed to compile, with some messasges like this(full log is in compilation_failed.txt):

<kernel>:157873:37: error: redefinition of '__func_func_getenv'
<kernel>:168648:37: error: redefinition of '__func_func__ZN3std5alloc8rust_oom17hb466c6b0b424784eE'
<kernel>:176935:37: error: redefinition of '__func_func__ZN3std3sys4wasi4once4Once4call17h43619e2953d53b25E'
<kernel>:179098:37: error: redefinition of '__func_func__ZN4core6option13expect_failed17h8f72e66e0b3163c7E'
<kernel>:181066:37: error: redefinition of '__func_func__ZN72_$LT$sha2sha256Sha256$u20$as$u20$digestfixedFixedOutputDirty$GT$19finalize_into_dirty17h563df1210a5950c5E'
<kernel>:181743:37: error: redefinition of '__func_func__ZN4sha26sha2569Engine2566update17hcb501717ee07d7caE'
<kernel>:234127:37: error: redefinition of '__func_func__ZN3std3sys4wasi4once4Once4call17hee18ac680eb799ccE'
<kernel>:238120:37: error: redefinition of '__func_func___main_void'

I think this is because some functions appear in more than one partitions, and the modification as follow(cfg_optimizer.rs in the attachment) seems to solve the problem.

diff --git a/src/opencl_writer/cfg_optimizer.rs b/src/opencl_writer/cfg_optimizer.rs
index 9a5e6a5..2bb119c 100644
--- a/src/opencl_writer/cfg_optimizer.rs
+++ b/src/opencl_writer/cfg_optimizer.rs
@@ -254,6 +254,9 @@ pub fn form_partitions(

         current_partition.insert(String::from(f_name.clone()));

+               let func_copies = include_limit.get(&f_name).cloned().unwrap_or(0);
+               include_limit.insert(f_name.clone(), func_copies + 1);
+
         let (loop_called_fns, called_fns) = get_called_funcs(
             writer_ctx,
             &indirect_call_mapping_formatted,

I'm not sure if this is what the function intend to perform(the function seems to support more than one function copies, how would the other components handle that?).

By the way, does the --partition parameter have something to do with this? I previously run similar commands without disabling partition seems to pass the compilation, but result in some memory access violation.

With the patch, the vm started. Then I execute

go run run_scrypt.go 127.0.0.1 8000 1 1 300 256

to start the test. But nothing happened. The log is in the attachment(run.txt).

The line Set entry point: ["func_strncmp"] seems strange, I think it would be something like __start or main.

With other configurations, I received illegal memory access or unsupported hypercall errors.

The attachment include the scrypt.wasm generated by cargo.

Do you have some advice? Thank you.
Attach_20230925.tar.gz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.