Repository navigation
Conversation
…ters Pass split Linear parameters through the custom-op boundary, reconstruct checked views at execution time and split full gradients outside backward. Preserve concatenation for disjoint storage and returned biases, handle promoted dtypes, and compute bias gradients when weights are frozen. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Replace ConcatenatedTensor with DeferredCat(parts), expose metadata through to_spec and keep materialization inside the custom op. Preserve deferred backward operands for non-FP8 training, reject quantized parts, and make dimension checks consume explicit metadata. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Keep singleton operands unwrapped and represent split parameters with immutable ParameterParts through the ConcatInput alias. Centralize eager and compiled input preparation, let the custom-op adapter restore saved parts, and select the execution path before concatenating parameters. Name backward weights by their role and update the existing MLA caller. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Restore compile_unsupported_reason, setup_saved_tensors(ctx), the original backward operand names, and the existing adapter contract. Remove the unrelated MLA changes. Retain the parameter-parts alias and helper, split-parameter correctness fixes, and focused regression coverage. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Use None when Linear has no deferred parameter parts, including eager forward, saved backward arguments and compile fallbacks. This avoids allocating empty weight and bias lists on the ordinary eager path. Transport Optional[List[Tensor]] through Tensor[]? custom-op inputs, preserving None without allocating replacement lists. Keep split-gradient handling outside the backward op and let the adapter supply absent list gradients when needed. Cover ordinary and optional lists, empty lists and None in the adapter test. Validate the full compile suite (384 passed, 62 skipped, one existing XPASS), 55 focused cases, 30 numerical Linear cases, pre-commit and Python L0 lint. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Use the same checked view or concatenation in eager and compiled Linear. Pass individual parts as explicit autograd inputs and save the materialized operands for eager backward, which returns views of the full gradients. Preserve the single-parameter and external-bias paths. Derive the view strides directly from contiguous parts to avoid symbolic stride-helper overhead. Extend the existing storage and cat-count tests. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
|
TE CI — selected tests Pipeline ID: Selected CI jobs and pytest filters are listed below. Frameworks: PyTorch Mode: PR Python, tests and QA with prebuilt native libraries; no TE rebuild. Selected jobs: 1
Not run (manual/skipped): 14 Show jobs not run
Results are reported as individual commit statuses on this PR. |
|
TE CI — selected tests Pipeline ID: Selected CI jobs and pytest filters are listed below. Frameworks: PyTorch Mode: PR Python, tests and QA with prebuilt native libraries; no TE rebuild. Pytest include: Job results cover this pytest subset. Non-pytest QA commands are unchanged. Selected jobs: 1
Not run (manual/skipped): 14 Show jobs not run
Results are reported as individual commit statuses on this PR. |
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
|
TE CI — selected tests Pipeline ID: Selected CI jobs and pytest filters are listed below. Frameworks: PyTorch Mode: PR Python, tests and QA with prebuilt native libraries; no TE rebuild. Pytest exclude: Job results cover this pytest subset. Non-pytest QA commands are unchanged. Selected jobs: 7
Not run (manual/skipped): 9 Show jobs not run
Results are reported as individual commit statuses on this PR. |
Merge main 9b7e959. Preserve the existing seven-file split Linear change without conflicts. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Restore the tree from 917773b. The split-parameter support belongs in PR NVIDIA#3623. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Share Linear's checked view/cat helper for split weights and fused biases. Pass the parts as explicit autograd inputs, save full operands for backward and return views of the full parameter gradients. Keep backward computation and saved-tensor restoration unchanged. Compute split shapes only when configuring weight quantization, and extend the existing cat-count regression to eager LayerNormLinear. Remove standalone storage-helper and tensor-list adapter tests at the user's request. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Replace five split-parameter tests with one parameterized integration test. Cover gradients, inference, recipes, bias modes, storage and parameter updates, saved-version checks and concatenation counts in a shared execution flow. Use ordinary torch.cat in the reference to verify deferred gradient routing. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Rely on concat_input to select nonempty ordinary tensor lists. Preserve storage, layout, offset and bounds checks before reconstructing a view. Extend the shared integration test with LayerNormLinear recipes and dtype/ split variants, plus mixed parameter dtypes under autocast. Keep dtype promotion in fake concatenation to match torch.cat metadata. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Remove the deferred-concatenation switch from Linear and LayerNormLinear parameter getters. Keep bias routing in the getters and explicitly concatenate deferred operands in the ONNX inference paths. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Rename concat_input to prepare_parameter and drop the tensors suffix from the Linear and LayerNormLinear getters, which can return split lists. Use the same forward operand names in LayerNormLinear as in Linear. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Use the presence of parameter_split_sizes to select gradient splitting in eager Linear and LayerNormLinear backward instead of counting the fixed positional autograd inputs. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Restore parameter lists from named input-list lengths already tracked by the custom-op adapter. Remove the duplicate lengths and the saved weight alias flag from Linear backward arguments. Resolve a missing plain split weight in the existing backward workspace reconstruction path. Extend the split integration test with workspace caching, reconstruction and high-precision/dequantized backward overrides. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Move selected split scenarios into the Linear compile and LayerNormLinear sanity tests, and add a split case to the existing microbatch cache test. Share parameter-update assertions and remove the standalone split test. Append complete scenarios without multiplying the existing parameter axes. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Move the parameter-update helper from the shared test utilities into test_torch_compile.py and name it _check_module_outputs_and_grads. Restore the shared utility module to its upstream contents. Signed-off-by: Pawel Gadzinski <pgadzinski@nvidia.com>
Description
Compiled
te.Linear(parameters_split=...)can consume adjacent parameter partswithout a concatenation copy. Pass the original parts through the custom op and
construct a checked view inside the consumer, preserving separate Parameters,
state-dict names and gradients. Disjoint or noncontiguous parts use concatenation.
This PR targets upstream
mainand adds split-parameter compile support only tote.Linear.ConcatInput[T]describes an ordinary operand or immutableParameterParts. A singleconcat_inputhelper keeps singleton tensors unchanged,uses
noop_catin eager, and defers supported compiled operands. Original partscross the op boundary; fake implementations receive metadata and the real
consumer constructs the view. Linear retains its existing final configuration
validation and
setup_saved_tensors(ctx)hook.Type of change
Changes
concatenating them; retain final validation of the prepared op arguments.
backward op; recheck storage adjacency on each execution.
Validation and remaining work
5d5c1802, before merging main and removing the separatefrozen-weight bias-gradient fix: RTX 5880 Ada, PyTorch 2.15 development
build/CUDA 13.4, compatible prebuilt
native TE extension: complete
test_torch_compile.pypassed (187 passed,46 skipped, 1 existing non-strict xfail passed). Includes 45 focused split/API
cases covering storage and parameter replacement, CUDA Graphs, saved hooks,
version checks, gradient targets, recipes and returned bias.
AST and whitespace checks passed. Both backward functions match upstream main;
only the bias-only variant was removed from the selective-gradient test.
GPU regression tests have not been rerun after these changes.
backward, and earlier split-projection measurements found host overhead for
small shapes. Ordinary-Linear CPU latency has not been benchmarked. No general
speedup or Blackwell/distributed validation is claimed.
Checklist