[PROJECT 3 PR 2] feat: implement Hardware Discovery Service for cross-platform orchest…#228
Conversation
|
Hey, thanks for the PR. Before we merge this, a couple things worth addressing — the GPU detection on macOS currently only returns true for Apple Silicon, but Intel Macs support Metal too, so that logic is off. Similarly the nvidia-smi check on Linux/Windows is pretty rough since it misses AMD/ROCm and Intel GPUs entirely, and .is_ok() only tells you the binary exists, not that a GPU is actually usable. Also right now nothing in the codebase actually calls this module, so it would land as dead code in mofa-foundation. What's your plan for the next steps here? Curious how you're thinking about wiring this into the actual orchestrator. |
|
@BH3GEI thanks for the detailed review you've raised valid points here's how I plan to address them: 1. GPU Detection Improvements:
2. Wiring into the Orchestrator:
3. Roadmap (next PRs):
happy to discuss the design further before I start implementing |
|
Sounds good. Go ahead and fix the GPU detection issues first, then we can move forward from there. |
|
Thanks for the quick fix, looks good now. Merging. |
📋 Summary
Implement a Hardware Discovery Service within
mofa-foundationthat dynamically detects the host machine's OS, CPU architecture, and basic GPU availability. This is a prerequisite for the multi-backend dispatch logic in the General Model Orchestrator (e.g., routing to MLX on Mac or Candle on Windows).🔗 Related Issues
#221
🧠 Context
As part of the GSoC 2026 General Model Orchestrator project, the orchestrator needs to know what hardware it's running on before it can route inference to the correct backend. This PR adds a lightweight, zero-external-dependency hardware detection module that identifies the OS, CPU family (including Apple Silicon distinction), and provides basic GPU availability stubs.
🛠️ Changes
OsClassificationandCpuFamilyenums, and detect_hardware() function.🧪 How you Tested
cargo build --workspace— builds successfully with zero new warnings.cargo test -p mofa-foundation hardware— hardware test passes.cargo clippy— no warnings from changed files (only pre-existing warning inmofa-plugins).📸 Screenshots / Logs (if applicable)
🧹 Checklist
Code Quality
cargo fmtruncargo clippypasses without warningsTesting
cargo testpasses locally without any errorDocumentation
PR Hygiene
main🚀 Deployment Notes (if applicable)
None — no migrations, config changes, or env vars required.
🧩 Additional Notes for Reviewers
nvidia-smion Windows/Linux, assumes Metal on Apple Silicon macOS). This will be expanded in a future issue.std::env::constsandstd::process::Command.