lunaticd
Approximate Binary Vector Search for RAG in Julia
julia> @code_llvm hamming_distance(Int8(33), Int8(125)) ; Function Signature: hamming_distance(Int8, Int8) ; @ /Users/lunaticd/code/tiny-binary-rag/rag.jl:13 within `hamming_distance` define i64 @julia_hamming_distance_16366(i8 signext %"x1::Int8", i8 signext %"x2::Int8") #0 { top: ; @ /Users/lunaticd/code/tiny-binary-rag/rag.jl:14 within `hamming_distance` ; ┌ @ int.jl:373 within `xor` %0 = xor i8 %"x2::Int8", %"x1::Int8" ; └ ; ┌ @ int.jl:415 within `count_ones` %1 = call i8 @llvm.ctpop.i8(i8 %0) ; │┌ @ int.jl:549 within `rem` %2 = zext i8 %1 to i64 ; └└ ret i64 %2 }
it lowers to the machine instruction now.
I also tried 8 Int64s vs 64 Int8s and it doesn't seem to make a difference when doing the search.
EDIT: apologize for the formatting
Thanks! With this the timings are even faster. I'll update the post.
Exact Binary Vector Search for RAG in 100 Lines of Julia
Generative AI vs. AWS Textract – A Case for GPT Wrappers
LLMs can dream of electric sheep, but can they add?
Take1 – An Exploration into LLM Writing
Counting NanoGPT FLOPs in PyTorch
Show HN: DataGPTd – Making data analysis as easy as asking a question
I'm excited to share a project I've been working on called DataGPTd.DataGPTd is a browser-based tool that aims to help make data analysis as simple as asking a question. It allows you to import your data (csv, excel), edit it, ask questions, create visualizations, just with text. All within your browser. It runs a code interpreter locally by WASM.Key features:- Text-based interaction: Using...