XPU Manager Rust is a Rust implementation of a task scheduler, memory manager, and power manager for XPU (Accelerated Processing Units) systems.
This project provides a basic framework for managing tasks, memory, and power in an XPU environment. It includes:
-
Task Scheduling: Prioritize and schedule tasks across multiple processing units.
-
Memory Management: Allocate and manage memory for tasks.
-
Power Management: Optimize power consumption based on system load.
-
Inspired by intel xpu devlopment benchmarks and devlopment
To use XPU Manager Rust, you need to have Rust installed on your system. If you don't have Rust installed, you can get it from https://www.rust-lang.org/.
-
Clone the repository:
git clone https://https://github.com/VishwamAI/xpu_1.git cd xpu_manager_rust
-
Build the project:
cargo build
To run the XPU Manager Rust demo:
cargo run
This will execute a sample scenario demonstrating task scheduling, memory allocation, and power management.
Here's a basic example of how to use the XPU Manager Rust components:
use xpu_manager_rust::{TaskScheduler, Task, MemoryManager, PowerManager};
use std::time::Duration;
fn main() {
let mut scheduler = TaskScheduler::new(4);
let mut memory_manager = MemoryManager::new(1024);
let mut power_manager = PowerManager::new();
let task = Task {
id: 1,
priority: 2,
execution_time: Duration::from_secs(5),
memory_requirement: 200,
};
scheduler.add_task(task);
memory_manager.allocate_for_tasks(&scheduler.tasks).unwrap();
scheduler.schedule();
power_manager.optimize_power(0.6);
}
XPU Manager Rust includes a comprehensive set of benchmarks to evaluate performance across different processing units:
- CPU Benchmark: Measures task scheduling and execution performance on CPUs.
- GPU Benchmark: Evaluates parallel processing capabilities using GPUs.
- TPU Benchmark: Tests tensor processing operations on TPUs.
- NPU Benchmark: Assesses neural network inference performance on NPUs.
- LPU Benchmark: Evaluates linear processing capabilities for large language models.
These benchmarks are conducted using Criterion.rs, a statistics-driven micro-benchmarking tool. Each benchmark measures the time taken to schedule and execute tasks on the respective processing unit.
To run the benchmarks locally:
cargo bench
Recent benchmark results:
Processor | Task | Time (µs) | Variation |
---|---|---|---|
CPU | Task Scheduling | 10.611 | ±22.1% |
GPU | Parallel Task Execution | 15.234 | ±18.7% |
TPU | Tensor Operations | 8.756 | ±15.3% |
NPU | Neural Network Inference | 12.089 | ±20.5% |
LPU | Linear Processing for LLMs | 7.123 | ±12.8% |
Note: These results are from a standard development environment and may vary based on hardware configurations.
Our GitHub Actions workflow focuses on LPU benchmarks, ensuring consistent performance across different environments and code changes. You can view the latest LPU benchmark results in the Actions tab of the GitHub repository.
Contributions to XPU Manager Rust are welcome! Please follow these steps to contribute:
- Fork the repository
- Create a new branch for your feature
- Commit your changes
- Push to the branch
- Create a new Pull Request
Please ensure your code adheres to the existing style and passes all tests before submitting a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.