MCPcopy Create free account
hub / github.com/NVIDIA/cutlass / CreateConv2dFixedChannelsOperator

Function CreateConv2dFixedChannelsOperator

python/cutlass_library/generator.py:682–726  ·  view source on GitHub ↗
(manifest, layout, tile_descriptions, data_type, channel_counts, \
  conv_kinds = [ConvKind.Fprop, ConvKind.Dgrad, ConvKind.Wgrad], \
  epilogue_functor = EpilogueFunctor.LinearCombination, swizzling_functor = SwizzlingFunctor.Identity4)

Source from the content-addressed store, hash-verified

680
681# Convolution for 2D operations specialized for few channels
682def CreateConv2dFixedChannelsOperator(manifest, layout, tile_descriptions, data_type, channel_counts, \
683 conv_kinds = [ConvKind.Fprop, ConvKind.Dgrad, ConvKind.Wgrad], \
684 epilogue_functor = EpilogueFunctor.LinearCombination, swizzling_functor = SwizzlingFunctor.Identity4):
685
686 element_a, element_b, element_c, element_epilogue = data_type
687
688 # one exceptional case
689
690 # iterator algorithm (analytic and optimized)
691 iterator_algorithms = [IteratorAlgorithm.FixedChannels,]
692
693 # by default, only generate the largest tile size, largest alignment, and optimized iterator
694 if manifest.kernel_filter == '':
695 tile_descriptions = [tile_descriptions[0],]
696 channel_counts = [channel_counts[0],]
697
698 operations = []
699
700
701
702 for tile in tile_descriptions:
703 for channel_count in channel_counts:
704
705 alignment_c = EpilogueAlignment(channel_count, tile)
706
707 A = TensorDescription(element_a, layout[0], channel_count)
708 B = TensorDescription(element_b, layout[1], channel_count)
709 C = TensorDescription(element_c, layout[2], alignment_c)
710
711 swizzling_functor_ = swizzling_functor
712
713 #
714 # Conv2d Fprop
715 #
716 if ConvKind.Fprop in conv_kinds:
717
718 # Strided support for Analytic and Optimized Fprop
719 for iterator_algorithm in iterator_algorithms:
720 new_operation = Conv2dOperation(ConvKind.Fprop, iterator_algorithm, tile.minimum_compute_capability, tile,\
721 A, B, C, element_epilogue, StrideSupport.Strided, epilogue_functor, swizzling_functor_)
722
723 manifest.append(new_operation)
724 operations.append(new_operation)
725
726 return operations
727
728# Convolution for 2D operations specialized for few channels
729def CreateConv2dFewChannelsOperator(manifest, layout, tile_descriptions, data_type, channel_counts, \

Calls 4

EpilogueAlignmentFunction · 0.85
TensorDescriptionClass · 0.70
Conv2dOperationClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected