This project demonstrates a distributed matrix calculation system using Ray framework, where matrix operations are distributed across multiple services.
-
client_a.py: Main client program that:
- Initializes Ray cluster
- Deploys B and C services
- Generates initial matrix
- Coordinates the distributed calculation
- Collects final result
-
serve_b.py: B Service that:
- Performs matrix multiplication with its fixed matrix
- Forwards result to C Service
-
serve_c.py: C Service that:
- Performs final matrix multiplication
- Returns the result to client
- Python 3.7+
- Ray 2.0+
- NumPy
- Install Python dependencies:
pip install ray numpy- Clone this repository (if applicable)
- Start the system by running:
python3 client_a.py- Expected output flow:
- Ray cluster initialization
- Services deployment
- Matrix calculation process
- Final result display
You should see logs showing:
- Ray cluster initialization
- Services deployment
- Matrix operations at each step
- Final calculated matrix result
- The system uses Ray's default ports (10001 for client, 8265 for dashboard)
- Dashboard is available at: http://127.0.0.1:8265
- For production use, modify the Ray initialization to connect to a proper cluster instead of local mode