File size: 954 Bytes
bbe836b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | {
"name": "softmax_fp32",
"op_type": "softmax",
"description": "1-D softmax, float32 in and out: y = exp(x - max(x)) / sum(exp(x - max(x))) over a vector of length N (e.g. one attention row or one vocabulary of logits). N varies per workload. Judged by SQNR against the baseline: outputs are about 1/N, below the default absolute tolerance. Baseline: KleidiAI kai_softmax_f32_f32_1d_sve_fexpa (SVE FEXPA exponential, any vector length).",
"tags": [
"status:active",
"baseline-solution:kleidiai",
"correctness:sqnr"
],
"axes": {
"N": {
"type": "var"
}
},
"inputs": {
"x": {
"shape": [
"N"
],
"dtype": "float32"
}
},
"outputs": {
"y": {
"shape": [
"N"
],
"dtype": "float32"
}
},
"reference": "import numpy as np\n\n\ndef run(x):\n x = x.astype(np.float64)\n e = np.exp(x - x.max())\n return (e / e.sum()).astype(np.float32)\n"
}
|