If not then what is the limiting factor?
If not then what is the limiting factor?
WebGPU will make this kind of thing more accessible. It's kind of a pain to do it in WebGL, but even so it's still totally possible and worthwhile because you can easily get 20 times the performance in many cases and handily beat native CPU code even on the web.
Latest Firefox, Windows 10, Radeon RX 6700XT 16GB.
I haven't tested the code extensively so I'm sure it's broken in some configurations. It's just a proof of concept demo for now.
I do find it confusing, as I can put in numbers that get me well below a 3% withdrawal rate, but still have only 40% success rate. But I'm probably misunderstanding some of the mortgage sliders.
On Firefox it's way laggier but still usable.
WebGPU is accessible enough maybe you should try it! You'll learn a lot either way, and it can be fun.
> As WebGPU spec is being developed, a reference implementation is also being build. It’s written in Rust, and is likely going to power the WebGPU implementation in Firefox. This reference implementation, called wgpu-native, also exposes a C-api, which means that it can be wrapped in Python. And this is what wgpu-py does.
> So in short, wgpu-py is a Python wrapper of wgpu-native, which is a wrapper for Vulkan, Metal and DX12, which are low-level API’s to talk to the GPU hardware.
So, it should be possible to WebGPU-accelerate SciPy; for example where NumPy is natively or third-partily CUDA-accelerated
edit: Intel MKL, https://Rapids.ai,
> Seamlessly scale from GPU workstations to multi-GPU servers and multi-node clusters with Dask.
Where can WebGPU + IDK WebRTC/WebSockets + Workers provide value for multi-GPU applications that already have efficient distributed messaging protocols?
"Considerable slowdown in Firefox once notebook gets a bit larger" https://github.com/jupyterlab/jupyterlab/issues/1639#issueco... Re: the differences between the W3C Service Workers API, Web Locks API, and the W3C Web Workers API and "4 Ways to Communicate Across Browser Tabs in Realtime" may be helpful.
Pyodide compiles CPython and the SciPy stack to WASM. The WASM build would probably benefit from WebGPU acceleration?
I think there's potential for interesting things in the future. There's nothing inherently preventing a more latency-optimized GPU implementation, and I personally would love to see that for a number of reasons. That would unlock vastly more computational power for audio applications.
There's also machine learning, of course. You'll definitely be seeing (and hearing) more of that in the future.
For some easy experimentation with GPUs I would advise looking at Futhark. It's super easy to setup and get started.
But how many stocks even are there? You might not even have enough parallel operations to saturate a modern GPU.
Out of curiosity, why use WebGPU for this? If you're really trying to do something high performance, why not reach for something like CUDA?
- Simple regression with TensorFlow.js: https://hal9.com/hal9/historic-temperature-analysis - LSTM with TensorFlow.js: https://hal9.com/hal9/bitcoin-prediction - ARIMA with Pyodide.js: https://hal9.com/hal9/ai-fundamentals-arima
If you have question or would be open to considering using Hal9 to do time series analysis in JavaScript, let me know! You can find me in Twitter at https://twitter.com/javierluraschi
The limiting factor is usually parallelism, to utilize a GPU well you need to be running something on the order of 10000 threads in parallel.