examples/models/qwen3_5_moe: CUDA Engine/Session adapter + OpenAI serving#20043
Open
mergennachin wants to merge 6 commits into
Open
examples/models/qwen3_5_moe: CUDA Engine/Session adapter + OpenAI serving#20043mergennachin wants to merge 6 commits into
mergennachin wants to merge 6 commits into
Conversation
[ghstack-poisoned]
Contributor
Author
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20043
Note: Links to docs will display an error until the docs builds have been completed. ❌ 5 New Failures, 1 PendingAs of commit 462416d with merge base eeb0646 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This was referenced Jun 4, 2026
[ghstack-poisoned]
mergennachin
added a commit
that referenced
this pull request
Jun 4, 2026
…ving
Implement Qwen35MoEEngine / Qwen35MoESession (the model-agnostic
LLMEngine / LLMSession contract) over the exported prefill/decode methods.
serving_capacity() reports a single physical session; the model is
hybrid_recurrent with seek() NotSupported (no prefix reuse). main.cpp is a thin
CLI over the engine/session.
OpenAI serving runs process-isolated and model execution stays in C++: serve.py
is the control plane (FastAPI, chat templating, Qwen XML tool parsing,
validation; no CUDA, no pybind) and spawns qwen3_5_moe_worker
(qwen35_moe_worker.cpp), a C++ worker that constructs the engine and one session
and speaks the same JSONL protocol as the generic text worker. Executing the
AOTI CUDA model inside a live asyncio server process segfaults in the int4
matmul; isolating it in a plain worker process makes serving reliable while
loading weights once. Single-slot: concurrent requests queue. Tool calls use the
Qwen XML <function=...> format (QwenFunctionCallDetector).
Review order: qwen35_moe_engine.{h,cpp} (adapter) and main.cpp; then
qwen35_moe_worker.cpp and serve.py (serving); then tests and docs.
ghstack-source-id: ca70937
ghstack-comment-id: 4625142707
Pull-Request: #20043
mergennachin
added a commit
that referenced
this pull request
Jun 4, 2026
…ving
Implement Qwen35MoEEngine / Qwen35MoESession (the model-agnostic
LLMEngine / LLMSession contract) over the exported prefill/decode methods.
serving_capacity() reports a single physical session; the model is
hybrid_recurrent with seek() NotSupported (no prefix reuse). main.cpp is a thin
CLI over the engine/session.
OpenAI serving runs process-isolated and model execution stays in C++: serve.py
is the control plane (FastAPI, chat templating, Qwen XML tool parsing,
validation; no CUDA, no pybind) and spawns qwen3_5_moe_worker
(qwen35_moe_worker.cpp), a C++ worker that constructs the engine and one session
and speaks the same JSONL protocol as the generic text worker. Executing the
AOTI CUDA model inside a live asyncio server process segfaults in the int4
matmul; isolating it in a plain worker process makes serving reliable while
loading weights once. Single-slot: concurrent requests queue. Tool calls use the
Qwen XML <function=...> format (QwenFunctionCallDetector).
Review order: qwen35_moe_engine.{h,cpp} (adapter) and main.cpp; then
qwen35_moe_worker.cpp and serve.py (serving); then tests and docs.
ghstack-source-id: ca70937
ghstack-comment-id: 4625142707
Pull-Request: #20043
[ghstack-poisoned]
mergennachin
added a commit
that referenced
this pull request
Jun 4, 2026
…ving
Implement Qwen35MoEEngine / Qwen35MoESession (the model-agnostic
LLMEngine / LLMSession contract) over the exported prefill/decode methods.
serving_capacity() reports a single physical session; the model is
hybrid_recurrent with seek() NotSupported (no prefix reuse). main.cpp is a thin
CLI over the engine/session.
OpenAI serving runs process-isolated and model execution stays in C++: serve.py
is the control plane (FastAPI, chat templating, Qwen XML tool parsing,
validation; no CUDA, no pybind) and spawns qwen3_5_moe_worker
(qwen35_moe_worker.cpp), a C++ worker that constructs the engine and one session
and speaks the same JSONL protocol as the generic text worker. Executing the
AOTI CUDA model inside a live asyncio server process segfaults in the int4
matmul; isolating it in a plain worker process makes serving reliable while
loading weights once. Single-slot: concurrent requests queue. Tool calls use the
Qwen XML <function=...> format (QwenFunctionCallDetector).
Review order: qwen35_moe_engine.{h,cpp} (adapter) and main.cpp; then
qwen35_moe_worker.cpp and serve.py (serving); then tests and docs.
ghstack-source-id: 6ae0026
ghstack-comment-id: 4625142707
Pull-Request: #20043
[ghstack-poisoned]
mergennachin
added a commit
that referenced
this pull request
Jun 4, 2026
…ving
Implement Qwen35MoEEngine / Qwen35MoESession (the model-agnostic
LLMEngine / LLMSession contract) over the exported prefill/decode methods.
serving_capacity() reports a single physical session; the model is
hybrid_recurrent with seek() NotSupported (no prefix reuse). main.cpp is a thin
CLI over the engine/session.
OpenAI serving runs process-isolated and model execution stays in C++: serve.py
is the control plane (FastAPI, chat templating, Qwen XML tool parsing,
validation; no CUDA, no pybind) and spawns qwen3_5_moe_worker
(qwen35_moe_worker.cpp), a C++ worker that constructs the engine and one session
and speaks the same JSONL protocol as the generic text worker. Executing the
AOTI CUDA model inside a live asyncio server process segfaults in the int4
matmul; isolating it in a plain worker process makes serving reliable while
loading weights once. Single-slot: concurrent requests queue. Tool calls use the
Qwen XML <function=...> format (QwenFunctionCallDetector).
Review order: qwen35_moe_engine.{h,cpp} (adapter) and main.cpp; then
qwen35_moe_worker.cpp and serve.py (serving); then tests and docs.
ghstack-source-id: 4440667
ghstack-comment-id: 4625142707
Pull-Request: #20043
[ghstack-poisoned]
mergennachin
added a commit
that referenced
this pull request
Jun 5, 2026
…ving
Implement Qwen35MoEEngine / Qwen35MoESession (the model-agnostic
LLMEngine / LLMSession contract) over the exported prefill/decode methods.
serving_capacity() reports a single physical session; the model is
hybrid_recurrent with seek() NotSupported (no prefix reuse). main.cpp is a thin
CLI over the engine/session.
OpenAI serving runs process-isolated and model execution stays in C++: serve.py
is the control plane (FastAPI, chat templating, Qwen XML tool parsing,
validation; no CUDA, no pybind) and spawns qwen3_5_moe_worker
(qwen35_moe_worker.cpp), a C++ worker that constructs the engine and one session
and speaks the same JSONL protocol as the generic text worker. Executing the
AOTI CUDA model inside a live asyncio server process segfaults in the int4
matmul; isolating it in a plain worker process makes serving reliable while
loading weights once. Single-slot: concurrent requests queue. Tool calls use the
Qwen XML <function=...> format (QwenFunctionCallDetector).
Review order: qwen35_moe_engine.{h,cpp} (adapter) and main.cpp; then
qwen35_moe_worker.cpp and serve.py (serving); then tests and docs.
ghstack-source-id: 4577b1d
ghstack-comment-id: 4625142707
Pull-Request: #20043
[ghstack-poisoned]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement Qwen35MoEEngine / Qwen35MoESession (the model-agnostic
LLMEngine / LLMSession contract) over the exported prefill/decode methods.
serving_capacity() reports a single physical session; the model is
hybrid_recurrent with seek() NotSupported (no prefix reuse). main.cpp is a thin
CLI over the engine/session.
OpenAI serving runs process-isolated and model execution stays in C++: serve.py
is the control plane (FastAPI, chat templating, Qwen XML tool parsing,
validation; no CUDA, no pybind) and spawns qwen3_5_moe_worker
(qwen35_moe_worker.cpp), a C++ worker that constructs the engine and one session
and speaks the same JSONL protocol as the generic text worker. Executing the
AOTI CUDA model inside a live asyncio server process segfaults in the int4
matmul; isolating it in a plain worker process makes serving reliable while
loading weights once. Single-slot: concurrent requests queue. Tool calls use the
Qwen XML <function=...> format (QwenFunctionCallDetector).
Review order: qwen35_moe_engine.{h,cpp} (adapter) and main.cpp; then
qwen35_moe_worker.cpp and serve.py (serving); then tests and docs.
Part of #20001