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
49 lines
2.4 KiB
C++
49 lines
2.4 KiB
C++
#pragma once
|
|
|
|
#include <torch/all.h>
|
|
|
|
torch::Tensor LLMM1(at::Tensor& in_a, at::Tensor& in_b,
|
|
const int64_t rows_per_block);
|
|
|
|
torch::Tensor wvSplitK(const at::Tensor& in_a, const at::Tensor& in_b,
|
|
const std::optional<at::Tensor>& in_bias,
|
|
const int64_t CuCount);
|
|
|
|
torch::Tensor wvSplitKrc(const at::Tensor& in_a, const at::Tensor& in_b,
|
|
const std::optional<at::Tensor>& in_bias,
|
|
const int64_t CuCount);
|
|
|
|
void wvSplitKQ(const at::Tensor& in_a, const at::Tensor& in_b,
|
|
const std::optional<at::Tensor>& in_bias, at::Tensor& out_c,
|
|
const at::Tensor& scale_a, const at::Tensor& scale_b,
|
|
const int64_t CuCount);
|
|
|
|
torch::Tensor gptq_gemm_rdna3(torch::Tensor a, torch::Tensor b_q_weight,
|
|
torch::Tensor b_qzeros, torch::Tensor b_scales,
|
|
torch::Tensor b_g_idx, bool use_v2_format);
|
|
|
|
torch::Tensor gptq_gemm_rdna3_wmma(torch::Tensor a, torch::Tensor b_q_weight,
|
|
torch::Tensor b_qzeros,
|
|
torch::Tensor b_scales,
|
|
torch::Tensor b_g_idx, bool use_v2_format);
|
|
|
|
void moe_gptq_gemm_rdna3(torch::Tensor a, torch::Tensor c,
|
|
torch::Tensor b_q_weight, torch::Tensor b_scales,
|
|
torch::Tensor b_qzeros, torch::Tensor topk_weights,
|
|
torch::Tensor sorted_token_ids,
|
|
torch::Tensor expert_ids,
|
|
torch::Tensor num_tokens_post_padded, int64_t top_k,
|
|
int64_t block_size_m, bool mul_topk_weight,
|
|
int64_t output_topk);
|
|
|
|
void paged_attention(
|
|
torch::Tensor& out, torch::Tensor& exp_sums, torch::Tensor& max_logits,
|
|
torch::Tensor& tmp_out, torch::Tensor& query, torch::Tensor& key_cache,
|
|
torch::Tensor& value_cache, int64_t num_kv_heads, double scale,
|
|
torch::Tensor& block_tables, torch::Tensor& seq_lens,
|
|
const std::optional<torch::Tensor>& query_start_loc, int64_t block_size,
|
|
int64_t max_seq_len, const std::optional<torch::Tensor>& alibi_slopes,
|
|
const std::string& kv_cache_dtype, torch::Tensor& k_scale,
|
|
torch::Tensor& v_scale, const std::optional<torch::Tensor>& fp8_out_scale,
|
|
const std::string& mfma_type);
|