rpc : pack only RPC structs (#9959)
Some checks are pending
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/full-cuda.Dockerfile platforms:linux/amd64 tag:full-cuda]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/full-musa.Dockerfile platforms:linux/amd64 tag:full-musa]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/full.Dockerfile platforms:linux/amd64,linux/arm64 tag:full]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/llama-cli-cuda.Dockerfile platforms:linux/amd64 tag:light-cuda]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/llama-cli-intel.Dockerfile platforms:linux/amd64 tag:light-intel]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/llama-cli-musa.Dockerfile platforms:linux/amd64 tag:light-musa]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/llama-cli.Dockerfile platforms:linux/amd64,linux/arm64 tag:light]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/llama-server-cuda.Dockerfile platforms:linux/amd64 tag:server-cuda]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/llama-server-intel.Dockerfile platforms:linux/amd64 tag:server-intel]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/llama-server-musa.Dockerfile platforms:linux/amd64 tag:server-musa]) (push) Waiting to run
Publish Docker image / Push Docker image to Docker Hub (map[dockerfile:.devops/llama-server.Dockerfile platforms:linux/amd64,linux/arm64 tag:server]) (push) Waiting to run
Nix CI / nix-eval (macos-latest) (push) Waiting to run
Nix CI / nix-eval (ubuntu-latest) (push) Waiting to run
Nix CI / nix-build (macos-latest) (push) Waiting to run
Nix CI / nix-build (ubuntu-latest) (push) Waiting to run
flake8 Lint / Lint (push) Waiting to run

This commit is contained in:
Radoslav Gerganov 2024-10-21 13:35:40 +03:00 committed by GitHub
parent 55e47786e3
commit d5ebd79c76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,8 +57,9 @@ struct socket_t {
}
};
// all RPC structures must be packed
#pragma pack(push, 1)
// ggml_tensor is serialized into rpc_tensor
#pragma pack(1)
struct rpc_tensor {
uint64_t id;
uint32_t type;
@ -95,76 +96,64 @@ enum rpc_cmd {
RPC_CMD_COUNT,
};
#pragma pack(1)
struct rpc_msg_alloc_buffer_req {
uint64_t size;
};
#pragma pack(1)
struct rpc_msg_alloc_buffer_rsp {
uint64_t remote_ptr;
uint64_t remote_size;
};
#pragma pack(1)
struct rpc_msg_get_alignment_rsp {
uint64_t alignment;
};
#pragma pack(1)
struct rpc_msg_get_max_size_rsp {
uint64_t max_size;
};
#pragma pack(1)
struct rpc_msg_buffer_get_base_req {
uint64_t remote_ptr;
};
#pragma pack(1)
struct rpc_msg_buffer_get_base_rsp {
uint64_t base_ptr;
};
#pragma pack(1)
struct rpc_msg_free_buffer_req {
uint64_t remote_ptr;
};
#pragma pack(1)
struct rpc_msg_buffer_clear_req {
uint64_t remote_ptr;
uint8_t value;
};
#pragma pack(1)
struct rpc_msg_get_tensor_req {
rpc_tensor tensor;
uint64_t offset;
uint64_t size;
};
#pragma pack(1)
struct rpc_msg_copy_tensor_req {
rpc_tensor src;
rpc_tensor dst;
};
#pragma pack(1)
struct rpc_msg_copy_tensor_rsp {
uint8_t result;
};
#pragma pack(1)
struct rpc_msg_graph_compute_rsp {
uint8_t result;
};
#pragma pack(1)
struct rpc_msg_get_device_memory_rsp {
uint64_t free_mem;
uint64_t total_mem;
};
#pragma pack(pop)
// RPC data structures