marlin_moe_ops.h 615 B

123456789101112131415
  1. #pragma once
  2. #include <torch/all.h>
  3. #include "core/scalar_type.hpp"
  4. torch::Tensor marlin_gemm_moe(
  5. const torch::Tensor& a, const torch::Tensor& b_q_weights,
  6. const torch::Tensor& sorted_ids, const torch::Tensor& topk_weights,
  7. const torch::Tensor& topk_ids, const torch::Tensor& b_scales,
  8. const torch::Tensor& g_idx, const torch::Tensor& perm,
  9. torch::Tensor& workspace, aphrodite::ScalarTypeTorchPtr const& b_q_type,
  10. int64_t size_m, int64_t size_n, int64_t size_k, bool is_k_full,
  11. int64_t num_experts, int64_t topk, int64_t moe_block_size,
  12. bool replicate_input, bool apply_weights);