Skip to content

Conversation

@vpietila-amd
Copy link
Contributor

@vpietila-amd vpietila-amd commented Oct 29, 2025

Proposed changes

The goal of this PR is to generalize the current convolution factory in CK Builder to be able to build instances of any relevant convolution device operation. The main changes are

  • Added new enums FwdGroupConvDeviceOperation, BwdDataGroupConvDeviceOperation, and BwdWeightGroupConvDeviceOperation that contain the device operations for which the builder should be able to build instances.
  • Create a union structure GroupConvDeviceOp that can represent a single value of the fwd, bwd weight, or bwd data device operations. This would be more naturally represented by std::variant object, but we cannot use std::variant in NTTPs because it is not a structural object.
  • Introduced a new member device_operation in the ConvSignatureDescriptor concept that assumes GroupConvDeviceOp value.
  • Added predicates to be used in creation ConvFactory specialization for the different device operation. When we add support for a new device operation, we'll just create a new ConvFactory specialization with appropriate predicates.
  • Changed handling of the convolution layouts (GroupConvLayout1D, GroupConvLayout2D, GroupConvLayout3D) to use the union based handling, i.e., there's now a GroupConvLayout union struct that can hold a single value of the 1D, 2D, or 3D layouts. This simplifies the handling of the different layouts as we get rid of templatized convolution signature.

These code changes allow developers to work more easily in parallel when adding new device operations.

@vpietila-amd vpietila-amd changed the title Vpietila/ckb generalize conv factory [CK_BUILDER] Generalize convolution factory to build arbitrary device operations. Oct 29, 2025
@shumway shumway merged commit b387249 into develop Oct 30, 2025
49 checks passed
@shumway shumway deleted the vpietila/ckb-generalize-conv-factory branch October 30, 2025 23:13
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.

3 participants