MoonshotAI / MoonshotAI/MoonEP
Deduplicate _max_smem_per_block_optin across 5 files
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 134
- PR merge metrics
- No merged PRs in 30d
Description
Problem
The function _max_smem_per_block_optin is copy-pasted identically across 5 files:
moonep/prefetch.pymoonep/grad_reduce.pymoonep/dispatch_epilogue.pymoonep/combine_prologue.pymoonep/combine.py
Recommendation
Move to moonep/_common.py (which already exists and contains shared utilities like inline_ptx, grid_sync, etc.) and import from there.
Impact
Maintainability. If the function needs to change (e.g., new GPU architecture support), it currently requires editing 5 files. Should be 1.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the identical _max_smem_per_block_optin definitions in moonep/prefetch.py, moonep/grad_reduce.py, moonep/dispatch_epilogue.py, moonep/combine_prologue.py, and moonep/combine.py, then inspect the shared utilities in moonep/_common.py. Move the function there and update all five files to import it; done means the duplicate definitions are removed and each caller uses the shared utility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100