{"id":31750568,"url":"https://github.com/dino65-dev/cuda_ml_library","last_synced_at":"2025-10-09T15:53:32.357Z","repository":{"id":309863610,"uuid":"1037788586","full_name":"dino65-dev/Cuda_ML_Library","owner":"dino65-dev","description":"This is a Cuda applied ML Library so that anyone can use GPU Powered ML with Ease in Python.","archived":false,"fork":false,"pushed_at":"2025-09-09T08:38:44.000Z","size":142,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-09T11:01:50.907Z","etag":null,"topics":["aritificial-intelligence","cuda-kernels","cuda-programming","gpu-computing","gpu-programming","machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Cuda","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dino65-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-14T05:59:07.000Z","updated_at":"2025-09-09T08:35:38.000Z","dependencies_parsed_at":"2025-08-14T08:43:03.391Z","dependency_job_id":"4467e5f6-34bd-4437-871b-d905e3fac418","html_url":"https://github.com/dino65-dev/Cuda_ML_Library","commit_stats":null,"previous_names":["dino65-dev/cuda-ml-library","dino65-dev/cuda_ml_library"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dino65-dev/Cuda_ML_Library","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dino65-dev%2FCuda_ML_Library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dino65-dev%2FCuda_ML_Library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dino65-dev%2FCuda_ML_Library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dino65-dev%2FCuda_ML_Library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dino65-dev","download_url":"https://codeload.github.com/dino65-dev/Cuda_ML_Library/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dino65-dev%2FCuda_ML_Library/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001640,"owners_count":26083147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aritificial-intelligence","cuda-kernels","cuda-programming","gpu-computing","gpu-programming","machine-learning"],"created_at":"2025-10-09T15:53:27.920Z","updated_at":"2025-10-09T15:53:32.350Z","avatar_url":"https://github.com/dino65-dev.png","language":"Cuda","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUDA ML Library\n\nA high-performance CUDA-accelerated Machine Learning library with automatic CPU fallback support, featuring optimized Support Vector Machine implementations for both classification and regression tasks.\n\n## 🚀 Features\n\n- **GPU Acceleration**: Full CUDA support for NVIDIA GPUs with Compute Capability 6.0+\n- **Automatic CPU Fallback**: Seamless fallback to optimized CPU implementation when CUDA is unavailable\n- **Cross-Platform Compatibility**: Linux, Windows, and macOS support\n- **Multiple SVM Types**: Classification (C-SVC, Nu-SVC) and Regression (Epsilon-SVR, Nu-SVR)\n- **Multiple Kernel Functions**: Linear, RBF, Polynomial, and Sigmoid kernels\n- **Advanced Algorithms**: SMO (Sequential Minimal Optimization) algorithm implementation\n- **Memory Optimization**: Efficient GPU memory management with pooling\n- **Easy Integration**: Scikit-learn compatible API\n\n## 📋 System Requirements\n\n### Hardware Requirements\n- **GPU (Optional)**: NVIDIA GPU with CUDA Compute Capability 6.0+ (RTX 20 series, GTX 1050Ti+, Tesla V100+)\n- **CPU (Required)**: Any modern x86_64 processor\n- **RAM**: 4GB+ system memory (8GB+ recommended for large datasets)\n\n### Software Requirements\n- **CUDA Toolkit** (Optional): Version 12.0+ for GPU acceleration\n- **Python**: 3.8+\n- **Dependencies**: numpy ≥1.19.0, scikit-learn ≥1.0.0\n\n### Supported Environments\n- **GPU-Accelerated**: Systems with CUDA-capable NVIDIA GPUs\n- **CPU-Only**: Any system (automatic fallback when CUDA unavailable)\n- **Cloud Platforms**: Google Colab, AWS, Azure, etc.\n- **Cross-Platform**: Linux, Windows, macOS\n\n## 🛠️ Installation\n\n### Option 1: Install from PyPI (Not yet configured)\n\n```bash\npip install cuda-ml-library\n```\n\n### Option 2: Build from Source (Recommended)\n\n```bash\n# Clone the repository\ngit clone https://github.com/dino65-dev/Cuda_ML_Library.git\ncd Cuda_ML_Library\n\n# Install dependencies\npip install numpy scikit-learn\n\n# Build the CUDA library\ncd SVM\nmake clean\nmake\n\n# Install the package\ncd ..\npip install -e .\n```\n\nThe build process will:\n- Auto-detect CUDA availability and GPU architecture\n- Compile CUDA kernels when GPU is available\n- Create CPU fallback implementation when CUDA is unavailable\n- Generate optimized shared libraries with universal compatibility\n\n## 🚀 Quick Start\n\n### Classification Example\n\n```python\nfrom SVM.cuda_svm import CudaSVC\nimport numpy as np\n\n# Generate sample data\nfrom sklearn.datasets import make_classification\nX, y = make_classification(n_samples=1000, n_features=20, random_state=42)\n\n# Create and train the model (automatically uses CUDA if available)\nsvc = CudaSVC(C=1.0, kernel='rbf', gamma='scale')\nsvc.fit(X, y)\n\n# Make predictions\npredictions = svc.predict(X_test)\nprobabilities = svc.predict_proba(X_test)  # If probability=True\n\nprint(f\"Accuracy: {accuracy_score(y_test, predictions)}\")\n```\n\n### Regression Example\n\n```python\nfrom SVM.cuda_svm import CudaSVR\nimport numpy as np\n\n# Generate sample data\nfrom sklearn.datasets import make_regression\nX, y = make_regression(n_samples=1000, n_features=20, random_state=42)\n\n# Create and train the model\nsvr = CudaSVR(C=1.0, epsilon=0.1, kernel='rbf', gamma='auto')\nsvr.fit(X, y)\n\n# Make predictions\npredictions = svr.predict(X_test)\n\nprint(f\"R² Score: {r2_score(y_test, predictions)}\")\n```\n\n## 📚 API Reference\n\n### CudaSVC (Classification)\n\n```python\nCudaSVC(\n    svm_type='c_svc',     # 'c_svc' or 'nu_svc'\n    kernel='rbf',         # 'linear', 'rbf', 'poly', 'sigmoid'\n    C=1.0,               # Regularization parameter\n    gamma='scale',        # Kernel coefficient\n    coef0=0.0,           # Independent term for poly/sigmoid\n    degree=3,            # Degree for polynomial kernel\n    nu=0.5,              # Nu parameter for nu-SVM\n    tolerance=1e-3,      # Tolerance for stopping criterion\n    max_iter=1000,       # Maximum iterations\n    shrinking=True,      # Use shrinking heuristic\n    probability=False    # Enable probability estimates\n)\n```\n\n### CudaSVR (Regression)\n\n```python\nCudaSVR(\n    svm_type='epsilon_svr',  # 'epsilon_svr' or 'nu_svr'\n    kernel='rbf',            # 'linear', 'rbf', 'poly', 'sigmoid'\n    C=1.0,                   # Regularization parameter\n    epsilon=0.1,             # Epsilon for epsilon-SVR\n    gamma='scale',           # Kernel coefficient\n    coef0=0.0,              # Independent term\n    degree=3,               # Polynomial degree\n    nu=0.5,                 # Nu parameter\n    tolerance=1e-3,         # Stopping tolerance\n    max_iter=1000          # Maximum iterations\n)\n```\n\n## 🔧 Advanced Usage\n\n### Hardware Detection\n\n```python\nfrom SVM.cuda_svm import CudaSVC\n\n# The library automatically detects and uses available hardware\nsvc = CudaSVC()\nprint(\"CUDA SVM initialized successfully\")\n\n# Hardware detection and optimization happen automatically\nsvc.fit(X_train, y_train)\n```\n\n### Kernel Customization\n\n```python\n# RBF Kernel with custom gamma\nsvc_rbf = CudaSVC(kernel='rbf', gamma=0.001)\n\n# Polynomial Kernel\nsvc_poly = CudaSVC(kernel='poly', degree=4, coef0=1.0, gamma='auto')\n\n# Linear Kernel (fastest)\nsvc_linear = CudaSVC(kernel='linear')\n\n# Sigmoid Kernel\nsvc_sigmoid = CudaSVC(kernel='sigmoid', gamma='scale', coef0=0.0)\n```\n\n## ⚠️ Important Notes\n\n### Current Status\n\n- **SVM**: Fully functional and ready for production use\n- **RF**: Fully functional and ready for production use\n\n**Please use the standard SVM implementation for all production workloads.**\n\n### Performance Tips\n\n1. **GPU Memory**: Ensure sufficient GPU memory for large datasets\n2. **Batch Processing**: For very large datasets, consider batch processing\n3. **Kernel Selection**: Linear kernels are fastest, RBF kernels offer good accuracy\n4. **Parameter Tuning**: Use cross-validation for optimal parameter selection\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit issues, feature requests, or pull requests.\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 🔗 Links\n\n- **Repository**: [https://github.com/dino65-dev/Cuda_ML_Library](https://github.com/dino65-dev/Cuda_ML_Library)\n- **Issues**: [https://github.com/dino65-dev/Cuda_ML_Library/issues](https://github.com/dino65-dev/Cuda_ML_Library/issues)\n- **Documentation**: [Usage Examples](./Usage/)\n\n## 📊 Version\n\nCurrent Version: **0.1.0**\n\n---\n\n**Made with ❤️ by [dino65-dev](https://github.com/dino65-dev)**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdino65-dev%2Fcuda_ml_library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdino65-dev%2Fcuda_ml_library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdino65-dev%2Fcuda_ml_library/lists"}