Skip to content
Draft
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
635 commits
Select commit Hold shift + click to select a range
2c57304
Remove stale stub-file comment from _stf_bindings_impl.pyx
caugonnet Apr 6, 2026
ac3487d
clang-format
caugonnet Apr 6, 2026
1457893
Reject non-contiguous buffers in logical_data
caugonnet Apr 6, 2026
cf7753f
Normalize and validate shape in logical_data.init_by_shape
caugonnet Apr 6, 2026
1f80e6a
pre-commit hooks
caugonnet Apr 6, 2026
1e29a51
Guard CuPy imports in example_potri and example_cholesky
caugonnet Apr 6, 2026
fb5dddf
Add finiteness assertions and clean up FDTD tests
caugonnet Apr 6, 2026
76c7bae
pre-commit hooks
caugonnet Apr 6, 2026
9e95107
Add host_launch to Python STF bindings
caugonnet Apr 6, 2026
8fe3c16
Add stf_fence binding to Python STF context
caugonnet Apr 6, 2026
c9cee96
Expose task.set_symbol() and ctx.task(symbol=) in Python STF bindings
caugonnet Apr 6, 2026
224eba1
Add cuda_kernel bindings to Python STF for efficient CUDA kernel laun…
caugonnet Apr 6, 2026
3cbbdd5
Fix cuda_kernel.launch() to keep all ParamHolder args alive for multi…
caugonnet Apr 6, 2026
f3ef1cd
Harden Python STF bindings with NULL checks and safe __dealloc__
caugonnet Apr 6, 2026
34e7139
Add exec_place_grid, composite data places, and FFI-safe partition_fn_t
caugonnet Apr 6, 2026
21ae4ec
Add task grid introspection: get_grid_dims, get_stream_at_index, get_…
caugonnet Apr 6, 2026
e19673d
Fix unused variable lint warnings in test_composite_places.py
caugonnet Apr 6, 2026
be2552b
Apply ruff-format to test_cuda_kernel.py
caugonnet Apr 6, 2026
3c77d25
Add STF + cuda.compute integration examples (reduce, scan, transform)
caugonnet Apr 6, 2026
0dc2d03
Add ctx.wait(), fix logical_data GC bug, numba_task helper, and simpl…
caugonnet Apr 7, 2026
cbbcc2f
Add task-free place support: exec_place_scope, pick_stream, get_place…
caugonnet Apr 7, 2026
cb05626
Expose data_place::allocate/deallocate through C API, Python bindings…
caugonnet Apr 7, 2026
49ddbe9
Merge branch 'main' into stf_c_api
caugonnet Apr 7, 2026
cab9f71
Merge branch 'main' into stf_c_api
caugonnet Apr 7, 2026
64d5848
Merge branch 'main' into stf_c_api
caugonnet Apr 7, 2026
486ca13
Add exec_place._handle_int property for FFI/ctypes interop
caugonnet Apr 7, 2026
6ed1987
Add STF green context bindings for Python.
caugonnet Apr 8, 2026
bb67603
[STF] Move stream pools to per-handle exec_place_resources registry
caugonnet Apr 20, 2026
7f72b99
[STF] Thread exec_place_resources through stream lookup call sites
caugonnet Apr 20, 2026
dab73bd
[STF] Add C++ tests and docs for explicit exec_place_resources stream…
caugonnet Apr 20, 2026
11b8b8b
[STF] Add C API and Python bindings for stackable contexts and exec_p…
caugonnet Apr 20, 2026
c0fd7d7
[STF] Add stackable-context Python test suite
caugonnet Apr 20, 2026
d547abc
pre-commit hooks
caugonnet Apr 20, 2026
3993bf4
[STF] Port linear algebra examples to nvmath-python + STF workspaces
caugonnet Apr 21, 2026
689c531
[STF] Add no_export empty stackable logical data in C API + Python
caugonnet Apr 22, 2026
93ecafd
[STF] Add explicit push() on stackable logical data in C API + Python
caugonnet Apr 22, 2026
17a2bf7
[STF] Expose async_resources_handle and caller-stream context in Python
caugonnet Apr 23, 2026
faf493b
[STF] Split stackable_ctx::pop() into pop_prologue/pop_epilogue
caugonnet Apr 26, 2026
c283065
[STF] Add C API and Python bindings for launchable stackable pop
caugonnet Apr 26, 2026
829268f
[STF] Make stream_ctx capture-safe and chain across back-to-back cont…
caugonnet Apr 26, 2026
6e857a9
[STF] Add shared-ownership launchable_graph for stackable_ctx
caugonnet Apr 26, 2026
2ae0272
[STF] C API for shared-ownership launchable_graph
caugonnet Apr 26, 2026
7c5b72f
[STF] Python bindings for shared-ownership launchable_graph
caugonnet Apr 26, 2026
32ddf6d
[STF] Add wp_stf Warp adapter and mixed Warp+PyTorch DAG tests
caugonnet Apr 29, 2026
d484e62
[STF] Fix C-facade dispatch for stackable tokens
caugonnet Apr 29, 2026
817bb50
[STF] Make graph_task and stream_task move-only
caugonnet Apr 29, 2026
947d0d2
[STF] Apply pre-commit hook reformatting
caugonnet Apr 29, 2026
f8b7fdd
Use an appropriate description of the DAG which is not a diamond shape
caugonnet Apr 30, 2026
5691af8
Merge main into STF Python bindings
andralex May 1, 2026
5f97c52
Merge remote-tracking branch 'caugonnet/stf_c_api' into work/pr-5315-…
andralex May 1, 2026
1e7c033
Merge remote-tracking branch 'origin/main' into work/pr-5315-merge-fix
andralex May 4, 2026
b3e6867
[STF] Fix CI after main merge
andralex May 4, 2026
81ca39a
[STF] Capture directly into ctx_graph on CTK 12.3+ via cudaStreamBegi…
caugonnet May 5, 2026
4492a10
[STF] Fix cudaErrorStreamCaptureIsolation on token().read() in capture
caugonnet May 6, 2026
e6965a9
[STF] Forward graph_scope finalize_prereqs into parent context
caugonnet May 6, 2026
4f2fb3c
Merge branch 'main' into stf_c_api
caugonnet May 12, 2026
04ec9ad
Remove Warp utility
caugonnet May 11, 2026
160396c
Warp/STF related wrappers are in Warp now
caugonnet May 11, 2026
66aba5b
Expose logical data initializers on stackable STF contexts
caugonnet May 18, 2026
c71b509
Test stackable logical data initializers
caugonnet May 18, 2026
98e3af5
pre-commit hooks
caugonnet May 18, 2026
c1f3eed
Merge branch 'main' into stf_c_api
caugonnet May 18, 2026
55f34c9
Merge branch 'main' into stf_c_api
caugonnet May 18, 2026
fae0627
This test would belong to Warp
caugonnet May 18, 2026
9a54c5a
Remove eager Burger PyTorch reference
caugonnet May 18, 2026
ee49ef6
Add branch while stackable graph example
caugonnet May 18, 2026
0b5262d
Add Python STF task graph helper
caugonnet May 18, 2026
cd232da
Merge remote-tracking branch 'upstream/main' into stf_c_api
caugonnet May 19, 2026
b5939a5
Merge origin/main into stf_c_api
caugonnet May 19, 2026
243062a
pre-commit hooks
caugonnet May 19, 2026
4459823
Use vector in STF places test buffer
caugonnet May 20, 2026
87ce7c8
Merge branch 'main' into stf_c_api
caugonnet May 20, 2026
438acb7
Merge branch 'main' into stf_c_api
andralex May 20, 2026
4e91f5d
Merge branch 'main' into stf_c_api
caugonnet May 21, 2026
12b4129
Merge branch 'main' into stf_c_api
caugonnet May 21, 2026
551d760
Document STF FHE composability examples
caugonnet May 22, 2026
08ce080
Merge branch 'main' into stf_c_api
caugonnet May 22, 2026
2d00b94
[STF] Port stream context capture fixes
caugonnet May 22, 2026
2b6d021
[STF] Use cuda.bindings for runtime calls
caugonnet May 22, 2026
cec4ac4
pre-commit hooks
caugonnet May 22, 2026
209e1f6
[STF] Skip Numba tests when Numba is unavailable
caugonnet May 22, 2026
c4de5c5
Merge branch 'main' into stf_c_api
caugonnet May 25, 2026
ce80f97
Merge branch 'main' into stf_c_api
caugonnet May 26, 2026
327bc18
Fix ruff import-order checks in STF tests
caugonnet May 26, 2026
4e1d024
[STF] ci: schedule base cuda.cccl wheel build for py3.13
andralex May 19, 2026
35c405d
Merge cuda-cccl-experimental into cuda-cccl as cuda.stf._experimental
caugonnet May 26, 2026
e3c3316
pre-commit hooks
caugonnet May 26, 2026
ded36ad
Remove STF debug probes and ad-hoc benchmark scripts
caugonnet May 26, 2026
545179b
Remove stray graphviz artifacts from repo root
caugonnet May 26, 2026
14d7f81
ci: drop ghost `python_experimental` project after STF merger
caugonnet May 26, 2026
f241555
Merge branch 'main' into stf_c_api
caugonnet May 26, 2026
364fee9
Merge branch 'main' into stf_c_api
caugonnet May 27, 2026
3fd17d3
[STF] Remove experimental LLM and MLP demos
caugonnet May 27, 2026
0e014b7
[STF] Remove experimental Warp simulation mockup
caugonnet May 27, 2026
ad7bb2e
[STF] Reorganize Python STF tests and promote interop adapters
caugonnet May 27, 2026
b470925
Merge branch 'main' into stf_c_api
caugonnet May 27, 2026
294b486
Merge branch 'main' into stf_c_api
caugonnet May 27, 2026
8ea81e9
pre-commit hooks
caugonnet May 27, 2026
efbcad3
Merge branch 'main' into stf_c_api
caugonnet May 27, 2026
edb3c43
Merge branch 'main' into stf_c_api
caugonnet May 28, 2026
e42c596
[STF] Use local extern C guards in C API header
caugonnet May 28, 2026
efc47ce
Merge branch 'main' into stf_c_api
caugonnet May 29, 2026
89dc425
Merge branch 'main' into stf_c_api
caugonnet May 31, 2026
01f0bf4
Merge branch 'main' into stf_c_api
caugonnet Jun 2, 2026
10568d5
do not touch this doc
caugonnet Jun 2, 2026
4fa8dc7
We don't use cccl/c/extern_c.h anymore
caugonnet Jun 2, 2026
f353320
revert useless change
caugonnet Jun 2, 2026
29ba25d
Merge branch 'main' into stf_c_api
caugonnet Jun 3, 2026
d96ced9
Update c2h_dependency inspect_changes fixture for python dep
caugonnet Jun 3, 2026
eb87418
[STF] Remove stackable_token_push_prologue debug probe
caugonnet Jun 3, 2026
d08b214
[STF] Remove duplicated stackable_ctx relaunch tests
caugonnet Jun 3, 2026
035a30a
[STF] Reframe stackable token push test comments as regression coverage
caugonnet Jun 3, 2026
6110331
[STF] Document Python interop adapters and fix stale doc links
caugonnet Jun 3, 2026
49df167
[STF] Guard optional torch/warp imports in Python STF tests
caugonnet Jun 3, 2026
a07cae1
[STF] Add missing license headers and fix set_exec_place in Python STF
caugonnet Jun 3, 2026
bbddedc
[STF] Slim and split Python Neural ODE examples
caugonnet Jun 3, 2026
dbee3d8
[STF] Reframe lifecycle test docstrings as regression coverage
caugonnet Jun 3, 2026
e65d392
Fix unified_task::get_stream(place_index) type check
caugonnet Jun 4, 2026
849f388
[STF] Skip cudax tests/examples in Python package build
caugonnet Jun 6, 2026
a1575f5
[STF] Use keyword args for cuda.compute calls in STF tests
caugonnet Jun 6, 2026
6928491
[STF] Fix broken imports and gate torch tests in STF tests
caugonnet Jun 6, 2026
eea8693
[STF] Unpack cuda-python error tuples in DeviceArray memcpy
caugonnet Jun 6, 2026
572eff3
[STF] Ship STF dev headers in cuda-cccl wheel + path discovery helpers
caugonnet Jun 6, 2026
6207eb7
[STF] Harden cuda-cccl path discovery for build isolation
caugonnet Jun 6, 2026
1aee7be
[STF] Add exec_place/data_place.from_handle and ExecPlaceLike duck-ty…
caugonnet Jun 6, 2026
10b4fb2
[STF] Test green-context places C API
caugonnet Jun 8, 2026
c238595
[STF] Avoid CuPy for zero logical data fills
caugonnet Jun 8, 2026
56818a9
[STF] Guard stf_machine_init at the C boundary
caugonnet Jun 8, 2026
908f59b
Merge branch 'main' into stf_c_api
caugonnet Jun 8, 2026
ca3c399
Merge branch 'main' into stf_c_api
caugonnet Jun 9, 2026
c71fa7e
Merge branch 'main' into stf_c_api
caugonnet Jun 9, 2026
13d88ee
[STF] Resolve graph instantiate conflict markers
caugonnet Jun 9, 2026
75b2a8c
Merge branch 'main' into stf_c_api
caugonnet Jun 9, 2026
836a023
[STF] Harden Python dep typing and path resolution
caugonnet Jun 9, 2026
cd0f0c0
[STF] Switch Burger examples to BiCGSTAB solver
caugonnet Jun 9, 2026
6f0ecf9
[STF] Skip nvmath-dependent examples when unavailable
caugonnet Jun 9, 2026
eabf767
[STF] Remove duplicate graph instantiation call
caugonnet Jun 9, 2026
2a15440
[STF] Clarify numba.jit context inference failures
caugonnet Jun 9, 2026
9af49af
[STF] Tighten numba interop error and exec_place validation
caugonnet Jun 9, 2026
3342fd1
pre-commit hooks
caugonnet Jun 9, 2026
a89c8b1
[STF] Fix stackable host_launch test and v2 build toggles
caugonnet Jun 9, 2026
07d55cf
Merge branch 'main' into stf_c_api
caugonnet Jun 9, 2026
8d6cc27
Merge branch 'main' into stf_c_api
caugonnet Jun 9, 2026
685ab5b
Update c2h inspect_changes expected lite output.
caugonnet Jun 10, 2026
82d20ce
Merge branch 'main' into stf_c_api
caugonnet Jun 10, 2026
c893ca9
[STF] Skip Python STF tests when compiled bindings are unavailable
caugonnet Jun 10, 2026
37c960c
Merge branch 'main' into stf_c_api
caugonnet Jun 10, 2026
8c05e60
pre-commit hooks
caugonnet Jun 10, 2026
f18ac6c
[STF] Remove duplicate host_launch C tests
caugonnet Jun 10, 2026
40540d5
[STF] Fix numba_task to end the STF task on setup failure
caugonnet Jun 10, 2026
677c381
[STF] Document that cross-context deps are rejected by the core
caugonnet Jun 10, 2026
20f730b
[STF] Fix and expand cuda.stf._experimental Python docs
caugonnet Jun 10, 2026
384102b
Merge branch 'main' into stf_c_api
caugonnet Jun 10, 2026
5f3e210
[STF] Use a realistic axpy chain as the Python intro example
caugonnet Jun 10, 2026
59d8620
[STF] Stabilize unfinalized context warning test
caugonnet Jun 10, 2026
4b066f7
[STF] Guard fill utils tests on bindings availability
caugonnet Jun 10, 2026
bd825ea
[STF] Scope Numba warning config in tests
caugonnet Jun 10, 2026
076fe32
[STF] Validate cuda_cccl wheel lookup in CI
caugonnet Jun 10, 2026
e32d9f3
[STF] Align lite Python STF CI version
caugonnet Jun 10, 2026
3fa91d2
[STF] Align BiCGSTAB test iteration count
caugonnet Jun 10, 2026
50188fb
[STF] Fail on unsupported PDSYMM side
caugonnet Jun 10, 2026
82194f3
[STF] Clarify stream ID handling during capture
caugonnet Jun 10, 2026
687aefb
[STF] Stabilize Warp stream cache key
caugonnet Jun 10, 2026
16ebcd5
[STF] Match Numba test sizes to launches
caugonnet Jun 10, 2026
2da1c87
Merge branch 'main' into stf_c_api
caugonnet Jun 10, 2026
d74bdd9
pre-commit hooks
caugonnet Jun 10, 2026
659a8e3
[STF] Preserve diffusion boundary values
caugonnet Jun 11, 2026
980a2e8
[STF] Remove standalone main blocks from tests
caugonnet Jun 11, 2026
34188f6
[STF] Require matplotlib for FDTD diagnostics
caugonnet Jun 11, 2026
44f8384
[STF] Validate DeviceArray inputs
caugonnet Jun 11, 2026
308ccc7
[STF] Make task graph reset cleanup-safe
caugonnet Jun 11, 2026
f6bba0c
Merge branch 'main' into stf_c_api
caugonnet Jun 11, 2026
b06e62d
[STF] Address Burger review nitpicks
caugonnet Jun 11, 2026
4600142
Merge branch 'main' into stf_c_api
caugonnet Jun 11, 2026
ade7c92
[STF] Address CodeRabbit follow-up review
caugonnet Jun 11, 2026
e892da6
pre-commit hooks
caugonnet Jun 11, 2026
05d90f0
[STF] Clarify Burger reference docstring
caugonnet Jun 11, 2026
4f93f06
Merge branch 'main' into stf_c_api
caugonnet Jun 11, 2026
b48b384
Remove stream pool changes from STF C API branch
caugonnet Jun 11, 2026
7a729d6
Restore merged stream pool comments
caugonnet Jun 11, 2026
1a08dde
Merge branch 'main' into stf_c_api
caugonnet Jun 11, 2026
bf1d107
Clarify task graph factory docs
caugonnet Jun 12, 2026
e4d533d
Merge branch 'main' into stf_c_api
caugonnet Jun 12, 2026
0f40e7a
Merge branch 'main' into stf_c_api
caugonnet Jun 22, 2026
a4917ad
stf: implement mem_create for green_ctx data place + name it by handle
caugonnet Jun 22, 2026
8cdae5e
Merge branch 'main' into stf_c_api
caugonnet Jul 1, 2026
f568c81
Merge branch 'main' into stf_c_api
caugonnet Jul 2, 2026
f2670d6
[STF] Accept CUDA stream protocol objects
caugonnet Jul 2, 2026
21d2ea7
[STF] Preserve structured CAI metadata
caugonnet Jul 2, 2026
5724d1a
[STF] Release borrowed place resources handles
caugonnet Jul 2, 2026
11f2e8a
[STF] Reject cross-context Python deps
caugonnet Jul 2, 2026
4c3c49d
Merge branch 'main' into stf_c_api
caugonnet Jul 2, 2026
9529906
pre-commit hooks
caugonnet Jul 2, 2026
5eddfed
[STF] Add multi-GPU Python CI coverage
caugonnet Jul 2, 2026
de030ef
Pin numba below 0.66 for Python CUDA extras
caugonnet Jul 2, 2026
649efcf
Merge branch 'main' into stf_c_api
caugonnet Jul 2, 2026
e8aa706
[STF] Split cuda.stf into a standalone cuda-stf package
caugonnet Jul 3, 2026
6402287
[STF] Make cuda-stf standalone; drop hard cuda-cccl dependency
caugonnet Jul 3, 2026
6191f45
Merge branch 'main' into stf_c_api
caugonnet Jul 3, 2026
bf3f3cd
pre-commit hooks
caugonnet Jul 3, 2026
ee08ce0
Merge branch 'main' into stf_c_api
caugonnet Jul 4, 2026
2bf929e
Fix use of `reduce_policy`
davebayer Jul 3, 2026
60f9329
[STF] Revert leftover cuda-cccl changes from the STF split
caugonnet Jul 4, 2026
cd181aa
Merge branch 'main' into stf_c_api
caugonnet Jul 4, 2026
9a015d4
Merge branch 'main' into stf_c_api
caugonnet Jul 8, 2026
3f46ed3
[STF] Reject cross-context waits in Python
caugonnet Jul 8, 2026
3862573
[STF] Reject noncontiguous CAI inputs
caugonnet Jul 8, 2026
a0bfbf7
Apply suggestion from @Jacobfaib
caugonnet Jul 8, 2026
f0f5504
[STF] Fix standalone Python documentation
caugonnet Jul 8, 2026
79f8817
Merge branch 'main' into stf_c_api
caugonnet Jul 9, 2026
be563bf
[STF] Add exec places from externally-owned CUDA contexts
caugonnet Jul 10, 2026
b19c931
[STF] Python: exec_place.from_context and cuda.core-backed green_plac…
caugonnet Jul 10, 2026
9a78a9f
[STF] Reject a null CUcontext in exec_place::cuda_context
caugonnet Jul 10, 2026
82c264f
[STF] Remove PR reference from CODEOWNERS comment
caugonnet Jul 10, 2026
3cb502e
[places] Implement cyclic_partition::get_executor
caugonnet Jul 11, 2026
39375e0
[places] Add geometry-aware allocation and returnable placement stats
caugonnet Jul 11, 2026
9e46795
[places] Add cute_partition: JAX-like structured tensor partitions
caugonnet Jul 11, 2026
50459da
[places] Test placement facilities and add a partitioned AXPY example
caugonnet Jul 11, 2026
f37c812
[places] Expose per-grid-position bytes in placement statistics
caugonnet Jul 11, 2026
b5e484d
Merge branch 'stf-cyclic-get-executor' into stf-cute-partitions-python
caugonnet Jul 11, 2026
e79a727
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 11, 2026
90b51dc
[STF] C API for placement evaluation and structured partitions
caugonnet Jul 11, 2026
024b540
[STF] Python: cute_partition, placement_evaluate, shaped allocation
caugonnet Jul 11, 2026
31ddd91
[places] Name the geometry-aware allocation allocate_nd
caugonnet Jul 11, 2026
90cbf9e
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 11, 2026
298a9b5
[STF] Follow the allocate_nd rename in the C API and Python bindings
caugonnet Jul 11, 2026
11741e0
[places] Implement cyclic_partition::get_executor
caugonnet Jul 11, 2026
2121dfd
[places] Harden placement APIs (review findings)
caugonnet Jul 11, 2026
c28747f
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 11, 2026
a94b66a
[STF] Harden the placement C API and Python bindings (review findings)
caugonnet Jul 11, 2026
5a28243
[places] Assert nonzero grid extents in cyclic get_executor
caugonnet Jul 12, 2026
55e4d18
Merge branch 'stf-cyclic-get-executor' into stf-cute-partitions-python
caugonnet Jul 12, 2026
5f1e008
[places] Drop the hand-rolled VMM check from the partitioned example
caugonnet Jul 12, 2026
8fd3b35
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 12, 2026
fbfa714
[places] Use all_devices and per-place launches in the partitioned ex…
caugonnet Jul 12, 2026
2772698
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 12, 2026
4aba5e3
[places] Skip trailing empty places in the partitioned AXPY loop
caugonnet Jul 12, 2026
1031f93
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 12, 2026
6f84405
[places] Migrate the Thrust allocator example to allocate_nd
caugonnet Jul 12, 2026
3336fdb
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 12, 2026
cc7edcc
[places] Store partition leaves in fixed-capacity device-ready arrays
caugonnet Jul 12, 2026
9bc98f7
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 12, 2026
96182e6
[places] Document structured partitions
caugonnet Jul 13, 2026
73dde1b
[places] Qualify the raw-byte allocate_nd form in the docs
caugonnet Jul 13, 2026
171ed2e
[STF] Include <cmath> in the partitioned_axpy example
caugonnet Jul 13, 2026
838b483
[places] Document that row-major front-ends reverse the whole descrip…
caugonnet Jul 13, 2026
6051d8d
Merge branch 'stf-cute-partitions' into stf-cute-partitions-python
caugonnet Jul 13, 2026
a6bdd68
[STF] Allocate DeviceArray through the extents form
caugonnet Jul 13, 2026
7afe2d2
[places] Reject partitions that leave grid places unused
caugonnet Jul 16, 2026
c8ae39d
[STF] Document localized Python tensor allocation
caugonnet Jul 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nvbench_helper/ @nvidia/cccl-infra-codeowners
**/cmake/ @nvidia/cccl-cmake-codeowners
# make an exception for the cudax test cmake file
cudax/test/CMakeLists.txt @nvidia/cccl-cudax-codeowners
# make an exception for STF test cmake files, following the PR #5406 cudax test precedent
# make an exception for STF test cmake files
cudax/test/stf/CMakeLists.txt @nvidia/cccl-cudax-codeowners
cudax/test/stf/static_error_checks/CMakeLists.txt @nvidia/cccl-cudax-codeowners

