File size: 3,654 Bytes
23ce6dc
 
dcaf68e
 
 
 
 
 
 
23ce6dc
b113f86
 
 
 
 
 
a1adbed
b113f86
 
 
 
a1adbed
d9c9c95
a1adbed
d9c9c95
a1adbed
d9c9c95
 
 
a1adbed
d9c9c95
a1adbed
 
 
d9c9c95
 
 
a1adbed
d9c9c95
a1adbed
d9c9c95
a1adbed
 
 
 
d9c9c95
d85c58e
d9c9c95
a1adbed
d9c9c95
a1adbed
 
 
 
d9c9c95
d85c58e
 
a1adbed
d9c9c95
a1adbed
d9c9c95
a1adbed
d9c9c95
 
 
 
a1adbed
d9c9c95
 
 
 
 
 
 
 
 
 
a1adbed
d9c9c95
 
a1adbed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
title: Sentinel - ROCm
license: mit
sdk: gradio
emoji: πŸš€
colorFrom: green
colorTo: gray
pinned: true
short_description: 'ROCm-Sentinel, a system designed to redefine how developers '
---
<div align="center">
  <img src="https://img.shields.io/badge/AMD-ROCm-ed1c24?style=for-the-badge&logo=amd&logoColor=white" alt="AMD ROCm" />
  <img src="https://img.shields.io/badge/AI_Agent-LangGraph-000000?style=for-the-badge&logo=openai&logoColor=white" alt="LangGraph" />
  <img src="https://img.shields.io/badge/UI-Gradio-ff7c00?style=for-the-badge" alt="Gradio" />
  
  <h1>πŸš€ ROCm-Sentinel</h1>
  <p><strong>Secure AI Agent for Automated Migration from NVIDIA CUDA to AMD ROCm (HIP)</strong></p>
</div>

---

## πŸ“– About the Project

**ROCm-Sentinel** is an AI-assisted tool designed to break vendor lock-in in hardware-accelerated software development. Using an Agentic Workflow, the application takes native NVIDIA CUDA code and automatically translates it to AMD HIP (Heterogeneous-Compute Interface for Portability), ensuring a smooth transition into the AMD ROCm ecosystem.

It acts as more than just a syntactic translator; it incorporates an autonomous **Security Auditor** that reviews the generated code for memory leaks, parallelism issues, and architecture-specific optimizations for AMD.

---

## 🎯 Goals and Vision

1. **Democratize Hardware:** Facilitate developers and companies in migrating their workloads from closed ecosystems to open and competitive platforms like AMD.
2. **Secure Migration (Zero-Leak):** Go beyond simple "find and replace". Ensure the resulting code correctly manages unified memory and threads on AMD GPUs.
3. **Interactive Workflow:** Provide a user-friendly interface where the developer acts as a supervisor (Human-in-the-Loop), guiding the agent through real-time chat.

---

## 🧠 Language Models (AI Agents)

Our multi-agent architecture (Translator + Auditor) is powered by state-of-the-art LLMs via the Fireworks AI API.

* 🟒 **Current Model in Use: `DeepSeek V3.1`**
    * The project is currently configured to run on DeepSeek V3.1, a highly capable model with exceptional logical reasoning and lightning-fast response times for interactive demonstration.
* ⭐ **Recommended Model: `Qwen2.5-Coder 32B Instruct`**
    * For production environments and complex code repositories, we **strongly recommend** switching the configuration to the Qwen 2.5 Coder model. Being trained specifically on deep programming syntax, it offers superior fidelity when translating pointers and complex C++/CUDA directives.

---

## πŸ› οΈ Technologies Used

* **Python 3** - Base language.
* **Gradio** - Interactive web interface construction.
* **LangGraph & LangChain** - Agent workflow orchestration (nodes and edges).
* **Fireworks AI** - Serverless inference provider for open-source LLM models.

---

## βš™οΈ Local Installation and Usage

Follow these steps to deploy ROCm-Sentinel on your local machine:

1. **Clone the repository:**
   ```bash
   git clone [https://github.com/MrZRo/ROCm-Sentinel.git](https://github.com/MrZRo/ROCm-Sentinel.git)
   cd ROCm-Sentinel

2. **Create and activate a virtual environment:**
  ```bash
  # En Windows
  python -m venv env
  source env/Scripts/activate
  
  # En Linux/Mac
  python3 -m venv env
  source env/bin/activate
  ```

3. **Install dependencies:**
   ```bash
   pip install -r requirements.txt
    ```

4. **Configure credentials:**
   ```bash
   FIREWORKS_API_KEY=tu_api_key_aqui
    ```

5. **Configurar las credenciales:**
   ```bash
   FIREWORKS_API_KEY=your_api_key_here
   ```

6. **Run the application:**
   ```bash
   Fpython app.py
   ```