Skip to content

Dynamic threadgroup memory#750

Draft
christiangnrd wants to merge 9 commits into
mainfrom
dynmem
Draft

Dynamic threadgroup memory#750
christiangnrd wants to merge 9 commits into
mainfrom
dynmem

Conversation

@christiangnrd

@christiangnrd christiangnrd commented Mar 1, 2026

Copy link
Copy Markdown
Member

Surprisingly it's somewhat functional. Only macOS 15+ since the global dynamic threadgroup memory is not available before then. This isn't the only way to get this dynamic threadgroup memory, but I tried this approach as my first attempt since it seemed the most similar to how static threadgroup memory is implemented.

The Metal interface takes an Integer or a Tuple of the size of the allocation, which is then aligned to the next multiple of 16.

Kernels silently fail under shader validation (which are caught in the tests since the output doesn't match expected results.

TODO:

  • Validate total threadgroup memory used
  • Make work under shader validation

Close #701

@codecov

codecov Bot commented Mar 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.03%. Comparing base (edeab68) to head (c6bf0b4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #750      +/-   ##
==========================================
+ Coverage   78.55%   82.03%   +3.47%     
==========================================
  Files          67       64       -3     
  Lines        3605     3590      -15     
==========================================
+ Hits         2832     2945     +113     
+ Misses        773      645     -128     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@christiangnrd christiangnrd added help wanted Extra attention is needed kernels Things about kernels and how they are compiled. labels Mar 14, 2026
@christiangnrd christiangnrd force-pushed the dynmem branch 10 times, most recently from 26d4370 to 70d9023 Compare June 7, 2026 17:58
@christiangnrd christiangnrd force-pushed the dynmem branch 2 times, most recently from 0b9c156 to c6bf0b4 Compare June 16, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed kernels Things about kernels and how they are compiled.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for dynamic shared memory

1 participant