-
Notifications
You must be signed in to change notification settings - Fork 0
⚡ Thunderbolt: softmax_v6 — 8x unrolled AVX2 Softmax #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -332,6 +332,18 @@ class SoftmaxV5Benchmark : public SoftmaxBenchmark { | |
| }; | ||
| REGISTER_BENCHMARK(SoftmaxV5Benchmark); | ||
|
|
||
| class SoftmaxV6Benchmark : public SoftmaxBenchmark { | ||
| public: | ||
| const char *name() const override { return "softmax_v6"; } | ||
|
|
||
| void run() override { | ||
| ml_kernels::softmax_v6(inputs_[current_idx_].data(), outputs_[current_idx_].data(), inputs_[0].size()); | ||
| current_idx_ = (current_idx_ + 1) % pool_size_; | ||
| } | ||
|
Comment on lines
+335
to
+342
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win Correct the inherited bandwidth accounting. This benchmark inherits Proposed fix- return 2.0 * n * sizeof(float);
+ return 5.0 * n * sizeof(float);🤖 Prompt for AI Agents |
||
| }; | ||
| REGISTER_BENCHMARK(SoftmaxV6Benchmark); | ||
|
|
||
|
|
||
| } // namespace | ||
|
|
||
| int main(int argc, char **argv) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Place function-body braces on their own lines.
ml_kernels/include/ml_kernels/softmax.h#L509-L509: move thesoftmax_v6opening brace to the following line.ml_kernels/src/kernel_bench.cpp#L337-L337: expandname()with its opening brace on the following line.ml_kernels/src/kernel_bench.cpp#L339-L339: moverun()’s opening brace to the following line.ml_kernels/src/test_naive_ops.cpp#L184-L184: movetest_softmax_v6()’s opening brace to the following line.ml_kernels/src/test_naive_ops.cpp#L223-L223: movemain()’s opening brace to the following line.As per coding guidelines, “Keep braces on their own lines for function bodies.”
📍 Affects 3 files
ml_kernels/include/ml_kernels/softmax.h#L509-L509(this comment)ml_kernels/src/kernel_bench.cpp#L337-L337ml_kernels/src/kernel_bench.cpp#L339-L339ml_kernels/src/test_naive_ops.cpp#L184-L184ml_kernels/src/test_naive_ops.cpp#L223-L223🤖 Prompt for AI Agents
Source: Coding guidelines