Skip to content

Add tests for flash_attention_backward perf model (PR #512)#580

Open
Copilot wants to merge 5 commits intomainfrom
copilot/add-tests-for-pr-512
Open

Add tests for flash_attention_backward perf model (PR #512)#580
Copilot wants to merge 5 commits intomainfrom
copilot/add-tests-for-pr-512

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

PR #512 overhauled flash_attention_backward — reparenting it from flash_attention to SDPA, adding a proper get_param_details, and registering flash_attn::_flash_attn_backward in the op mapping — but shipped without tests.

New test file: tests/test_flash_attention_backward.py

  • Mapping & categorizationflash_attn::_flash_attn_backward resolves to flash_attention_backward and categorizes as SDPA_bwd
  • Class hierarchy — inherits SDPA, not flash_attention
  • get_param_details argument indexingdout at index 0; q/k/v correctly read from indices 1/2/3
  • get_param_details concrete inputsdropout from concrete[8], causal from concrete[10]; both default safely when Concrete Inputs is absent
  • __init__ attributeself.d_h is set to self.d_h_qk (required by get_simulation_time_bwd_func)
  • flops() — delegates to flops_bwd(); backward > forward for identical shapes; non-causal > causal
  • bytes() — zero-arg form resolves bytes_per_element from param_details dtype; explicit bpe delegates to bytes_bwd()
  • fa flagtype(self).__name__ check in get_simulation_time_bwd correctly identifies flash_attention_backward as a flash-attention op

Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
Agent-Logs-Url: https://github.com/AMD-AGI/TraceLens/sessions/57c6aab9-d187-4fb9-90bb-cacfb503a156

Co-authored-by: gabeweisz <162640284+gabeweisz@users.noreply.github.com>
Copilot AI changed the title [WIP] Add tests related to PR #512 Add tests for flash_attention_backward perf model (PR #512) Apr 3, 2026
Copilot AI requested a review from gabeweisz April 3, 2026 16:40
@gabeweisz gabeweisz marked this pull request as ready for review April 3, 2026 17:36
@gabeweisz gabeweisz requested a review from ajassani April 3, 2026 17:36
@gabeweisz gabeweisz enabled auto-merge (squash) April 3, 2026 17:40
@gabeweisz gabeweisz requested review from spandoesai and unagiboi April 7, 2026 12:59
@spandoesai
Copy link
Copy Markdown
Collaborator

spandoesai commented Apr 7, 2026

Should probably wait until #582 closes since that PR makes changes to the reference reports? @unagiboi could you merge that one first?

@unagiboi
Copy link
Copy Markdown
Collaborator

unagiboi commented Apr 7, 2026

@spandoesai #582 has been merged.

@spandoesai
Copy link
Copy Markdown
Collaborator

Thanks, @gabeweisz could you rebase and try the tests again?

@gabeweisz
Copy link
Copy Markdown
Collaborator

gabeweisz commented Apr 7, 2026

Merged main. This particular PR does not use reference reports, it just adds additional tests. All tests pass after merging main

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests related to PR #512

4 participants