-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use upstream LLVM with generic runtime #49
Conversation
bc9aa05
to
e335786
Compare
59194e0
to
3d4e6fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
Using the files and building locally, I have these issues: Simple copy ❌
In clang 17 this is an error instead of a warning, and the function has to be declared before it can be used. diff --git a/kernels/simple_copy/main.c b/kernels/simple_copy/main.c
index eeed3fc..0e1fa5a 100644
--- a/kernels/simple_copy/main.c
+++ b/kernels/simple_copy/main.c
@@ -5,6 +5,9 @@
#include <snrt.h>
#include <stdint.h>
+
+void _mlir_ciface_simple_copy(OneDMemrefI32_t* memrefA, OneDMemrefI32_t* memrefB);
+
int main() {
// create memref object for A Furthermore, it fails:
Simple mult ✔️Simple matmult ✔️After applying this fix: diff --git a/kernels/simple_matmul/main.c b/kernels/simple_matmul/main.c
index 1e37e3c..00c7789 100644
--- a/kernels/simple_matmul/main.c
+++ b/kernels/simple_matmul/main.c
@@ -49,7 +49,7 @@ void _mlir_ciface_simple_matmul_cpu(TwoDMemrefI8_t *a, TwoDMemrefI8_t *b,
int8_t *a_ptr = a->aligned_data;
int8_t *b_ptr = b->aligned_data;
int32_t *c_ptr = c->aligned_data;
- batch_gemm_cpu(Batch, M_param, K_param, N_param, a_ptr, b_ptr, c_ptr,
+ batch_gemm_cpu(Batch, M_param, K_param, N_param, a_ptr, b_ptr, 0, 0, c_ptr,
strideInnermostA, strideInnermostB, strideInnermostC, ldA, ldB,
ldC, strideA, strideB, strideC);
} Alloc ✔️ |
Awaiting merging of #53 |
Also installs make again :)
Adds a dma_wait in simple copy calls
5462ae9
to
2020110
Compare
latest update introduced offset fields for quantized gemm
2020110
to
d9e7850
Compare
This reverts commit f28b1cb.
Solves #48
Note that there are still two linking dependencies that I'm hauling over from the old toolchain.
In KULeuven-MICAS/snax_cluster#57 this toolchain was installed by default, here I have to explicitly keep it in the installation but also copy over the static libraries.
libclang_rt.builtins-riscv32.a
: this is not built with the standard distribution of LLVM and I'm too lazy to build this myself.More info here (I think) : https://github.com/llvm/llvm-project/tree/main/compiler-rt/lib/builtins
libc.a
apparently there are a few routines in the runtime that rely onmemset
: Not sure why we would have to stick to this specific version, but hey it works. Compiling directly with only the source of memset might save us a few kb's in the final elf file size, but I'm not sure about this.One implementation is in musl: https://git.musl-libc.org/cgit/musl/tree/src/string/memset.c