Conversation
) Summary: X-link: https://github.com/facebookresearch/FBGEMM/pull/3107 Add the standalone `tbe_bwd_indices_preproc` CUDA op that runs the two grad-independent index-preprocessing steps (transpose_embedding_input, find_long_segments) and returns the 12-tensor bundle. Folded into embedding_backward_split_grad_template.cu. Adds a unit test asserting the op's bundle yields an allclose weight update versus the inline path. Differential Revision: D114645411
Summary: Everything except the forward for moving grad-independent index preprocessing off the TBE backward critical path. Two halves, folded into one diff: - Backend driver (consume): adds an optional `preproc_tensors` (Tensor[]?) argument to the TBE backward driver so it can accept precomputed index-preprocessing outputs (transpose_embedding_input + find_long_segments) and skip recomputing them inline. When the arg is None (the default / common path), the driver runs the inline preprocessing exactly as before -- no behavior change. Applied across the backward host/meta/cu templates, the PT2 CPU/CUDA wrappers, and split_embeddings_utils. - PT2 autograd (route): threads the optional preproc_tensors bundle through the PT2 training autograd backward into the backend backward op. When the forward emits the 12 index-preproc grad slots (grad_outputs[1..12]), backward packs them into preproc_tensors and forwards them to the driver's consume path; otherwise preproc_tensors stays nullopt and the driver recomputes the preproc inline exactly as before. Non-breaking on its own: no forward output is emitted yet, so grad_outputs stays size 1 until the forward-emit diff (top of stack) is applied. The backward simply gains the ability to accept and route the extra grads when they later appear. Builds on the add-op base (D114645411, below in stack). Differential Revision: D113624507
Contributor
|
@gchalump has exported this pull request. If you are a Meta employee, you can view the originating Diff in D113624507. |
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.
Summary:
Everything except the forward for moving grad-independent index preprocessing
off the TBE backward critical path. Two halves, folded into one diff:
Backend driver (consume): adds an optional
preproc_tensors(Tensor[]?)argument to the TBE backward driver so it can accept precomputed
index-preprocessing outputs (transpose_embedding_input + find_long_segments)
and skip recomputing them inline. When the arg is None (the default / common
path), the driver runs the inline preprocessing exactly as before -- no
behavior change. Applied across the backward host/meta/cu templates, the PT2
CPU/CUDA wrappers, and split_embeddings_utils.
PT2 autograd (route): threads the optional preproc_tensors bundle through the
PT2 training autograd backward into the backend backward op. When the forward
emits the 12 index-preproc grad slots (grad_outputs[1..12]), backward packs
them into preproc_tensors and forwards them to the driver's consume path;
otherwise preproc_tensors stays nullopt and the driver recomputes the preproc
inline exactly as before.
Non-breaking on its own: no forward output is emitted yet, so grad_outputs stays
size 1 until the forward-emit diff (top of stack) is applied. The backward
simply gains the ability to accept and route the extra grads when they later
appear. Builds on the add-op base (D114645411, below in stack).
Differential Revision: D113624507