Skip to content

[ROCm] Retry copy-kernel profiler checks that miss the kernel - #200694

Closed
pablo-garay wants to merge 2 commits into
pytorch:mainfrom
pablo-garay:rocm-retry-copy-kernel-profiler-check
Closed

pablo-garay wants to merge 2 commits into
pytorch:mainfrom
pablo-garay:rocm-retry-copy-kernel-profiler-check

Conversation

@pablo-garay

@pablo-garay pablo-garay commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor
  • Passes lint (spin fixlint)
  • Added/updated tests
  • Updated documentation (if applicable)
  • Included benchmark results (for PRs impacting perf)

Linked issue or supporting maintainer

Part of #200903

BC-breaking?

No

Summary (human written only)

The copy-kernel dispatch tests in test_torch.py (test_copy_strided_chunk*, test_copy_transpose_tiled*) check which kernel ran by looking for it in the profiler events. On ROCm the profiler intermittently misses the kernel record, and the flaky bot has disabled 13 variants (#200246, #199996, #200382, #199890, #199910, #200383, #200400, #200401, #199997, #199016, #198911, #199891, #199893). The profiler bug is tracked in #200903. This routes both helpers through one _copy_uses_kernel that, on ROCm only, retries the profiled copy up to 3 times when the kernel is not seen; a miss cannot produce a false positive, so expected-False checks stay strict, and CUDA keeps a single attempt.

Agent details (if applicable)

An agent helped analyze the CI failures, write the retry helper, and draft this description; I reviewed all of it.

@pytorch-bot pytorch-bot Bot added module: rocm AMD GPU support for Pytorch topic: not user facing topic category labels Oct 12, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

PR Status: missing actionable issue

Auto PR Triage did not find either of the following when it checked this PR:

  • a linked issue labeled actionable (Fixes #<issue> or Part of #<issue>); or
  • a maintainer named in the description who agreed to the change (Supported by @<maintainer>).

Such PRs are a low priority for maintainers to review and might not get a response given the very high volume of PRs we receive. Please focus on actionable issues to ensure a maintainer will be available to review your PR.

If one of these applies, add the matching line to the PR description. If there is no actionable issue for this change yet, you can open one (or comment on an existing one) and wait for a maintainer to label it actionable. Then ask a maintainer to triage the PR again: they remove the triaged, bot-triaged, and missing actionable issue labels, then remove and re-add open source.

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/200694

Note: Links to docs will display an error until the docs builds have been completed.

⚠️ 4 Awaiting Approval

As of commit c1a4e01 with merge base 12da5f6 (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pablo-garay

Copy link
Copy Markdown
Contributor Author

@pytorchbot label ciflow/rocm-mi300 ciflow/inductor-rocm-mi300 module:rocm

@pytorch-bot

pytorch-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

The ciflow label(s) ciflow/rocm-mi300, ciflow/inductor-rocm-mi300 will be added, but CI won't be triggered until the workflows are approved (scroll to the bottom of this page).

Please ping one of the reviewers if you do not have access to approve and run workflows.

@pytorch-bot

pytorch-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

Didn't find following labels among repository labels: module:rocm

@pytorch-bot pytorch-bot Bot added ciflow/inductor-rocm-mi300 Trigger "inductor" config CI on ROCm MI300/MI325 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 labels Oct 12, 2026
@pytorch-bot

pytorch-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:

  • ciflow/rocm-mi300
  • ciflow/inductor-rocm-mi300

Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows.

1 similar comment
@pytorch-bot

pytorch-bot Bot commented Oct 12, 2026

Copy link
Copy Markdown

The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:

  • ciflow/rocm-mi300
  • ciflow/inductor-rocm-mi300

Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows.

@github-actions github-actions Bot added bot-triaged This is a label only to be used by the auto triage bot missing actionable issue A PR without a linked actionable issue or maintainer sponsor triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Oct 12, 2026

@jeffdaily jeffdaily left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My agent came up with this analysis, but I've read and approved it.

  1. The job cited in the description (114884413906) contradicts the retry: in process 38371 the uint8 check hit once and then the next three profiled sessions all missed, and the first fresh process (38400) repeated that pattern. With attempts=3 that job still fails. The miss persists across profiler sessions in a process, which points at kineto RocprofLogger state across start/stop (see #199973, #200296) rather than an occasional dropped record. Please file an issue for the profiler bug and check whether those PRs fix it before re-enabling these tests.
  2. If a test-side workaround stays, gate it on torch.version.hip; as written it triples every expected-False check on CUDA, including the 4 GB copy in test_copy_strided_chunk_64bit.
  3. The description needs the PR template sections (linked actionable issue or supporting maintainer, BC-breaking, human-written summary).

On CUDA the retry tripled every expected-False check, including the 4 GB copy in test_copy_strided_chunk_64bit.

Signed-off-by: pablo-garay <[email protected]>
@pablo-garay

Copy link
Copy Markdown
Contributor Author

@jeffdaily thanks. The retry is now gated on torch.version.hip, so CUDA keeps a single attempt. I filed the profiler bug as #200903. I've moved this PR back to draft and dropped the Fixes lines, so the tests stay disabled until I've checked whether #199973 or #200296 fix it.

@jeffdaily jeffdaily left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My agent came up with this analysis, but I've read and approved it.

  1. Per #200903 the miss is sticky within a process: job 114884413906 missed three consecutive sessions after a hit, and the fresh process repeated it. An in-process retry cannot turn that job green, and there is no evidence that any of the 13 disabled variants failed transiently. The comment at test_torch.py:124 ("occasionally drops kernel records") also contradicts the issue.
  2. #200296 does not touch the profiler session lifecycle, so it is unlikely to fix #200903; #199973 (RocprofLogger teardown) is the better candidate. Please check #200903 against that, and re-enable the tests on top of a real fix with no retry. Until then I don't see what this PR buys; consider closing it.

@pablo-garay

pablo-garay commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

My agent rechecked the CI log;

Thanks Jeff, agreed. I went back through job 114884413906 and the miss does stick within the process: after the first hit, every later profiled session missed, including pytest's in-process reruns, and the first fresh process did the same. A retry inside the process can't fix that, and the helper comment calling it occasional was wrong.

Closing this. The 13 tests stay disabled, and #200903 tracks the profiler bug. Once there's a real fix we can re-enable the tests by closing the DISABLED issues, with no retry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-triaged This is a label only to be used by the auto triage bot ciflow/inductor-rocm-mi300 Trigger "inductor" config CI on ROCm MI300/MI325 ciflow/rocm-mi300 Trigger "default" config CI on ROCm MI300 missing actionable issue A PR without a linked actionable issue or maintainer sponsor module: rocm AMD GPU support for Pytorch open source topic: not user facing topic category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants