Repository navigation
Conversation
|
Warning: Unknown label
Please add the new label to .github/pytorch-probot.yml |
|
Warning: Unknown label
Please add the new label to .github/pytorch-probot.yml |
5c6371b to
821c3cf
Compare
|
Detailed Root Cause Analysis for Each Failure
Trivial fix. Lines 81, 83, and 89 have comments exceeding B950 line length: Line 81: "# We define each template kernel in a separate file which is the name of the input to Fix: Wrap comments to multiple lines. Line 89 has a URL that can't be broken, so either use # noqa: B950
This is the core bug. The problem is in wrapper.py:2656-2665. The triton_kernel_wrap.py change (the correct one for Triton 3.7):
But wrapper.py still does the OLD behavior (lines 2656-2665): And triton_utils.py:69-72 has a matching bug: Plus AttrsDescriptorWrapper for V4_DICT (line 88-93 of hints.py) ignores equal_to_1 entirely and only The fix for wrapper.py: The fix for triton_utils.py:69-72: Remove the _arg_equals_1 check that returns "constexpr" — let it fall
This test uses the op_zeros autotuned kernel with scalar args interleaved with tensor args. The FileCheck The likely failure is a compilation error during TTIR generation or mutation analysis, caused by the same
This test uses the mm template with a mocked input_dependent_preserved_state. It expects an InductorError Root cause: With Triton 3.7, the V4_DICT AttrsDescriptor changes the config/attrs format. The way
The FXIR backend's add_constants_to_call_args (wrapper_fxir.py:1028) reads triton_meta["constants"] and Root cause: In Triton 3.7 (V4_DICT), constexpr args are skipped from call_args at the IR level but still Fix: After fixing the wrapper.py constants issue, verify that add_constants_to_call_args correctly For: |
3cdc566 to
7d6d9c6
Compare
| @unittest.skipIf(TEST_WITH_ASAN, "Skipped under ASAN") | ||
| @skipIfTorchDynamo("Test uses dynamo already") | ||
| @skipIfCrossRef | ||
| @skipIfRocm(msg="Fails with Triton 3.7 on MI200") |
There was a problem hiding this comment.
What is MI200? Consumer GPU?
| ) from e | ||
| raise | ||
|
|
||
| @requires_gpu |
There was a problem hiding this comment.
To clarify, this requires a GPU to find a backend? If so it might be good to add a comment since we don't actually run this kernel (and really just need a target arch).
| raise | ||
|
|
||
| @requires_gpu | ||
| def test_constexpr_handling(self): |
There was a problem hiding this comment.
Also can you add a comment of expectations for this test? I assume we are checking that constexprs are resolved as constants? Since None is not a constexpr are we depending on argument elimination (e.g. maybe_param will always be replaced with None), because if so that seems reasonable, but should probably be in a docstring or test name.
| offs = pid * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE) | ||
| mask = offs < n_elements | ||
| x = tl.load(src_ptr + offs * stride, mask=mask) | ||
| scale = tl.where(maybe_param != 0, 0.5, 1.0) |
There was a problem hiding this comment.
I assume we expect maybe_param != 0 to evaluate to False because they are different types (its unclear the cast rules to me). Maybe we should express the boolean as maybe_param (assuming None is False) so that its a "valid" condition to reason about.
We should also check that scale evaluates to 1.0 then. Maybe we could just actually run the kernel one all 1 and verify that we get all 1s instead of all 0.5s?
| return False | ||
|
|
||
| def is_tensor_like_arg(arg: Any) -> bool: | ||
| if isinstance(arg, Tensor) or is_stable_tensor_descriptor_arg(arg): |
There was a problem hiding this comment.
Looks like this function was dead code?
| # To account for this, we inject some fake arg names as placeholders for | ||
| # the stride and size parameters. | ||
| def get_tensor_names(name: str, arg: Any) -> list[str]: | ||
| if isinstance(arg, Tensor): |
There was a problem hiding this comment.
Is there a reason we never need isinstance(arg, Tensor) anymore?
There was a problem hiding this comment.
It seems right to me, but I just wanted to confirm.
| write_stack.extend(op.args[idx] for idx in WRITE_OPS.get(op.name, [])) | ||
| read_stack.extend(op.args[idx] for idx in READ_OPS.get(op.name, [])) | ||
|
|
||
| # For these ops, only the first argument (base pointer) refers to actual |
There was a problem hiding this comment.
Naive question: This is because we are trying to ask "when does the pointer change?" I want to understand why for example tt.make_tensor_descriptor pertaining to a block of memory doesn't need the shape information tracked.
| # includes scalars, so writes may reference non-tensor args like SymInts. | ||
| return [ | ||
| dep.name | ||
| for dep in tensor_accesses.read_writes.writes |
There was a problem hiding this comment.
Not a blocker here, but it seems like we need to centralize this to one location. Maybe this is already that function, but this seems very likely to introduce more bugs in the future (and makes it hard to support multiple Triton versions). We may ideally want to allow for different variations at once.
| tma_descriptor_metadata, | ||
| ) | ||
|
|
||
| # Filter to only tensor args: with Triton 3.7+, ordered_arg_names |
There was a problem hiding this comment.
Ya this should be moved to a single helper function, ideally based on Triton version. This can be a followup.
3ed5815 to
c043583
Compare
njriasan
left a comment
There was a problem hiding this comment.
This looks great thanks!
|
@jataylo looks like rocm failure is caused by removing Looks like failure comes from here: |
update test triton_changes pin_update feb_triton_update update_triton_latest [ROCm] temporary skips required for triton 3.7 bump Skip inductor on Navi and more 3.7 triton skips fix test_fp8_cast_and_t Revert "fix" This reverts commit a62cfe3. Revert "Skip inductor on Navi and more 3.7 triton skips" This reverts commit dba6883. Revert "[ROCm] temporary skips required for triton 3.7 bump" This reverts commit 4ce8faf. temporary_branch_out_rocm_pin remove_extra_file pins docker Revert "temporary_branch_out_rocm_pin" This reverts commit ee2aea9. Skipped all the tests that fail on ROCm with latest triton Skipped one more failing test for ROCm More skips for ROCm Added skips for MI200 failures Added MI300 skips Added MI355 skips Added skips for navi arch Skipped all non-exclusive and flaky failures for ROCm bump pinned revert fix fixes fix fixes pin fixes Revert "fixes" This reverts commit 3cdc566. pin fixes fix fixes triton_kernel_wrap apply_triton_fixes fixes fixes
1aaa431 to
6c3b425
Compare
|
@pytorchmergebot merge -f "lint and rest of the failures are not related" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@warrendeng has imported this pull request. If you are a Meta employee, you can view this in D98216985. |
|
Seeing cpp_wrapper test failures like https://github.com/pytorch/pytorch/actions/runs/23567594086/job/68626980526 after this PR. #178478 is the fix. |
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @Lucaskabela