Skip to content

Add tests for AMDGPU#271

Merged
lkdvos merged 8 commits into
masterfrom
ksh/amd
Jun 15, 2026
Merged

Add tests for AMDGPU#271
lkdvos merged 8 commits into
masterfrom
ksh/amd

Conversation

@kshyatt

@kshyatt kshyatt commented May 11, 2026

Copy link
Copy Markdown
Member

No description provided.

@lkdvos

lkdvos commented May 11, 2026

Copy link
Copy Markdown
Member

Thanks for setting this up! Would be cool if the tests actually pass, but since this is not really relevant for what this PR is trying to achieve I would then still merge anyways.

lkdvos
lkdvos previously approved these changes May 11, 2026
@kshyatt

kshyatt commented May 11, 2026

Copy link
Copy Markdown
Member Author

AMD CI is really backed up but we can just see what happens when it finally clears, I guess

@kshyatt kshyatt enabled auto-merge (squash) May 11, 2026 14:38
@lkdvos

lkdvos commented May 11, 2026

Copy link
Copy Markdown
Member

Ah, it turns out we need proper overloads for the allocator as well. I give this a quick try but I don't have access to any AMD machines so I can't actually try this out.

@kshyatt

kshyatt commented May 11, 2026

Copy link
Copy Markdown
Member Author

I do have access so I'll give it a whirl tomorrow

lkdvos
lkdvos previously approved these changes Jun 11, 2026
@lkdvos

lkdvos commented Jun 11, 2026

Copy link
Copy Markdown
Member

@kshyatt it seems like the AMD tests are still not all passing. Do you want me to wait with tagging a release to include this, or should I just go ahead?

@kshyatt

kshyatt commented Jun 11, 2026

Copy link
Copy Markdown
Member Author

I'll take a look later today and if I can't sort it out let's just tag?

@kshyatt

kshyatt commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

This worked on 1.10 and 1.12 on AMD for me, let's see how CUDA does

Comment thread src/implementation/strided.jl Outdated
# resolve conj flags and absorb into StridedView constructor to avoid type instabilities later on
if conjA
stridedtensoradd!(SV(C), conj(SV(A)), pA, α, β, backend, allocator)
stridedtensoradd!(SV(C), conj!(SV(A)), pA, α, β, backend, allocator)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this conj! there? It looks a bit suspicious to me, since I'm not sure we are really allowed to modify A, so we are really depending on the fact that conj(SV(A)) produces a view without modifying A.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This "resolved" the AMD tests but caused the CUDA ones to fail (I was testing on an AMD machine), I thought conj! on a StridedView would also return simply a view but I guess not

@kshyatt

kshyatt commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

Oh my god it's a difference between conj and conj! on 1.10 I hate being able to read

@kshyatt

kshyatt commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

I think the problem for AMD on 1.10 is somewhere in https://github.com/QuantumKitHub/Strided.jl/blob/main/ext/StridedGPUArraysExt.jl#L129 I'll keep digging a bit

@kshyatt

kshyatt commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

OK, this is I think a problem in that kernel only on AMD and 1.10. Annoyingly you can't print from within a kernel on AMD super easily so I would say let's revert my last commit, merge this, and I'll keep working on the problem in Strided

This reverts commit 5502697.
@lkdvos

lkdvos commented Jun 15, 2026

Copy link
Copy Markdown
Member

I'm not entirely following since I don't really know what error you are getting (correctness or actual runtime errors?), but I'm definitely okay with opening an issue in Strided for this, as it definitely seems like that is the problem, and not the specific TensorOperations implementation.

@kshyatt

kshyatt commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

It's correctness. The output of that kernel for the same inputs differs for AMD between 1.10 and 1.12

@lkdvos lkdvos disabled auto-merge June 15, 2026 14:54
@lkdvos lkdvos merged commit 574b16d into master Jun 15, 2026
11 of 12 checks passed
@lkdvos lkdvos deleted the ksh/amd branch June 15, 2026 14:54
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.

2 participants