char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
b114b4739
char/aliceai-t5-moe
1#pragma once 2 3#include <cstddef> 4#include <cstdint> 5#include <memory> 6 7struct socket_t ; 8typedef std ::shared_ptr < socket_t > socket_ptr ; 9 10static constexprsize_t MAX_CHUNK_SIZE = 1024ull * 1024ull * 1024ull ;// 1 GiB 11static constexprsize_t RPC_CONN_CAPS_SIZE = 24 ; 12 13struct socket_t { 14 ~socket_t (); 15 16bool send_data (const void * data ,size_t size ); 17bool recv_data (void * data ,size_t size ); 18// Must be called at every message boundary: the RDMA transport coalesces 19// writes into fixed-size frames and posts the trailing partial frame only 20// here. No-op on TCP. 21bool flush (); 22 23socket_ptr accept (); 24 25void get_caps (uint8_t * local_caps ); 26void update_caps (const uint8_t * remote_caps ); 27 28static socket_ptr create_server (const char * host ,int port ); 29static socket_ptr connect (const char * host ,int port ); 30 31private : 32struct impl ; 33explicit socket_t ( std ::unique_ptr < impl > p); 34std ::unique_ptr < impl > pimpl; 35}; 36 37bool rpc_transport_init (); 38void rpc_transport_shutdown ();