Problem
The function _max_smem_per_block_optin is copy-pasted identically across 5 files:
moonep/prefetch.py
moonep/grad_reduce.py
moonep/dispatch_epilogue.py
moonep/combine_prologue.py
moonep/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.
Problem
The function
_max_smem_per_block_optinis copy-pasted identically across 5 files:moonep/prefetch.pymoonep/grad_reduce.pymoonep/dispatch_epilogue.pymoonep/combine_prologue.pymoonep/combine.pyRecommendation
Move to
moonep/_common.py(which already exists and contains shared utilities likeinline_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.