Skip to content

Commit 33632ac

Browse files
Update SOCP dependencies for cuOpt 26.06
1 parent 908861c commit 33632ac

5 files changed

Lines changed: 502 additions & 148 deletions

File tree

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ source $HOME/.local/bin/env # (sh, bash, zsh)
9595
# source $HOME/.local/bin/env.fish # (fish)
9696

9797
# Install with CUDA-specific dependencies
98-
uv sync --extra cuda13 # this container image has cuda13
98+
uv sync --extra cuda13 # full CUDA 13 stack currently tracks cuOpt/cuML 26.04
99+
# On CUDA 12 hosts, use the full cuOpt/cuML 26.06 stack:
100+
# uv sync --extra cuda12
101+
# For direct SOCP testing on CUDA 13 with cuOpt 26.06:
102+
# uv sync --extra cuda13-socp
99103

100104
# Optional: Install development tools
101105
uv sync --extra cuda13 --extra dev
@@ -107,13 +111,13 @@ uv run python -m ipykernel install --user --name=portfolio-opt --display-name "P
107111
uv run jupyter lab --no-browser --NotebookApp.token=''
108112
```
109113

110-
**Note:** If you use a different container image than the suggested one above, during uv sync, please use the `--extra cuda12` or `--extra cuda13` flag to install the GPU packages (cuOpt, cuML) matching your container's CUDA version. The `uv sync` command automatically creates a virtual environment and installs all dependencies from `uv.lock`.
114+
**Note:** If you use a different container image than the suggested one above, during uv sync, use `--extra cuda12` for the full cuOpt/cuML 26.06 CUDA 12 stack or `--extra cuda13` for the current full CUDA 13 cuOpt/cuML stack. As of the cuOpt 26.06 release, `cuml-cu13` 26.06 is not published, so CUDA 13 SOCP testing with cuOpt 26.06 uses `--extra cuda13-socp`; that extra is cuOpt-only and is intended for direct SOCP preview/Mean-Variance variance-cap solves, not GPU KDE/CVaR rebalancing. The `uv sync` command automatically creates a virtual environment and installs all dependencies from `uv.lock`.
111115

112116
**Tip:** To check your CUDA version, run `nvidia-smi` and look for "CUDA Version" in the output.
113117

114118
**Important Notes:**
115119
- If you encounter "No space left on device" errors, set `UV_CACHE_DIR` to an alternate cache location: `export UV_CACHE_DIR=/path/to/cache/directory`
116-
- The `cuda12` and `cuda13` extras are mutually exclusive - install only one based on your system's CUDA version
120+
- The `cuda12`, `cuda13`, and `cuda13-socp` extras are mutually exclusive - install only one based on your system's CUDA version and workflow
117121
- If you plan to run the Streamlit demo from this container, include `-p 8501:8501` when starting Docker. Docker port mappings cannot be added to an already-running container; restart the container with the port published if it was omitted.
118122

119123
#### Using the Jupyter Kernel

demo/README_streamlit.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Open `http://localhost:8501` for local runs. On a remote GPU instance, forward o
4545
- Python 3.11+
4646
- Streamlit, Plotly, and Squarify from `demo/requirements.txt`
4747
- CVXPY and cuFOLIO core dependencies from `pyproject.toml`
48-
- Optional: NVIDIA GPU + CUDA with the matching `cuda12` or `cuda13` extra for cuOpt acceleration
48+
- Optional: NVIDIA GPU + CUDA with `cuda12` for the full cuOpt/cuML 26.06 stack, `cuda13` for the current full CUDA 13 stack, or `cuda13-socp` for CUDA 13 SOCP-only cuOpt 26.06 preview
4949

5050
## Troubleshooting
5151

