Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/ggml/blob/master/src/ggml-cuda/topk-moe.cuh # ggml [Ported from github.com/ggml-org/ggml] docs : sync ggml_type enum in gguf.md (#1685) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `ggml / src / ggml-cuda / topk-moe.cuh` 33 lines ยท 1227 bytes Raw Blame History 1 #include "common.cuh" 2 #include "ggml.h" 3 4 #include 5 6 // Rows that one CUDA block handles. 7 #define TOPK_MOE_ROWS_PER_BLOCK 8 8 9 struct ggml_cuda_topk_moe_args { 10 bool sigmoid{}; 11 bool sqrt_softplus{}; 12 bool softmax{}; 13 bool delayed_softmax{}; 14 bool prob_bias{}; 15 bool norm{}; 16 bool scale{}; 17 int n_groups{}; // > 0: pick experts only from the top n_group_used expert groups 18 int n_group_used{}; 19 }; 20 21 void ggml_cuda_op_topk_moe(ggml_backend_cuda_context & ctx, 22 const ggml_tensor * logits, 23 ggml_tensor * weights, 24 ggml_tensor * ids, 25 const ggml_tensor * clamp, 26 const ggml_tensor * scale, 27 const ggml_tensor * bias, 28 const ggml_cuda_topk_moe_args & args); 29 30 bool ggml_cuda_should_use_topk_moe(const ggml_tensor * gating_op, 31 const ggml_tensor * weights, 32 const ggml_tensor * logits, 33 const ggml_tensor * ids);