Repository navigation
Conversation
[Low impact] This documentation-only PR appears safe to merge. SummaryUpdates docstrings across six files to match existing function arguments.
No actionable issues found. Reviews (13) · Last reviewed commit: "Merge branch 'main' into docs/more-docst..." · Reviewed by Greptile |
390c6f9 to
cef3422
Compare
|
Question about CI rather than a merge request: this PR has If it needs the comment trigger, say the word and I'll leave it to a maintainer to fire (I don't want to run the GPU matrix on a doc-only diff if that's not the convention). If it should have run on its own, then something went wrong on my side: I rebased this branch onto |
cef3422 to
13ec457
Compare
Signed-off-by: lxcxjxhx <lxcxjxhx@users.noreply.github.com>
13ec457 to
c171949
Compare
|
One question rather than a status ping: is a six-file docstring PR the right shape here, or would you rather take these one file at a time? I ask because the diff is small (+11/−23) but spread across Since #3877 merged, I re-scanned the tree with the same check and this PR is what remains: |
|
Re-asking the question I left in round one, now with a concrete proposal rather than a wait: this is six docstrings in six files across If review attention is the constraint, say which part you want first and I will force-push this branch down to it — the Separately, and relevant to every PR I have open here: |
There was a problem hiding this comment.
LGTM !
Simple clean up of docstrings for unused params. Thanks for doing so @lxcxjxhx
@timmoon10 Feel free to request changes if you'd rather not have this go in for UB as is. That was the only one I was on the fence for.
| data: The quantized tensor data | ||
| scale_inv: The inverse scaling factors | ||
| dq_dtype: The data type for dequantized values | ||
| scaling_mode: The scaling mode used for quantization | ||
| is_colwise: Whether the scaling is column-wise | ||
| flatten_axis: The axis along which the tensor could be flattened to 2D | ||
| scaled_tensor: The block-scaled tensor to dequantize. Its fields supply the | ||
| quantized data, the inverse scaling factors, the output dtype, the scaling | ||
| mode, whether the scaling is column-wise, and the axis it can be flattened | ||
| to 2D along. |
There was a problem hiding this comment.
Looks okay. Seems like the docstring was erroneously copied from _dequantize_func
There was a problem hiding this comment.
You were right about the copy: that block described _dequantize_func's arguments, not _dequantize.
Checked both against their signatures now — _dequantize(x, quantized_dtype, scale, scale_inv, block_scaling_dim) versus _dequantize_func(x, quantized_dtype, scale, scale_inv, block_scaling_dim) — they do take the same parameter list, which is why the copy was wrong in wording rather than in content. The docstring in this PR names the parameters those two actually take, so the description no longer claims a different function's behaviour.
KshitijLakhani
left a comment
There was a problem hiding this comment.
Left a small nit change in the SeqeunceDescriptor comment
Signed-off-by: Kshitij Lakhani <33047503+KshitijLakhani@users.noreply.github.com>
Description
Documentation-only. Five docstrings named parameters these functions do not take; they now
match the signatures in the same file.
Type of change
Changes
transformer_engine/pytorch/*: docstrings corrected to the parameter names the functions actually takeChecklist:
Original description (unchanged)
What
Six docstrings name parameters the signature does not take. Doc-only, +11/−23 across six files.
jax/cpp_extensions/attention.pyfused_attn_fwdandfused_attn_bwdq_seqlen,kv_seqlen,q_seq_offsets,kv_seq_offsetssequence_descriptor: SequenceDescriptorjax/flax/module.pyLayerNorm.__call__inputsxjax/quantize/dequantizer.pyBlockScaleDequantizer.dequantizedata,scale_inv,dq_dtype,scaling_mode,is_colwise,flatten_axis)scaled_tensorpytorch/ops/fused/userbuffers_backward_linear.pyfuse_backward_opsrecipeopsplus**unusedpytorch/triton/mhc.pymHCProjectionOp.forwardnnis derived fromphi.shape[0]Two of these are one-cause copies rather than one-off typos:
sequence_descriptor: the two attention entry points were migrated from four separate tensors to a single descriptor, and both docstrings kept the old list. The class istransformer_engine.jax.attention.SequenceDescriptor; the new text says so instead of describing four arguments that no longer exist.dequantize: the docstring describes the helper the method delegates to. Its two neighbours in the same file —_dequantize_func(data, scale_inv, …)and theamax/has_rht_appliedvariant — really do take those arguments, so this is the only one of the three that is wrong. That is why the diff touches one docstring in a file with three nearly identical ones.ninmhc.pyis worth a sentence: the docstring explainsphias shape(N, K)withN = 2n + n*n, so the prose value ofnstays inside thephientry; the standalonen (int)bullet is deleted because nothing can pass it.How this was found
AST pass over
transformer_engine/(520 Python files) comparing each numpydoc/GoogleArgsentry with the enclosing signature:What I deliberately left
tests/jax/utils.py:217— added after review of [Docs] Fix the parameter name in two moe_sort_chunks_by_index docstrings #3877:TestAttention.__call__documents adropout_rngargument it does not take either ((query, key, value, bias, deterministic)). One line, and it is what made the table above complete rather than "every hit except one".jax/cpp_extensions/gemm.py:1514(abstract) — the docstring drops the_avalsuffix the signature uses. Whether the convention there is "document the aval parameter or the value it wraps" is a maintainer call, and I did not want to guess in this PR.context_parallel_strategyis missing fromfused_attn_fwd's list entirely — adding prose for a parameter I have not exercised seemed worse than leaving the omission visible.Verification
No executable line changed.
ast.parseon all five files; the pass above reports 0 hits in them afterwards. The repository's own checks (Check / Build / PyTorch C++ / PyTorch Python / JAX C++ / JAX Python) cover docstring-free source, so they should be unaffected — this PR is where you will see it if they are not.Overlap with open PRs
#3865also editsjax/cpp_extensions/attention.py, inside the same two functions. Its hunks are at-3735,6,-3798,7,-3851,6,-3868,14,-3902,6and-3967,7; this PR changes the docstring lines at-3754and-3923, which none of those cover. Whoever merges second gets a mechanical rebase, not a semantic one.