char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
eafe15a5e
char/aliceai-t5-moe
1#ifndef ALLREDUCE_OPS_H 2#define ALLREDUCE_OPS_H 3 4#include <stdint.h> 5#include <stddef.h> 6#include <stdbool.h> 7 8#define HTP_ALLREDUCE_MAX_RANKS 4 9 10#ifdef __cplusplus 11extern "C" { 12#endif 13 14enum htp_allreduce_kernel_type { 15HTP_ALLREDUCE_KERNEL_UNSUPPORTED = 0 , 16HTP_ALLREDUCE_KERNEL_DMA_1D , 17HTP_ALLREDUCE_KERNEL_DMA_2D , 18}; 19 20static inline size_t htp_allreduce_vtcm_buffer_count ( 21uint32_t n_ranks , 22uint32_t n_threads , 23bool has_add , 24bool is_row_bcast 25) { 26return (size_t ) (n_ranks + 1 )* n_threads + (has_add ? (is_row_bcast ?1 :n_threads ) :0 ); 27} 28 29struct htp_allreduce_kernel_params { 30int32_t rank ; 31int32_t n_ranks ; 32int32_t n_threads ; 33int32_t block_elems ;// 1D: block_elems, 2D: block_rows 34int32_t elems_per_thread ;// 1D: nelem_per_thread, 2D: nrows_per_thread 35int32_t vtcm_size_per_thread ; 36int32_t vtcm_size ; 37int32_t kernel_type ; 38int32_t ne0 ; 39int32_t ne1 ; 40int32_t row_size_aligned ; 41int32_t rank_elem_start ; 42int32_t rank_nelem ; 43int32_t n_dsts ; 44int32_t is_row_bcast ; 45}; 46 47#ifdef __cplusplus 48} 49#endif 50 51#endif /* ALLREDUCE_OPS_H */