Skip to content

Instantly share code, notes, and snippets.

@josevalim
Created February 26, 2023 19:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josevalim/9f77305b7273d33ac962519ff115fa6a to your computer and use it in GitHub Desktop.
Save josevalim/9f77305b7273d33ac962519ff115fa6a to your computer and use it in GitHub Desktop.

Implementation of Torch JIT compiler for Nx

Nx is a library for working with tensors in Elixir. Nx supports building tensor expressions via defn (called numerical expressions). Tensor expressions can be compiled to specific hardware or use specific tensor compilers. Currently, Google's XLA compiler is supported.

The goal of this project is to add a Torch JIT compiler for Nx. We already have initial bindings for Torch in Elixir and this work will build on top of that. You will be working both with C++ and Elixir.

Quantization algorithms for Nx

Nx is a library for working with tensors and building neural networks in Elixir. When working with large models, you may want to apply quantization to reduce the size of the model and its parameters.

The goal of this project is to implement quantization for Nx. A similar project for the Python JAX library exists and can be used as reference.

This project requires the ability to fiddle with Python code and Elixir experience.

Creating an AI Chatbot for question/answering of programming questions from documentation

The idea is to parse the documentation of Elixir and its libraries and provide answers. What is a string? It gives an answer. How to lower case a string? It gives an answer.

The general idea:

  • Use Elixir structured docs and break up by functions, modules, guides, etc.
  • Embed each section with a similarity model
  • Store embeddings in a FAISS index

At question time you do this:

  • Embed question with same similarity model
  • Search for top related segment in faiss index
  • Create prompt which includes context from similarity model and original question
  • Use a conversational/instruction model like Flan-T5 to generate output

You will be programming in Elixir and you must have some familiarity with neural networks.

@josevalim
Copy link
Author

For the future: Humming Bird based on top of EXGBoost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment