fix(jax): interpolate the tensor-sequence-parallelism warning - #3486
Open
Anai-Guo wants to merge 1 commit into
Open
fix(jax): interpolate the tensor-sequence-parallelism warning#3486Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
The warning raised when tp_resource appears in lhs_specs is built from three
implicitly concatenated fragments, none of which carries the f prefix, so users
see the literal text {gsr.tp_resource} and {lhs_specs} instead of the values that
triggered the warning. Both names are locals defined a few lines above.
Signed-off-by: Tai An <antai12232931@outlook.com>
Contributor
Greptile SummaryThis PR fixes a JAX tensor-sequence-parallelism warning so it displays the actual tensor-parallel resource and left-hand-side partition specification instead of literal placeholders.
Confidence Score: 5/5The PR appears safe to merge because it only corrects diagnostic interpolation without changing control flow or computation. The interpolated values have safe built-in representations, and no actionable correctness, security, or quality issues remain. Important Files Changed
Reviews (1): Last reviewed commit: "fix(jax): interpolate the tensor-sequenc..." | Re-trigger Greptile |
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.
Problem
transformer_engine/jax/cpp_extensions/gemm.py, in_parse_operand_output_specs:The message is built from three implicitly concatenated fragments and none of them
carries the
fprefix, so the user is shown the literal{gsr.tp_resource}and{lhs_specs}— precisely the two values that would tell them which resource and whichspec caused the warning. Both are locals bound a few lines above.
Why this is a typo
gemm.pycontains 78 string literals with{...}interpolation. 76 carry thefprefix; the only two that do not are the two fragments of this one call.
Verification
I pulled the
warnings.warncall out of both the currentmainfile and the patchedfile with
ast(no hand-transcription) and evaluated each underwarnings.catch_warningswithgsr.tp_resource = "tp",lhs_specs = ("dp", "tp", None):The
fprefix is added only to the two fragments that contain placeholders — the thirdis left plain so it does not become an empty f-string.
Formatting checked with the pinned pre-commit hook exactly as configured
(
black==24.4.2 --line-length=100 --preview --enable-unstable-feature=string_processing):1 file left unchanged.Left alone
The message also reads "Please setting MeshResource.tpsp_resource". I did not touch the
wording so this stays a single-concern change — happy to fix it if you'd like.
🤖 Generated with Claude Code