chsasank / llama.lisp

Lisp dialect designed for HPC and AI
GNU Lesser General Public License v2.1
14 stars 6 forks source link

Quantized types and casting in C-Lisp #76

Closed GlowingScrewdriver closed 2 months ago

GlowingScrewdriver commented 2 months ago

Support for more types and casts between them was introduced in Brilisp in #68. Now the same capabilities need to be exposed in C-Lisp.

GlowingScrewdriver commented 2 months ago

Since we are now supporting quantized types, there is no such thing as a "fixed-type expression" anymore. Before #68, add always produced an int result; now, it can produce any of the quantized int types. Further, LLVM does not support adding differently quantized types (e.g. int8 + int16). This means we need to track the types of all intermediate variables, not just pointers. On the positive side, we have a lot more opportunities for type checking if we track all intermediates.

chsasank commented 2 months ago

As we discussed before, we need to track types of all intermediates.