-
Notifications
You must be signed in to change notification settings - Fork 267
[gfx906] Collection of fixes for MI50/MI60 (non-MFMA) GPUs #3593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -418,6 +418,12 @@ struct GridwiseGemmDlMultipleD_km_kn_mn | |||||||||||||||||||||||||||||
| auto c_thread_buf = make_static_buffer<AddressSpaceEnum::Vgpr, FloatAcc>( | ||||||||||||||||||||||||||||||
| c_thread_desc_m10_m11_n10_n11.GetElementSpaceSize()); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // FIX: Separate buffer for element op output with proper type (FloatC) | ||||||||||||||||||||||||||||||
| // This is needed when FloatAcc (e.g., int32) differs from FloatC (e.g., float) | ||||||||||||||||||||||||||||||
| // The element op e = static_cast<E>(c) * d expects to write to FloatC, not FloatAcc | ||||||||||||||||||||||||||||||
| auto e_thread_buf = make_static_buffer<AddressSpaceEnum::Vgpr, FloatC>( | ||||||||||||||||||||||||||||||
| c_thread_desc_m10_m11_n10_n11.GetElementSpaceSize()); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // Initialize C | ||||||||||||||||||||||||||||||
| c_thread_buf.Clear(); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
@@ -621,13 +627,22 @@ struct GridwiseGemmDlMultipleD_km_kn_mn | |||||||||||||||||||||||||||||
| Number<NumDTensor>{}); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // get reference to dst data | ||||||||||||||||||||||||||||||
| // FIX: Use e_thread_buf (FloatC) for output, c_thread_buf | ||||||||||||||||||||||||||||||
| // (FloatAcc) for input. This fixes type mismatch when FloatAcc | ||||||||||||||||||||||||||||||
| // (int32) != FloatC (float) | ||||||||||||||||||||||||||||||
| constexpr index_t c_offset = | ||||||||||||||||||||||||||||||
| c_thread_desc_m0_m10_m11_n0_n10_n11.CalculateOffset( | ||||||||||||||||||||||||||||||
| make_tuple(0, m10, m11, 0, n10, i)); | ||||||||||||||||||||||||||||||
| auto dst_data_refs = generate_tie( | ||||||||||||||||||||||||||||||
| // return type should be lvalue | ||||||||||||||||||||||||||||||
| [&](auto) -> auto& { return c_thread_buf(Number<c_offset>{}); }, | ||||||||||||||||||||||||||||||
| Number<2>{}); | ||||||||||||||||||||||||||||||
| // Element op signature: (E& e, const C& c, const D& d) | ||||||||||||||||||||||||||||||
| // - e (output): goes to e_thread_buf (FloatC type) | ||||||||||||||||||||||||||||||
| // - c (input): comes from c_thread_buf (FloatAcc type) | ||||||||||||||||||||||||||||||
| // Use tie() to create a tuple of references to different buffers | ||||||||||||||||||||||||||||||
| auto dst_data_refs = | ||||||||||||||||||||||||||||||
| tie(e_thread_buf( | ||||||||||||||||||||||||||||||
| Number<c_offset>{}), // E& e (output to FloatC buffer) | ||||||||||||||||||||||||||||||
| c_thread_buf( | ||||||||||||||||||||||||||||||
| Number<c_offset>{}) // C& c (input from FloatAcc buffer) | ||||||||||||||||||||||||||||||
|
Comment on lines
+638
to
+644
|
||||||||||||||||||||||||||||||
| // - c (input): comes from c_thread_buf (FloatAcc type) | |
| // Use tie() to create a tuple of references to different buffers | |
| auto dst_data_refs = | |
| tie(e_thread_buf( | |
| Number<c_offset>{}), // E& e (output to FloatC buffer) | |
| c_thread_buf( | |
| Number<c_offset>{}) // C& c (input from FloatAcc buffer) | |
| // - c (const input): comes from c_thread_buf (FloatAcc type) | |
| // Use tie() to create a tuple of references to different buffers | |
| auto dst_data_refs = | |
| tie(e_thread_buf( | |
| Number<c_offset>{}), // E& e (output to FloatC buffer) | |
| c_thread_buf( | |
| Number<c_offset>{}) // const C& c (input from FloatAcc buffer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the introduction of e_thread_buf for element op output, consider whether e_thread_buf also needs initialization. If the element op always writes to all elements before the transfer, initialization may not be necessary, but this assumption should be documented or e_thread_buf should be cleared for consistency.