Skip to content

Commit

Permalink
Group all archs in the same file
Browse files Browse the repository at this point in the history
  • Loading branch information
danthe3rd committed Sep 6, 2022
1 parent 02062f7 commit 6018600
Show file tree
Hide file tree
Showing 21 changed files with 37 additions and 61 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file is auto-generated. See "generate_kernels.sh"
#include "../kernel_backward.h"
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM50(cutlass::half_t, false);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM70(cutlass::half_t, false);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM75(cutlass::half_t, false);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM80(cutlass::half_t, false);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file is auto-generated. See "generate_kernels.sh"
#include "../kernel_backward.h"
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM50(cutlass::half_t, true);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM70(cutlass::half_t, true);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM75(cutlass::half_t, true);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM80(cutlass::half_t, true);

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file is auto-generated. See "generate_kernels.sh"
#include "../kernel_backward.h"
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM50(float, false);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM70(float, false);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM75(float, false);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM80(float, false);
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file is auto-generated. See "generate_kernels.sh"
#include "../kernel_backward.h"
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM50(float, true);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM70(float, true);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM75(float, true);
INSTANTIATE_ATTENTION_KERNEL_BACKWARD_SM80(float, true);

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ rm -f *.cu
IFS=","
for kernel in "BACKWARD"; do
kernel_lower=`echo "\$kernel" | awk '{print tolower($0)}'`
for sm in 50 70 75 80; do
for aligned in "false" "true"; do
[[ $aligned = "true" ]] && aligned_suffix="_aligned" || aligned_suffix=""
for dtype_name in "f32" "f16"; do
case "$dtype_name" in
"f32") dtype="float" ;;
"f16") dtype="cutlass::half_t" ;;
esac
FNAME="${kernel_lower}_${dtype_name}_sm${sm}${aligned_suffix}.cu"
echo $FNAME
cat <<EOF > $FNAME
for aligned in "false" "true"; do
[[ $aligned = "true" ]] && aligned_suffix="_aligned" || aligned_suffix=""
for dtype_name in "f32" "f16"; do
case "$dtype_name" in
"f32") dtype="float" ;;
"f16") dtype="cutlass::half_t" ;;
esac
FNAME="${kernel_lower}_${dtype_name}${aligned_suffix}.cu"
echo $FNAME
cat <<EOF > $FNAME
// This file is auto-generated. See "generate_kernels.sh"
#include "../kernel_backward.h"
INSTANTIATE_ATTENTION_KERNEL_${kernel}_SM${sm}($dtype, $aligned);
EOF
for sm in 50 70 75 80; do
echo "INSTANTIATE_ATTENTION_KERNEL_${kernel}_SM${sm}($dtype, $aligned);" >> $FNAME
done;
done
done;
done
done;

0 comments on commit 6018600

Please sign in to comment.