Skip to content

Commit e86d6dc

Browse files
author
Viviane Potocnik
committed
[tests] FA-2: fix indents
[lint] FA-2 FP8 and GEMM
1 parent 703de24 commit e86d6dc

26 files changed

+55
-56
lines changed

sw/blas/gemm/src/gemm.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,8 @@ typedef struct {
7979
// distinct cores.
8080
// TODO: beta (and alpha) should be of floating-point type (same precision as
8181
// operands)
82-
void sc_st_gemm(gemm_args_t* gemm_args, void* a, void* b,
83-
uint32_t beta, void* c) {
84-
82+
void sc_st_gemm(gemm_args_t* gemm_args, void* a, void* b, uint32_t beta,
83+
void* c) {
8584
gemm_fp_t impl = (gemm_fp_t)gemm_args->gemm_fp;
8685
precision_t prec = gemm_args->prec;
8786
uint32_t setup_ssr = gemm_args->setup_ssr;
@@ -94,7 +93,7 @@ void sc_st_gemm(gemm_args_t* gemm_args, void* a, void* b,
9493

9594
uint32_t lda = k;
9695
uint32_t ldb;
97-
if(transb) {
96+
if (transb) {
9897
ldb = k;
9998
} else {
10099
ldb = n;

sw/dnn/flashattention_2/src/flashattention_2_fp8.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ static inline float fp8_to_float(char val) {
1010
asm volatile(
1111
"fmv.b.x %[res], %[val]\n"
1212
"fcvt.s.b %[res], %[res]\n"
13-
: [res] "=f"(res)
14-
: [val] "r"(val));
13+
: [ res ] "=f"(res)
14+
: [ val ] "r"(val));
1515
return res;
1616
}
1717

@@ -20,8 +20,8 @@ static inline char float_to_fp8(float val) {
2020
asm volatile(
2121
"fcvt.b.s ft3, %[val]\n"
2222
"fmv.x.b %[res], ft3\n"
23-
: [res] "=r"(res)
24-
: [val] "f"(val)
23+
: [ res ] "=r"(res)
24+
: [ val ] "f"(val)
2525
: "ft3");
2626
return res;
2727
}

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp16-opt-gpt-3-xl-inf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 1,
7-
S: 64,
6+
L: 1,
7+
S: 64,
88
d: 128,
99
B_r: 1,
1010
B_c: 32,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp16-opt-gpt-3-xl.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 64,
7-
S: 64,
6+
L: 64,
7+
S: 64,
88
d: 128,
99
B_r: 32,
1010
B_c: 32,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp16-opt-gpt-j-inf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 1,
7-
S: 32,
6+
L: 1,
7+
S: 32,
88
d: 256,
99
B_r: 1,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp16-opt-gpt-j.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 32,
6+
L: 32,
7+
S: 32,
88
d: 256,
99
B_r: 16,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp16-opt-vit-base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 128,
6+
L: 32,
7+
S: 128,
88
d: 64,
99
B_r: 16,
1010
B_c: 64,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp16-opt-vit-huge.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 128,
6+
L: 32,
7+
S: 128,
88
d: 80,
99
B_r: 16,
1010
B_c: 64,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp32-opt-gpt-3-xl-inf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 1,
7-
S: 64,
6+
L: 1,
7+
S: 64,
88
d: 128,
99
B_r: 1,
1010
B_c: 32,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp32-opt-gpt-3-xl.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 64,
7-
S: 64,
6+
L: 64,
7+
S: 64,
88
d: 128,
99
B_r: 32,
1010
B_c: 32,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp32-opt-gpt-j-inf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 1,
7-
S: 32,
6+
L: 1,
7+
S: 32,
88
d: 256,
99
B_r: 1,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp32-opt-gpt-j.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 32,
6+
L: 32,
7+
S: 32,
88
d: 256,
99
B_r: 16,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp32-opt-vit-base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 128,
6+
L: 32,
7+
S: 128,
88
d: 64,
99
B_r: 16,
1010
B_c: 64,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp32-opt-vit-huge.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 128,
6+
L: 32,
7+
S: 128,
88
d: 80,
99
B_r: 16,
1010
B_c: 64,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp8-opt-gpt-3-xl-inf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 1,
7-
S: 64,
6+
L: 1,
7+
S: 64,
88
d: 128,
99
B_r: 1,
1010
B_c: 32,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp8-opt-gpt-3-xl.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 64,
7-
S: 64,
6+
L: 64,
7+
S: 64,
88
d: 128,
99
B_r: 32,
1010
B_c: 32,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp8-opt-gpt-j-inf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 1,
7-
S: 32,
6+
L: 1,
7+
S: 32,
88
d: 256,
99
B_r: 1,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp8-opt-gpt-j.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 32,
6+
L: 32,
7+
S: 32,
88
d: 256,
99
B_r: 16,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp8-opt-vit-base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 128,
6+
L: 32,
7+
S: 128,
88
d: 64,
99
B_r: 16,
1010
B_c: 64,

target/snitch_cluster/sw/apps/dnn/flashattention_2/tcasai/cfg/fp8-opt-vit-huge.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: Apache-2.0
44

55
{
6-
L: 32,
7-
S: 128,
6+
L: 32,
7+
S: 128,
88
d: 80,
99
B_r: 16,
1010
B_c: 64,

target/snitch_cluster/sw/apps/dnn/flashattention_2/test/cfg/fp16-base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: SHL-0.51
44

55
{
6-
L: 16,
7-
S: 32,
6+
L: 16,
7+
S: 32,
88
d: 16,
99
B_r: 16,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/test/cfg/fp16-opt.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: SHL-0.51
44

55
{
6-
L: 16,
7-
S: 32,
6+
L: 16,
7+
S: 32,
88
d: 16,
99
B_r: 16,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/test/cfg/fp32-base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: SHL-0.51
44

55
{
6-
L: 16,
7-
S: 32,
6+
L: 16,
7+
S: 32,
88
d: 16,
99
B_r: 16,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/test/cfg/fp32-opt.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: SHL-0.51
44

55
{
6-
L: 16,
7-
S: 32,
6+
L: 16,
7+
S: 32,
88
d: 16,
99
B_r: 16,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/test/cfg/fp8-base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: SHL-0.51
44

55
{
6-
L: 16,
7-
S: 32,
6+
L: 16,
7+
S: 32,
88
d: 16,
99
B_r: 16,
1010
B_c: 16,

target/snitch_cluster/sw/apps/dnn/flashattention_2/test/cfg/fp8-opt.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
// SPDX-License-Identifier: SHL-0.51
44

55
{
6-
L: 16,
7-
S: 32,
6+
L: 16,
7+
S: 32,
88
d: 16,
99
B_r: 16,
1010
B_c: 16,

0 commit comments

Comments
 (0)