Skip to content

[CUDAX] Remove assign and execution policy from async_buffer - #4604

Merged
pciolkosz merged 1 commit into
NVIDIA:mainfrom
pciolkosz:remove_assign
May 2, 2025
Merged

pciolkosz merged 1 commit into
NVIDIA:mainfrom
pciolkosz:remove_assign

Conversation

@pciolkosz

Copy link
Copy Markdown
Contributor

Currently async_buffer technically has both size and capacity, because assign can could assign a smaller sequence to the buffer. We don't fully expose capacity controls, so this is all internal detail that is hard to control. Assign was also capable of reallocating the buffer.
This PR aims to simplify that and drop both assign and internal separate size and capacity tracking. Size will now always report full size of the allocation.
With the recently added move assignment operator the buffer can be explicitly resized by the user by constructing and assigning a new buffer. This way it's easier to understand reallocation is happening and provide separate streams for previous buffer destruction and new buffer construction.
With the last member function in the async_buffer that could submit meaningful GPU work gone there is no need for the buffer to hold execution policy anymore. The policy was unused even before the changes in this PR, but now it's doubtful it would be useful past the buffer construction. The environment type used during buffer construction will retain its execution policy member in case the buffer constructor would utilize it in the future.

@pciolkosz
pciolkosz requested review from a team as code owners April 30, 2025 23:32
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Apr 30, 2025
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Apr 30, 2025
@github-actions

github-actions Bot commented May 1, 2025

