Commit Graph

108 Commits

Author SHA1 Message Date
Ville Pietilä
c3a9044bad Dispatching for DeviceGroupedConvBwdWeightMultipleD_Wmma_CShuffle. 2026-01-02 09:25:38 -05:00
Ville Pietilä
1759db7250 Factory and tests for DeviceGroupedConvBwdWeight_Wmma_CShuffle. 2026-01-02 08:52:38 -05:00
Ville Pietilä
aa10d659b7 Added factory and tests for DeviceGroupedConvBwdWeightTwoStage_Wmma_CShuffleV3. 2026-01-02 07:51:40 -05:00
Ville Pietilä
89934275f4 Fix WMMA bwd weight tests. 2026-01-02 07:07:08 -05:00
Ville Pietilä
2e43e16e47 Update Readme. 2026-01-02 07:06:51 -05:00
Ville Pietilä
bc3cba873b Add factory and tests for DeviceGroupedConvBwdWeight_Wmma_CShuffleV3. 2026-01-02 06:08:29 -05:00
Ville Pietilä
d045923a0d Refactor large tensor support and WMMA configuration. 2026-01-02 05:12:19 -05:00
Ville Pietilä
09e188f2a8 Treat ref algorithm the same way as real algorithms in the dispatcher. 2026-01-02 02:28:05 -05:00
Ville Pietilä
5be1ed65fb Merge remote-tracking branch 'origin/develop' into vpietila/ckb-bwd-weight-factories 2026-01-02 02:15:24 -05:00
Ville Pietilä
6e8c401e33 [CK_BUILDER] Instance traits for conv bwd weight algorithms (#3498)
Added instance traits for the following bwd weight conv algorithms

DeviceGroupedConvBwdWeight_Xdl_CShuffleV3
DeviceGroupedConvBwdWeight_Wmma_CShuffleV3
DeviceGroupedConvBwdWeight_Wmma_CShuffle
DeviceGroupedConvBwdWeight_TwoStage_Xdl_CShuffle
DeviceGroupedConvBwdWeight_TwoStage_Wmma_CShuffleV3
DeviceGroupedConvBwdWeight_DL
DeviceGroupedConvBwdWeightMultipleD_Xdl_CShuffle
DeviceGroupedConvBwdWeightMultipleD_Wmma_CShuffleV3
Added also unit tests for instance traits of those bwd weigth algorithms that are currently exposed by the narrow CK build for MIOpen.
---------

Co-authored-by: Ville Pietilä <>
2025-12-31 15:41:15 -08:00
Ville Pietilä
fba80401d1 Add factory for DeviceGroupedConvBwdWeightMultipleD_Xdl_CShuffle 2025-12-31 09:32:58 -05:00
Ville Pietilä
83be9c740c Add test for creating DeviceGroupedConvBwdWeightMultipleD_Xdl_CShuffle instance. 2025-12-31 09:08:06 -05:00
Ville Pietilä
e1b4acd431 Final implementation for bwd weight DL factory. 2025-12-31 08:29:11 -05:00
Ville Pietilä
3b0777f629 Conv bwd weight DL factory. 2025-12-31 07:38:52 -05:00
Ville Pietilä
75710202ab Added factory for DeviceGroupedConvBwdWeightTwoStage_Xdl_CShuffle. 2025-12-31 04:32:28 -05:00
kabrahamAMD
f86bbb1aef [CK_Builder] [testing] Integrate device random generators (#3427)
Implemented device random number generators for ck tensors.
Includes tests and integration to ck builder testing interface.
2025-12-30 10:03:05 -08:00
Ville Pietilä
30c10e2544 Build new instance traits unit tests but exclude WMMA for now. 2025-12-30 05:52:55 -05:00
Ville Pietilä
adfab9db7e Add unit tests for instance strings. 2025-12-30 05:52:15 -05:00
Ville Pietilä
3c1e2b0170 Add instance traits for bwd weight algorithms. 2025-12-30 04:29:38 -05:00
Ville Pietilä
3e16fa072f Test fix. 2025-12-29 09:53:47 -05:00
Ville Pietilä
ab88cee0eb Add instance traits for DeviceGroupedConvBwdWeight_Xdl_CShuffleV3. 2025-12-29 09:53:07 -05:00
Ville Pietilä
a83790e9da Build conv bwd weigth v3 instances successfully. 2025-12-29 09:30:58 -05:00
Ville Pietilä
80f44824f5 Add bwd weight XDL CShuffle V3 factory. 2025-12-29 09:12:14 -05:00
JH-Leon-KIM-AMD
a0acc83a72 [CK_BUILDER] Add GPU Reference Algorithm to CK Builder (#3381)
* [CK_BUILDER] Integrate GPU reference as ConvAlgorithm

Add GPU reference as a ConvAlgorithm specialization, enabling:
- Unified Builder API for reference and optimized kernels
- Future ckProfiler integration for validation
- First step toward numerical validation in Builder tests

Changes:
- Add ConvAlgorithmSpecialization::REFERENCE enum
- Add ConvAlgorithm_Reference struct
- Add IsReferenceAlgorithm concept
- Create 3 reference factories (Forward, BwdData, BwdWeight)
- Wire into conv_dispatcher
- Add proof-of-concept test (passing)

Test result: Can instantiate reference through Builder API

* Add GPU reference execution tests

- Reference kernel executes through Builder (459ms)
- Both reference and optimized can instantiate
- Tests passing

Next: Implement utilities for comparison

* Optimized Builder kernel execution works

- MakeArgument pattern implemented
- Builder-generated kernel executes successfully
- Tests passing (451ms execution)

Next: Add comparison

* VALIDATION COMPLETE: Builder == Reference

Builder-generated kernel output matches GPU reference!

Test: Validate_Optimized_vs_Reference_Forward_2D_FP16
Result: PASS ✓

This proves CK Builder generates correct code!

* Update to new Builder API

All tests passing

* Rename test file for clarity

test_builder_kernel_execution -> test_builder_kernel_validation

* Add all 3 directions support

- Forward, Backward Data, Backward Weight
- All reference factories working
- Dispatcher wired for all directions
- 9 tests passing

Tests:
- test_reference_execution: 3 tests (all directions)
- test_optimized_execution: 3 tests (all directions)
- test_builder_kernel_validation: 3 tests (fwd validated, bwd placeholders)

* Add backward direction support

- Backward data and weight dispatcher wiring
- Fix factories for new API
- All 3 directions tested
- 9 tests passing

* Refactor: Change IsReferenceAlgorithm from concept to consteval function

Address review feedback: Use consteval function in dispatcher instead of
concept, matching the pattern for other algorithms (Tile, XDL, WMMA, DL).

- Remove IsReferenceAlgorithm concept from conv_algorithm_concepts.hpp
- Add IsReferenceAlgorithm() consteval function to conv_dispatcher.hpp
- Update dispatcher to use function call: IsReferenceAlgorithm<T>()
- Remove redundant algorithm checks from reference factory requires clauses

All tests passing (9/9).

* Move Tile algorithm check outside direction block to support all directions

* Implement MakeInvokerPointer interface and add random input validation

- Implement full Argument/Invoker structs for old CK interface (not just nullptr)
- Refactor with reference_common.hpp to reduce code duplication
- Add random input validation tests: Builder vs direct GPU reference (all directions)
- Fix layout: GNHWC -> NHWGC to match reference kernel expectations
- All 12 tests pass with IDENTICAL results on random input

* Move ConvAlgorithm_Reference to test/impl/conv_algorithm_types.hpp

Keep types.hpp for data types only (enums), move algorithm descriptors
to conv_algorithm_types.hpp as suggested by review.

* Add static_assert to ensure reference factories only accept PassThrough operations

Reference implementation doesn't support fused elementwise operations.
Add compile-time validation to fail early with clear error message if
non-PassThrough operations are specified on input, weight, or output.

* Add InstanceTraits support for reference kernels

- Store SIGNATURE/ALGORITHM/VERSION in Instance for reflection
- Create shared ReferenceCommonTraits base for common properties
- Add 3 direction-specific InstanceTraits specializations in one file
- Include data type and layouts in instance_string output

* Remove optimized kernel validation tests from reference-only branch

* Use existing layout helper and organize reference tests

Use LayoutToCK from conv_tensor_layout.hpp and move reference InstanceTraits
test to validation folder.

* Merge develop branch

Fix DataType switch for new mixed precision types.

* Fix comment spacing for CI

* Convert IsReferenceAlgorithm from function to concept

* Add reference tests to CI smoke tests

* Consolidate 3 reference factories into single unified factory

---------

Co-authored-by: Ville Pietilä <188998872+vpietila-amd@users.noreply.github.com>
2025-12-29 16:11:08 +02:00
Ville Pietilä
277981bc9b Clean-up CK Tile builder tests. 2025-12-29 07:15:08 -05:00
Ville Pietilä
9926d942e9 Separate bwd weigth and bwd data tests into separate targets. 2025-12-29 07:03:55 -05:00
Ville Pietilä
52086b350a Fix smoke tests. 2025-12-29 05:44:51 -05:00
Ville Pietilä
3bd0f05081 Fix fwd conv builder tests. 2025-12-29 05:31:35 -05:00
Ville Pietilä
027d943b2f Update conv specialization enum. 2025-12-29 05:06:39 -05:00
Ville Pietilä
30a9686877 Update compiletime diagnostics to use the size type. 2025-12-29 04:56:22 -05:00
Ville Pietilä
8c80e005bd Introduve a common size type for concepts. 2025-12-29 04:53:19 -05:00
Ville Pietilä
ff2fdd8acc Improve concept diagnostics. 2025-12-29 04:26:06 -05:00
Ville Pietilä
77e10c7b08 Concept improvements. 2025-12-23 10:27:38 -05:00
Ville Pietilä
a1740c614b Refactor handing of GEMM-K batch template parameter in conv bwd weight factory. 2025-12-23 10:08:56 -05:00
kabrahamAMD
4ce7d4c511 [ck_builder] add utility functions to convolution (#3459)
* reinstate conv_signature_utils.hpp

* added tests for elementwise operation getters

* add tests for getDataType functions

* added test for no data type specified

---------

Co-authored-by: Kevin Abraham <kevin.abraham@streamhpc.com>
2025-12-23 10:39:49 +01:00
Ville Pietilä
608266a4ef First functional version of bwd weight conv factory. 2025-12-22 11:50:00 -05:00
Ville Pietilä
96a4a5de37 Factory bug fixes. 2025-12-22 11:05:00 -05:00
Ville Pietilä
a8e7edd814 Update algorithm signature diagnostics. 2025-12-22 10:56:47 -05:00
Ville Pietilä
8eb62241fb Remove debug assert. 2025-12-22 09:30:43 -05:00
Ville Pietilä
dacf82d652 Concept bug fixes. 2025-12-22 09:23:47 -05:00
Ville Pietilä
5ee99d83d5 Improve compile time diagnostics. 2025-12-22 08:59:46 -05:00
Ville Pietilä
9679d9b141 Improve missing member/wrong type compile-time errors. 2025-12-22 08:39:47 -05:00
Ville Pietilä
8d40e6d9fe Small improvements. 2025-12-22 08:39:01 -05:00
Ville Pietilä
c6798d3673 Improve compile time diagnostics. 2025-12-22 08:06:41 -05:00
Ville Pietilä
4d20cc6b4d Use amcro to ensure automatic macthing between concepts are their string representations. 2025-12-22 07:36:13 -05:00
Ville Pietilä
4d5b5b7ef3 Improve compile time erros message when no matching factory is found. 2025-12-22 07:12:46 -05:00
Bartłomiej Kocot
cbc8335964 Improve XDL to WMMA porting for grouped conv fwd (#3456)
Refactors the way the number of XDL (matrix multiply-accumulate) instructions per wave is calculated and used in the grouped convolution forward implementations, especially to better support WMMA (Wave Matrix Multiply-Accumulate) instructions and 16x16 tiles. 
The changes use MXdlPerWave instead of NXdlPerWave to increase number of waves per M dim.
2025-12-19 15:58:51 -07:00
Ville Pietilä
1df8077528 Add missing pieces to bwd weight factory. 2025-12-19 10:38:27 -05:00
Ville Pietilä
5a1c9c9a22 Conv builder test refactoring. 2025-12-19 09:14:44 -05:00
Ville Pietilä
2460cf4579 Initial conv bwd weight factory. 2025-12-19 07:59:37 -05:00