[PyTorch] Add torch.compile custom ops for GroupedLinear - #32
Draft
pggPL wants to merge 1 commit into
Draft
Conversation
pggPL
force-pushed
the
grouped_linear_compile
branch
from
August 13, 2026 10:27
926952e to
45a2c8b
Compare
pggPL
changed the base branch from
linear_compile_on_main
to
linear_torch_compile_final_attempt
August 13, 2026 10:27
pggPL
force-pushed
the
grouped_linear_compile
branch
from
September 10, 2026 10:33
e431045 to
2859669
Compare
pggPL
changed the base branch from
linear_torch_compile_final_attempt
to
main
September 10, 2026 10:33
pggPL
force-pushed
the
grouped_linear_compile
branch
from
September 10, 2026 10:44
2859669 to
71732da
Compare
5 tasks
pggPL
force-pushed
the
grouped_linear_compile
branch
from
September 10, 2026 11:24
71732da to
2db50bd
Compare
pggPL
force-pushed
the
grouped_linear_refactor
branch
from
September 10, 2026 11:24
50ca413 to
d007d1c
Compare
pggPL
force-pushed
the
grouped_linear_compile
branch
from
September 10, 2026 11:31
2db50bd to
c89b414
Compare
Reuse eager computation for both grouped paths and add fake implementations, registrations, saved-state serialization and compile dispatch. Extend argument packing and autograd routing for tensor lists and SymInt lists, including empty lists, with compile regression coverage. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
pggPL
force-pushed
the
grouped_linear_refactor
branch
from
September 11, 2026 11:34
d007d1c to
a3c005d
Compare
pggPL
force-pushed
the
grouped_linear_compile
branch
from
September 11, 2026 11:34
c89b414 to
151f2b2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add
torch.compile(fullgraph=True)support tote.pytorch.GroupedLinearon top of the eager refactor in #50. Both custom ops reuse the shared forward/backward computation from that PR.This is the second of two stacked PRs; its base is
grouped_linear_refactor.Type of change
Changes
_FieldPlan/_ArgPlanwith tensor-list packing, per-element gradients, subclass flattening andSymInt[]inputs. Flatten mixed tensor/storage lists in one pass, and cover empty SymInt lists in autograd with a regression test.Validation
RTX Ada workstation, current source:
test_torch_compile.py+test_grouped_linear.py: 849 passed, 608 skipped, 2 XPASS.fullgraph=Trueprobe: forward/backward numerics and changing device splits without recompilation pass with grouped GEMM replaced by matmuls. This does not validate native fused kernels or CUDA-graph capture.attention/fused_mla_q_uproj.py.The installed PyTorch 2.14 development build exposes
is_opaque_value_typeinstead of theis_opaque_constant_typename expected by TE main. Tests used a temporary compatibility alias outside the repository.Native fused grouped GEMM tests require Hopper/Blackwell and were skipped on RTX Ada.
Limitations
Unsupported configurations fall back to eager: debug instrumentation, distributed weights, CPU offloading, delayed wgrad, fused wgrad accumulation, caller-provided output buffers, single grouped parameters and non-value-opaque quantizers. Legacy compiled execution requires host-side splits; fused execution requires CUDA splits. Fused
save_original_input=Truefalls back to eager.Checklist