From c72e0954c8c07accec63594e60a202519d3f456a Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Mon, 7 Sep 2026 15:59:38 +0100 Subject: [PATCH 1/5] fix(ci): export fetched xsimd dependency --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6944e91..6bfffa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,7 @@ if(TINYML_BUILD_EXTENDED) endif() include(FetchContent) - set(XSIMD_SKIP_INSTALL ON CACHE BOOL "" FORCE) + set(XSIMD_SKIP_INSTALL OFF CACHE BOOL "" FORCE) FetchContent_Declare( xsimd URL https://github.com/xtensor-stack/xsimd/archive/refs/tags/12.1.1.tar.gz @@ -287,7 +287,7 @@ if(TINYML_BUILD_BENCHMARKS) add_executable(AttentionBenchmark benchmarks/benchmark_attention.cpp) target_link_libraries(AttentionBenchmark PRIVATE TinyML GTest::gtest_main) - add_executable(SimpleAttentionBenchmark benchmarks/benchmark_simple_attention.cpp) + add_executable(SimpleAttentionBenchmark benchmarks/benchmark_simple.cpp) target_include_directories(SimpleAttentionBenchmark PRIVATE ${PROJECT_SOURCE_DIR}/include) target_compile_features(SimpleAttentionBenchmark PRIVATE cxx_std_17) From 27b537a21e633736ae2f15313d50c9a7ac4dc23d Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Mon, 7 Sep 2026 16:00:40 +0100 Subject: [PATCH 2/5] fix(ci): preserve benchmark source path --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bfffa3..1df1447 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -287,7 +287,7 @@ if(TINYML_BUILD_BENCHMARKS) add_executable(AttentionBenchmark benchmarks/benchmark_attention.cpp) target_link_libraries(AttentionBenchmark PRIVATE TinyML GTest::gtest_main) - add_executable(SimpleAttentionBenchmark benchmarks/benchmark_simple.cpp) + add_executable(SimpleAttentionBenchmark benchmarks/benchmark_simple_attention.cpp) target_include_directories(SimpleAttentionBenchmark PRIVATE ${PROJECT_SOURCE_DIR}/include) target_compile_features(SimpleAttentionBenchmark PRIVATE cxx_std_17) From 73ab3f062ba66cd1fbc36009841b1157b3da3eee Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Mon, 7 Sep 2026 16:01:04 +0100 Subject: [PATCH 3/5] noop --- __noop__ | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 __noop__ diff --git a/__noop__ b/__noop__ new file mode 100644 index 0000000..e69de29 From c0a3b6a77a8c16ed7c3fb19faf78fcb7f1e73ccd Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Mon, 7 Sep 2026 16:01:16 +0100 Subject: [PATCH 4/5] chore: remove accidental placeholder --- __noop__ | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 __noop__ diff --git a/__noop__ b/__noop__ deleted file mode 100644 index e69de29..0000000 From 3d40f35ddcbd9bcf660a6f0b3ff4e9fd943653fe Mon Sep 17 00:00:00 2001 From: Abhishek Shivakumar Date: Mon, 7 Sep 2026 16:08:43 +0100 Subject: [PATCH 5/5] fix: correct generative output weight indexing --- src/GenerativeModels.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/GenerativeModels.cpp b/src/GenerativeModels.cpp index d1f7026..f1e5281 100644 --- a/src/GenerativeModels.cpp +++ b/src/GenerativeModels.cpp @@ -319,7 +319,7 @@ void VAE::decoder_forward(const LatentVector& latent, const Tensor& condition, for (size_t i = 0; i < config_.input_dim; ++i) { float sum = decoder_b2_[i]; for (size_t j = 0; j < config_.hidden_dim; ++j) { - sum += hidden[j] * decoder_w2_[j * config_.hidden_dim + i]; + sum += hidden[j] * decoder_w2_[j * config_.input_dim + i]; } output[i] = std::tanh(sum); } @@ -394,7 +394,7 @@ std::vector VAE::get_activations(const Tensor& input) { for (size_t i = 0; i < config_.input_dim; ++i) { float sum = decoder_b2_[i]; for (size_t j = 0; j < config_.hidden_dim; ++j) { - sum += dec_hidden[j] * decoder_w2_[j * config_.hidden_dim + i]; + sum += dec_hidden[j] * decoder_w2_[j * config_.input_dim + i]; } output[i] = std::tanh(sum); } @@ -427,7 +427,7 @@ std::vector VAE::get_decoder_activations(const LatentVector& latent) { for (size_t i = 0; i < config_.input_dim; ++i) { float sum = decoder_b2_[i]; for (size_t j = 0; j < config_.hidden_dim; ++j) { - sum += dec_hidden[j] * decoder_w2_[j * config_.hidden_dim + i]; + sum += dec_hidden[j] * decoder_w2_[j * config_.input_dim + i]; } output[i] = std::tanh(sum); } @@ -589,7 +589,7 @@ void GAN::generator_forward(const Tensor& noise, const Tensor& condition, Tensor for (size_t i = 0; i < config_.input_dim; ++i) { float sum = gen_b3_[i]; for (size_t j = 0; j < config_.hidden_dim; ++j) { - sum += hidden2[j] * gen_w3_[j * config_.hidden_dim + i]; + sum += hidden2[j] * gen_w3_[j * config_.input_dim + i]; } output[i] = std::tanh(sum); } @@ -836,7 +836,7 @@ void DiffusionModel::unet_forward(const Tensor& xt, const Tensor& time_emb, for (size_t i = 0; i < config_.input_dim; ++i) { float sum = noise_b3_[i]; for (size_t j = 0; j < config_.hidden_dim; ++j) { - sum += hidden2[j] * noise_w3_[j * config_.hidden_dim + i]; + sum += hidden2[j] * noise_w3_[j * config_.input_dim + i]; } epsilon_pred[i] = sum; } @@ -861,7 +861,6 @@ void DiffusionModel::forward_diffusion(const Tensor& x0, int t, Tensor& xt, Tens void DiffusionModel::predict_noise(const Tensor& xt, int t, const Tensor& condition, Tensor& epsilon_pred) { Tensor time_emb; time_embedding(t, time_emb); - unet_forward(xt, time_emb, condition, epsilon_pred); }