Skip to content

Conversation

@bstellato
Copy link
Collaborator

@bstellato bstellato commented Dec 23, 2025

Summary

This PR updates the Python wrapper to be compatible with the C repo PR #8 (diagonal step sizes) and adds support for both CUDA 12 and CUDA 13 backends.

API Changes (from C PR #8)

  • rhorho_init (initial step size)
  • sigmasigma_init (initial step size)
  • update_rho()update_step_sizes(rho_init=..., sigma_init=...)

CUDA Backend Support

  • osqp-cu12: CUDA 12.9 support (Linux + Windows)
  • osqp-cu13: CUDA 13.1 support (Linux + Windows)
  • Both packages provide the same osqp_cuda module (mutually exclusive)
  • Consolidated GitHub Actions workflows with automatic PyPI publishing

Files Changed

  • src/bindings.cpp.in: Updated bindings for new API
  • src/osqp/interface.py: Updated Python interface
  • backend/cuda12/: CUDA 12 backend configuration
  • backend/cuda13/: CUDA 13 backend configuration
  • .github/workflows/build_cuda12.yml: Build + publish CUDA 12 wheels
  • .github/workflows/build_cuda13.yml: Build + publish CUDA 13 wheels
  • CLAUDE.md: Updated build documentation

Test plan

  • All builtin tests pass
  • All CUDA direct tests pass
  • All CUDA indirect tests pass
  • CI builds pass for all platforms

- Replace osqp_update_rho() with osqp_update_step_sizes(rho, sigma)
- Rename settings: rho -> rho_init, sigma -> sigma_init
- Remove obsolete settings: rho_is_vec, adaptive_rho_tolerance_greater/less
- Remove rho_estimate from OSQPInfo
- Add update_step_sizes(rho_init, sigma_init) method to Python interface
- Add deprecation warnings for old parameter names
- Update tests to use new API
- Switch from b/diagonal_step_sizes to b/cuda-13-blackwell-support
  which includes both the diagonal step sizes API changes AND CUDA 13/
  Blackwell architecture support
- Update CLAUDE.md with clearer build instructions:
  - Emphasize activating venv before uv pip commands
  - Add uv build instructions for backend wheels
  - Document proper wheel installation workflow
- Restructure backend directories: cuda -> cuda12, add cuda13
- CUDA 12: Update from 12.6 to 12.9
- CUDA 13: Add new backend package (osqp-cu13) for CUDA 13.1
- Consolidate workflows: build_cuda12.yml and build_cuda13.yml
  each handle Linux + Windows builds and PyPI publishing
- Both packages produce same osqp_cuda module (mutually exclusive)
- Update CLAUDE.md with build instructions for both backends
@bstellato bstellato changed the title Update Python wrapper for C repo PR #8 (vectorized step sizes) Update Python wrapper for C repo PR #8 + CUDA 12/13 support Dec 24, 2025
- Skip Python 3.8 for CUDA 13 (requires C++17, manylinux2014 uses older compilers)
- Add missing Windows CUDA 13 components (cuda_runtime, cublas, curand, cusparse)
- Add CMAKE_CUDA_STANDARD=17 and CMAKE_CXX_STANDARD=17 for CUDA 13
- Install full CUDA 13 toolkit on Windows (component names changed)
- Remove CMAKE_GENERATOR_TOOLSET to let CMake auto-detect VS integration
- Fix Windows CUDA cache path
- Switch Windows runner from windows-2022 to windows-2025
- Add CMAKE_CUDA_STANDARD=17 and CMAKE_CXX_STANDARD=17 to pyproject.toml
  (environment variables alone don't get passed to CMake via scikit-build-core)
- CUDA 12: Fix cache path from Intel OneAPI to NVIDIA CUDA directory
- CUDA 13: Use explicit component list with -s flag instead of
  undefined CUDATOOLKIT_INSTALL_ARGS variable
@vineetbansal
Copy link
Collaborator

Thanks @bstellato! Let me know when you think you're "done" with this PR and I can take a further look at any failing CI scenarios - looks like its only Windows right now so that should be fixable.

@bstellato
Copy link
Collaborator Author

Thanks @vineetbansal ! Could you please take care of the remaining failing CUDA 13 builds on windows? I may have specified CXX 17 in a couple of places where it is not strictly needed. Otherwise, this PR should also automatically build wheels for both CUDA 12 and 13.

@vineetbansal vineetbansal force-pushed the feature/pr8-compat branch 2 times, most recently from ac966ec to c4fc7e2 Compare December 24, 2025 20:50
@vineetbansal
Copy link
Collaborator

@bstellato - should be good now.

@bstellato
Copy link
Collaborator Author

Amazing! Thank you so much @vineetbansal! Before merging this PR, I propose to:

Then we should be good to go!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants