ref(upstream): add Deep-Spark xllm + vllm MoE/GDN reference code
Sources (Apache 2.0, cloned 2026-08-09):
- Deep-Spark/xllm: Iluvatar's official C++ inference engine
- Deep-Spark/vllm: Iluvatar's vllm fork
Key files for our EX Engine development:
MoE topk_softmax (fixes 2304 calls/token PyTorch fallback):
- xllm/kernels/cuda/moe/moe_topk_softmax_kernels.cuh
CUB-based fused softmax+topk, power-of-2 expert count optimized
For 64 experts: topk_gating_softmax<T,VPT=2,64,WARPS=4,BYTES=4>
- xllm/kernels/ilu/ixformer.h
Official ixformer C++ API: topk_softmax(), paged_attention(), etc.
- xllm/kernels/ilu/fused_moe.cpp
How xllm calls ixformer::infer::topk_softmax()
- ds_vllm/csrc/moe/topk_softmax_kernels.cu
vllm-native topk_softmax (TensorRT-LLM derived, 874 lines)
GatedDeltaNet (fixes NaN in 4 GDN layers):
- xllm/layers/npu_torch/qwen3_gated_delta_net_base.cpp
fp32 state accumulation, proper recurrent update
Complete FusedMoE pipeline reference:
- xllm/layers/ilu/fused_moe.cpp
gate -> topk -> expand -> gemm1 -> act -> gemm2 -> combine
2026-08-10 02:48:17 +00:00
|
|
|
/* Copyright 2025 The xLLM Authors. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
|
|
https://github.com/jd-opensource/xllm/blob/main/LICENSE
|
|
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
|
limitations under the License.
|
|
|
|
|
==============================================================================*/
|
|
|
|
|
|
ref(upstream): FULL TREE — Deep-Spark xllm (1470) + ds_vllm csrc/models (703)
Replaces cherry-picked upstream_ref with complete source trees.
xllm/ — Iluvatar official C++ inference engine (15MB, 1470 files)
Complete: kernels → layers → models → runtime → scheduler → api
Excluded: .git, binary images, third_party submodule checkouts
ds_vllm/ — Iluvatar official vllm fork (8MB, 703 files)
Included: csrc/ (ALL CUDA kernels), fused_moe/, qwen3_5 model, _custom_ops
Excluded: tests, benchmarks, docs, examples (not needed for reference)
Critical call chains now fully traceable:
MoE: moe_topk_softmax_kernels.cuh → ixformer.h → fused_moe.cpp → layer
GDN: qwen3_gated_delta_net_base.cpp → qwen3_5_gated_delta_net.cpp
Attention: ixformer.h → xllm_paged_attention → attention.cpp
2026-08-10 02:53:54 +00:00
|
|
|
#pragma once
|
ref(upstream): add Deep-Spark xllm + vllm MoE/GDN reference code
Sources (Apache 2.0, cloned 2026-08-09):
- Deep-Spark/xllm: Iluvatar's official C++ inference engine
- Deep-Spark/vllm: Iluvatar's vllm fork
Key files for our EX Engine development:
MoE topk_softmax (fixes 2304 calls/token PyTorch fallback):
- xllm/kernels/cuda/moe/moe_topk_softmax_kernels.cuh
CUB-based fused softmax+topk, power-of-2 expert count optimized
For 64 experts: topk_gating_softmax<T,VPT=2,64,WARPS=4,BYTES=4>
- xllm/kernels/ilu/ixformer.h
Official ixformer C++ API: topk_softmax(), paged_attention(), etc.
- xllm/kernels/ilu/fused_moe.cpp
How xllm calls ixformer::infer::topk_softmax()
- ds_vllm/csrc/moe/topk_softmax_kernels.cu
vllm-native topk_softmax (TensorRT-LLM derived, 874 lines)
GatedDeltaNet (fixes NaN in 4 GDN layers):
- xllm/layers/npu_torch/qwen3_gated_delta_net_base.cpp
fp32 state accumulation, proper recurrent update
Complete FusedMoE pipeline reference:
- xllm/layers/ilu/fused_moe.cpp
gate -> topk -> expand -> gemm1 -> act -> gemm2 -> combine
2026-08-10 02:48:17 +00:00
|
|
|
|
ref(upstream): FULL TREE — Deep-Spark xllm (1470) + ds_vllm csrc/models (703)
Replaces cherry-picked upstream_ref with complete source trees.
xllm/ — Iluvatar official C++ inference engine (15MB, 1470 files)
Complete: kernels → layers → models → runtime → scheduler → api
Excluded: .git, binary images, third_party submodule checkouts
ds_vllm/ — Iluvatar official vllm fork (8MB, 703 files)
Included: csrc/ (ALL CUDA kernels), fused_moe/, qwen3_5 model, _custom_ops
Excluded: tests, benchmarks, docs, examples (not needed for reference)
Critical call chains now fully traceable:
MoE: moe_topk_softmax_kernels.cuh → ixformer.h → fused_moe.cpp → layer
GDN: qwen3_gated_delta_net_base.cpp → qwen3_5_gated_delta_net.cpp
Attention: ixformer.h → xllm_paged_attention → attention.cpp
2026-08-10 02:53:54 +00:00
|
|
|
namespace xllm {
|
ref(upstream): add Deep-Spark xllm + vllm MoE/GDN reference code
Sources (Apache 2.0, cloned 2026-08-09):
- Deep-Spark/xllm: Iluvatar's official C++ inference engine
- Deep-Spark/vllm: Iluvatar's vllm fork
Key files for our EX Engine development:
MoE topk_softmax (fixes 2304 calls/token PyTorch fallback):
- xllm/kernels/cuda/moe/moe_topk_softmax_kernels.cuh
CUB-based fused softmax+topk, power-of-2 expert count optimized
For 64 experts: topk_gating_softmax<T,VPT=2,64,WARPS=4,BYTES=4>
- xllm/kernels/ilu/ixformer.h
Official ixformer C++ API: topk_softmax(), paged_attention(), etc.
- xllm/kernels/ilu/fused_moe.cpp
How xllm calls ixformer::infer::topk_softmax()
- ds_vllm/csrc/moe/topk_softmax_kernels.cu
vllm-native topk_softmax (TensorRT-LLM derived, 874 lines)
GatedDeltaNet (fixes NaN in 4 GDN layers):
- xllm/layers/npu_torch/qwen3_gated_delta_net_base.cpp
fp32 state accumulation, proper recurrent update
Complete FusedMoE pipeline reference:
- xllm/layers/ilu/fused_moe.cpp
gate -> topk -> expand -> gemm1 -> act -> gemm2 -> combine
2026-08-10 02:48:17 +00:00
|
|
|
|
ref(upstream): FULL TREE — Deep-Spark xllm (1470) + ds_vllm csrc/models (703)
Replaces cherry-picked upstream_ref with complete source trees.
xllm/ — Iluvatar official C++ inference engine (15MB, 1470 files)
Complete: kernels → layers → models → runtime → scheduler → api
Excluded: .git, binary images, third_party submodule checkouts
ds_vllm/ — Iluvatar official vllm fork (8MB, 703 files)
Included: csrc/ (ALL CUDA kernels), fused_moe/, qwen3_5 model, _custom_ops
Excluded: tests, benchmarks, docs, examples (not needed for reference)
Critical call chains now fully traceable:
MoE: moe_topk_softmax_kernels.cuh → ixformer.h → fused_moe.cpp → layer
GDN: qwen3_gated_delta_net_base.cpp → qwen3_5_gated_delta_net.cpp
Attention: ixformer.h → xllm_paged_attention → attention.cpp
2026-08-10 02:53:54 +00:00
|
|
|
#ifdef XLLM_CAPI_WEAK
|
|
|
|
|
#define XLLM_CAPI_EXPORT \
|
|
|
|
|
__attribute__((visibility("default"))) __attribute((weak))
|
|
|
|
|
#else
|
|
|
|
|
#define XLLM_CAPI_EXPORT __attribute__((visibility("default")))
|
|
|
|
|
#endif // XLLM_CAPI_WEAK
|
ref(upstream): add Deep-Spark xllm + vllm MoE/GDN reference code
Sources (Apache 2.0, cloned 2026-08-09):
- Deep-Spark/xllm: Iluvatar's official C++ inference engine
- Deep-Spark/vllm: Iluvatar's vllm fork
Key files for our EX Engine development:
MoE topk_softmax (fixes 2304 calls/token PyTorch fallback):
- xllm/kernels/cuda/moe/moe_topk_softmax_kernels.cuh
CUB-based fused softmax+topk, power-of-2 expert count optimized
For 64 experts: topk_gating_softmax<T,VPT=2,64,WARPS=4,BYTES=4>
- xllm/kernels/ilu/ixformer.h
Official ixformer C++ API: topk_softmax(), paged_attention(), etc.
- xllm/kernels/ilu/fused_moe.cpp
How xllm calls ixformer::infer::topk_softmax()
- ds_vllm/csrc/moe/topk_softmax_kernels.cu
vllm-native topk_softmax (TensorRT-LLM derived, 874 lines)
GatedDeltaNet (fixes NaN in 4 GDN layers):
- xllm/layers/npu_torch/qwen3_gated_delta_net_base.cpp
fp32 state accumulation, proper recurrent update
Complete FusedMoE pipeline reference:
- xllm/layers/ilu/fused_moe.cpp
gate -> topk -> expand -> gemm1 -> act -> gemm2 -> combine
2026-08-10 02:48:17 +00:00
|
|
|
|
ref(upstream): FULL TREE — Deep-Spark xllm (1470) + ds_vllm csrc/models (703)
Replaces cherry-picked upstream_ref with complete source trees.
xllm/ — Iluvatar official C++ inference engine (15MB, 1470 files)
Complete: kernels → layers → models → runtime → scheduler → api
Excluded: .git, binary images, third_party submodule checkouts
ds_vllm/ — Iluvatar official vllm fork (8MB, 703 files)
Included: csrc/ (ALL CUDA kernels), fused_moe/, qwen3_5 model, _custom_ops
Excluded: tests, benchmarks, docs, examples (not needed for reference)
Critical call chains now fully traceable:
MoE: moe_topk_softmax_kernels.cuh → ixformer.h → fused_moe.cpp → layer
GDN: qwen3_gated_delta_net_base.cpp → qwen3_5_gated_delta_net.cpp
Attention: ixformer.h → xllm_paged_attention → attention.cpp
2026-08-10 02:53:54 +00:00
|
|
|
} // namespace xllm
|