@@ -57,4 +57,4 @@ Open `http://localhost:8501` for local runs. On a remote GPU instance, forward o
5757
uv run python -c 'from cufolio.utils import download_data; download_data("data/stock_data", datasets=["sp500"])'
5858
```
5959

60-
**GPU Solver Unavailable**: The UI can still boot without a GPU, but the full GTC comparison and SOCP preview need cuOpt. Install the matching CUDA extra and run on an NVIDIA GPU instance.
60+
**GPU Solver Unavailable**: The UI can still boot without a GPU, but the full GTC comparison and SOCP preview need cuOpt. Use `--extra cuda12` for full cuOpt/cuML 26.06 validation, `--extra cuda13` for the current full CUDA 13 stack, or `--extra cuda13-socp` for CUDA 13 SOCP-only preview with cuOpt 26.06.

pyproject.toml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requires-python = ">=3.11"
77
dependencies = [
88
"numpy>=2.0.0",
99
"pandas>=2.0",
10-
"cvxpy>=1.7.0",
10+
"cvxpy>=1.9.1",
1111
"scikit-learn>=1.5",
1212
"seaborn>=0.13",
1313
"yfinance>=0.2.0",
@@ -21,12 +21,15 @@ dev = [
2121
"pre-commit==4.3.0",
2222
]
2323
cuda12 = [
24-
"cuml-cu12==26.8.*",
25-
"cuopt-cu12==26.8.*",
24+
"cuml-cu12==26.6.*",
25+
"cuopt-cu12==26.6.*",
2626
]
2727
cuda13 = [
28-
"cuml-cu13==26.8.*",
29-
"cuopt-cu13==26.8.*",
28+
"cuml-cu13==26.4.*",
29+
"cuopt-cu13==26.4.*",
30+
]
31+
cuda13-socp = [
32+
"cuopt-cu13==26.6.*",
3033
]
3134

3235
[tool.ruff]
@@ -66,18 +69,21 @@ conflicts = [
6669
{ extra = "cuda12" },
6770
{ extra = "cuda13" },
6871
],
72+
[
73+
{ extra = "cuda12" },
74+
{ extra = "cuda13-socp" },
75+
],
76+
[
77+
{ extra = "cuda13" },
78+
{ extra = "cuda13-socp" },
79+
],
6980
]
7081

7182
[[tool.uv.index]]
7283
name = "nvidia"
7384
url = "https://pypi.nvidia.com"
7485

7586
[tool.uv.sources]
76-
# Build cvxpy from the upstream master branch instead of the PyPI wheel so
77-
# we can pull in QP-via-cuOpt fixes ahead of the next release. uv.lock pins
78-
# the resolved commit SHA for reproducibility; bump with
79-
# `uv lock --upgrade-package cvxpy`.
80-
cvxpy = { git = "https://github.com/cvxpy/cvxpy.git", branch = "master" }
8187
cuml-cu12 = { index = "nvidia" }
8288
cuopt-cu12 = { index = "nvidia" }
8389
cuml-cu13 = { index = "nvidia" }

skills/cufolio/SKILL.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ Do not use it for generic finance summaries, price forecasting, neural-network t
4444
## Prerequisites
4545

4646
- Python environment with the installed `cufolio` package.
47-
- NVIDIA GPU runtime with cuOpt and cuML installed. Mean-Variance SOCP workflows require a cuOpt build with QCQP/SOCP support, such as the 26.08 line or newer.
48-
- CUDA extra matching the host, such as `uv sync --extra cuda12` or `uv sync --extra cuda13`.
47+
- NVIDIA GPU runtime with cuOpt and cuML installed. Mean-Variance SOCP workflows require a cuOpt build with QCQP/SOCP support, such as the 26.06 line or newer.
48+
- CUDA extra matching the host and workflow: `uv sync --extra cuda12` for full cuOpt/cuML 26.06 on CUDA 12, `uv sync --extra cuda13` for the current full CUDA 13 stack, or `uv sync --extra cuda13-socp` for CUDA 13 SOCP-only validation with cuOpt 26.06.
4949
- `cvxpy` exposing `cp.CUOPT`.
5050
- Network access on first run if the default price CSV must be downloaded.
5151

@@ -243,7 +243,8 @@ Use the package APIs instead of reimplementing portfolio math or simulation loop
243243
## Limitations
244244

245245
- Requires an NVIDIA GPU with cuOpt and cuML; CPU solvers are intentionally disallowed.
246-
- Mean-Variance SOCP variance caps require cuOpt QCQP/SOCP support. Use the 26.08 line or newer when installing CUDA extras.
246+
- Mean-Variance SOCP variance caps require cuOpt QCQP/SOCP support. Use the 26.06 line or newer when installing CUDA extras.
247+
- `cuda13-socp` intentionally installs cuOpt without cuML because `cuml-cu13` 26.06 is not published yet; use it for direct SOCP/QCQP validation, not GPU KDE CVaR workflows.
247248
- Cardinality plus SOCP is treated as unsupported unless cuFOLIO exposes explicit mixed-integer conic support.
248249
- CPU-only eval containers can still validate routing, data handling, and reporting behavior, but they cannot produce a valid cuOpt solve. In that case, report the missing GPU/cuOpt runtime explicitly.
249250
- Default price data is a historical snapshot and may omit current constituents.
@@ -253,8 +254,8 @@ Use the package APIs instead of reimplementing portfolio math or simulation loop
253254

254255
- Missing default CSV or `FileNotFoundError`: explain that cuFOLIO will fetch public market data with `download_data("data/stock_data", datasets=["sp500"])`; run it only after user confirmation.
255256
- `SolverError` or missing `cp.CUOPT`: install the CUDA extra matching the host and verify with `python -c "import cvxpy as cp; print(hasattr(cp, 'CUOPT'), cp.installed_solvers())"`.
256-
- `ImportError` for `cuml` or GPU KDE failures: confirm cuML is present with `python -c "import cuml"` and keep `KDESettings(device="GPU")`.
257-
- SOCP setup fails before solving: verify the installed `cuopt` package is on the 26.08 line or newer and that `MeanVarianceParameters.var_limit` is positive.
257+
- `ImportError` for `cuml` or GPU KDE failures: confirm cuML is present with `python -c "import cuml"` and keep `KDESettings(device="GPU")`. If using `cuda13-socp`, this is expected for CVaR/KDE; switch to `cuda12` or `cuda13` for cuML workflows.
258+
- SOCP setup fails before solving: verify the installed `cuopt` package is on the 26.06 line or newer and that `MeanVarianceParameters.var_limit` is positive.
258259
- Ordinary optimization returns all cash: set `c_max=0.0` in `CvarParameters`.
259260
- Solver reports infeasible or no solution: check for contradictory bounds, too few tickers for the requested caps/cardinality, or a date filter that leaves too little data; report the smallest constraint change that would make the request feasible.
260261
- Requested tickers are absent from the default CSV: report them and proceed with the remaining requested tickers.

0 commit comments

Comments
 (0)