mirror of
https://github.com/deepseek-ai/DeepGEMM.git
synced 2026-11-05 00:47:26 +00:00
[PR #442] Add torch dispatcher op for tf32_hc_prenorm_gemm #450
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepGEMM#450
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/442
Author: @leevan
Created: 9/14/2026
Status: 🔄 Open
Base:
main← Head:feat/torchop-tf32-hc-prenorm📝 Commits (2)
38f0dc2Add torch dispatcher op for tf32_hc_prenorm_gemm9f07225Address review: FRAGMENT registration, num_splits check, test📊 Changes
3 files changed (+96 additions, -0 deletions)
View changed files
➕
csrc/apis/torch_ops.hpp(+60 -0)📝
csrc/python_api.cpp(+1 -0)📝
tests/test_hyperconnection.py(+35 -0)📄 Description
What
Registers
deep_gemm::tf32_hc_prenorm_gemmas a torch dispatcher op (torch.ops.deep_gemm.tf32_hc_prenorm_gemm) in addition to the existing pybind binding.Why
External C++ (and Python) callers can then invoke this kernel through the PyTorch dispatcher without including DeepGEMM headers or linking against DeepGEMM — e.g. a host-side C++ extension can resolve it via
c10::Dispatcher::singleton().findSchemaOrThrow("deep_gemm::tf32_hc_prenorm_gemm", ""). The schema is compiled into the_Cextension alongside the pybind bindings, so the op is available as soon asimport deep_gemmloads_C.Details
csrc/apis/torch_ops.hpp:deep_gemm::hyperconnection::tf32_hc_prenorm_gemm, convertingstd::optional<int64_t>→std::optional<int>.TORCH_LIBRARY(deep_gemm)schema:tf32_hc_prenorm_gemm(Tensor a, Tensor b, Tensor(d!) d, Tensor(s!) sqr_sum, int? num_splits=None) -> ()—dandsqr_sumare marked mutable (written in place),num_splitsdefaults toNoneto match the pybind signature.TORCH_LIBRARY_IMPL(deep_gemm, CUDA)registering the CUDA implementation.csrc/python_api.cpp: include the new header so the schema is compiled into_C.Notes
TORCH_LIBRARYhandle is namedlib(notm) so the.pyistub generator, which scans csrc for pybind-stylem.def(...), skips these dispatcher schemas.torch.compile.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.