Add tests/parallel/examples/scan/scan_applications.py#5634
Merged
shwina merged 2 commits intoNVIDIA:mainfrom Aug 26, 2025
Merged
Add tests/parallel/examples/scan/scan_applications.py#5634shwina merged 2 commits intoNVIDIA:mainfrom
shwina merged 2 commits intoNVIDIA:mainfrom
Conversation
This file contains two applications. 1. inclusive_segmented_scan_example This example demonstrates how to compute segmented scan using ordinary scan with crafter scan operation over flag-value struct. This example uses ZipIterator to efficiently read values and head flags. 2. logcdf_from_logpdf_example This example uses inclusive_scan with logaddsum operation (v1, v2) -> log(exp(v1) + exp(v2)) Applied to a sequence of log-probabilities, computed for binomial distribution in this example using cupyx, the result should be a strictly increasing sequence that ends with 0.0 == log(1.0). Due to numerical accuracy issues (?) this is not always true, so we follow up with another application of inclusive_scan with maximum operator, producing strictly non-decreasing sequence. cp.searchsorted is used to compute quantiles of binomial distribution. Result is compared with reference scipy.stats.distributions.binom.isf
Contributor
🟩 CI finished in 33m 25s: Pass: 100%/22 | Total: 3h 51m | Avg: 10m 31s | Max: 19m 39s
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| CCCL Packaging | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| CCCL Packaging | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
🏃 Runner counts (total jobs: 22)
| # | Runner |
|---|---|
| 16 | linux-amd64-gpu-l4-latest-1 |
| 4 | linux-amd64-gpu-h100-latest-1 |
| 2 | linux-amd64-cpu16 |
Member
|
Very cool! |
Contributor
🟩 CI finished in 31m 40s: Pass: 100%/22 | Total: 3h 59m | Avg: 10m 52s | Max: 20m 43s
|
| Project | |
|---|---|
| CCCL Infrastructure | |
| CCCL Packaging | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
Modifications in project or dependencies?
| Project | |
|---|---|
| CCCL Infrastructure | |
| CCCL Packaging | |
| libcu++ | |
| CUB | |
| Thrust | |
| CUDA Experimental | |
| stdpar | |
| +/- | python |
| CCCL C Parallel Library | |
| Catch2Helper |
🏃 Runner counts (total jobs: 22)
| # | Runner |
|---|---|
| 16 | linux-amd64-gpu-l4-latest-1 |
| 4 | linux-amd64-gpu-h100-latest-1 |
| 2 | linux-amd64-cpu16 |
davebayer
pushed a commit
to davebayer/cccl
that referenced
this pull request
Sep 23, 2025
* Add tests/parallel/examples/scan/scan_applications.py This file contains two applications. 1. inclusive_segmented_scan_example This example demonstrates how to compute segmented scan using ordinary scan with crafter scan operation over flag-value struct. This example uses ZipIterator to efficiently read values and head flags. 2. logcdf_from_logpdf_example This example uses inclusive_scan with logaddsum operation (v1, v2) -> log(exp(v1) + exp(v2)) Applied to a sequence of log-probabilities, computed for binomial distribution in this example using cupyx, the result should be a strictly increasing sequence that ends with 0.0 == log(1.0). Due to numerical accuracy issues (?) this is not always true, so we follow up with another application of inclusive_scan with maximum operator, producing strictly non-decreasing sequence. cp.searchsorted is used to compute quantiles of binomial distribution. Result is compared with reference scipy.stats.distributions.binom.isf * Add example of computing exponential moving average using inclusive_scan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This file contains two applications.
This example demonstrates how to compute segmented scan using ordinary scan with crafter scan operation over flag-value struct.
This example uses
ZipIteratorto efficiently read values and head flags.This example uses$v_1, v_2 \to \log(\exp(v_1) + \exp(v_2))$
inclusive_scanwith logaddsum operation:Applied to a sequence of log-probabilities, computed for binomial distribution in this example using cupyx, the result should be a strictly increasing sequence that ends with
0.0 == log(1.0).Due to numerical accuracy issues (?) this is not always true, so we follow up with another application of inclusive_scan with maximum operator, producing strictly non-decreasing sequence.
cp.searchsorted is used to compute quantiles of binomial distribution. Result is compared with reference scipy.stats.distributions.binom.isf
Checklist