Expand Down
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Supported versions: `3.10`, `3.11`, `3.12`, `3.13`

* **cuda.compute** — Device-level algorithms, iterators, custom GPU types
* **cuda.coop._experimental** — Block/warp-level primitives for Numba CUDA
* **cuda.stf._experimental** — Stream Task Flow (CUDASTF) Python bindings, shipped in the standalone `cuda-stf` package (Linux only)
* **cuda.cccl.headers** — Programmatic access to headers

### Installation
Expand Down Expand Up @@ -262,14 +263,16 @@ include_paths = headers.get_include_paths()
./ci/test_cuda_coop_python.sh -py-version 3.10
./ci/test_cuda_cccl_headers_python.sh -py-version 3.10
./ci/test_cuda_cccl_examples_python.sh -py-version 3.10
./ci/test_cuda_stf_python.sh -py-version 3.10 # Linux only
```

Test organization:

* `tests/compute` — Algorithms and iterators
* `tests/coop` — Cooperative primitives
* `tests/headers` — Header integration
* `test_examples.py` — Runs compute/coop examples
* `python/cuda_stf/tests/stf` — Sequential Task Flow (separate `cuda-stf` package, Linux only)
* `test_examples.py` — Runs compute/coop examples (STF examples live in `python/cuda_stf/tests/test_examples.py`)

---

Expand Down
197 changes: 197 additions & 0 deletions c/experimental/stf/include/cccl/c/experimental/stf/stf.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ stf_exec_place_handle stf_exec_place_device(int dev_id);
//! \brief Create execution place for the current CUDA device.
stf_exec_place_handle stf_exec_place_current_device(void);

//! \brief Create an execution place from an externally-owned CUDA driver context \p ctx.
//!
//! The place is non-owning: the caller must keep \p ctx alive while the place is in
//! use. This is the natural entry point for contexts created by other libraries, e.g.
//! green contexts converted with cuCtxFromGreenCtx (such as the ones produced by
//! cuda.core in Python). \p dev_id is the device ordinal of the context, or -1 to
//! derive it from the context. \p ctx must not be NULL. Returns NULL on failure
//! (invalid context, allocation failure), with a diagnostic printed to stderr.
stf_exec_place_handle stf_exec_place_cuda_context(CUcontext ctx, int dev_id);

//! \brief Create a green-context helper for \p dev_id with \p sm_count SMs per green context.
//! Requires CUDA 12.4+. Returns NULL on failure.
stf_green_context_helper_handle stf_green_context_helper_create(int sm_count, int dev_id);
Expand Down Expand Up @@ -329,6 +339,193 @@ void stf_data_place_deallocate(stf_data_place_handle h, void* ptr, size_t size,
//! \return 1 if stream-ordered, 0 otherwise
int stf_data_place_allocation_is_stream_ordered(stf_data_place_handle h);

//! \brief Allocate memory at a data place for a tensor with the given extents.
//!
//! For most places this is equivalent to allocating
//! prod(data_dims) * elemsize bytes; composite places use the geometry to
//! back each block of the allocation on the place owning it according to the
//! partitioner (which is why the plain byte-count stf_data_place_allocate()
//! fails on them: a byte count alone does not carry the tensor geometry).
//! Extents follow the dimension-0-fastest linearization convention; row-major
//! callers should present reversed extents (and a coordinate-reversing
//! partitioner).
//!
//! \param h Data place handle (must not be NULL)
//! \param data_dims Extents of the tensor (must not be NULL)
//! \param elemsize Size of one element in bytes
//! \param stream CUDA stream for stream-ordered allocation (may be NULL)
//! \return Pointer to allocated memory (release with
//! stf_data_place_deallocate()), or NULL on failure
void* stf_data_place_allocate_nd(
stf_data_place_handle h, const stf_dim4* data_dims, uint64_t elemsize, cudaStream_t stream);

//! \}

//! \defgroup Placement Tensor placement description and evaluation
//! \brief Structured partitions (cute_partition) and placement statistics
//! \{

//! \brief Opaque handle to a structured tensor partition (see
//! stf_cute_partition_create()). Caller owns the handle; release with
//! stf_cute_partition_destroy().
typedef struct stf_cute_partition_opaque_t* stf_cute_partition_handle;

//! \brief Statistics describing how a localized allocation (or a dry-run
//! evaluation of one) distributes a tensor over data places.
//! The estimated fraction of block-local bytes ("accuracy") is
//! matching_samples / total_samples.
typedef struct stf_placement_stats
{
uint64_t total_bytes; //!< requested payload size in bytes
uint64_t vm_bytes; //!< block-rounded virtual reservation size in bytes
uint64_t block_size; //!< placement granularity in bytes
uint64_t nblocks; //!< number of placement blocks
uint64_t nallocs; //!< physical allocations after merging same-owner runs
uint64_t total_samples; //!< probes drawn by the block-owner sampler
uint64_t matching_samples; //!< probes agreeing with the chosen block owner
} stf_placement_stats;

//! \brief Per-dimension distribution policy (see stf_partition_dim_spec).
typedef enum stf_dim_policy
{
STF_DIM_WHOLE = 0, //!< dimension is not distributed
STF_DIM_BLOCKED = 1, //!< contiguous chunks of ceil(extent / places)
STF_DIM_CYCLIC = 2, //!< round-robin elements
STF_DIM_BLOCK_CYCLIC = 3 //!< round-robin blocks of a given size
} stf_dim_policy;

//! \brief Per-dimension entry of a JAX-like partition specification.
typedef struct stf_partition_dim_spec
{
int policy; //!< an stf_dim_policy value
int mesh_axis; //!< grid axis this dimension distributes over (ignored for STF_DIM_WHOLE)
uint64_t block; //!< block size (STF_DIM_BLOCK_CYCLIC only)
} stf_partition_dim_spec;

//! \brief Evaluate - without allocating - how a localized allocation would
//! distribute a tensor over the places of a grid.
//!
//! Runs the exact same block-owner decision procedure as the allocation path
//! and returns the resulting statistics, so a candidate mapping can be scored
//! (and its parameters tuned) before committing memory.
//!
//! \param grid Grid of execution places (must not be NULL)
//! \param mapper Partition function mapping element coordinates to a place
//! \param data_dims Extents of the tensor (dimension 0 fastest; must not be NULL)
//! \param elemsize Size of one element in bytes
//! \param probes Samples per block for the majority vote (0 = default)
//! \param block_size Placement granularity in bytes; 0 selects the device
//! allocation granularity when a device is present (2 MiB otherwise)
//! \param out_stats Filled with the resulting statistics (must not be NULL)
//! \param bytes_per_grid_index Optional array of one entry per grid position
//! (length = product of the grid dims), filled with the bytes owned by
//! each position; pass NULL to skip
//! \return 0 on success, non-zero on failure (diagnostic on stderr)
int stf_placement_evaluate(
stf_exec_place_handle grid,
stf_get_executor_fn mapper,
const stf_dim4* data_dims,
uint64_t elemsize,
uint64_t probes,
uint64_t block_size,
stf_placement_stats* out_stats,
uint64_t* bytes_per_grid_index);

//! \brief Variant of stf_placement_evaluate() for a structured partition.
//! The tensor extents are the partition's true extents.
int stf_placement_evaluate_partition(
stf_exec_place_handle grid,
stf_cute_partition_handle partition,
uint64_t elemsize,
uint64_t probes,
uint64_t block_size,
stf_placement_stats* out_stats,
uint64_t* bytes_per_grid_index);

//! \brief Build a structured partition from a JAX-like per-dimension
//! specification ("dimension 1, blocked over grid axis 0").
//!
//! Split dimensions are padded up to divisibility so the underlying layout is
//! exact; coordinates beyond the true extents own no bytes (predication).
//!
//! \param true_dims True tensor extents (dimension 0 fastest; must not be NULL)
//! \param grid_dims Extents of the grid of places (must not be NULL)
//! \param spec One entry per tensor dimension (must not be NULL)
//! \param rank Number of entries in \p spec (at most 4)
//! \return New partition handle, or NULL on invalid input
stf_cute_partition_handle stf_cute_partition_create(
const stf_dim4* true_dims, const stf_dim4* grid_dims, const stf_partition_dim_spec* spec, size_t rank);

//! \brief Build a structured partition directly from flattened
//! (extent, stride) leaves (expert form; see the C++ cute_partition docs).
//! Strides are in linear element units over the padded extents, dimension 0
//! fastest, leaf 0 fastest within each mode.
//!
//! \return New partition handle, or NULL if the leaves do not tile the padded
//! space exactly
stf_cute_partition_handle stf_cute_partition_from_leaves(
const uint64_t* place_extents,
const int64_t* place_strides,
const int* place_axes,
size_t num_place_leaves,
const uint64_t* local_extents,
const int64_t* local_strides,
size_t num_local_leaves,
const stf_dim4* padded_dims,
const stf_dim4* true_dims,
const stf_dim4* grid_dims);

//! \brief Destroy a partition handle (NULL is ignored).
void stf_cute_partition_destroy(stf_cute_partition_handle h);

//! \brief Get the true tensor extents of a partition.
void stf_cute_partition_true_dims(stf_cute_partition_handle h, stf_dim4* out_dims);

//! \brief Get the padded tensor extents of a partition.
void stf_cute_partition_padded_dims(stf_cute_partition_handle h, stf_dim4* out_dims);

//! \brief Get the grid extents of a partition.
void stf_cute_partition_grid_dims(stf_cute_partition_handle h, stf_dim4* out_dims);

//! \brief Number of leaves in the place mode.
size_t stf_cute_partition_num_place_leaves(stf_cute_partition_handle h);

//! \brief Number of leaves in the local mode.
size_t stf_cute_partition_num_local_leaves(stf_cute_partition_handle h);

//! \brief Fill the place-mode leaves (arrays sized by
//! stf_cute_partition_num_place_leaves(); any output may be NULL to skip).
void stf_cute_partition_get_place_leaves(stf_cute_partition_handle h, uint64_t* extents, int64_t* strides, int* axes);

//! \brief Fill the local-mode leaves (arrays sized by
//! stf_cute_partition_num_local_leaves(); any output may be NULL to skip).
void stf_cute_partition_get_local_leaves(stf_cute_partition_handle h, uint64_t* extents, int64_t* strides);

//! \brief Linear element offset (in the padded space) of a place's first
//! element, given the place's linear index in place-mode order.
//! Returns UINT64_MAX (with a diagnostic on stderr) if the index is out of
//! range.
uint64_t stf_cute_partition_place_offset(stf_cute_partition_handle h, uint64_t place_index);

//! \brief Create a composite data place backed by a structured partition.
//!
//! Such a place is specific to one tensor (the partition's true extents):
//! allocate with stf_data_place_allocate_nd() using those extents.
//!
//! \param grid Grid of execution places (must not be NULL)
//! \param partition Structured partition (must not be NULL; copied)
//! \return New data place handle, or NULL on failure
stf_data_place_handle stf_data_place_composite_cute(stf_exec_place_handle grid, stf_cute_partition_handle partition);

//! \brief Native blocked partition function for a given dimension
//! (values outside [0, 3] select the highest-rank dimension, like -1),
//! usable wherever an stf_get_executor_fn is expected without any FFI
//! callback cost.
stf_get_executor_fn stf_partition_fn_blocked(int dim);

//! \brief Native cyclic (round-robin) partition function.
stf_get_executor_fn stf_partition_fn_cyclic(void);

//! \}

//! \defgroup Handles Opaque Handles
Expand Down
Loading
Loading