From a680727f92d058beb447cbb65b58985f94e11c8f Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 07:50:24 -0800 Subject: [PATCH 01/32] Build cuda solver --- CMakeLists.txt | 10 +++++++++- pyproject.toml | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d5d3ff..7b4f9c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ include(FetchContent) FetchContent_Declare( qoco GIT_REPOSITORY https://github.com/qoco-org/qoco.git - GIT_TAG bbab0db3899f19331c5c8e9d31d68bbbb68704ae + GIT_TAG b38e6dd0755508fae98a1fd1ed5cbdb283c5f157 ) list(POP_BACK CMAKE_MESSAGE_INDENT) @@ -31,5 +31,13 @@ FetchContent_MakeAvailable(qoco) pybind11_add_module(qoco_ext src/bindings.cpp) target_include_directories(qoco_ext INTERFACE ${qoco_SOURCE_DIR}/include) + +if(${QOCO_ALGEBRA_BACKEND} STREQUAL "builtin") target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic) +elseif(${QOCO_ALGEBRA_BACKEND} STREQUAL "cuda") + enable_language(CUDA) + find_package(CUDA) + target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic cudart) +endif() + install(TARGETS qoco_ext DESTINATION . COMPONENT python) diff --git a/pyproject.toml b/pyproject.toml index 35752b9..0e2f157 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "qoco" -version = "0.1.7" +version = "0.2.0" description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" @@ -15,6 +15,9 @@ dependencies = ["jinja2", "numpy>=1.7", "qdldl", "scipy>=0.13.2", "setuptools"] install.components = ["python"] wheel.install-dir = "qoco" +[tool.scikit-build.cmake.define] +QOCO_ALGEBRA_BACKEND = "cuda" + [project.urls] Homepage = "https://github.com/qoco-org/qoco" Issues = "https://github.com/qoco-org/qoco/issues" From 515a7d267f53d8f98ce67ba2509532e6b451f6fa Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 08:22:20 -0800 Subject: [PATCH 02/32] WIP --- CMakeLists.txt | 2 ++ backends/cuda/pyproject.toml | 24 ++++++++++++++++++++ pyproject.toml | 3 ++- src/{bindings.cpp => bindings.cpp.in} | 2 +- src/qoco/interface.py | 32 +++++++++++++++++++++++++-- 5 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 backends/cuda/pyproject.toml rename src/{bindings.cpp => bindings.cpp.in} (99%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b4f9c9..6fbe98e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,8 @@ FetchContent_Declare( list(POP_BACK CMAKE_MESSAGE_INDENT) FetchContent_MakeAvailable(qoco) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.cpp.in + ${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.cpp) pybind11_add_module(qoco_ext src/bindings.cpp) target_include_directories(qoco_ext INTERFACE ${qoco_SOURCE_DIR}/include) diff --git a/backends/cuda/pyproject.toml b/backends/cuda/pyproject.toml new file mode 100644 index 0000000..524e1eb --- /dev/null +++ b/backends/cuda/pyproject.toml @@ -0,0 +1,24 @@ +[build-system] +requires = ["scikit-build-core", "pybind11"] +build-backend = "scikit_build_core.build" + +[project] +name = "qoco" +version = "0.2.0" +description = "QOCO: Quadratic Objective Conic Optimizer" +readme = "README.md" +requires-python = ">=3.8" +authors = [{ name = "Govind M. Chari", email = "govindchari1@gmail.com" }] +dependencies = ["jinja2", "numpy>=1.7", "qdldl", "scipy>=0.13.2", "setuptools"] + +[tool.scikit-build] +install.components = ["python"] +wheel.install-dir = "qoco" + +[tool.scikit-build.cmake.define] +QOCO_ALGEBRA_BACKEND = "cuda" +QOCO_EXT_MODULE_NAME = "qoco_cuda" + +[project.urls] +Homepage = "https://github.com/qoco-org/qoco" +Issues = "https://github.com/qoco-org/qoco/issues" diff --git a/pyproject.toml b/pyproject.toml index 0e2f157..dfa3f60 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,8 @@ install.components = ["python"] wheel.install-dir = "qoco" [tool.scikit-build.cmake.define] -QOCO_ALGEBRA_BACKEND = "cuda" +QOCO_ALGEBRA_BACKEND = "builtin" +QOCO_EXT_MODULE_NAME = "qoco_ext" [project.urls] Homepage = "https://github.com/qoco-org/qoco" diff --git a/src/bindings.cpp b/src/bindings.cpp.in similarity index 99% rename from src/bindings.cpp rename to src/bindings.cpp.in index 50a2af2..7e88d7b 100644 --- a/src/bindings.cpp +++ b/src/bindings.cpp.in @@ -241,7 +241,7 @@ QOCOInt PyQOCOSolver::update_settings(const QOCOSettings &new_settings) return qoco_update_settings(this->_solver, &new_settings); } -PYBIND11_MODULE(qoco_ext, m) +PYBIND11_MODULE(@QOCO_EXT_MODULE_NAME@, m) { // Enums. py::enum_(m, "qoco_solve_status", py::module_local()) diff --git a/src/qoco/interface.py b/src/qoco/interface.py index ac9607c..e55ced5 100644 --- a/src/qoco/interface.py +++ b/src/qoco/interface.py @@ -5,7 +5,32 @@ import numpy as np from scipy import sparse from types import SimpleNamespace -import time + +ALGEBRAS = ( + "cuda", + "builtin", +) + +ALGEBRA_MODULES = { + "cuda": "qoco_cuda", + "builtin": "qoco.qoco_ext", +} + + +def algebra_available(algebra): + assert algebra in ALGEBRAS, f"Unknown algebra {algebra}" + module = ALGEBRA_MODULES[algebra] + + try: + importlib.import_module(module) + except ImportError: + return False + else: + return True + + +def algebras_available(): + return [algebra for algebra in ALGEBRAS if algebra_available(algebra)] class QOCO: @@ -41,7 +66,10 @@ def __init__(self, *args, **kwargs): "QOCO_MAX_ITER", ] - self.ext = importlib.import_module("qoco.qoco_ext") + self.algebra = kwargs.pop("algebra") if "algebra" in kwargs else "builtin" + if not algebra_available(self.algebra): + raise RuntimeError(f"Algebra {self.algebra} not available") + self.ext = importlib.import_module(ALGEBRA_MODULES[self.algebra]) self._solver = None def update_settings(self, **kwargs): From e3e3eedd92a39d86c7273d1696549edabf6e92f1 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 09:01:53 -0800 Subject: [PATCH 03/32] Build qoco-cuda wheel --- .gitignore | 3 ++- CMakeLists.txt | 11 +++++------ backends/cuda/pyproject.toml | 12 +++++++----- pyproject.toml | 6 +++++- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index a54a539..4e89e57 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ build/ .vscode/ __pycache__/ -qoco_custom*/ \ No newline at end of file +qoco_custom*/ +src/bindings.cpp \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 6fbe98e..41467c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,15 +31,14 @@ FetchContent_MakeAvailable(qoco) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.cpp.in ${CMAKE_CURRENT_SOURCE_DIR}/src/bindings.cpp) -pybind11_add_module(qoco_ext src/bindings.cpp) -target_include_directories(qoco_ext INTERFACE ${qoco_SOURCE_DIR}/include) +pybind11_add_module(${QOCO_EXT_MODULE_NAME} src/bindings.cpp) +target_include_directories(${QOCO_EXT_MODULE_NAME} INTERFACE ${qoco_SOURCE_DIR}/include) +install(TARGETS ${QOCO_EXT_MODULE_NAME} DESTINATION . COMPONENT python) if(${QOCO_ALGEBRA_BACKEND} STREQUAL "builtin") target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic) elseif(${QOCO_ALGEBRA_BACKEND} STREQUAL "cuda") enable_language(CUDA) find_package(CUDA) - target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic cudart) -endif() - -install(TARGETS qoco_ext DESTINATION . COMPONENT python) + target_link_libraries(qoco_cuda PUBLIC pybind11::module qocostatic cudart) +endif() \ No newline at end of file diff --git a/backends/cuda/pyproject.toml b/backends/cuda/pyproject.toml index 524e1eb..5dade4b 100644 --- a/backends/cuda/pyproject.toml +++ b/backends/cuda/pyproject.toml @@ -3,17 +3,16 @@ requires = ["scikit-build-core", "pybind11"] build-backend = "scikit_build_core.build" [project] -name = "qoco" -version = "0.2.0" +name = "qoco-cuda" +version = "0.1.0" description = "QOCO: Quadratic Objective Conic Optimizer" -readme = "README.md" requires-python = ">=3.8" authors = [{ name = "Govind M. Chari", email = "govindchari1@gmail.com" }] -dependencies = ["jinja2", "numpy>=1.7", "qdldl", "scipy>=0.13.2", "setuptools"] +dependencies = ["numpy>=1.7", "scipy>=0.13.2", "setuptools", "qoco>=0.2.0"] [tool.scikit-build] install.components = ["python"] -wheel.install-dir = "qoco" +cmake.source-dir = "../.." [tool.scikit-build.cmake.define] QOCO_ALGEBRA_BACKEND = "cuda" @@ -22,3 +21,6 @@ QOCO_EXT_MODULE_NAME = "qoco_cuda" [project.urls] Homepage = "https://github.com/qoco-org/qoco" Issues = "https://github.com/qoco-org/qoco/issues" + +[tool.setuptools_scm] +root = "../.." \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index dfa3f60..67af7e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,11 @@ description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" authors = [{ name = "Govind M. Chari", email = "govindchari1@gmail.com" }] -dependencies = ["jinja2", "numpy>=1.7", "qdldl", "scipy>=0.13.2", "setuptools"] +dependencies = ["numpy>=1.7", "scipy>=0.13.2", "setuptools"] +[project.optional-dependencies] +cuda = [ + "qoco-cuda", +] [tool.scikit-build] install.components = ["python"] From 9f03deff3ae69e9ace8f9d9ba8347559ce861238 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 13:20:40 -0800 Subject: [PATCH 04/32] Automatically push to pypi --- .github/workflows/build.yml | 34 +++++++++++++++++++++++++++++++++- pyproject.toml | 2 +- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbc2c6a..90810e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,15 @@ on: pull_request: branches: [main] + # Manual trigger for pushing to PyPI + workflow_dispatch: + inputs: + deploy: + description: "Upload wheels & sdist to PyPI?" + required: true + type: boolean + default: false + jobs: build_sdist: name: Build source @@ -57,4 +66,27 @@ jobs: uses: actions/upload-artifact@v4 with: name: cibw-wheels-${{ matrix.os }} - path: wheelhouse/*.whl \ No newline at end of file + path: wheelhouse/*.whl + + upload_pypi: + name: Upload to PyPI (manual trigger) + needs: [build_sdist, build_wheels] + runs-on: ubuntu-latest + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true' }} + + steps: + - uses: actions/download-artifact@v4 + with: + pattern: "*wheels*" + merge-multiple: true + + - name: Install Twine + run: | + python -m pip install --upgrade twine + + - name: Upload to PyPI + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + twine upload --skip-existing *.whl *.tar.gz diff --git a/pyproject.toml b/pyproject.toml index 67af7e2..ddbe79e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "qoco" -version = "0.2.0" +version = "0.1.7" description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" From b8ba0d54d044ee9da410dd06adfd8065eba70db9 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 13:39:19 -0800 Subject: [PATCH 05/32] Test pypi --- .github/workflows/build.yml | 59 ++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90810e4..2f9900b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -68,25 +68,48 @@ jobs: name: cibw-wheels-${{ matrix.os }} path: wheelhouse/*.whl - upload_pypi: - name: Upload to PyPI (manual trigger) - needs: [build_sdist, build_wheels] + # publish-qoco-to-pypi: + # name: >- + # Publish QOCO Wheels to PyPI + # if: startsWith(github.ref, 'refs/tags/') + # needs: + # - build_sdist + # - build_wheels + # runs-on: ubuntu-latest + # environment: + # name: pypi + # url: https://pypi.org/p/qoco + # permissions: + # id-token: write + # steps: + # - name: Download all the dists + # uses: actions/download-artifact@v6 + # with: + # name: python-package-distributions + # path: dist/ + # - name: Publish distribution 📦 to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 + + publish-qoco-to-testpypi: + name: Publish QOCO Wheels to TestPyPI + needs: + - build runs-on: ubuntu-latest - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true' }} - steps: - - uses: actions/download-artifact@v4 - with: - pattern: "*wheels*" - merge-multiple: true + environment: + name: testpypi + url: https://test.pypi.org/p/qoco - - name: Install Twine - run: | - python -m pip install --upgrade twine + permissions: + id-token: write - - name: Upload to PyPI - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - twine upload --skip-existing *.whl *.tar.gz + steps: + - name: Download all the dists + uses: actions/download-artifact@v6 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file From 5325a6a05e0906680189e7951a439a7136ee1e73 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 13:40:48 -0800 Subject: [PATCH 06/32] download teh right path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f9900b..9a8fbd0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,7 +108,7 @@ jobs: uses: actions/download-artifact@v6 with: name: python-package-distributions - path: dist/ + path: wheelhouse/*.whl - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From 69c1ceefed37378262a844624a4a51242f27e868 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 13:41:59 -0800 Subject: [PATCH 07/32] Fix depend --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a8fbd0..a82f09e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,7 +93,8 @@ jobs: publish-qoco-to-testpypi: name: Publish QOCO Wheels to TestPyPI needs: - - build + - build_sdist + - build_wheels runs-on: ubuntu-latest environment: From caea0db4e0bc5cb44b7d5b798544ff3b53be8d3d Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 13:57:00 -0800 Subject: [PATCH 08/32] Fix i think --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a82f09e..e93a577 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,7 +108,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v6 with: - name: python-package-distributions + name: cibw-wheels-${{ matrix.os }} path: wheelhouse/*.whl - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 From 7192d7e811d6e60a0b55988ea5af67eddba88f8e Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 14:22:42 -0800 Subject: [PATCH 09/32] Hopefully fix --- .github/workflows/build.yml | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e93a577..db8afbf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,18 +32,6 @@ jobs: with: submodules: "recursive" - - name: Build source and wheel - run: | - python -m pip install build - python -m build --outdir=wheelhouse - - - name: Upload sdist and wheel to github - uses: actions/upload-artifact@v4 - with: - name: wheels-sdist - path: wheelhouse/* - if-no-files-found: error - build_wheels: name: Building wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -62,10 +50,15 @@ jobs: env: CIBW_SKIP: "pp38-*" + - name: Build source + run: | + python -m pip install build + python -m build --sdist -o wheelhouse + - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: cibw-wheels-${{ matrix.os }} + name: wheelhouse path: wheelhouse/*.whl # publish-qoco-to-pypi: @@ -93,7 +86,6 @@ jobs: publish-qoco-to-testpypi: name: Publish QOCO Wheels to TestPyPI needs: - - build_sdist - build_wheels runs-on: ubuntu-latest @@ -108,7 +100,7 @@ jobs: - name: Download all the dists uses: actions/download-artifact@v6 with: - name: cibw-wheels-${{ matrix.os }} + name: wheelhouse path: wheelhouse/*.whl - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 From 745cb8e61f806fe8389d9cedbc3774d6d81d725e Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 14:31:48 -0800 Subject: [PATCH 10/32] Add python --- .github/workflows/build.yml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db8afbf..86b9532 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,26 +12,7 @@ on: pull_request: branches: [main] - # Manual trigger for pushing to PyPI - workflow_dispatch: - inputs: - deploy: - description: "Upload wheels & sdist to PyPI?" - required: true - type: boolean - default: false - jobs: - build_sdist: - name: Build source - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@master - with: - submodules: "recursive" - build_wheels: name: Building wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -45,6 +26,9 @@ jobs: with: fetch-depth: 0 submodules: true + - uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} - uses: pypa/cibuildwheel@v2.21 env: From 3efac419d22eb1c3efdbc73730665e0a5b39bfed Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 14:41:15 -0800 Subject: [PATCH 11/32] Make build sdist seperate --- .github/workflows/build.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 86b9532..0576b5e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,21 @@ on: branches: [main] jobs: + build_sdist: + name: Build source + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@master + with: + submodules: "recursive" + + - name: Build source and wheel + run: | + python -m pip install build + python -m build --sdist -o wheelhouse + build_wheels: name: Building wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -34,11 +49,6 @@ jobs: env: CIBW_SKIP: "pp38-*" - - name: Build source - run: | - python -m pip install build - python -m build --sdist -o wheelhouse - - name: Upload wheels uses: actions/upload-artifact@v4 with: From 05055594da4dab4af5856b64ae663839dde4f103 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 16:44:10 -0800 Subject: [PATCH 12/32] name --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0576b5e..dbfb3ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -52,7 +52,7 @@ jobs: - name: Upload wheels uses: actions/upload-artifact@v4 with: - name: wheelhouse + name: wheelhouse-${{ matrix.os }} path: wheelhouse/*.whl # publish-qoco-to-pypi: @@ -91,11 +91,10 @@ jobs: id-token: write steps: - - name: Download all the dists + - name: Download all the wheels uses: actions/download-artifact@v6 with: - name: wheelhouse - path: wheelhouse/*.whl + path: wheelhouse - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: From fe832f173577da60338ef62e7439cf8bf0d3140e Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 17:12:10 -0800 Subject: [PATCH 13/32] fix --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dbfb3ce..31fad08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -98,4 +98,5 @@ jobs: - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - repository-url: https://test.pypi.org/legacy/ \ No newline at end of file + repository-url: https://test.pypi.org/legacy/ + packages-dir: wheelhouse From 56f28a6b0d1b9593088542c5759c7087e1211bd9 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 17:22:47 -0800 Subject: [PATCH 14/32] Upload sdist --- .github/workflows/build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 31fad08..99c357a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,6 +28,13 @@ jobs: python -m pip install build python -m build --sdist -o wheelhouse + - name: Upload sdist to github + uses: actions/upload-artifact@v4 + with: + name: wheels-sdist + path: wheelhouse/* + if-no-files-found: error + build_wheels: name: Building wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -81,6 +88,7 @@ jobs: name: Publish QOCO Wheels to TestPyPI needs: - build_wheels + - build_sdist runs-on: ubuntu-latest environment: From 331081ff6c6c6c68f0e098e9e99e356c4f3a6ca5 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 17:36:33 -0800 Subject: [PATCH 15/32] Merge directories --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99c357a..28b0e85 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,9 +99,11 @@ jobs: id-token: write steps: - - name: Download all the wheels + - name: Download all wheels uses: actions/download-artifact@v6 with: + pattern: wheelhouse-* + merge-multiple: true path: wheelhouse - name: Publish distribution to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 From 78158e99b8b18e88ec9cac5d770bf3fa2568391b Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:03:26 -0800 Subject: [PATCH 16/32] Upload sdist --- .github/workflows/build.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 28b0e85..5e9f66a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Upload sdist to github uses: actions/upload-artifact@v4 with: - name: wheels-sdist + name: wheelhouse-sdist path: wheelhouse/* if-no-files-found: error @@ -76,12 +76,17 @@ jobs: # permissions: # id-token: write # steps: - # - name: Download all the dists + # - name: Download all wheels # uses: actions/download-artifact@v6 # with: - # name: python-package-distributions - # path: dist/ - # - name: Publish distribution 📦 to PyPI + # pattern: wheelhouse-* + # merge-multiple: true + # path: wheelhouse + # - name: Move wheels into dist directory + # run: | + # mkdir -p dist + # cp wheelhouse/* dist/ + # - name: Publish distribution to PyPI # uses: pypa/gh-action-pypi-publish@release/v1 publish-qoco-to-testpypi: From 7ebb80294df98cc7d22ac2ea534663d7fa449230 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:20:58 -0800 Subject: [PATCH 17/32] test --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ddbe79e..fbc4df4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "qoco" -version = "0.1.7" +version = "0.1.6" description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" From dde304d9a8c4ec48c1921cfbc21a0ccc6a44cc33 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:21:10 -0800 Subject: [PATCH 18/32] revert --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index fbc4df4..ddbe79e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "qoco" -version = "0.1.6" +version = "0.1.7" description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" From ad5c589d94cd9c6300800c22b489fe16496bfedc Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:36:25 -0800 Subject: [PATCH 19/32] test manual dispatch --- .github/workflows/build.yml | 9 +-------- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e9f66a..5a71922 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,14 +3,7 @@ name: Build Wheels on: - # Triggers the workflow on push or pull request events - push: - branches: - - "*" - - "*/*" - - "**" - pull_request: - branches: [main] + workflow_dispatch: jobs: build_sdist: diff --git a/pyproject.toml b/pyproject.toml index ddbe79e..dea9565 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "qoco" -version = "0.1.7" +version = "0.1.5" description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" From a4593ea6f94ccb1e16582849a43d92e5b98c9846 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:36:38 -0800 Subject: [PATCH 20/32] revert version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dea9565..ddbe79e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "qoco" -version = "0.1.5" +version = "0.1.7" description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" From dad661ab7321ea721d51872d39729e36fd693a68 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:40:37 -0800 Subject: [PATCH 21/32] Manual test --- .github/workflows/build.yml | 8 +++++++- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a71922..bb28503 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,11 @@ name: Build Wheels on: workflow_dispatch: + inputs: + branch: + description: "Branch to run on" + required: true + default: "main" jobs: build_sdist: @@ -12,8 +17,9 @@ jobs: strategy: fail-fast: false steps: - - uses: actions/checkout@master + - uses: actions/checkout@v4 with: + ref: ${{ github.event.inputs.branch }} submodules: "recursive" - name: Build source and wheel diff --git a/pyproject.toml b/pyproject.toml index ddbe79e..dea9565 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "qoco" -version = "0.1.7" +version = "0.1.5" description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" From 0d135c112b91ec0c96f34ebc2d6e54b04d25c828 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:46:00 -0800 Subject: [PATCH 22/32] Revert build.yml --- .github/workflows/build.yml | 124 +++++++----------------------------- pyproject.toml | 2 +- 2 files changed, 23 insertions(+), 103 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bb28503..059f540 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,116 +1,36 @@ -# Taken from osqp-python - -name: Build Wheels +name: Build CUDA Linux on: - workflow_dispatch: - inputs: - branch: - description: "Branch to run on" - required: true - default: "main" + push: + branches: + - master + tags: + - '*' + pull_request: + branches: + - master jobs: - build_sdist: - name: Build source - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.branch }} - submodules: "recursive" - - - name: Build source and wheel - run: | - python -m pip install build - python -m build --sdist -o wheelhouse - - - name: Upload sdist to github - uses: actions/upload-artifact@v4 - with: - name: wheelhouse-sdist - path: wheelhouse/* - if-no-files-found: error - build_wheels: - name: Building wheels on ${{ matrix.os }} + name: Build wheel on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13, macos-latest, windows-latest] + os: [ubuntu-latest] steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: true - - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - - - uses: pypa/cibuildwheel@v2.21 - env: - CIBW_SKIP: "pp38-*" + - uses: actions/checkout@master - - name: Upload wheels - uses: actions/upload-artifact@v4 - with: - name: wheelhouse-${{ matrix.os }} - path: wheelhouse/*.whl - - # publish-qoco-to-pypi: - # name: >- - # Publish QOCO Wheels to PyPI - # if: startsWith(github.ref, 'refs/tags/') - # needs: - # - build_sdist - # - build_wheels - # runs-on: ubuntu-latest - # environment: - # name: pypi - # url: https://pypi.org/p/qoco - # permissions: - # id-token: write - # steps: - # - name: Download all wheels - # uses: actions/download-artifact@v6 - # with: - # pattern: wheelhouse-* - # merge-multiple: true - # path: wheelhouse - # - name: Move wheels into dist directory - # run: | - # mkdir -p dist - # cp wheelhouse/* dist/ - # - name: Publish distribution to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 - - publish-qoco-to-testpypi: - name: Publish QOCO Wheels to TestPyPI - needs: - - build_wheels - - build_sdist - runs-on: ubuntu-latest - - environment: - name: testpypi - url: https://test.pypi.org/p/qoco - - permissions: - id-token: write - - steps: - - name: Download all wheels - uses: actions/download-artifact@v6 + - name: Build wheels + uses: pypa/cibuildwheel@v2.23 with: - pattern: wheelhouse-* - merge-multiple: true - path: wheelhouse - - name: Publish distribution to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 + package-dir: backend/cuda + config-file: backend/cuda/cibuildwheel.toml + output-dir: wheelhouse + + - name: Upload artifacts to github + uses: actions/upload-artifact@v4 with: - repository-url: https://test.pypi.org/legacy/ - packages-dir: wheelhouse + name: wheels-cuda-${{ matrix.os }} + path: ./wheelhouse diff --git a/pyproject.toml b/pyproject.toml index dea9565..ddbe79e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "scikit_build_core.build" [project] name = "qoco" -version = "0.1.5" +version = "0.1.7" description = "QOCO: Quadratic Objective Conic Optimizer" readme = "README.md" requires-python = ">=3.8" From 18307a73f72e327b61731f72b314db29562f8a3c Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:51:30 -0800 Subject: [PATCH 23/32] Test building cuda wheels --- .github/workflows/build.yml | 68 +++++++++++++++++++++----------- .github/workflows/built_cuda.yml | 38 ++++++++++++++++++ backends/cuda/cibuildwheel.toml | 17 ++++++++ 3 files changed, 101 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/built_cuda.yml create mode 100644 backends/cuda/cibuildwheel.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 059f540..fbc2c6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,36 +1,60 @@ -name: Build CUDA Linux +# Taken from osqp-python + +name: Build Wheels on: + # Triggers the workflow on push or pull request events push: branches: - - master - tags: - - '*' + - "*" + - "*/*" + - "**" pull_request: - branches: - - master + branches: [main] jobs: + build_sdist: + name: Build source + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@master + with: + submodules: "recursive" + + - name: Build source and wheel + run: | + python -m pip install build + python -m build --outdir=wheelhouse + + - name: Upload sdist and wheel to github + uses: actions/upload-artifact@v4 + with: + name: wheels-sdist + path: wheelhouse/* + if-no-files-found: error + build_wheels: - name: Build wheel on ${{ matrix.os }} + name: Building wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, macos-13, macos-latest, windows-latest] steps: - - uses: actions/checkout@master - - - name: Build wheels - uses: pypa/cibuildwheel@v2.23 - with: - package-dir: backend/cuda - config-file: backend/cuda/cibuildwheel.toml - output-dir: wheelhouse - - - name: Upload artifacts to github - uses: actions/upload-artifact@v4 - with: - name: wheels-cuda-${{ matrix.os }} - path: ./wheelhouse + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: true + + - uses: pypa/cibuildwheel@v2.21 + env: + CIBW_SKIP: "pp38-*" + + - name: Upload wheels + uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }} + path: wheelhouse/*.whl \ No newline at end of file diff --git a/.github/workflows/built_cuda.yml b/.github/workflows/built_cuda.yml new file mode 100644 index 0000000..34f2f19 --- /dev/null +++ b/.github/workflows/built_cuda.yml @@ -0,0 +1,38 @@ +# Taken from osqp-python + +name: Build CUDA Linux + +on: + # Triggers the workflow on push or pull request events + push: + branches: + - "*" + - "*/*" + - "**" + pull_request: + branches: [main] + +jobs: + build_wheels: + name: Build wheel on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + + steps: + - uses: actions/checkout@master + + - name: Build wheels + uses: pypa/cibuildwheel@v2.23 + with: + package-dir: backend/cuda + config-file: backend/cuda/cibuildwheel.toml + output-dir: wheelhouse + + - name: Upload artifacts to github + uses: actions/upload-artifact@v4 + with: + name: wheels-cuda-${{ matrix.os }} + path: ./wheelhouse diff --git a/backends/cuda/cibuildwheel.toml b/backends/cuda/cibuildwheel.toml new file mode 100644 index 0000000..6f670d4 --- /dev/null +++ b/backends/cuda/cibuildwheel.toml @@ -0,0 +1,17 @@ +[tool.cibuildwheel] +build = "cp3*" +skip = ["cp36-*", "cp37-*", "*-win32", "*-manylinux_i686", "*-musllinux_*"] +build-verbosity = 1 +before-build = "rm -rf {package}/osqp_sources/build" +repair-wheel-command = "" + +[tool.cibuildwheel.linux] +before-all = [ + "yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo", + "yum search cuda-toolkit*", + "yum install -y cuda-toolkit-12-6" +] +environment = { CMAKE_CUDA_COMPILER = "/usr/local/cuda-12.6/bin/nvcc" } + +[tool.cibuildwheel.windows] +environment = { CMAKE_CUDA_COMPILER = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin/nvcc.exe", CUDA_TOOLKIT_ROOT_DIR = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6", CMAKE_GENERATOR_TOOLSET = "cuda=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6" } From 43f11715993ffb09d0d7e19ee13e92115403765b Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:53:00 -0800 Subject: [PATCH 24/32] rename --- {backends => backend}/cuda/cibuildwheel.toml | 0 {backends => backend}/cuda/pyproject.toml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {backends => backend}/cuda/cibuildwheel.toml (100%) rename {backends => backend}/cuda/pyproject.toml (100%) diff --git a/backends/cuda/cibuildwheel.toml b/backend/cuda/cibuildwheel.toml similarity index 100% rename from backends/cuda/cibuildwheel.toml rename to backend/cuda/cibuildwheel.toml diff --git a/backends/cuda/pyproject.toml b/backend/cuda/pyproject.toml similarity index 100% rename from backends/cuda/pyproject.toml rename to backend/cuda/pyproject.toml From 39a3be35f901d49d2534a60fcd02f31a7e567bf7 Mon Sep 17 00:00:00 2001 From: govindchari Date: Fri, 5 Dec 2025 18:58:14 -0800 Subject: [PATCH 25/32] cuda13 --- backend/cuda/cibuildwheel.toml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/backend/cuda/cibuildwheel.toml b/backend/cuda/cibuildwheel.toml index 6f670d4..832969c 100644 --- a/backend/cuda/cibuildwheel.toml +++ b/backend/cuda/cibuildwheel.toml @@ -9,9 +9,6 @@ repair-wheel-command = "" before-all = [ "yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo", "yum search cuda-toolkit*", - "yum install -y cuda-toolkit-12-6" + "yum install -y cuda-toolkit-13-0" ] -environment = { CMAKE_CUDA_COMPILER = "/usr/local/cuda-12.6/bin/nvcc" } - -[tool.cibuildwheel.windows] -environment = { CMAKE_CUDA_COMPILER = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin/nvcc.exe", CUDA_TOOLKIT_ROOT_DIR = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6", CMAKE_GENERATOR_TOOLSET = "cuda=C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6" } +environment = { CMAKE_CUDA_COMPILER = "/usr/local/cuda-13.0/bin/nvcc" } From 14c901cafc8d9ce074e25a55c513a77d9f857c43 Mon Sep 17 00:00:00 2001 From: govindchari Date: Mon, 8 Dec 2025 11:20:40 -0800 Subject: [PATCH 26/32] Install cuda --- .github/workflows/{built_cuda.yml => build_cuda.yml} | 6 ++++++ 1 file changed, 6 insertions(+) rename .github/workflows/{built_cuda.yml => build_cuda.yml} (80%) diff --git a/.github/workflows/built_cuda.yml b/.github/workflows/build_cuda.yml similarity index 80% rename from .github/workflows/built_cuda.yml rename to .github/workflows/build_cuda.yml index 34f2f19..78da5f4 100644 --- a/.github/workflows/built_cuda.yml +++ b/.github/workflows/build_cuda.yml @@ -24,6 +24,12 @@ jobs: steps: - uses: actions/checkout@master + - name: Install CUDA Toolkit (if using GitHub-hosted runner) + # Use a specific version, e.g., '11.8' + uses: Jimver/cuda-toolkit@v0.2.11 + with: + cuda: '12.1.0' + - name: Build wheels uses: pypa/cibuildwheel@v2.23 with: From 91dadd4cf0fd38ab9ac6d554782e92d59dbf8d56 Mon Sep 17 00:00:00 2001 From: govindchari Date: Mon, 8 Dec 2025 13:44:53 -0800 Subject: [PATCH 27/32] Build cuda wheels --- .gitignore | 3 ++- Dockerfile.cuda-manylinux | 19 +++++++++++++++++++ backend/cuda/cibuildwheel.toml | 16 +++------------- backend/cuda/pyproject.toml | 6 +----- build_cuda_wheels.sh | 3 +++ requirements.txt | 7 ------- 6 files changed, 28 insertions(+), 26 deletions(-) create mode 100644 Dockerfile.cuda-manylinux create mode 100644 build_cuda_wheels.sh delete mode 100644 requirements.txt diff --git a/.gitignore b/.gitignore index 4e89e57..6e08b37 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ build/ .vscode/ __pycache__/ qoco_custom*/ -src/bindings.cpp \ No newline at end of file +src/bindings.cpp +dist/ \ No newline at end of file diff --git a/Dockerfile.cuda-manylinux b/Dockerfile.cuda-manylinux new file mode 100644 index 0000000..a7b2eb7 --- /dev/null +++ b/Dockerfile.cuda-manylinux @@ -0,0 +1,19 @@ +# Base manylinux image with Python interpreters +FROM quay.io/pypa/manylinux_2_28_x86_64:2025.11.09-2 + +# Install prerequisites +RUN yum install -y wget tar bzip2 xz gzip make gcc gcc-c++ git + +# Install CUDA Toolkit 13.1 and cuDSS 0.7.1 +RUN wget https://developer.download.nvidia.com/compute/cuda/13.0.0/local_installers/cuda_13.0.0_580.65.06_linux.run && \ + sh cuda_13.0.0_580.65.06_linux.run --silent --toolkit && \ + rm cuda_13.0.0_580.65.06_linux.run && \ + curl -O https://developer.download.nvidia.com/compute/cudss/0.7.1/local_installers/cudss-local-repo-rhel10-0.7.1-0.7.1-1.x86_64.rpm && \ + rpm -i cudss-local-repo-rhel10-0.7.1-0.7.1-1.x86_64.rpm && \ + dnf clean all && \ + dnf -y install cudss + +# Set CUDA environment variables +ENV PATH=/usr/local/cuda/bin:$PATH +ENV LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH +ENV CUDAToolkit_ROOT=/usr/local/cuda/bin diff --git a/backend/cuda/cibuildwheel.toml b/backend/cuda/cibuildwheel.toml index 832969c..7702380 100644 --- a/backend/cuda/cibuildwheel.toml +++ b/backend/cuda/cibuildwheel.toml @@ -1,14 +1,4 @@ -[tool.cibuildwheel] -build = "cp3*" -skip = ["cp36-*", "cp37-*", "*-win32", "*-manylinux_i686", "*-musllinux_*"] -build-verbosity = 1 -before-build = "rm -rf {package}/osqp_sources/build" -repair-wheel-command = "" - [tool.cibuildwheel.linux] -before-all = [ - "yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/x86_64/cuda-rhel9.repo", - "yum search cuda-toolkit*", - "yum install -y cuda-toolkit-13-0" -] -environment = { CMAKE_CUDA_COMPILER = "/usr/local/cuda-13.0/bin/nvcc" } +skip = ["*-musllinux*"] +manylinux-x86_64-image = "mycuda-manylinux:latest" +environment = { CUDAToolkit_ROOT = "/usr/local/cuda/bin" } diff --git a/backend/cuda/pyproject.toml b/backend/cuda/pyproject.toml index 5dade4b..e984347 100644 --- a/backend/cuda/pyproject.toml +++ b/backend/cuda/pyproject.toml @@ -12,7 +12,6 @@ dependencies = ["numpy>=1.7", "scipy>=0.13.2", "setuptools", "qoco>=0.2.0"] [tool.scikit-build] install.components = ["python"] -cmake.source-dir = "../.." [tool.scikit-build.cmake.define] QOCO_ALGEBRA_BACKEND = "cuda" @@ -20,7 +19,4 @@ QOCO_EXT_MODULE_NAME = "qoco_cuda" [project.urls] Homepage = "https://github.com/qoco-org/qoco" -Issues = "https://github.com/qoco-org/qoco/issues" - -[tool.setuptools_scm] -root = "../.." \ No newline at end of file +Issues = "https://github.com/qoco-org/qoco/issues" \ No newline at end of file diff --git a/build_cuda_wheels.sh b/build_cuda_wheels.sh new file mode 100644 index 0000000..52779ad --- /dev/null +++ b/build_cuda_wheels.sh @@ -0,0 +1,3 @@ +mv backend/cuda/pyproject.toml . +docker build -f Dockerfile.cuda-manylinux -t mycuda-manylinux:latest . +cibuildwheel --platform linux --output-dir dist --config-file backend/cuda/cibuildwheel.toml \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 3b81b01..0000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -pybind11 -numpy>=1.7 -# Exclude scipy 1.12 because the random sparse array function started returning -# the transpose of the original, breaking the unit tests. This was fixed in 1.13.0. -# ref: https://github.com/scipy/scipy/issues/20027 -scipy>=0.13.2,!=1.12.0 -qdldl \ No newline at end of file From b1e87b956e6d77292329f0999088cdbe0dbed110 Mon Sep 17 00:00:00 2001 From: govindchari Date: Mon, 8 Dec 2025 13:45:51 -0800 Subject: [PATCH 28/32] Remove cuda-build.yml --- .github/workflows/build_cuda.yml | 44 -------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 .github/workflows/build_cuda.yml diff --git a/.github/workflows/build_cuda.yml b/.github/workflows/build_cuda.yml deleted file mode 100644 index 78da5f4..0000000 --- a/.github/workflows/build_cuda.yml +++ /dev/null @@ -1,44 +0,0 @@ -# Taken from osqp-python - -name: Build CUDA Linux - -on: - # Triggers the workflow on push or pull request events - push: - branches: - - "*" - - "*/*" - - "**" - pull_request: - branches: [main] - -jobs: - build_wheels: - name: Build wheel on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest] - - steps: - - uses: actions/checkout@master - - - name: Install CUDA Toolkit (if using GitHub-hosted runner) - # Use a specific version, e.g., '11.8' - uses: Jimver/cuda-toolkit@v0.2.11 - with: - cuda: '12.1.0' - - - name: Build wheels - uses: pypa/cibuildwheel@v2.23 - with: - package-dir: backend/cuda - config-file: backend/cuda/cibuildwheel.toml - output-dir: wheelhouse - - - name: Upload artifacts to github - uses: actions/upload-artifact@v4 - with: - name: wheels-cuda-${{ matrix.os }} - path: ./wheelhouse From ee928ceaee90d9e2570067078393a56d914183da Mon Sep 17 00:00:00 2001 From: govindchari Date: Mon, 8 Dec 2025 13:48:42 -0800 Subject: [PATCH 29/32] Remove macos13 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbc2c6a..a54eb97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -41,7 +41,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-13, macos-latest, windows-latest] + os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 From 4794ac5a06660b60c25eb1bad8758250ef084efb Mon Sep 17 00:00:00 2001 From: govindchari Date: Mon, 8 Dec 2025 13:53:14 -0800 Subject: [PATCH 30/32] macos-latest --- .github/workflows/unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index d14823d..a107e45 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -28,7 +28,7 @@ jobs: fail-fast: false matrix: - os: [ubuntu-latest, macos-13, windows-latest] + os: [ubuntu-latest, macos-latest, windows-latest] # Steps represent a sequence of tasks that will be executed as part of the job steps: From 0c9d645e6d3b5a12cc92284d71cf454b1d1806e4 Mon Sep 17 00:00:00 2001 From: govindchari Date: Mon, 8 Dec 2025 16:35:43 -0800 Subject: [PATCH 31/32] gs --- CMakeLists.txt | 4 ++-- build_cuda_wheels.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 build_cuda_wheels.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 41467c1..56bee76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ include(FetchContent) FetchContent_Declare( qoco GIT_REPOSITORY https://github.com/qoco-org/qoco.git - GIT_TAG b38e6dd0755508fae98a1fd1ed5cbdb283c5f157 + GIT_TAG b058d60aa48ef7015a9f86e67dc99ad2d15a1172 ) list(POP_BACK CMAKE_MESSAGE_INDENT) @@ -40,5 +40,5 @@ target_link_libraries(qoco_ext PUBLIC pybind11::module qocostatic) elseif(${QOCO_ALGEBRA_BACKEND} STREQUAL "cuda") enable_language(CUDA) find_package(CUDA) - target_link_libraries(qoco_cuda PUBLIC pybind11::module qocostatic cudart) + target_link_libraries(qoco_cuda PUBLIC pybind11::module qocostatic) endif() \ No newline at end of file diff --git a/build_cuda_wheels.sh b/build_cuda_wheels.sh old mode 100644 new mode 100755 index 52779ad..776c9de --- a/build_cuda_wheels.sh +++ b/build_cuda_wheels.sh @@ -1,3 +1,3 @@ -mv backend/cuda/pyproject.toml . +cp backend/cuda/pyproject.toml . docker build -f Dockerfile.cuda-manylinux -t mycuda-manylinux:latest . cibuildwheel --platform linux --output-dir dist --config-file backend/cuda/cibuildwheel.toml \ No newline at end of file From 87665eb6084f7dae48f8141f384032f5d9dc1b71 Mon Sep 17 00:00:00 2001 From: govindchari Date: Mon, 8 Dec 2025 16:49:48 -0800 Subject: [PATCH 32/32] Bump hash --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 56bee76..6258701 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,7 +23,7 @@ include(FetchContent) FetchContent_Declare( qoco GIT_REPOSITORY https://github.com/qoco-org/qoco.git - GIT_TAG b058d60aa48ef7015a9f86e67dc99ad2d15a1172 + GIT_TAG d40cb8170b0e967be38ad0e1b134d9c51f5d636e ) list(POP_BACK CMAKE_MESSAGE_INDENT)