[Misc] Consolidate csrc shared headers and prune dead code (#60721)

Signed-off-by: mgoin <mgoin64@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Misha Goin
2026-10-12 09:46:22 -07:00
committed by GitHub
co-authored by Claude
parent e0317b28ce
commit d79b52b182
242 changed files with 2783 additions and 3638 deletions
@@ -0,0 +1,35 @@
#include "ops.h"
#include "core/registration.h"
#include <torch/csrc/stable/library.h>
STABLE_TORCH_LIBRARY_FRAGMENT(_C_custom_ar, custom_ag_rs) {
custom_ag_rs.def(
"custom_all_gather(int fa, Tensor inp, Tensor! out, int reg_buffer, "
"int reg_buffer_sz_bytes) -> ()");
custom_ag_rs.def(
"mnnvl_lamport_all_gather(int fa, Tensor inp, Tensor! out, int "
"local_buffer, int multicast_buffer, int epoch_buffer, int "
"stage_sz_bytes) -> ()");
custom_ag_rs.def(
"custom_reduce_scatter(int fa, Tensor inp, Tensor! out, int reg_buffer, "
"int reg_buffer_sz_bytes) -> ()");
custom_ag_rs.def(
"mnnvl_lamport_reduce_scatter(int fa, Tensor inp, Tensor! out, int "
"local_buffer, int epoch_buffer, int stage_sz_bytes) -> ()");
custom_ag_rs.def(
"mnnvl_multimem_reduce_scatter(int fa, Tensor inp, Tensor! out, int "
"local_buffer, int multicast_buffer, int stage_sz_bytes, int "
"block_limit) -> ()");
}
STABLE_TORCH_LIBRARY_IMPL(_C_custom_ar, CUDA, custom_ag_rs) {
custom_ag_rs.impl("custom_all_gather", TORCH_BOX(&custom_all_gather));
custom_ag_rs.impl("mnnvl_lamport_all_gather",
TORCH_BOX(&mnnvl_lamport_all_gather));
custom_ag_rs.impl("custom_reduce_scatter", TORCH_BOX(&custom_reduce_scatter));
custom_ag_rs.impl("mnnvl_lamport_reduce_scatter",
TORCH_BOX(&mnnvl_lamport_reduce_scatter));
custom_ag_rs.impl("mnnvl_multimem_reduce_scatter",
TORCH_BOX(&mnnvl_multimem_reduce_scatter));
}