HackerTrans
TopNewTrendsCommentsPastAskShowJobs

cloudhan

no profile record

comments

cloudhan
·l’année dernière·discuss
> The official project language is American English with ISO 8601 dates and metric units.

Very good taste for an American.
cloudhan
·il y a 2 ans·discuss
NPU folks offen time say

> it's not enough time to get new silicon designs specifically for <blahblah>

Where blahblah stands for a model architecture that has caused a paradigm shift.

When you need a new silicon for a new model, you are already losing.
cloudhan
·il y a 2 ans·discuss
OK, I am one of the developers in onnxruntime team. Perviously working on ROCm EP now has been transfered to QNN EP. The following is purely devrant and the opinions are mine.

So ROCm already sucks whereas QNN sucks even harder!

The conclusion here is NVIDIA knows how to make software that just works. AMD makes software that might work. Qualcomm, however, knows zero piece of shit of how to make a useful software.

The dev experience is just another level of disaster with Qualcomm. Their tools and APIs return absolutely zero useful infomation about what error you are getting, just an error code that you can grep from their include headers from SDK. To debug an error code, you need strace to get the internal error string on the device. Their profiler merely gives you a trace that cannot be associated back to original computing logic with very high stddev on the runtime. Their docs website is not indexed by the MF search engine, not to say LLMs, so if you have any question, good luck then!

So if you don't have a reason to use QNN, just don't use it (and any other NPU you name it).

Back to the benchmark script. There is a lot of flaws as I can see.

1. the session is not warmed up and the iteraion is too small. 2. the onnx graph is too small, I suspect the onnxruntime overhead cannot be ignored in this case. Try stack more gemm in the graph instead of increasing the iteration naively. 3. the "htp_performance_mode": "sustained_high_performance" might give a lower perf compare to "burst" mode.

A more reliable way to benchmark might just dump the context binary[1] and dump context inputs[2] and run this with qnn-net-run to get rid of the onnxruntime overhead.

[1]: https://github.com/cloudhan/misc-nn-test-driver/blob/main/qn... [2]: https://github.com/cloudhan/misc-nn-test-driver/blob/main/qn...
cloudhan
·il y a 2 ans·discuss
Yes.
cloudhan
·il y a 2 ans·discuss
This reminds me of Weight Agnostic Neural Networks https://weightagnostic.github.io/
cloudhan
·il y a 2 ans·discuss
Very unfriendly.

The symbolic library (type of activations) requires a branching at the very core of the kernel. GPU will need to serialized on these operations warp-wise.

To optimize, you might want to do a scan operation beforehand and dispatch to activation funcs in a warp specialized way, this, however, makes the global memory read/write non-coalesced.

You then may sort the input based on type of activations and store it in that order, this makes the gmem IO coalesced but requires gather and scatter as pre and post processing.
cloudhan
·il y a 2 ans·discuss
You run or your code runs, choose one and choose it wisely ;)
cloudhan
·il y a 2 ans·discuss
The memory is too small to be useful nowadays.
cloudhan
·il y a 3 ans·discuss
At the time of the dev of the EP, the tooling is not that good as current. I have imagined a pipeline that HLSL compiles down to DXIL then go through spirv cross and then target wide variety of mobile devices with opencl runtime. But they are more focused on graphics part and is cannot work with the kernel execution model, not to even mention the structural control flow things, it definitely not going to work. The OpenGL does not work with the imagined pipeline, because IIRC it cannot consume SPIRV bytecode. Vulkan is so niche and discarded very early. The final result with opencl runtime and cl language worked but the driver is a mess [palmface]
cloudhan
·il y a 3 ans·discuss
Not exactly, both cl and glsl can be aot, but the runtime will be limited to some newer version and then the market coverage will be niche, those vendor are so lazy on updating the driver and fixing the compiler bugs...
cloudhan
·il y a 3 ans·discuss
circle lang is also very worth to check out.
cloudhan
·il y a 3 ans·discuss
Thoes "existing libraries" does not necessary mean stdc++, but some parallel primitive, and are essential to performance portability. For example, cub for scan and reduction, cutlass for dense linear algebra[1].

> I think the driver ecosystem for Vulkan is rather high-quality

Sorry, I meant OpenGL. At the time of evaluation, the market shared of vulkan on Android deivces is too small and been out of consideration at very early stage. I'd assume the state has changed a lot thereafter.

It is really good to see more projects take a shot on compiling C++ to GPU natively.

[1] cutlass itself is not portable, but the recently added cute is well portable as I evaluated. It provides a unified abstraction for hierarchical layout decomposition along with copy primitive and gemm primitive.
cloudhan
·il y a 3 ans·discuss
I am long sought after a CUDA or HIP compiler that target SPIR-V or DXIL. So that we can compile all thoes neural network kernels to almost all compute devices.

The requirements are, 1. extend on C++17 this means template meta programming works so that cub or cutlass/cute works

2. AOT

3. and no shitshow!

The only thing that comes to close is circle[1].

- OpenCL is a no go, as it is purely C. And it is full of shitshow especially on Android devices. And the vendor drivers are the main source of shit, jit compile adds the other.

- Vulkan+GLSL is a no go. The degree of shitness is on par with OpenCL due to driver and jit compiler.

- slang[2] has the potential, but the meta programming part is not as strong as C++, existing libraries cannot be used.

The above conclusion is drawn from my work on OpenCL EP for onnxruntime. And it purely is a nightmare to work with thoes drivers and jit compilers. Hopefully Vcc can take compute shader more seriously.

[1]: https://www.circle-lang.org/

[2]: https://shader-slang.com/

[3]: https://github.com/microsoft/onnxruntime/tree/dev/opencl
cloudhan
·il y a 3 ans·discuss
Mixtral-8x7B support --> Support new model

https://github.com/stanford-futuredata/megablocks/pull/45
cloudhan
·il y a 3 ans·discuss
Might be the training code related with the model https://github.com/mistralai/megablocks-public/tree/pstock/m...
cloudhan
·il y a 3 ans·discuss
You might also want to watch on helix, if PR 8675 is merged, then scheme will be the extension langauge, then we get the best of both world. Modal editing and scheme =)

PR 8675: https://github.com/helix-editor/helix/pull/8675