#include "checked_float_buffer.h"#include "checked_parallel.h"#include "checked_q4_k_activation.h"#include "packed_q8_dot_ordered.h"#include "packed_k_dot_ordered.h"#include "packed_iq2_xs_dot.h"#include "packed_iq2_s_dot.h"#include "packed_iq3_xxs_dot.h"#include "packed_iq3_s_dot.h"#include "packed_q3_k_dot.h"#include "packed_q8_activation_checked.h"#include "ckernel_transformer_rows_checked.h"#include <string.h>#include <stdatomic.h>Go to the source code of this file.
Macros | |
| #define | EXPERT_ARGS |
| #define | IQ4_NL_BLOCK_BYTES 18 |
| #define | IQ4_NL_ROUTED_PROVIDER(name, gate_storage, dot) |
| #define | ROUTED_EXPERT_ARGS EXPERT_ARGS, float gate_cap, float up_cap |
| #define | ROUTED_EXPERT_FORWARD(storage, down_storage, down_bytes, quantize, reference_moe, packed_k) |
| #define | SCALED_NVFP4_ROUTED_PROVIDER(name, gate_storage, dot, packer, q8_0) |
Enumerations | |
| enum | expert_storage { EXPERT_F32 , EXPERT_Q8_0 , EXPERT_IQ4_NL , EXPERT_Q4_K , EXPERT_Q5_0 , EXPERT_IQ2_XS , EXPERT_IQ2_S , EXPERT_IQ3_XXS , EXPERT_IQ3_S , EXPERT_Q3_K , EXPERT_NVFP4 , EXPERT_Q5_1 } |
Functions | |
| static size_t | collect_expert_pair_jobs (const struct routed_work *work, struct expert_pair_job *jobs) |
| static int | combine_expert (const float *expert, float *mixture, size_t width, float weight, size_t index, int reference) |
| static int | contains_overlap (const void *p, size_t pn, const void *q, size_t qn) |
| static float | expert_dot (const float *input, const unsigned char *weight, size_t width, enum expert_storage storage, const unsigned char *activation) |
| static unsigned char * | expert_packed_activation (const struct routed_projection *p, float *scratch) |
| static int | finish_expert (const struct routed_projection *p, size_t slot, float *scratch, float *output) |
| void | gemv_q5_0_q8_0_checked_cpu (float *, const void *, const void *, int, int) |
| void | gemv_q5_0_q8_0_pair_checked_cpu (float *, float *, const void *, const void *, const void *, int, int) |
| static unsigned char * | hidden_workspace (const struct routed_projection *p, float *scratch) |
| static void | iq2_s_expert_matvec (float *out, const void *weight, const void *input, int rows, int width) |
| static void | iq2_xs_expert_matvec (float *out, const void *weight, const void *input, int rows, int width) |
| static void | iq3_s_expert_matvec (float *out, const void *weight, const void *input, int rows, int width) |
| static void | iq3_xxs_expert_matvec (float *out, const void *weight, const void *input, int rows, int width) |
| static void | iq4_nl_expert_matvec (float *out, const void *weight, const void *input, int rows, int width) |
| static void | mix_grouped_rows (size_t begin, size_t end, void *data) |
| static void | nvfp4_expert_matvec (float *out, const void *weight, const void *input, int rows, int width) |
| static void | order_slots (const int32_t *ids, size_t experts, size_t top_k, size_t *ordered_slots) |
| static void | pack_grouped_rows (size_t begin, size_t end, void *data) |
| static int | pack_hidden (const struct routed_projection *p, const float *input, unsigned char *packed) |
| static size_t | packed_block_bytes (enum expert_storage storage) |
| static size_t | packed_block_elements (enum expert_storage storage) |
| static int | prepare_expert_activation (const struct routed_projection *p, float *scratch, unsigned char *packed_activation) |
| static int | project_expert (const struct routed_projection *p, const float *input, const unsigned char *packed_hidden, size_t slot, float *scratch, float *output) |
| static int | project_expert_pair (const struct routed_projection *p, size_t slot, const unsigned char *x0, const unsigned char *x1, float *work0, float *work1, float *out0, float *out1) |
| static void | project_expert_pair_jobs (size_t begin, size_t end, void *opaque) |
| static void | project_grouped_experts (size_t begin, size_t end, void *opaque) |
| static void | project_routes (size_t begin, size_t end, void *data) |
| static void | project_rows (size_t begin, size_t end, void *data) |
| static void | q3_k_expert_matvec (float *out, const void *weight, const void *input, int rows, int width) |
| static int | region (const void *p, size_t bytes) |
| static int | routed_softcapped_experts (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes, enum expert_storage storage, enum expert_storage down_storage, int quantize, int reference_moe, const struct packed_k_expert_ops *packed_k, int uncapped, const float *gate_up_scales, const float *down_scales, size_t scale_elements) |
| int | routed_softcapped_experts_checked_f32 (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap) |
| int | routed_softcapped_experts_checked_iq2_s_nvfp4_scaled (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes, const float *gate_up_scales, const float *down_scales, size_t scale_elements) |
| int | routed_softcapped_experts_checked_iq2_xs_nvfp4_scaled (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes, const float *gate_up_scales, const float *down_scales, size_t scale_elements) |
| int | routed_softcapped_experts_checked_iq3_s_iq4_nl (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_iq3_xxs_iq4_nl (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_iq3_xxs_nvfp4_scaled (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes, const float *gate_up_scales, const float *down_scales, size_t scale_elements) |
| int | routed_softcapped_experts_checked_iq4_nl (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap) |
| int | routed_softcapped_experts_checked_nvfp4_nvfp4_scaled (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes, const float *gate_up_scales, const float *down_scales, size_t scale_elements) |
| int | routed_softcapped_experts_checked_q3_k_nvfp4_scaled (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes, const float *gate_up_scales, const float *down_scales, size_t scale_elements) |
| int | routed_softcapped_experts_checked_q4_k_q5_0 (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q5_0_grouped (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q5_0_grouped_pair (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q5_0_pair_jobs (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden_q8_0_down (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q8_0 (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q8_0_grouped (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q8_0_grouped_pair (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q8_0_pair_jobs (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden_q8_0_down (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap, size_t down_matrix_bytes) |
| int | routed_softcapped_experts_checked_q8_0 (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap) |
| int | routed_softcapped_experts_checked_q8_0_q8_activation (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap) |
| int | routed_softcapped_experts_checked_q8_0_q8_activation_scaled_situ (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, float gate_cap, float up_cap) |
| int | routed_swiglu_experts_checked_f32 (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements) |
| int | routed_swiglu_experts_checked_q3_k_q5_1 (const float *hidden, const int32_t *ids, const float *route_weights, const int32_t *expert_slots, const void *gate, const void *up, const void *down, float *expert_output, float *output, float *work, size_t rows, size_t hidden_dim, size_t inner, size_t experts, size_t slots, size_t top_k, size_t matrix_bytes, size_t hidden_elements, size_t id_elements, size_t route_elements, size_t expert_slot_elements, size_t expert_output_elements, size_t output_capacity, size_t work_elements, size_t down_matrix_bytes) |
Variables | |
| static const int8_t | iq4_nl_values [16] |
| static const struct packed_k_expert_ops | q4_grouped |
| static const struct packed_k_expert_ops | q4_grouped_pairs |
| static const struct packed_k_expert_ops | q4_hidden |
| static const struct packed_k_expert_ops | q4_hidden_and_down |
| static const struct packed_k_expert_ops | q4_pair_jobs |
| #define EXPERT_ARGS |
Definition at line 117 of file routed_softcapped_experts_checked.c.
Referenced by routed_swiglu_experts_checked_f32(), and routed_swiglu_experts_checked_q3_k_q5_1().
| #define IQ4_NL_BLOCK_BYTES 18 |
Definition at line 32 of file routed_softcapped_experts_checked.c.
Referenced by iq4_nl_expert_matvec(), and packed_block_bytes().
| #define IQ4_NL_ROUTED_PROVIDER | ( | name, | |
| gate_storage, | |||
| dot ) |
Definition at line 880 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts_checked_iq3_xxs_iq4_nl().
| #define ROUTED_EXPERT_ARGS EXPERT_ARGS, float gate_cap, float up_cap |
Definition at line 126 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts(), routed_softcapped_experts_checked_f32(), routed_softcapped_experts_checked_iq4_nl(), routed_softcapped_experts_checked_q4_k_q5_0(), routed_softcapped_experts_checked_q4_k_q5_0_grouped(), routed_softcapped_experts_checked_q4_k_q5_0_grouped_pair(), routed_softcapped_experts_checked_q4_k_q5_0_pair_jobs(), routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden(), routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden_q8_0_down(), routed_softcapped_experts_checked_q4_k_q8_0(), routed_softcapped_experts_checked_q4_k_q8_0_grouped(), routed_softcapped_experts_checked_q4_k_q8_0_grouped_pair(), routed_softcapped_experts_checked_q4_k_q8_0_pair_jobs(), routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden(), routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden_q8_0_down(), routed_softcapped_experts_checked_q8_0(), routed_softcapped_experts_checked_q8_0_q8_activation(), and routed_softcapped_experts_checked_q8_0_q8_activation_scaled_situ().
| #define ROUTED_EXPERT_FORWARD | ( | storage, | |
| down_storage, | |||
| down_bytes, | |||
| quantize, | |||
| reference_moe, | |||
| packed_k ) |
Definition at line 677 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts_checked_f32(), routed_softcapped_experts_checked_iq4_nl(), routed_softcapped_experts_checked_q4_k_q5_0(), routed_softcapped_experts_checked_q4_k_q5_0_grouped(), routed_softcapped_experts_checked_q4_k_q5_0_grouped_pair(), routed_softcapped_experts_checked_q4_k_q5_0_pair_jobs(), routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden(), routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden_q8_0_down(), routed_softcapped_experts_checked_q4_k_q8_0(), routed_softcapped_experts_checked_q4_k_q8_0_grouped(), routed_softcapped_experts_checked_q4_k_q8_0_grouped_pair(), routed_softcapped_experts_checked_q4_k_q8_0_pair_jobs(), routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden(), routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden_q8_0_down(), routed_softcapped_experts_checked_q8_0(), routed_softcapped_experts_checked_q8_0_q8_activation(), and routed_softcapped_experts_checked_q8_0_q8_activation_scaled_situ().
| #define SCALED_NVFP4_ROUTED_PROVIDER | ( | name, | |
| gate_storage, | |||
| dot, | |||
| packer, | |||
| q8_0 ) |
Definition at line 854 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts_checked_iq2_s_nvfp4_scaled(), routed_softcapped_experts_checked_iq2_xs_nvfp4_scaled(), routed_softcapped_experts_checked_iq3_xxs_nvfp4_scaled(), and routed_softcapped_experts_checked_nvfp4_nvfp4_scaled().
| enum expert_storage |
| Enumerator | |
|---|---|
| EXPERT_F32 | |
| EXPERT_Q8_0 | |
| EXPERT_IQ4_NL | |
| EXPERT_Q4_K | |
| EXPERT_Q5_0 | |
| EXPERT_IQ2_XS | |
| EXPERT_IQ2_S | |
| EXPERT_IQ3_XXS | |
| EXPERT_IQ3_S | |
| EXPERT_Q3_K | |
| EXPERT_NVFP4 | |
| EXPERT_Q5_1 | |
Definition at line 17 of file routed_softcapped_experts_checked.c.
|
static |
Definition at line 473 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts().
|
inlinestatic |
Definition at line 295 of file routed_softcapped_experts_checked.c.
Referenced by mix_grouped_rows(), project_rows(), and routed_softcapped_experts().
|
static |
Definition at line 107 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts().
|
static |
Definition at line 76 of file routed_softcapped_experts_checked.c.
References ck_fp16_to_fp32_soft(), ck_packed_q3_k_dot_ordered(), ck_packed_q4_k_dot_ordered(), ck_packed_q5_0_dot_ordered(), ck_packed_q5_1_dot_ordered(), ck_packed_q8_dot_ordered(), ck_q8_activation_dot(), EXPERT_F32, EXPERT_Q3_K, EXPERT_Q4_K, EXPERT_Q5_0, EXPERT_Q5_1, EXPERT_Q8_0, iq4_nl_values, packed_block_bytes(), and QK8_0.
Referenced by finish_expert(), and project_expert().
|
static |
Definition at line 191 of file routed_softcapped_experts_checked.c.
Referenced by finish_expert(), and project_expert_pair().
|
static |
Definition at line 221 of file routed_softcapped_experts_checked.c.
References ck_checked_finite(), expert_dot(), expert_packed_activation(), EXPERT_Q5_0, prepare_expert_activation(), and slot().
Referenced by project_expert(), and project_expert_pair().
| void gemv_q5_0_q8_0_checked_cpu | ( | float * | out, |
| const void * | weights, | ||
| const void * | input, | ||
| int | rows, | ||
| int | width ) |
Definition at line 1770 of file gemm_kernels_q5_0.c.
References dot(), QK5_0, and vec_dot_q5_0_q8_0_ref().
Referenced by gemv_q5_0_q8_0_pair_checked_cpu().
| void gemv_q5_0_q8_0_pair_checked_cpu | ( | float * | out0, |
| float * | out1, | ||
| const void * | weights, | ||
| const void * | x0, | ||
| const void * | x1, | ||
| int | rows, | ||
| int | width ) |
Definition at line 1803 of file gemm_kernels_q5_0.c.
References gemv_q5_0_q8_0_checked_cpu(), and QK5_0.
|
static |
Definition at line 339 of file routed_softcapped_experts_checked.c.
Referenced by project_routes(), project_rows(), and routed_softcapped_experts().
|
static |
Definition at line 801 of file routed_softcapped_experts_checked.c.
References ck_dot_iq2_s_q8_k(), and QK_K.
Referenced by routed_softcapped_experts_checked_iq2_s_nvfp4_scaled().
|
static |
Definition at line 788 of file routed_softcapped_experts_checked.c.
References ck_dot_iq2_xs_q8_k(), and QK_K.
Referenced by routed_softcapped_experts_checked_iq2_xs_nvfp4_scaled().
|
static |
Definition at line 817 of file routed_softcapped_experts_checked.c.
References ck_dot_iq3_s_q8_k(), and QK_K.
Referenced by routed_softcapped_experts_checked_iq3_s_iq4_nl().
|
static |
Definition at line 809 of file routed_softcapped_experts_checked.c.
References ck_dot_iq3_xxs_q8_k(), and QK_K.
Referenced by routed_softcapped_experts_checked_iq3_xxs_iq4_nl(), and routed_softcapped_experts_checked_iq3_xxs_nvfp4_scaled().
|
static |
Definition at line 833 of file routed_softcapped_experts_checked.c.
References CK_FP16_TO_FP32, ck_fp16_to_fp32_soft(), dot(), IQ4_NL_BLOCK_BYTES, iq4_nl_values, QK8_0, and block_q8_0::qs.
|
static |
Definition at line 364 of file routed_softcapped_experts_checked.c.
References combine_expert(), end, and order_slots().
Referenced by routed_softcapped_experts().
|
static |
Definition at line 796 of file routed_softcapped_experts_checked.c.
References gemv_nvfp4_q8_0().
Referenced by routed_softcapped_experts_checked_nvfp4_nvfp4_scaled().
|
static |
Definition at line 310 of file routed_softcapped_experts_checked.c.
References id, ids, and slot().
Referenced by mix_grouped_rows(), project_rows(), and routed_softcapped_experts().
|
static |
Definition at line 351 of file routed_softcapped_experts_checked.c.
References end, and pack_hidden().
Referenced by routed_softcapped_experts().
|
static |
Definition at line 344 of file routed_softcapped_experts_checked.c.
References ck_pack_q8_activation_rne().
Referenced by pack_grouped_rows(), project_rows(), and routed_softcapped_experts().
|
static |
Definition at line 39 of file routed_softcapped_experts_checked.c.
References EXPERT_IQ2_S, EXPERT_IQ2_XS, EXPERT_IQ3_S, EXPERT_IQ3_XXS, EXPERT_IQ4_NL, EXPERT_NVFP4, EXPERT_Q3_K, EXPERT_Q4_K, EXPERT_Q5_0, EXPERT_Q5_1, EXPERT_Q8_0, and IQ4_NL_BLOCK_BYTES.
Referenced by expert_dot(), and routed_softcapped_experts().
|
static |
Definition at line 57 of file routed_softcapped_experts_checked.c.
References EXPERT_F32, EXPERT_IQ2_S, EXPERT_IQ2_XS, EXPERT_IQ3_S, EXPERT_IQ3_XXS, EXPERT_NVFP4, EXPERT_Q3_K, EXPERT_Q4_K, EXPERT_Q5_0, EXPERT_Q5_1, QK5_0, QK5_1, QK8_0, QK_K, and QK_NVFP4.
Referenced by routed_softcapped_experts().
|
static |
Definition at line 199 of file routed_softcapped_experts_checked.c.
References ck_pack_q8_activation_rne(), silu_mul_rows_checked_f32(), and softcapped_swiglu_rows_checked_f32().
Referenced by finish_expert(), and project_expert_pair().
|
static |
Definition at line 244 of file routed_softcapped_experts_checked.c.
References ck_q8_activation_dot_pair(), expert_dot(), finish_expert(), and slot().
Referenced by project_expert_pair_jobs(), project_grouped_experts(), project_routes(), and project_rows().
|
static |
Definition at line 274 of file routed_softcapped_experts_checked.c.
References ck_checked_finite(), expert_packed_activation(), EXPERT_Q5_0, finish_expert(), prepare_expert_activation(), and slot().
Referenced by project_expert_pair_jobs(), and project_grouped_experts().
|
static |
Definition at line 492 of file routed_softcapped_experts_checked.c.
References ck_threadpool_thread_id(), end, project_expert(), project_expert_pair(), and slot().
Referenced by routed_softcapped_experts().
|
static |
Definition at line 428 of file routed_softcapped_experts_checked.c.
References end, id, project_expert(), and project_expert_pair().
Referenced by routed_softcapped_experts().
|
static |
Definition at line 384 of file routed_softcapped_experts_checked.c.
References end, hidden_workspace(), and project_expert().
Referenced by routed_softcapped_experts().
|
static |
Definition at line 399 of file routed_softcapped_experts_checked.c.
References combine_expert(), end, hidden_workspace(), order_slots(), pack_hidden(), and project_expert().
Referenced by routed_softcapped_experts().
|
static |
Definition at line 825 of file routed_softcapped_experts_checked.c.
References ck_dot_q3_k_q8_k(), and QK_K.
Referenced by routed_softcapped_experts_checked_q3_k_nvfp4_scaled().
|
static |
Definition at line 112 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts().
|
static |
Definition at line 517 of file routed_softcapped_experts_checked.c.
References buffers(), CHECKED_ROUTED_EXPERT_MAX_ROWS, ck_checked_finite(), ck_checked_parallel_for(), ck_checked_region(), ck_threadpool_global(), CK_THREADPOOL_MAX_THREADS, collect_expert_pair_jobs(), combine_expert(), contains_overlap(), count, EXPERT_Q5_0, hidden_workspace(), id, ids, mix_grouped_rows(), order_slots(), pack_grouped_rows(), pack_hidden(), packed_block_bytes(), packed_block_elements(), project_expert_pair_jobs(), project_grouped_experts(), project_routes(), project_rows(), QK8_0, QK_K, region(), ROUTED_EXPERT_ARGS, and slot().
Referenced by routed_swiglu_experts_checked_f32(), and routed_swiglu_experts_checked_q3_k_q5_1().
| int routed_softcapped_experts_checked_f32 | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap ) |
Definition at line 684 of file routed_softcapped_experts_checked.c.
References EXPERT_F32, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_iq2_s_nvfp4_scaled | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes, | ||
| const float * | gate_up_scales, | ||
| const float * | down_scales, | ||
| size_t | scale_elements ) |
Definition at line 872 of file routed_softcapped_experts_checked.c.
References ck_pack_q4_input_q8_k(), EXPERT_IQ2_S, iq2_s_expert_matvec(), routed_softcapped_experts_checked_iq3_xxs_nvfp4_scaled(), and SCALED_NVFP4_ROUTED_PROVIDER.
Referenced by routed_softcapped_experts_checked_iq2_xs_nvfp4_scaled().
| int routed_softcapped_experts_checked_iq2_xs_nvfp4_scaled | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes, | ||
| const float * | gate_up_scales, | ||
| const float * | down_scales, | ||
| size_t | scale_elements ) |
Definition at line 870 of file routed_softcapped_experts_checked.c.
References ck_pack_q4_input_q8_k(), EXPERT_IQ2_XS, iq2_xs_expert_matvec(), routed_softcapped_experts_checked_iq2_s_nvfp4_scaled(), and SCALED_NVFP4_ROUTED_PROVIDER.
| int routed_softcapped_experts_checked_iq3_s_iq4_nl | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 893 of file routed_softcapped_experts_checked.c.
References EXPERT_IQ3_S, iq3_s_expert_matvec(), and routed_softcapped_experts_checked_iq3_s_iq4_nl().
Referenced by routed_softcapped_experts_checked_iq3_s_iq4_nl().
| int routed_softcapped_experts_checked_iq3_xxs_iq4_nl | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 894 of file routed_softcapped_experts_checked.c.
References EXPERT_IQ3_XXS, iq3_xxs_expert_matvec(), IQ4_NL_ROUTED_PROVIDER, and routed_softcapped_experts_checked_iq3_xxs_iq4_nl().
Referenced by routed_softcapped_experts_checked_iq3_xxs_iq4_nl().
| int routed_softcapped_experts_checked_iq3_xxs_nvfp4_scaled | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes, | ||
| const float * | gate_up_scales, | ||
| const float * | down_scales, | ||
| size_t | scale_elements ) |
Definition at line 874 of file routed_softcapped_experts_checked.c.
References ck_pack_q4_input_q8_k(), EXPERT_IQ3_XXS, iq3_xxs_expert_matvec(), routed_softcapped_experts_checked_nvfp4_nvfp4_scaled(), and SCALED_NVFP4_ROUTED_PROVIDER.
Referenced by routed_softcapped_experts_checked_iq2_s_nvfp4_scaled().
| int routed_softcapped_experts_checked_iq4_nl | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap ) |
Definition at line 711 of file routed_softcapped_experts_checked.c.
References EXPERT_IQ4_NL, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_nvfp4_nvfp4_scaled | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes, | ||
| const float * | gate_up_scales, | ||
| const float * | down_scales, | ||
| size_t | scale_elements ) |
Definition at line 876 of file routed_softcapped_experts_checked.c.
References ck_pack_q8_activation_rne(), EXPERT_NVFP4, nvfp4_expert_matvec(), routed_softcapped_experts_checked_q3_k_nvfp4_scaled(), and SCALED_NVFP4_ROUTED_PROVIDER.
Referenced by routed_softcapped_experts_checked_iq3_xxs_nvfp4_scaled().
| int routed_softcapped_experts_checked_q3_k_nvfp4_scaled | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes, | ||
| const float * | gate_up_scales, | ||
| const float * | down_scales, | ||
| size_t | scale_elements ) |
Definition at line 878 of file routed_softcapped_experts_checked.c.
References ck_pack_q4_input_q8_k(), EXPERT_Q3_K, and q3_k_expert_matvec().
Referenced by routed_softcapped_experts_checked_nvfp4_nvfp4_scaled().
| int routed_softcapped_experts_checked_q4_k_q5_0 | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 728 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q5_0, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q5_0_grouped | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 758 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q5_0, q4_grouped, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q5_0_grouped_pair | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 768 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q5_0, q4_grouped_pairs, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q5_0_pair_jobs | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 778 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q5_0, q4_pair_jobs, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 738 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q5_0, q4_hidden, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden_q8_0_down | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 748 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q5_0, q4_hidden_and_down, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q8_0 | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 733 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q8_0, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q8_0_grouped | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 763 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q8_0, q4_grouped, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q8_0_grouped_pair | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 773 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q8_0, q4_grouped_pairs, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q8_0_pair_jobs | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 783 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q8_0, q4_pair_jobs, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 743 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q8_0, q4_hidden, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden_q8_0_down | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap, | ||
| size_t | down_matrix_bytes ) |
Definition at line 753 of file routed_softcapped_experts_checked.c.
References EXPERT_Q4_K, EXPERT_Q8_0, q4_hidden_and_down, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q8_0 | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap ) |
Definition at line 706 of file routed_softcapped_experts_checked.c.
References EXPERT_Q8_0, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q8_0_q8_activation | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap ) |
Definition at line 717 of file routed_softcapped_experts_checked.c.
References EXPERT_Q8_0, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_softcapped_experts_checked_q8_0_q8_activation_scaled_situ | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| float | gate_cap, | ||
| float | up_cap ) |
Definition at line 722 of file routed_softcapped_experts_checked.c.
References EXPERT_Q8_0, ROUTED_EXPERT_ARGS, and ROUTED_EXPERT_FORWARD.
| int routed_swiglu_experts_checked_f32 | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements ) |
Definition at line 689 of file routed_softcapped_experts_checked.c.
References EXPERT_ARGS, EXPERT_F32, ids, and routed_softcapped_experts().
| int routed_swiglu_experts_checked_q3_k_q5_1 | ( | const float * | hidden, |
| const int32_t * | ids, | ||
| const float * | route_weights, | ||
| const int32_t * | expert_slots, | ||
| const void * | gate, | ||
| const void * | up, | ||
| const void * | down, | ||
| float * | expert_output, | ||
| float * | output, | ||
| float * | work, | ||
| size_t | rows, | ||
| size_t | hidden_dim, | ||
| size_t | inner, | ||
| size_t | experts, | ||
| size_t | slots, | ||
| size_t | top_k, | ||
| size_t | matrix_bytes, | ||
| size_t | hidden_elements, | ||
| size_t | id_elements, | ||
| size_t | route_elements, | ||
| size_t | expert_slot_elements, | ||
| size_t | expert_output_elements, | ||
| size_t | output_capacity, | ||
| size_t | work_elements, | ||
| size_t | down_matrix_bytes ) |
Definition at line 697 of file routed_softcapped_experts_checked.c.
References EXPERT_ARGS, EXPERT_Q3_K, EXPERT_Q5_1, ids, and routed_softcapped_experts().
|
static |
Definition at line 35 of file routed_softcapped_experts_checked.c.
Referenced by expert_dot(), and iq4_nl_expert_matvec().
|
static |
Definition at line 154 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts_checked_q4_k_q5_0_grouped(), and routed_softcapped_experts_checked_q4_k_q8_0_grouped().
|
static |
Definition at line 161 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts_checked_q4_k_q5_0_grouped_pair(), and routed_softcapped_experts_checked_q4_k_q8_0_grouped_pair().
|
static |
Definition at line 141 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden(), and routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden().
|
static |
Definition at line 148 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts_checked_q4_k_q5_0_q8_k_hidden_q8_0_down(), and routed_softcapped_experts_checked_q4_k_q8_0_q8_k_hidden_q8_0_down().
|
static |
Definition at line 170 of file routed_softcapped_experts_checked.c.
Referenced by routed_softcapped_experts_checked_q4_k_q5_0_pair_jobs(), and routed_softcapped_experts_checked_q4_k_q8_0_pair_jobs().