|
ember.cpp 0.1.0
C++ inference engine for Llama-family and paperkiln models (CPU, CUDA, WebAssembly)
|
Distributed inference main program for TinyLlama. More...
#include <iostream>#include <string>#include <thread>#include <chrono>#include <signal.h>#include <atomic>#include "distributed_coordinator.h"#include "logger.h"
Go to the source code of this file.
Variables | |
| std::atomic< bool > | shutdown_requested {false} |
Distributed inference main program for TinyLlama.
This program provides distributed inference capabilities using MPI. It can run as either a master node (coordinating requests) or worker nodes (processing inference requests).
Usage:
* mpirun -np 4 ./tinyllama_distributed <model_path> <tokenizer_path> <role> [gpu_layers] *
Arguments: model_path: Path to the model file (.gguf) or directory (SafeTensors). tokenizer_path: Path to the tokenizer file. role: Node role - "master", "worker", or "hybrid" gpu_layers: (Optional) Number of layers to offload to GPU. Default: -1 (all layers)
Examples:
mpirun -np 4 ./tinyllama_distributed ./models/model.gguf ./models/tokenizer.model worker -1
mpirun -np 4 ./tinyllama_distributed ./models/model.gguf ./models/tokenizer.model hybrid -1
Environment Variables: TINYLLAMA_LOG_LEVEL: Set logging level (DEBUG, INFO, WARNING, ERROR)
Definition in file distributed_main.cpp.
Definition at line 173 of file distributed_main.cpp.
References Logger::DEBUG, Logger::ERROR, Logger::INFO, j, parse_role(), print_usage(), run_interactive_master(), Logger::set_level(), shutdown_requested, signal_handler(), and Logger::WARNING.
| DistributedCoordinator::NodeRole parse_role | ( | const std::string & | role_str | ) |
Definition at line 68 of file distributed_main.cpp.
References j.
Referenced by main().
Definition at line 53 of file distributed_main.cpp.
References j.
Referenced by main().
| void run_interactive_master | ( | DistributedCoordinator & | coordinator | ) |
Definition at line 80 of file distributed_main.cpp.
References j, tinyllama::DistributedCoordinator::InferenceRequest::request_id, and shutdown_requested.
Referenced by main().
Definition at line 46 of file distributed_main.cpp.
References j, and shutdown_requested.
Referenced by main().
| std::atomic<bool> shutdown_requested {false} |
Definition at line 44 of file distributed_main.cpp.
Referenced by main(), run_interactive_master(), and signal_handler().