Skip to content

[fusilli-provider] Allocate workspace in SDPA integration tests#6712

Merged
rkayaith merged 2 commits into
developfrom
users/rkayaith/fix-sdpa-test-workspace
Apr 23, 2026
Merged

[fusilli-provider] Allocate workspace in SDPA integration tests#6712
rkayaith merged 2 commits into
developfrom
users/rkayaith/fix-sdpa-test-workspace

Conversation

@rkayaith
Copy link
Copy Markdown
Contributor

@rkayaith rkayaith commented Apr 23, 2026

SdpaIntegrationTest.SdpaIndependentKVHeads (added in #6186) fails at execute time because the compiled IREE program requires a workspace buffer but the test passes nullptr. This adds the required allocation, matching the pattern in IntegrationConvForward.cpp. SdpaIntegrationTest.SimpleSdpa and SdpaIntegrationTest.SdpaGqa don't require a workspace buffer, but are updated the same way for consistency.

I ran all SDPA tests locally on gfx942:

$ ctest --test-dir fusilli-provider-build -R "Sdpa"
    Start 22: TestFusilliPluginApi.GetApplicableEngineIdsSdpa
1/4 Test #22: TestFusilliPluginApi.GetApplicableEngineIdsSdpa ...   Passed    0.21 sec
    Start 87: SdpaIntegrationTest.SimpleSdpa
2/4 Test #87: SdpaIntegrationTest.SimpleSdpa ....................   Passed    4.33 sec
    Start 88: SdpaIntegrationTest.SdpaGqa
3/4 Test #88: SdpaIntegrationTest.SdpaGqa .......................   Passed    4.51 sec
    Start 89: SdpaIntegrationTest.SdpaIndependentKVHeads
4/4 Test #89: SdpaIntegrationTest.SdpaIndependentKVHeads ........   Passed    4.28 sec

100% tests passed, 0 tests failed out of 4

Fixes #6710

SdpaIntegrationTest.SdpaIndependentKVHeads (added in #6186) fails at
execute time:

    Workspace of size 8192 bytes required but workspace pointer is null

The compiled IREE program for SDPA with independent K/V head counts
requires 8 KiB of transient storage, but the test passes nullptr for
the workspace pointer.

Query the size with `get_workspace_size()` and use the existing
`Workspace` RAII helper, matching the pattern in
`projects/hipdnn/tests/frontend/IntegrationConvForward.cpp`.

Updated tests:
- SdpaIntegrationTest.SdpaIndependentKVHeads (was failing)
- SdpaIntegrationTest.SimpleSdpa (defensive — currently 0 workspace)
- SdpaIntegrationTest.SdpaGqa (defensive — currently 0 workspace)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rkayaith rkayaith merged commit 1ff6041 into develop Apr 23, 2026
7 checks passed
@rkayaith rkayaith deleted the users/rkayaith/fix-sdpa-test-workspace branch April 23, 2026 17:50
aledudek pushed a commit that referenced this pull request May 20, 2026
`SdpaIntegrationTest.SdpaIndependentKVHeads` (added in #6186) fails at
execute time because the compiled IREE program requires a workspace
buffer but the test passes `nullptr`. This adds the required allocation,
matching the pattern in `IntegrationConvForward.cpp`.
`SdpaIntegrationTest.SimpleSdpa` and `SdpaIntegrationTest.SdpaGqa` don't
require a workspace buffer, but are updated the same way for
consistency.


I ran all SDPA tests locally on gfx942:

```
$ ctest --test-dir fusilli-provider-build -R "Sdpa"
    Start 22: TestFusilliPluginApi.GetApplicableEngineIdsSdpa
1/4 Test #22: TestFusilliPluginApi.GetApplicableEngineIdsSdpa ...   Passed    0.21 sec
    Start 87: SdpaIntegrationTest.SimpleSdpa
2/4 Test #87: SdpaIntegrationTest.SimpleSdpa ....................   Passed    4.33 sec
    Start 88: SdpaIntegrationTest.SdpaGqa
3/4 Test #88: SdpaIntegrationTest.SdpaGqa .......................   Passed    4.51 sec
    Start 89: SdpaIntegrationTest.SdpaIndependentKVHeads
4/4 Test #89: SdpaIntegrationTest.SdpaIndependentKVHeads ........   Passed    4.28 sec

100% tests passed, 0 tests failed out of 4
```

Fixes #6710

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue] Fusilli SDPA test fails: hipdnnEnginePluginExecuteOpGraph requires 8192B workspace but workspace ptr is null

2 participants