Skip to content

Commit ad17016

Browse files
hfiguerapolvalente
andauthored
Support dense Qwen3 generation in EMLXAxon (#119)
* feat: add dense qwen3 generation to EMLXAxon * Update emlx_axon/lib/emlx_axon/qwen3/generate.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update emlx_axon/lib/emlx_axon/qwen3/generate.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update emlx_axon/lib/emlx_axon/qwen3/generate.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Update emlx_axon/lib/emlx_axon/qwen3/generate.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Address text generation style feedback * Use microsecond timing for Qwen3 profiling * Update emlx_axon/lib/emlx_axon/qwen3/dense_loader.ex Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com> * Simplify Qwen3 dense parameter lookup * Rename Qwen3 quantized attention path * Leave dense Qwen3 state evaluation lazy * Keep Qwen3 greedy sampler generic * Isolate Qwen3 native accelerators * Inline Qwen3 native error returns * Move Qwen3 native code under emlx_fast * Move memory include to Qwen3 source --------- Co-authored-by: Paulo Valente <16843419+polvalente@users.noreply.github.com>
1 parent 25f5340 commit ad17016

20 files changed

Lines changed: 7079 additions & 200 deletions

emlx/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ endif
4747
MAKE_JOBS ?= $(MAKE_DEFAULT_JOBS)
4848

4949
# Source files
50-
SOURCES = c_src/emlx_nif.cpp c_src/emlx_fast.cpp
51-
HEADERS = c_src/nx_nif_utils.hpp c_src/emlx_worker.hpp c_src/emlx_async.hpp c_src/emlx_nif_shared.hpp
50+
SOURCES = c_src/emlx_nif.cpp c_src/emlx_fast.cpp c_src/emlx_fast/qwen3.cpp
51+
HEADERS = c_src/nx_nif_utils.hpp c_src/emlx_worker.hpp c_src/emlx_async.hpp c_src/emlx_nif_shared.hpp c_src/emlx_fast/qwen3.hpp
5252
OBJECTS = $(patsubst c_src/%.cpp,$(call esc,$(BUILD_DIR))/%.o,$(SOURCES))
5353

5454
# Main targets
@@ -59,7 +59,7 @@ $(call esc,$(PRIV_DIR)):
5959
@ mkdir -p "$(PRIV_DIR)"
6060

6161
$(call esc,$(BUILD_DIR))/%.o: c_src/%.cpp $(HEADERS)
62-
@ mkdir -p "$(BUILD_DIR)"
62+
@ mkdir -p "$(dir $@)"
6363
$(CXX) $(CFLAGS) -c "$<" -o "$@"
6464

6565
$(call esc,$(MLX_SRC_ARCHIVE)):

emlx/c_src/emlx_fast.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,3 +640,4 @@ NIF(kv_cache_sdpa_update) {
640640
CATCH()
641641
}
642642
ASYNC_NIF(kv_cache_sdpa_update)
643+

0 commit comments

Comments
 (0)