Copy link
Copy Markdown
Contributor
ðŸŸĐ CI finished in 31m 25s: Pass: 100%/26 | Total: 2h 21m | Avg: 5m 26s | Max: 12m 35s | Hits: 96%/14616
  • ðŸŸĐ cudax: Pass: 100%/26 | Total: 2h 21m | Avg: 5m 26s | Max: 12m 35s | Hits: 96%/14616

    ðŸŸĐ cpu
      ðŸŸĐ amd64              Pass: 100%/22  | Total:  2h 06m | Avg:  5m 45s | Max: 12m 35s | Hits:  96%/12276 
      ðŸŸĐ arm64              Pass: 100%/4   | Total: 14m 53s | Avg:  3m 43s | Max:  3m 53s | Hits:  96%/2340  
    ðŸŸĐ ctk
      ðŸŸĐ 12.0               Pass: 100%/3   | Total: 20m 22s | Avg:  6m 47s | Max: 12m 35s | Hits:  95%/1460  
      ðŸŸĐ 12.8               Pass: 100%/23  | Total:  2h 01m | Avg:  5m 16s | Max: 11m 24s | Hits:  96%/13156 
    ðŸŸĐ cudacxx
      ðŸŸĐ nvcc12.0           Pass: 100%/3   | Total: 20m 22s | Avg:  6m 47s | Max: 12m 35s | Hits:  95%/1460  
      ðŸŸĐ nvcc12.8           Pass: 100%/23  | Total:  2h 01m | Avg:  5m 16s | Max: 11m 24s | Hits:  96%/13156 
    ðŸŸĐ cudacxx_family
      ðŸŸĐ nvcc               Pass: 100%/26  | Total:  2h 21m | Avg:  5m 26s | Max: 12m 35s | Hits:  96%/14616 
    ðŸŸĐ cxx
      ðŸŸĐ Clang14            Pass: 100%/2   | Total:  8m 00s | Avg:  4m 00s | Max:  4m 02s | Hits:  96%/1174  
      ðŸŸĐ Clang15            Pass: 100%/1   | Total:  4m 31s | Avg:  4m 31s | Max:  4m 31s | Hits:  96%/585   
      ðŸŸĐ Clang16            Pass: 100%/1   | Total:  4m 15s | Avg:  4m 15s | Max:  4m 15s | Hits:  96%/585   
      ðŸŸĐ Clang17            Pass: 100%/1   | Total:  4m 11s | Avg:  4m 11s | Max:  4m 11s | Hits:  96%/585   
      ðŸŸĐ Clang18            Pass: 100%/1   | Total:  4m 13s | Avg:  4m 13s | Max:  4m 13s | Hits:  96%/585   
      ðŸŸĐ Clang19            Pass: 100%/4   | Total: 19m 53s | Avg:  4m 58s | Max:  8m 13s | Hits:  97%/2340  
      ðŸŸĐ GCC10              Pass: 100%/2   | Total:  7m 51s | Avg:  3m 55s | Max:  4m 02s | Hits:  96%/1174  
      ðŸŸĐ GCC11              Pass: 100%/1   | Total:  4m 07s | Avg:  4m 07s | Max:  4m 07s | Hits:  96%/585   
      ðŸŸĐ GCC12              Pass: 100%/1   | Total:  4m 09s | Avg:  4m 09s | Max:  4m 09s | Hits:  96%/585   
      ðŸŸĐ GCC13              Pass: 100%/8   | Total: 39m 56s | Avg:  4m 59s | Max:  9m 01s | Hits:  97%/4680  
      ðŸŸĐ MSVC14.39          Pass: 100%/1   | Total: 12m 35s | Avg: 12m 35s | Max: 12m 35s | Hits:  89%/286   
      ðŸŸĐ MSVC14.42          Pass: 100%/1   | Total: 11m 24s | Avg: 11m 24s | Max: 11m 24s | Hits:  89%/286   
      ðŸŸĐ NVHPC25.3          Pass: 100%/2   | Total: 16m 32s | Avg:  8m 16s | Max:  8m 26s | Hits:  94%/1166  
    ðŸŸĐ cxx_family
      ðŸŸĐ Clang              Pass: 100%/10  | Total: 45m 03s | Avg:  4m 30s | Max:  8m 13s | Hits:  97%/5854  
      ðŸŸĐ GCC                Pass: 100%/12  | Total: 56m 03s | Avg:  4m 40s | Max:  9m 01s | Hits:  97%/7024  
      ðŸŸĐ MSVC               Pass: 100%/2   | Total: 23m 59s | Avg: 11m 59s | Max: 12m 35s | Hits:  89%/572   
      ðŸŸĐ NVHPC              Pass: 100%/2   | Total: 16m 32s | Avg:  8m 16s | Max:  8m 26s | Hits:  94%/1166  
    ðŸŸĐ gpu
      ðŸŸĐ h100               Pass: 100%/2   | Total: 11m 58s | Avg:  5m 59s | Max:  8m 25s | Hits:  98%/1170  
      ðŸŸĐ rtx2080            Pass: 100%/24  | Total:  2h 09m | Avg:  5m 24s | Max: 12m 35s | Hits:  96%/13446 
    ðŸŸĐ jobs
      ðŸŸĐ Build              Pass: 100%/23  | Total:  1h 55m | Avg:  5m 02s | Max: 12m 35s | Hits:  96%/12861 
      ðŸŸĐ Test               Pass: 100%/3   | Total: 25m 39s | Avg:  8m 33s | Max:  9m 01s | Hits:  99%/1755  
    ðŸŸĐ sm
      ðŸŸĐ 90                 Pass: 100%/3   | Total: 15m 43s | Avg:  5m 14s | Max:  8m 25s | Hits:  97%/1755  
      ðŸŸĐ 90a                Pass: 100%/1   | Total:  3m 44s | Avg:  3m 44s | Max:  3m 44s | Hits:  96%/585   
    ðŸŸĐ std
      ðŸŸĐ 17                 Pass: 100%/4   | Total: 19m 39s | Avg:  4m 54s | Max:  8m 26s | Hits:  96%/2338  
      ðŸŸĐ 20                 Pass: 100%/22  | Total:  2h 01m | Avg:  5m 32s | Max: 12m 35s | Hits:  96%/12278 
    

👃 Inspect Changes

Modifications in project?

Project
CCCL Infrastructure
libcu++
CUB
Thrust
+/- CUDA Experimental
stdpar
python
CCCL C Parallel Library
Catch2Helper

Modifications in project or dependencies?

Project
CCCL Infrastructure
libcu++
CUB
Thrust
+/- CUDA Experimental
stdpar
python
CCCL C Parallel Library
Catch2Helper

🏃‍ Runner counts (total jobs: 26)

# Runner
17 linux-amd64-cpu16
4 linux-arm64-cpu16
2 windows-amd64-cpu16
2 linux-amd64-gpu-rtx2080-latest-1
1 linux-amd64-gpu-h100-latest-1

@miscco miscco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to note that initialization is also meaningfull work, so we might need to retain the execution policy if we want to not just drop this and go back to uninitialized buffer

@pciolkosz

Copy link
Copy Markdown
Contributor Author

I would like to note that initialization is also meaningfull work, so we might need to retain the execution policy if we want to not just drop this and go back to uninitialized buffer

I agree and noted at the end of the description that environment will most likely retain the execution policy for the initialization part, but after the buffer is constructed there is no reason to store it in the buffer

@pciolkosz
pciolkosz merged commit b246a81 into NVIDIA:main May 2, 2025
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants